File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_wua.cpython-310.pyc
o
�N�g� � @ s d Z ddlZddlZddlZddlZddlZddlmZ zddl Z
dZW n ey/ dZY nw e�
e�ZddiZdd � Z dd
d�Zd dd
�Z d!dd�Zd"dd�Zdd� Zdd� Zdd� Z d#dd�Zdd� Zdd� Zdd� ZdS )$a�
Module for managing Windows Updates using the Windows Update Agent.
List updates on the system using the following functions:
- :py:func:`win_wua.available <salt.modules.win_wua.available>`
- :py:func:`win_wua.list <salt.modules.win_wua.list_>`
This is an easy way to find additional information about updates available to
to the system, such as the GUID, KB number, or description.
Once you have the GUID or a KB number for the update you can get information
about the update, download, install, or uninstall it using these functions:
- :py:func:`win_wua.get <salt.modules.win_wua.get>`
- :py:func:`win_wua.download <salt.modules.win_wua.download>`
- :py:func:`win_wua.install <salt.modules.win_wua.install>`
- :py:func:`win_wua.uninstall <salt.modules.win_wua.uninstall>`
The get function expects a name in the form of a GUID, KB, or Title and should
return information about a single update. The other functions accept either a
single item or a list of items for downloading/installing/uninstalling a
specific list of items.
The :py:func:`win_wua.list <salt.modules.win_wua.list_>` and
:py:func:`win_wua.get <salt.modules.win_wua.get>` functions are utility
functions. In addition to returning information about updates they can also
download and install updates by setting ``download=True`` or ``install=True``.
So, with py:func:`win_wua.list <salt.modules.win_wua.list_>` for example, you
could run the function with the filters you want to see what is available. Then
just add ``install=True`` to install everything on that list.
If you want to download, install, or uninstall specific updates, use
:py:func:`win_wua.download <salt.modules.win_wua.download>`,
:py:func:`win_wua.install <salt.modules.win_wua.install>`, or
:py:func:`win_wua.uninstall <salt.modules.win_wua.uninstall>`. To update your
system with the latest updates use :py:func:`win_wua.list
<salt.modules.win_wua.list_>` and set ``install=True``
You can also adjust the Windows Update settings using the
:py:func:`win_wua.set_wu_settings <salt.modules.win_wua.set_wu_settings>`
function. This function is only supported on the following operating systems:
- Windows Vista / Server 2008
- Windows 7 / Server 2008R2
- Windows 8 / Server 2012
- Windows 8.1 / Server 2012R2
As of Windows 10 and Windows Server 2016, the ability to modify the Windows
Update settings has been restricted. The settings can be modified in the Local
Group Policy using the ``lgpo`` module.
.. versionadded:: 2015.8.0
:depends: salt.utils.win_update
� N)�CommandExecutionErrorTFZlist_�listc C s� t jj�� sdS tsdS t jjjsdS t jj�d�d dkr dS t jj�d�d dkr-d S t jj�d
�d dkr:dS t jj�d�d dkrGd
S t jj�d�d dkrTdS dS )z4
Only works on Windows systems with PyWin32
)Fz&WUA: Only available on Windows systems)FzWUA: Requires PyWin32 libraries)Fz8WUA: Missing Libraries required by salt.utils.win_updateZwuauservZ StartTypeZDisabled)Fz?WUA: The Windows Update service (wuauserv) must not be disabledZ msiserver)FzCWUA: The Windows Installer service (msiserver) must not be disabledZBITS)FzLWUA: The Background Intelligent Transfer service (bits) must not be disabledZCryptSvc)FzGWUA: The Cryptographic Services service (CryptSvc) must not be disabledZTrustedInstaller)FzQWUA: The Windows Module Installer service (TrustedInstaller) must not be disabledT)�salt�utils�platformZ
is_windows�HAS_PYWIN32�
win_updateZwin_service�info� r
r
�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_wua.py�__virtual__P s"