repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/modules/win_smtp_server.py
get_connection_ip_list
python
def get_connection_ip_list(as_wmi_format=False, server=_DEFAULT_SERVER): ''' Get the IPGrant list for the SMTP virtual server. :param bool as_wmi_format: Returns the connection IPs as a list in the format WMI expects. :param str server: The SMTP server name. :return: A dictionary of the IP and sub...
Get the IPGrant list for the SMTP virtual server. :param bool as_wmi_format: Returns the connection IPs as a list in the format WMI expects. :param str server: The SMTP server name. :return: A dictionary of the IP and subnet pairs. :rtype: dict CLI Example: .. code-block:: bash salt...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_smtp_server.py#L364-L400
[ "def _get_wmi_setting(wmi_class_name, setting, server):\n '''\n Get the value of the setting for the provided class.\n '''\n with salt.utils.winapi.Com():\n try:\n connection = wmi.WMI(namespace=_WMI_NAMESPACE)\n wmi_class = getattr(connection, wmi_class_name)\n\n ...
# -*- coding: utf-8 -*- ''' Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed. :depends: wmi ''' # IIS metabase configuration settings: # https://goo.gl/XCt1uO # IIS logging options: # https://goo.gl/RL8ki9 # https://goo.gl/...
saltstack/salt
salt/modules/win_smtp_server.py
set_connection_ip_list
python
def set_connection_ip_list(addresses=None, grant_by_default=False, server=_DEFAULT_SERVER): ''' Set the IPGrant list for the SMTP virtual server. :param str addresses: A dictionary of IP + subnet pairs. :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist. :param s...
Set the IPGrant list for the SMTP virtual server. :param str addresses: A dictionary of IP + subnet pairs. :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist. :param str server: The SMTP server name. :return: A boolean representing whether the change succeeded. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_smtp_server.py#L403-L458
[ "def _get_wmi_setting(wmi_class_name, setting, server):\n '''\n Get the value of the setting for the provided class.\n '''\n with salt.utils.winapi.Com():\n try:\n connection = wmi.WMI(namespace=_WMI_NAMESPACE)\n wmi_class = getattr(connection, wmi_class_name)\n\n ...
# -*- coding: utf-8 -*- ''' Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed. :depends: wmi ''' # IIS metabase configuration settings: # https://goo.gl/XCt1uO # IIS logging options: # https://goo.gl/RL8ki9 # https://goo.gl/...
saltstack/salt
salt/modules/win_smtp_server.py
get_relay_ip_list
python
def get_relay_ip_list(server=_DEFAULT_SERVER): ''' Get the RelayIpList list for the SMTP virtual server. :param str server: The SMTP server name. :return: A list of the relay IPs. :rtype: list .. note:: A return value of None corresponds to the restrictive 'Only the list below' GUI p...
Get the RelayIpList list for the SMTP virtual server. :param str server: The SMTP server name. :return: A list of the relay IPs. :rtype: list .. note:: A return value of None corresponds to the restrictive 'Only the list below' GUI parameter with an empty access list, and setting an ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_smtp_server.py#L461-L501
[ "def _get_wmi_setting(wmi_class_name, setting, server):\n '''\n Get the value of the setting for the provided class.\n '''\n with salt.utils.winapi.Com():\n try:\n connection = wmi.WMI(namespace=_WMI_NAMESPACE)\n wmi_class = getattr(connection, wmi_class_name)\n\n ...
# -*- coding: utf-8 -*- ''' Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed. :depends: wmi ''' # IIS metabase configuration settings: # https://goo.gl/XCt1uO # IIS logging options: # https://goo.gl/RL8ki9 # https://goo.gl/...
saltstack/salt
salt/modules/win_smtp_server.py
set_relay_ip_list
python
def set_relay_ip_list(addresses=None, server=_DEFAULT_SERVER): ''' Set the RelayIpList list for the SMTP virtual server. Due to the unusual way that Windows stores the relay IPs, it is advisable to retrieve the existing list you wish to set from a pre-configured server. For example, setting '127.0...
Set the RelayIpList list for the SMTP virtual server. Due to the unusual way that Windows stores the relay IPs, it is advisable to retrieve the existing list you wish to set from a pre-configured server. For example, setting '127.0.0.1' as an allowed relay IP through the GUI would generate an actual r...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_smtp_server.py#L504-L571
[ "def get_relay_ip_list(server=_DEFAULT_SERVER):\n '''\n Get the RelayIpList list for the SMTP virtual server.\n\n :param str server: The SMTP server name.\n\n :return: A list of the relay IPs.\n :rtype: list\n\n .. note::\n\n A return value of None corresponds to the restrictive 'Only the l...
# -*- coding: utf-8 -*- ''' Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed. :depends: wmi ''' # IIS metabase configuration settings: # https://goo.gl/XCt1uO # IIS logging options: # https://goo.gl/RL8ki9 # https://goo.gl/...
saltstack/salt
salt/modules/netmiko_mod.py
_prepare_connection
python
def _prepare_connection(**kwargs): ''' Prepare the connection with the remote network device, and clean up the key value pairs, removing the args used for the connection init. ''' init_args = {} fun_kwargs = {} netmiko_kwargs = __salt__['config.get']('netmiko', {}) netmiko_kwargs.update(...
Prepare the connection with the remote network device, and clean up the key value pairs, removing the args used for the connection init.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netmiko_mod.py#L241-L260
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' Netmiko Execution Module ======================== .. versionadded:: 2019.2.0 Execution module to interface the connection with a remote network device. It is flexible enough to execute the commands both when running under a Netmiko Proxy Minion, as well as running under a Regular Minion by...
saltstack/salt
salt/modules/netmiko_mod.py
multi_call
python
def multi_call(*methods, **kwargs): ''' Invoke multiple Netmiko methods at once, and return their output, as list. methods A list of dictionaries with the following keys: - ``name``: the name of the Netmiko method to be executed. - ``args``: list of arguments to be sent to the Netm...
Invoke multiple Netmiko methods at once, and return their output, as list. methods A list of dictionaries with the following keys: - ``name``: the name of the Netmiko method to be executed. - ``args``: list of arguments to be sent to the Netmiko method. - ``kwargs``: dictionary of ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netmiko_mod.py#L319-L348
[ "def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These keys are useful for tracking what was used to invoke\n the function call, but they may not be desirab...
# -*- coding: utf-8 -*- ''' Netmiko Execution Module ======================== .. versionadded:: 2019.2.0 Execution module to interface the connection with a remote network device. It is flexible enough to execute the commands both when running under a Netmiko Proxy Minion, as well as running under a Regular Minion by...
saltstack/salt
salt/modules/netmiko_mod.py
send_config
python
def send_config(config_file=None, config_commands=None, template_engine='jinja', commit=False, context=None, defaults=None, saltenv='base', **kwargs): ''' Send configuration commands down the SSH chan...
Send configuration commands down the SSH channel. Return the configuration lines sent to the device. The function is flexible to send the configuration from a local or remote file, or simply the commands as list. config_file The source file with the configuration commands to be sent to the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netmiko_mod.py#L474-L583
[ "def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These keys are useful for tracking what was used to invoke\n the function call, but they may not be desirab...
# -*- coding: utf-8 -*- ''' Netmiko Execution Module ======================== .. versionadded:: 2019.2.0 Execution module to interface the connection with a remote network device. It is flexible enough to execute the commands both when running under a Netmiko Proxy Minion, as well as running under a Regular Minion by...
saltstack/salt
salt/modules/qemu_nbd.py
connect
python
def connect(image): ''' Activate nbd for an image file. CLI Example: .. code-block:: bash salt '*' qemu_nbd.connect /tmp/image.raw ''' if not os.path.isfile(image): log.warning('Could not connect image: %s does not exist', image) return '' if salt.utils.path.which...
Activate nbd for an image file. CLI Example: .. code-block:: bash salt '*' qemu_nbd.connect /tmp/image.raw
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/qemu_nbd.py#L37-L68
null
# -*- coding: utf-8 -*- ''' Qemu Command Wrapper The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which are used here to build up kvm images. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import glob import tempfile import time impo...
saltstack/salt
salt/modules/qemu_nbd.py
mount
python
def mount(nbd, root=None): ''' Pass in the nbd connection device location, mount all partitions and return a dict of mount points CLI Example: .. code-block:: bash salt '*' qemu_nbd.mount /dev/nbd0 ''' __salt__['cmd.run']( 'partprobe {0}'.format(nbd), pytho...
Pass in the nbd connection device location, mount all partitions and return a dict of mount points CLI Example: .. code-block:: bash salt '*' qemu_nbd.mount /dev/nbd0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/qemu_nbd.py#L71-L100
null
# -*- coding: utf-8 -*- ''' Qemu Command Wrapper The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which are used here to build up kvm images. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import glob import tempfile import time impo...
saltstack/salt
salt/modules/qemu_nbd.py
init
python
def init(image, root=None): ''' Mount the named image via qemu-nbd and return the mounted roots CLI Example: .. code-block:: bash salt '*' qemu_nbd.init /srv/image.qcow2 ''' nbd = connect(image) if not nbd: return '' return mount(nbd, root)
Mount the named image via qemu-nbd and return the mounted roots CLI Example: .. code-block:: bash salt '*' qemu_nbd.init /srv/image.qcow2
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/qemu_nbd.py#L103-L116
[ "def connect(image):\n '''\n Activate nbd for an image file.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' qemu_nbd.connect /tmp/image.raw\n '''\n if not os.path.isfile(image):\n log.warning('Could not connect image: %s does not exist', image)\n return ''\n\n if sa...
# -*- coding: utf-8 -*- ''' Qemu Command Wrapper The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which are used here to build up kvm images. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import glob import tempfile import time impo...
saltstack/salt
salt/modules/qemu_nbd.py
clear
python
def clear(mnt): ''' Pass in the mnt dict returned from nbd_mount to unmount and disconnect the image from nbd. If all of the partitions are unmounted return an empty dict, otherwise return a dict containing the still mounted partitions CLI Example: .. code-block:: bash salt '*' qe...
Pass in the mnt dict returned from nbd_mount to unmount and disconnect the image from nbd. If all of the partitions are unmounted return an empty dict, otherwise return a dict containing the still mounted partitions CLI Example: .. code-block:: bash salt '*' qemu_nbd.clear '{"/mnt/foo": "...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/qemu_nbd.py#L119-L143
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' Qemu Command Wrapper The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which are used here to build up kvm images. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import glob import tempfile import time impo...
saltstack/salt
salt/scripts.py
_handle_interrupt
python
def _handle_interrupt(exc, original_exc, hardfail=False, trace=''): ''' if hardfailing: If we got the original stacktrace, log it If all cases, raise the original exception but this is logically part the initial stack. else just let salt exit gracefully ''' if hardfa...
if hardfailing: If we got the original stacktrace, log it If all cases, raise the original exception but this is logically part the initial stack. else just let salt exit gracefully
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L28-L43
null
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_master
python
def salt_master(): ''' Start the salt master. ''' import salt.cli.daemons # REMOVEME after Python 2.7 support is dropped (also the six import) if six.PY2: from salt.utils.versions import warn_until # Message borrowed from pip's deprecation warning warn_until('Sodium', ...
Start the salt master.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L100-L116
[ "def warn_until(version,\n message,\n category=DeprecationWarning,\n stacklevel=None,\n _version_info_=None,\n _dont_call_warnings=False):\n '''\n Helper function to raise a warning, by default, a ``DeprecationWarning``,\n until the prov...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
minion_process
python
def minion_process(): ''' Start a minion process ''' import salt.utils.platform import salt.utils.process import salt.cli.daemons # salt_minion spawns this function in a new process salt.utils.process.appendproctitle('KeepAlive') def handle_hup(manager, sig, frame): manage...
Start a minion process
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L119-L178
[ "def appendproctitle(name):\n '''\n Append \"name\" to the current process title\n '''\n if HAS_SETPROCTITLE:\n setproctitle.setproctitle(setproctitle.getproctitle() + ' ' + name)\n" ]
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_minion
python
def salt_minion(): ''' Start the salt minion in a subprocess. Auto restart minion on error. ''' import signal import salt.utils.platform import salt.utils.process salt.utils.process.notify_systemd() import salt.cli.daemons import multiprocessing if '' in sys.path: s...
Start the salt minion in a subprocess. Auto restart minion on error.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L181-L266
[ "def warn_until(version,\n message,\n category=DeprecationWarning,\n stacklevel=None,\n _version_info_=None,\n _dont_call_warnings=False):\n '''\n Helper function to raise a warning, by default, a ``DeprecationWarning``,\n until the prov...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
proxy_minion_process
python
def proxy_minion_process(queue): ''' Start a proxy minion process ''' import salt.cli.daemons import salt.utils.platform # salt_minion spawns this function in a new process lock = threading.RLock() def suicide_when_without_parent(parent_pid): ''' Have the minion suicide...
Start a proxy minion process
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L269-L330
null
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_proxy
python
def salt_proxy(): ''' Start a proxy minion. ''' import salt.cli.daemons import salt.utils.platform import multiprocessing if '' in sys.path: sys.path.remove('') if salt.utils.platform.is_windows(): proxyminion = salt.cli.daemons.ProxyMinion() proxyminion.start() ...
Start a proxy minion.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L333-L386
null
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_syndic
python
def salt_syndic(): ''' Start the salt syndic. ''' import salt.utils.process salt.utils.process.notify_systemd() import salt.cli.daemons pid = os.getpid() try: syndic = salt.cli.daemons.Syndic() syndic.start() except KeyboardInterrupt: os.kill(pid, 15)
Start the salt syndic.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L389-L402
[ "def notify_systemd():\n '''\n Notify systemd that this process has started\n '''\n try:\n import systemd.daemon\n except ImportError:\n if salt.utils.path.which('systemd-notify') \\\n and systemd_notify_call('--booted'):\n # Notify systemd synchronously\n ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_key
python
def salt_key(): ''' Manage the authentication keys with salt-key. ''' import salt.cli.key try: client = salt.cli.key.SaltKey() _install_signal_handlers(client) client.run() except Exception as err: sys.stderr.write("Error: {0}\n".format(err))
Manage the authentication keys with salt-key.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L405-L415
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_cp
python
def salt_cp(): ''' Publish commands to the salt system from the command line on the master. ''' import salt.cli.cp client = salt.cli.cp.SaltCPCli() _install_signal_handlers(client) client.run()
Publish commands to the salt system from the command line on the master.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L418-L426
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_call
python
def salt_call(): ''' Directly call a salt command in the modules, does not require a running salt minion to run. ''' import salt.cli.call if '' in sys.path: sys.path.remove('') client = salt.cli.call.SaltCall() _install_signal_handlers(client) client.run()
Directly call a salt command in the modules, does not require a running salt minion to run.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L429-L439
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_run
python
def salt_run(): ''' Execute a salt convenience routine. ''' import salt.cli.run if '' in sys.path: sys.path.remove('') client = salt.cli.run.SaltRun() _install_signal_handlers(client) client.run()
Execute a salt convenience routine.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L442-L451
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_ssh
python
def salt_ssh(): ''' Execute the salt-ssh system ''' import salt.cli.ssh if '' in sys.path: sys.path.remove('') try: client = salt.cli.ssh.SaltSSH() _install_signal_handlers(client) client.run() except SaltClientError as err: trace = traceback.format_ex...
Execute the salt-ssh system
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L454-L474
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_cloud
python
def salt_cloud(): ''' The main function for salt-cloud ''' # Define 'salt' global so we may use it after ImportError. Otherwise, # UnboundLocalError will be raised. global salt # pylint: disable=W0602 try: # Late-imports for CLI performance import salt.cloud import ...
The main function for salt-cloud
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L477-L499
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_api
python
def salt_api(): ''' The main function for salt-api ''' import salt.utils.process salt.utils.process.notify_systemd() import salt.cli.api sapi = salt.cli.api.SaltAPI() # pylint: disable=E1120 sapi.start()
The main function for salt-api
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L502-L511
[ "def notify_systemd():\n '''\n Notify systemd that this process has started\n '''\n try:\n import systemd.daemon\n except ImportError:\n if salt.utils.path.which('systemd-notify') \\\n and systemd_notify_call('--booted'):\n # Notify systemd synchronously\n ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_main
python
def salt_main(): ''' Publish commands to the salt system from the command line on the master. ''' import salt.cli.salt if '' in sys.path: sys.path.remove('') client = salt.cli.salt.SaltCMD() _install_signal_handlers(client) client.run()
Publish commands to the salt system from the command line on the master.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L514-L524
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_spm
python
def salt_spm(): ''' The main function for spm, the Salt Package Manager .. versionadded:: 2015.8.0 ''' import salt.cli.spm spm = salt.cli.spm.SPM() # pylint: disable=E1120 spm.run()
The main function for spm, the Salt Package Manager .. versionadded:: 2015.8.0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L527-L535
null
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_extend
python
def salt_extend(extension, name, description, salt_dir, merge): ''' Quickstart for developing on the saltstack installation .. versionadded:: 2016.11.0 ''' import salt.utils.extend salt.utils.extend.run(extension=extension, name=name, descript...
Quickstart for developing on the saltstack installation .. versionadded:: 2016.11.0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L538-L549
[ "def run(extension=None, name=None, description=None, salt_dir=None, merge=False, temp_dir=None):\n '''\n A template factory for extending the salt ecosystem\n\n :param extension: The extension type, e.g. 'module', 'state', if omitted, user will be prompted\n :type extension: ``str``\n\n :param name...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/scripts.py
salt_support
python
def salt_support(): ''' Run Salt Support that collects system data, logs etc for debug and support purposes. :return: ''' import salt.cli.support.collector if '' in sys.path: sys.path.remove('') client = salt.cli.support.collector.SaltSupport() _install_signal_handlers(client) ...
Run Salt Support that collects system data, logs etc for debug and support purposes. :return:
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/scripts.py#L552-L563
[ "def _install_signal_handlers(client):\n # Install the SIGINT/SIGTERM handlers if not done so far\n if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:\n # No custom signal handling was added, install our own\n signal.signal(signal.SIGINT, functools.partial(_handle_signals, client))\n\n if ...
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
saltstack/salt
salt/pillar/puppet.py
ext_pillar
python
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 command): ''' Execute an unmodified puppet_node_classifier and read the output as YAML ''' try: data = salt.utils.yaml.safe_load(__salt__['cmd.run']('{0} {1}'.format(command, minion_id))) return data...
Execute an unmodified puppet_node_classifier and read the output as YAML
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/puppet.py#L20-L31
[ "def safe_load(stream, Loader=SaltYamlSafeLoader):\n '''\n .. versionadded:: 2018.3.0\n\n Helper function which automagically uses our custom loader.\n '''\n return yaml.load(stream, Loader=Loader)\n" ]
# -*- coding: utf-8 -*- ''' Execute an unmodified puppet_node_classifier and read the output as YAML. The YAML data is then directly overlaid onto the minion's Pillar data. ''' from __future__ import absolute_import, print_function, unicode_literals # Don't "fix" the above docstring to put it on two lines, as the sphi...
saltstack/salt
salt/modules/win_wusa.py
_pshell_json
python
def _pshell_json(cmd, cwd=None): ''' Execute the desired powershell command and ensure that it returns data in JSON format and load that into python ''' if 'convertto-json' not in cmd.lower(): cmd = '{0} | ConvertTo-Json'.format(cmd) log.debug('PowerShell: %s', cmd) ret = __salt__['c...
Execute the desired powershell command and ensure that it returns data in JSON format and load that into python
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_wusa.py#L41-L73
null
# -*- coding: utf-8 -*- ''' Microsoft Update files management via wusa.exe :maintainer: Thomas Lemarchand :platform: Windows :depends: PowerShell .. versionadded:: 2018.3.4 ''' # Import python libs from __future__ import absolute_import, unicode_literals import logging import os # Import salt libs imp...
saltstack/salt
salt/modules/win_wusa.py
install
python
def install(path, restart=False): ''' Install a KB from a .msu file. Args: path (str): The full path to the msu file to install restart (bool): ``True`` to force a restart if required by the installation. Adds the ``/forcerestart`` switch to the ``wusa....
Install a KB from a .msu file. Args: path (str): The full path to the msu file to install restart (bool): ``True`` to force a restart if required by the installation. Adds the ``/forcerestart`` switch to the ``wusa.exe`` command. ``False`` will add ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_wusa.py#L99-L145
null
# -*- coding: utf-8 -*- ''' Microsoft Update files management via wusa.exe :maintainer: Thomas Lemarchand :platform: Windows :depends: PowerShell .. versionadded:: 2018.3.4 ''' # Import python libs from __future__ import absolute_import, unicode_literals import logging import os # Import salt libs imp...
saltstack/salt
salt/modules/win_wusa.py
uninstall
python
def uninstall(path, restart=False): ''' Uninstall a specific KB. Args: path (str): The full path to the msu file to uninstall. This can also be just the name of the KB to uninstall restart (bool): ``True`` to force a restart if required by the installat...
Uninstall a specific KB. Args: path (str): The full path to the msu file to uninstall. This can also be just the name of the KB to uninstall restart (bool): ``True`` to force a restart if required by the installation. Adds the ``/forcerestart`` swit...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_wusa.py#L148-L206
null
# -*- coding: utf-8 -*- ''' Microsoft Update files management via wusa.exe :maintainer: Thomas Lemarchand :platform: Windows :depends: PowerShell .. versionadded:: 2018.3.4 ''' # Import python libs from __future__ import absolute_import, unicode_literals import logging import os # Import salt libs imp...
saltstack/salt
salt/modules/win_wusa.py
list
python
def list(): ''' Get a list of updates installed on the machine Returns: list: A list of installed updates CLI Example: .. code-block:: bash salt '*' wusa.list ''' kbs = [] ret = _pshell_json('Get-HotFix | Select HotFixID') for item in ret: kbs.append(item[...
Get a list of updates installed on the machine Returns: list: A list of installed updates CLI Example: .. code-block:: bash salt '*' wusa.list
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_wusa.py#L209-L226
[ "def _pshell_json(cmd, cwd=None):\n '''\n Execute the desired powershell command and ensure that it returns data\n in JSON format and load that into python\n '''\n if 'convertto-json' not in cmd.lower():\n cmd = '{0} | ConvertTo-Json'.format(cmd)\n log.debug('PowerShell: %s', cmd)\n ret ...
# -*- coding: utf-8 -*- ''' Microsoft Update files management via wusa.exe :maintainer: Thomas Lemarchand :platform: Windows :depends: PowerShell .. versionadded:: 2018.3.4 ''' # Import python libs from __future__ import absolute_import, unicode_literals import logging import os # Import salt libs imp...
saltstack/salt
salt/states/net_napalm_yang.py
managed
python
def managed(name, data, **kwargs): ''' Manage the device configuration given the input data structured according to the YANG models. data YANG structured data. models A list of models to be used when generating the config. profiles: ``None`` Us...
Manage the device configuration given the input data structured according to the YANG models. data YANG structured data. models A list of models to be used when generating the config. profiles: ``None`` Use certain profiles to generate the config. If not specified, wi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/net_napalm_yang.py#L78-L202
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' NAPALM YANG state ================= Manage the configuration of network devices according to the YANG models (OpenConfig/IETF). .. versionadded:: 2017.7.0 Dependencies ------------ - napalm-yang - pyangbind > 0.5.11 To be able to load configuration on network devices, it requires NAPALM...
saltstack/salt
salt/states/net_napalm_yang.py
configured
python
def configured(name, data, **kwargs): ''' Configure the network device, given the input data structured according to the YANG models. .. note:: The main difference between this function and ``managed`` is that the later generates and loads the configuration...
Configure the network device, given the input data structured according to the YANG models. .. note:: The main difference between this function and ``managed`` is that the later generates and loads the configuration only when there are differences between the existing configurat...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/net_napalm_yang.py#L205-L294
[ "def default_ret(name):\n '''\n Return the default dict of the state output.\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'result': False,\n 'comment': ''\n }\n return ret\n", "def loaded_ret(ret, loaded, test, debug, compliance_report=False, opts=None):\n ''...
# -*- coding: utf-8 -*- ''' NAPALM YANG state ================= Manage the configuration of network devices according to the YANG models (OpenConfig/IETF). .. versionadded:: 2017.7.0 Dependencies ------------ - napalm-yang - pyangbind > 0.5.11 To be able to load configuration on network devices, it requires NAPALM...
saltstack/salt
salt/states/dvs.py
_get_datacenter_name
python
def _get_datacenter_name(): ''' Returns the datacenter name configured on the proxy Supported proxies: esxcluster, esxdatacenter ''' proxy_type = __salt__['vsphere.get_proxy_type']() details = None if proxy_type == 'esxcluster': details = __salt__['esxcluster.get_details']() el...
Returns the datacenter name configured on the proxy Supported proxies: esxcluster, esxdatacenter
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L245-L261
null
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
dvs_configured
python
def dvs_configured(name, dvs): ''' Configures a DVS. Creates a new DVS, if it doesn't exist in the provided datacenter or reconfigures it if configured differently. dvs DVS dict representations (see module sysdocs) ''' datacenter_name = _get_datacenter_name() dvs_name = dvs['na...
Configures a DVS. Creates a new DVS, if it doesn't exist in the provided datacenter or reconfigures it if configured differently. dvs DVS dict representations (see module sysdocs)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L264-L407
[ "def _get_datacenter_name():\n '''\n Returns the datacenter name configured on the proxy\n\n Supported proxies: esxcluster, esxdatacenter\n '''\n\n proxy_type = __salt__['vsphere.get_proxy_type']()\n details = None\n if proxy_type == 'esxcluster':\n details = __salt__['esxcluster.get_det...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
_get_diff_dict
python
def _get_diff_dict(dict1, dict2): ''' Returns a dictionary with the diffs between two dictionaries It will ignore any key that doesn't exist in dict2 ''' ret_dict = {} for p in dict2.keys(): if p not in dict1: ret_dict.update({p: {'val1': None, 'val2': dict2[p]}}) el...
Returns a dictionary with the diffs between two dictionaries It will ignore any key that doesn't exist in dict2
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L410-L427
[ "def _get_diff_dict(dict1, dict2):\n '''\n Returns a dictionary with the diffs between two dictionaries\n\n It will ignore any key that doesn't exist in dict2\n '''\n ret_dict = {}\n for p in dict2.keys():\n if p not in dict1:\n ret_dict.update({p: {'val1': None, 'val2': dict2[p]...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
_get_val2_dict_from_diff_dict
python
def _get_val2_dict_from_diff_dict(diff_dict): ''' Returns a dictionaries with the values stored in val2 of a diff dict. ''' ret_dict = {} for p in diff_dict.keys(): if not isinstance(diff_dict[p], dict): raise ValueError('Unexpected diff difct \'{0}\''.format(diff_dict)) ...
Returns a dictionaries with the values stored in val2 of a diff dict.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L430-L443
[ "def _get_val2_dict_from_diff_dict(diff_dict):\n '''\n Returns a dictionaries with the values stored in val2 of a diff dict.\n '''\n ret_dict = {}\n for p in diff_dict.keys():\n if not isinstance(diff_dict[p], dict):\n raise ValueError('Unexpected diff difct \\'{0}\\''.format(diff_d...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
_get_changes_from_diff_dict
python
def _get_changes_from_diff_dict(diff_dict): ''' Returns a list of string message of the differences in a diff dict. Each inner message is tabulated one tab deeper ''' changes_strings = [] for p in diff_dict.keys(): if not isinstance(diff_dict[p], dict): raise ValueError('Une...
Returns a list of string message of the differences in a diff dict. Each inner message is tabulated one tab deeper
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L462-L492
[ "def _get_changes_from_diff_dict(diff_dict):\n '''\n Returns a list of string message of the differences in a diff dict.\n\n Each inner message is tabulated one tab deeper\n '''\n changes_strings = []\n for p in diff_dict.keys():\n if not isinstance(diff_dict[p], dict):\n raise V...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
portgroups_configured
python
def portgroups_configured(name, dvs, portgroups): ''' Configures portgroups on a DVS. Creates/updates/removes portgroups in a provided DVS dvs Name of the DVS portgroups Portgroup dict representations (see module sysdocs) ''' datacenter = _get_datacenter_name() log.inf...
Configures portgroups on a DVS. Creates/updates/removes portgroups in a provided DVS dvs Name of the DVS portgroups Portgroup dict representations (see module sysdocs)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L495-L628
[ "def _get_datacenter_name():\n '''\n Returns the datacenter name configured on the proxy\n\n Supported proxies: esxcluster, esxdatacenter\n '''\n\n proxy_type = __salt__['vsphere.get_proxy_type']()\n details = None\n if proxy_type == 'esxcluster':\n details = __salt__['esxcluster.get_det...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/dvs.py
uplink_portgroup_configured
python
def uplink_portgroup_configured(name, dvs, uplink_portgroup): ''' Configures the uplink portgroup on a DVS. The state assumes there is only one uplink portgroup. dvs Name of the DVS upling_portgroup Uplink portgroup dict representations (see module sysdocs) ''' datacenter ...
Configures the uplink portgroup on a DVS. The state assumes there is only one uplink portgroup. dvs Name of the DVS upling_portgroup Uplink portgroup dict representations (see module sysdocs)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dvs.py#L631-L710
[ "def _get_datacenter_name():\n '''\n Returns the datacenter name configured on the proxy\n\n Supported proxies: esxcluster, esxdatacenter\n '''\n\n proxy_type = __salt__['vsphere.get_proxy_type']()\n details = None\n if proxy_type == 'esxcluster':\n details = __salt__['esxcluster.get_det...
# -*- coding: utf-8 -*- ''' Manage VMware distributed virtual switches (DVSs) and their distributed virtual portgroups (DVportgroups). :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>` Examples ======== Several settings can be changed for DVSs and DVporgroups. Here are two examples covering ...
saltstack/salt
salt/states/postgres_user.py
present
python
def present(name, createdb=None, createroles=None, encrypted=None, superuser=None, replication=None, inherit=None, login=None, password=None, default_password=None, refresh_password=None, ...
Ensure that the named user is present with the specified privileges Please note that the user/group notion in postgresql is just abstract, we have roles, where users can be seens as roles with the LOGIN privilege and groups the others. name The name of the system user to manage. createdb ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_user.py#L37-L259
[ "def _maybe_encrypt_password(role,\n password,\n encrypted=_DEFAULT_PASSWORDS_ENCRYPTION):\n '''\n pgsql passwords are md5 hashes of the string: 'md5{password}{rolename}'\n '''\n if password is not None:\n password = six.text_type(password)\n ...
# -*- coding: utf-8 -*- ''' Management of PostgreSQL users (roles) ====================================== The postgres_users module is used to create and manage Postgres users. .. code-block:: yaml frank: postgres_user.present ''' from __future__ import absolute_import, unicode_literals, print_function # ...
saltstack/salt
salt/states/zone.py
property_present
python
def property_present(name, property, value): ''' Ensure property has a certain value name : string name of the zone property : string name of property value : string value of property ''' ret = {'name': name, 'changes': {}, 'result': None, ...
Ensure property has a certain value name : string name of the zone property : string name of property value : string value of property
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L151-L199
[ "def _parse_value(value):\n '''Internal helper for parsing configuration values into python values'''\n if isinstance(value, bool):\n return 'true' if value else 'false'\n elif isinstance(value, six.string_types):\n # parse compacted notation to dict\n listparser = re.compile(r'''((?:[...
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
property_absent
python
def property_absent(name, property): ''' Ensure property is absent name : string name of the zone property : string name of property .. note:: This does a zoneacfg clear call. So the property may be reset to a default value! Does has the side effect of always having...
Ensure property is absent name : string name of the zone property : string name of property .. note:: This does a zoneacfg clear call. So the property may be reset to a default value! Does has the side effect of always having to be called.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L202-L253
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
resource_present
python
def resource_present(name, resource_type, resource_selector_property, resource_selector_value, **kwargs): ''' Ensure resource exists with provided properties name : string name of the zone resource_type : string type of resource resource_selector_property : string unique res...
Ensure resource exists with provided properties name : string name of the zone resource_type : string type of resource resource_selector_property : string unique resource identifier resource_selector_value : string value for resource selection kwargs : string|int|......
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L256-L414
[ "def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These keys are useful for tracking what was used to invoke\n the function call, but they may not be desirab...
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
resource_absent
python
def resource_absent(name, resource_type, resource_selector_property, resource_selector_value): ''' Ensure resource is absent name : string name of the zone resource_type : string type of resource resource_selector_property : string unique resource identifier resource_sel...
Ensure resource is absent name : string name of the zone resource_type : string type of resource resource_selector_property : string unique resource identifier resource_selector_value : string value for resource selection .. warning:: Both resource_selector_...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L417-L514
[ "def _parse_value(value):\n '''Internal helper for parsing configuration values into python values'''\n if isinstance(value, bool):\n return 'true' if value else 'false'\n elif isinstance(value, six.string_types):\n # parse compacted notation to dict\n listparser = re.compile(r'''((?:[...
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
booted
python
def booted(name, single=False): ''' Ensure zone is booted name : string name of the zone single : boolean boot in single usermode ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](instal...
Ensure zone is booted name : string name of the zone single : boolean boot in single usermode
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L517-L568
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
halted
python
def halted(name, graceful=True): ''' Ensure zone is halted name : string name of the zone graceful : boolean use shutdown instead of halt if true ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zonea...
Ensure zone is halted name : string name of the zone graceful : boolean use shutdown instead of halt if true
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L571-L622
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
export
python
def export(name, path, replace=False): ''' Export a zones configuration name : string name of the zone path : string path of file to export too. replace : boolean replace the file if it exists ''' ret = {'name': name, 'changes': {}, 'result': N...
Export a zones configuration name : string name of the zone path : string path of file to export too. replace : boolean replace the file if it exists
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L625-L738
[ "def mkstemp(*args, **kwargs):\n '''\n Helper function which does exactly what ``tempfile.mkstemp()`` does but\n accepts another argument, ``close_fd``, which, by default, is true and closes\n the fd before returning the file path. Something commonly done throughout\n Salt's code.\n '''\n if 'p...
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
import_
python
def import_(name, path, mode='import', nodataset=False, brand_opts=None): ''' Import a zones configuration name : string name of the zone path : string path of the configuration file to import mode : string either import, install, or attach nodataset : boolean do...
Import a zones configuration name : string name of the zone path : string path of the configuration file to import mode : string either import, install, or attach nodataset : boolean do not create a ZFS file system brand_opts : boolean brand specific options ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L741-L839
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
present
python
def present(name, brand, zonepath, properties=None, resources=None): ''' Ensure a zone with certain properties and resources name : string name of the zone brand : string brand of the zone zonepath : string path of the zone properties : list of key-value pairs di...
Ensure a zone with certain properties and resources name : string name of the zone brand : string brand of the zone zonepath : string path of the zone properties : list of key-value pairs dict of properties resources : list of key-value pairs dict of resource...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L842-L988
[ "def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False):\n if strategy == 'smart':\n if renderer.split('|')[-1] == 'yamlex' or renderer.startswith('yamlex_'):\n strategy = 'aggregate'\n else:\n strategy = 'recurse'\n\n if strategy == 'list':\n ...
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
absent
python
def absent(name, uninstall=False): ''' Ensure a zone is absent name : string name of the zone uninstall : boolean when true, uninstall instead of detaching the zone first. ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} ...
Ensure a zone is absent name : string name of the zone uninstall : boolean when true, uninstall instead of detaching the zone first.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L991-L1055
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
attached
python
def attached(name, force=False): ''' Ensure zone is attached name : string name of the zone force : boolean force attach the zone ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](instal...
Ensure zone is attached name : string name of the zone force : boolean force attach the zone
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L1058-L1097
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
detached
python
def detached(name): ''' Ensure zone is detached name : string name of the zone ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](installed=True, configured=True) if name in zones: if zon...
Ensure zone is detached name : string name of the zone
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L1100-L1138
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
installed
python
def installed(name, nodataset=False, brand_opts=None): ''' Ensure zone is installed name : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : boolean brand specific options to pass ''' ret = {'name': name, 'changes': ...
Ensure zone is installed name : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : boolean brand specific options to pass
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L1141-L1182
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/states/zone.py
uninstalled
python
def uninstalled(name): ''' Ensure zone is uninstalled name : string name of the zone ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](installed=True, configured=True) if name in zones: ...
Ensure zone is uninstalled name : string name of the zone
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L1185-L1223
null
# -*- coding: utf-8 -*- ''' Management of Solaris Zones :maintainer: Jorge Schrauwen <sjorge@blackdot.be> :maturity: new :depends: salt.modules.zoneadm, salt.modules.zonecfg :platform: solaris .. versionadded:: 2017.7.0 Below are some examples of how to use this state. Lets start with creating a z...
saltstack/salt
salt/beacons/avahi_announce.py
validate
python
def validate(config): ''' Validate the beacon configuration ''' _config = {} list(map(_config.update, config)) if not isinstance(config, list): return False, ('Configuration for avahi_announce ' 'beacon must be a list.') elif not all(x in _config for x in ('s...
Validate the beacon configuration
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/avahi_announce.py#L60-L76
null
# -*- coding: utf-8 -*- ''' Beacon to announce via avahi (zeroconf) .. versionadded:: 2016.11.0 Dependencies ============ - python-avahi - dbus-python ''' # Import Python libs from __future__ import absolute_import, unicode_literals import logging import time import salt.utils.stringutils from salt.ext.six.moves i...
saltstack/salt
salt/beacons/avahi_announce.py
beacon
python
def beacon(config): ''' Broadcast values via zeroconf If the announced values are static, it is advised to set run_once: True (do not poll) on the beacon configuration. The following are required configuration settings: - ``servicetype`` - The service type to announce - ``port`` - The por...
Broadcast values via zeroconf If the announced values are static, it is advised to set run_once: True (do not poll) on the beacon configuration. The following are required configuration settings: - ``servicetype`` - The service type to announce - ``port`` - The port of the service to announce ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/avahi_announce.py#L99-L236
null
# -*- coding: utf-8 -*- ''' Beacon to announce via avahi (zeroconf) .. versionadded:: 2016.11.0 Dependencies ============ - python-avahi - dbus-python ''' # Import Python libs from __future__ import absolute_import, unicode_literals import logging import time import salt.utils.stringutils from salt.ext.six.moves i...
saltstack/salt
salt/states/tomcat.py
war_deployed
python
def war_deployed(name, war, force=False, url='http://localhost:8080/manager', timeout=180, temp_war_location=None, version=True): ''' Enforce that the WAR will be deployed and started in the context path, w...
Enforce that the WAR will be deployed and started in the context path, while making use of WAR versions in the filename. .. note:: For more info about Tomcats file paths and context naming, please see http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming name The cont...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/tomcat.py#L73-L222
null
# -*- coding: utf-8 -*- ''' Manage Apache Tomcat web applications ===================================== .. note:: This state requires the Tomcat Manager webapp to be installed and running. The following grains/pillars must be set for communication with Tomcat Manager to work: .. code-block:: yaml tomcat-man...
saltstack/salt
salt/states/tomcat.py
wait
python
def wait(name, url='http://localhost:8080/manager', timeout=180): ''' Wait for the Tomcat Manager to load. Notice that if tomcat is not running we won't wait for it start and the state will fail. This state can be required in the tomcat.war_deployed state to make sure tomcat is running and that the...
Wait for the Tomcat Manager to load. Notice that if tomcat is not running we won't wait for it start and the state will fail. This state can be required in the tomcat.war_deployed state to make sure tomcat is running and that the manager is running as well and ready for deployment. url : http://lo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/tomcat.py#L225-L270
null
# -*- coding: utf-8 -*- ''' Manage Apache Tomcat web applications ===================================== .. note:: This state requires the Tomcat Manager webapp to be installed and running. The following grains/pillars must be set for communication with Tomcat Manager to work: .. code-block:: yaml tomcat-man...
saltstack/salt
salt/states/tomcat.py
mod_watch
python
def mod_watch(name, url='http://localhost:8080/manager', timeout=180): ''' The tomcat watcher, called to invoke the watch command. When called, it will reload the webapp in question .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. I...
The tomcat watcher, called to invoke the watch command. When called, it will reload the webapp in question .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be se...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/tomcat.py#L273-L294
null
# -*- coding: utf-8 -*- ''' Manage Apache Tomcat web applications ===================================== .. note:: This state requires the Tomcat Manager webapp to be installed and running. The following grains/pillars must be set for communication with Tomcat Manager to work: .. code-block:: yaml tomcat-man...
saltstack/salt
salt/states/tomcat.py
undeployed
python
def undeployed(name, url='http://localhost:8080/manager', timeout=180): ''' Enforce that the WAR will be undeployed from the server name The context path to undeploy. url : http://localhost:8080/manager The URL of the server with the Tomcat Manager webapp. ...
Enforce that the WAR will be undeployed from the server name The context path to undeploy. url : http://localhost:8080/manager The URL of the server with the Tomcat Manager webapp. timeout : 180 Timeout for HTTP request to the Tomcat Manager. Example: .. code-block:: yaml ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/tomcat.py#L297-L349
null
# -*- coding: utf-8 -*- ''' Manage Apache Tomcat web applications ===================================== .. note:: This state requires the Tomcat Manager webapp to be installed and running. The following grains/pillars must be set for communication with Tomcat Manager to work: .. code-block:: yaml tomcat-man...
saltstack/salt
salt/modules/xmpp.py
send_msg
python
def send_msg(recipient, message, jid=None, password=None, profile=None): ''' Send a message to an XMPP recipient. Designed for use in states. CLI Examples: .. code-block:: bash xmpp.send_msg 'admins@xmpp.example.com' 'This is a salt module test' \ profile='my-xmpp-account' ...
Send a message to an XMPP recipient. Designed for use in states. CLI Examples: .. code-block:: bash xmpp.send_msg 'admins@xmpp.example.com' 'This is a salt module test' \ profile='my-xmpp-account' xmpp.send_msg 'admins@xmpp.example.com' 'This is a salt module test' \ j...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xmpp.py#L121-L146
null
# -*- coding: utf-8 -*- ''' Module for Sending Messages via XMPP (a.k.a. Jabber) .. versionadded:: 2014.1.0 :depends: - sleekxmpp>=1.3.1 - pyasn1 - pyasn1-modules - dnspython :configuration: This module can be used by either passing a jid and password directly to send_message...
saltstack/salt
salt/modules/xmpp.py
send_msg_multi
python
def send_msg_multi(message, recipients=None, rooms=None, jid=None, password=None, nick="SaltStack Bot", profile=None): ''' Send a message to an XMPP recipient, support send message to multiple r...
Send a message to an XMPP recipient, support send message to multiple recipients or chat room. CLI Examples: .. code-block:: bash xmpp.send_msg recipients=['admins@xmpp.example.com'] \ rooms=['secret@conference.xmpp.example.com'] \ 'This is a salt module test' \ ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xmpp.py#L149-L197
[ "def create_multi(cls, jid, password, msg, recipients=None, rooms=None,\n nick=\"SaltStack Bot\"):\n '''\n Alternate constructor that accept multiple recipients and rooms\n '''\n obj = SendMsgBot(jid, password, None, msg)\n obj.recipients = [] if recipients is None else recipients\n ...
# -*- coding: utf-8 -*- ''' Module for Sending Messages via XMPP (a.k.a. Jabber) .. versionadded:: 2014.1.0 :depends: - sleekxmpp>=1.3.1 - pyasn1 - pyasn1-modules - dnspython :configuration: This module can be used by either passing a jid and password directly to send_message...
saltstack/salt
salt/modules/xmpp.py
SendMsgBot.create_multi
python
def create_multi(cls, jid, password, msg, recipients=None, rooms=None, nick="SaltStack Bot"): ''' Alternate constructor that accept multiple recipients and rooms ''' obj = SendMsgBot(jid, password, None, msg) obj.recipients = [] if recipients is None else rec...
Alternate constructor that accept multiple recipients and rooms
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xmpp.py#L90-L99
null
class SendMsgBot(_ClientXMPP): def __init__(self, jid, password, recipient, msg): # pylint: disable=E1002 # PyLint wrongly reports an error when calling super, hence the above # disable call super(SendMsgBot, self).__init__(jid, password) self.recipients = [] if recipient is None ...
saltstack/salt
salt/beacons/twilio_txt_msg.py
beacon
python
def beacon(config): ''' Emit a dict name "texts" whose value is a list of texts. .. code-block:: yaml beacons: twilio_txt_msg: - account_sid: "<account sid>" - auth_token: "<auth token>" - twilio_number: "+15555555555" - interval: 10 ...
Emit a dict name "texts" whose value is a list of texts. .. code-block:: yaml beacons: twilio_txt_msg: - account_sid: "<account sid>" - auth_token: "<auth token>" - twilio_number: "+15555555555" - interval: 10
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/twilio_txt_msg.py#L60-L111
null
# -*- coding: utf-8 -*- ''' Beacon to emit Twilio text messages ''' # Import Python libs from __future__ import absolute_import, unicode_literals import logging from salt.ext import six from salt.ext.six.moves import map # Import 3rd Party libs try: import twilio # Grab version, ensure elements are ints ...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
exists
python
def exists(Name, region=None, key=None, keyid=None, profile=None): ''' Given a rule name, check to see if the given rule exists. Returns True if the given rule exists and returns False if the given rule does not exist. CLI example:: salt myminion boto_cloudwatch_event.exists myevent regio...
Given a rule name, check to see if the given rule exists. Returns True if the given rule exists and returns False if the given rule does not exist. CLI example:: salt myminion boto_cloudwatch_event.exists myevent region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L89-L112
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
create_or_update
python
def create_or_update(Name, ScheduleExpression=None, EventPattern=None, Description=None, RoleArn=None, State=None, region=None, key=None, keyid=None, profile=None): ''' Given a valid config, create an event rule. Returns {created: true} if t...
Given a valid config, create an event rule. Returns {created: true} if the rule was created and returns {created: False} if the rule was not created. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.create_or_update my_rule
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L115-L153
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
describe
python
def describe(Name, region=None, key=None, keyid=None, profile=None): ''' Given a rule name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.describe myrule ''' try: ...
Given a rule name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.describe myrule
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L180-L210
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
list_rules
python
def list_rules(region=None, key=None, keyid=None, profile=None): ''' List, with details, all Cloudwatch Event rules visible in the current scope. CLI example:: salt myminion boto_cloudwatch_event.list_rules region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=...
List, with details, all Cloudwatch Event rules visible in the current scope. CLI example:: salt myminion boto_cloudwatch_event.list_rules region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L213-L233
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
list_targets
python
def list_targets(Rule, region=None, key=None, keyid=None, profile=None): ''' Given a rule name list the targets of that rule. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.list_targets myrule ''' ...
Given a rule name list the targets of that rule. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.list_targets myrule
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L236-L266
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/boto_cloudwatch_event.py
put_targets
python
def put_targets(Rule, Targets, region=None, key=None, keyid=None, profile=None): ''' Add the given targets to the given rule Returns a dictionary describing any failures. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.put_targets myrule [{'Id': 'target...
Add the given targets to the given rule Returns a dictionary describing any failures. CLI Example: .. code-block:: bash salt myminion boto_cloudwatch_event.put_targets myrule [{'Id': 'target1', 'Arn': 'arn:***'}]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch_event.py#L269-L296
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Connection module for Amazon CloudWatch Events .. versionadded:: 2016.11.0 :configuration: This module accepts explicit credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API an...
saltstack/salt
salt/modules/smf_service.py
_get_enabled_disabled
python
def _get_enabled_disabled(enabled_prop="true"): ''' DRY: Get all service FMRIs and their enabled property ''' ret = set() cmd = '/usr/bin/svcprop -c -p general/enabled "*"' lines = __salt__['cmd.run_stdout'](cmd, python_shell=False).splitlines() for line in lines: comps = line.split(...
DRY: Get all service FMRIs and their enabled property
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L38-L51
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
available
python
def available(name): ''' Returns ``True`` if the specified service is available, otherwise returns ``False``. We look up the name with the svcs command to get back the FMRI This allows users to use simpler service names CLI Example: .. code-block:: bash salt '*' service.available...
Returns ``True`` if the specified service is available, otherwise returns ``False``. We look up the name with the svcs command to get back the FMRI This allows users to use simpler service names CLI Example: .. code-block:: bash salt '*' service.available net-snmp
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L98-L114
[ "def get_all():\n '''\n Return all installed services\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.get_all\n '''\n ret = set()\n cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI'\n lines = __salt__['cmd.run'](cmd).splitlines()\n for line in lines:\n comps = l...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
missing
python
def missing(name): ''' The inverse of service.available. Returns ``True`` if the specified service is not available, otherwise returns ``False``. CLI Example: .. code-block:: bash salt '*' service.missing net-snmp ''' cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name) name ...
The inverse of service.available. Returns ``True`` if the specified service is not available, otherwise returns ``False``. CLI Example: .. code-block:: bash salt '*' service.missing net-snmp
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L117-L131
[ "def get_all():\n '''\n Return all installed services\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.get_all\n '''\n ret = set()\n cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI'\n lines = __salt__['cmd.run'](cmd).splitlines()\n for line in lines:\n comps = l...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
get_all
python
def get_all(): ''' Return all installed services CLI Example: .. code-block:: bash salt '*' service.get_all ''' ret = set() cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI' lines = __salt__['cmd.run'](cmd).splitlines() for line in lines: comps = line.split() ...
Return all installed services CLI Example: .. code-block:: bash salt '*' service.get_all
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L134-L152
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
start
python
def start(name): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name> ''' cmd = '/usr/sbin/svcadm enable -s -t {0}'.format(name) retcode = __salt__['cmd.retcode'](cmd, python_shell=False) if not retcode: return True ...
Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L155-L176
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
restart
python
def restart(name): ''' Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service name> ''' cmd = '/usr/sbin/svcadm restart {0}'.format(name) if not __salt__['cmd.retcode'](cmd, python_shell=False): # calling restart doesn't clear mainten...
Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L193-L208
[ "def start(name):\n '''\n Start the specified service\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.start <service name>\n '''\n cmd = '/usr/sbin/svcadm enable -s -t {0}'.format(name)\n retcode = __salt__['cmd.retcode'](cmd, python_shell=False)\n if not retcode:\n ...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
reload_
python
def reload_(name): ''' Reload the named service CLI Example: .. code-block:: bash salt '*' service.reload <service name> ''' cmd = '/usr/sbin/svcadm refresh {0}'.format(name) if not __salt__['cmd.retcode'](cmd, python_shell=False): # calling reload doesn't clear maintenanc...
Reload the named service CLI Example: .. code-block:: bash salt '*' service.reload <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L211-L226
[ "def start(name):\n '''\n Start the specified service\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.start <service name>\n '''\n cmd = '/usr/sbin/svcadm enable -s -t {0}'.format(name)\n retcode = __salt__['cmd.retcode'](cmd, python_shell=False)\n if not retcode:\n ...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
status
python
def status(name, sig=None): ''' Return the status for a service. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the servi...
Return the status for a service. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the service to check sig (str): Not imple...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L229-L264
[ "def get_all():\n '''\n Return all installed services\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.get_all\n '''\n ret = set()\n cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI'\n lines = __salt__['cmd.run'](cmd).splitlines()\n for line in lines:\n comps = l...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
enable
python
def enable(name, **kwargs): ''' Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name> ''' cmd = '/usr/sbin/svcadm enable {0}'.format(name) return not __salt__['cmd.retcode'](cmd, python_shell=False)
Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L267-L278
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
disable
python
def disable(name, **kwargs): ''' Disable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' cmd = '/usr/sbin/svcadm disable {0}'.format(name) return not __salt__['cmd.retcode'](cmd, python_shell=False)
Disable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.disable <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L281-L292
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/smf_service.py
enabled
python
def enabled(name, **kwargs): ''' Check to see if the named service is enabled to start on boot CLI Example: .. code-block:: bash salt '*' service.enabled <service name> ''' # The property that reveals whether a service is enabled # can only be queried using the full FMRI # We ...
Check to see if the named service is enabled to start on boot CLI Example: .. code-block:: bash salt '*' service.enabled <service name>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smf_service.py#L295-L315
null
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.sta...
saltstack/salt
salt/modules/win_pkg.py
upgrade_available
python
def upgrade_available(name, **kwargs): ''' Check whether or not an upgrade is available for a given package Args: name (str): The name of a single package Kwargs: refresh (bool): Refresh package metadata. Default ``True`` saltenv (str): The salt environment. Default ``base`` ...
Check whether or not an upgrade is available for a given package Args: name (str): The name of a single package Kwargs: refresh (bool): Refresh package metadata. Default ``True`` saltenv (str): The salt environment. Default ``base`` Returns: bool: True if new version avail...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L187-L214
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
list_upgrades
python
def list_upgrades(refresh=True, **kwargs): ''' List all available package upgrades on this system Args: refresh (bool): Refresh package metadata. Default ``True`` Kwargs: saltenv (str): Salt environment. Default ``base`` Returns: dict: A dictionary of packages with availab...
List all available package upgrades on this system Args: refresh (bool): Refresh package metadata. Default ``True`` Kwargs: saltenv (str): Salt environment. Default ``base`` Returns: dict: A dictionary of packages with available upgrades CLI Example: .. code-block:: bash...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L217-L254
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
list_available
python
def list_available(*names, **kwargs): ''' Return a list of available versions of the specified package. Args: names (str): One or more package names Kwargs: saltenv (str): The salt environment to use. Default ``base``. refresh (bool): Refresh package metadata. Default ``False...
Return a list of available versions of the specified package. Args: names (str): One or more package names Kwargs: saltenv (str): The salt environment to use. Default ``base``. refresh (bool): Refresh package metadata. Default ``False``. return_dict_always (bool): ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L257-L314
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
version
python
def version(*names, **kwargs): ''' Returns a string representing the package version or an empty string if not installed. If more than one package name is specified, a dict of name/version pairs is returned. Args: name (str): One or more package names Kwargs: saltenv (str): The...
Returns a string representing the package version or an empty string if not installed. If more than one package name is specified, a dict of name/version pairs is returned. Args: name (str): One or more package names Kwargs: saltenv (str): The salt environment to use. Default ``base``....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L317-L364
[ "def list_pkgs(versions_as_list=False,\n include_components=True,\n include_updates=True,\n **kwargs):\n '''\n List the packages currently installed.\n\n .. note::\n To view installed software as displayed in the Add/Remove Programs, set\n ``include_comp...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
list_pkgs
python
def list_pkgs(versions_as_list=False, include_components=True, include_updates=True, **kwargs): ''' List the packages currently installed. .. note:: To view installed software as displayed in the Add/Remove Programs, set ``include_components`` and `...
List the packages currently installed. .. note:: To view installed software as displayed in the Add/Remove Programs, set ``include_components`` and ``include_updates`` to False. Args: versions_as_list (bool): Returns the versions as a list include_components (bool...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L367-L445
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
_get_reg_software
python
def _get_reg_software(include_components=True, include_updates=True): ''' This searches the uninstall keys in the registry to find a match in the sub keys, it will return a dict with the display name as the key and the version as the value Args: include_components (bo...
This searches the uninstall keys in the registry to find a match in the sub keys, it will return a dict with the display name as the key and the version as the value Args: include_components (bool): Include sub components of installed software. Default is ``True`` include_upda...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L448-L763
null
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
_refresh_db_conditional
python
def _refresh_db_conditional(saltenv, **kwargs): ''' Internal use only in this module, has a different set of defaults and returns True or False. And supports checking the age of the existing generated metadata db, as well as ensure metadata db exists to begin with Args: saltenv (str): Salt ...
Internal use only in this module, has a different set of defaults and returns True or False. And supports checking the age of the existing generated metadata db, as well as ensure metadata db exists to begin with Args: saltenv (str): Salt environment Kwargs: force (bool): ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L766-L832
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
refresh_db
python
def refresh_db(**kwargs): r''' Generates the local software metadata database (`winrepo.p`) on the minion. The database is stored in a serialized format located by default at the following location: ``C:\salt\var\cache\salt\minion\files\base\win\repo-ng\winrepo.p`` This module performs the fol...
r''' Generates the local software metadata database (`winrepo.p`) on the minion. The database is stored in a serialized format located by default at the following location: ``C:\salt\var\cache\salt\minion\files\base\win\repo-ng\winrepo.p`` This module performs the following steps to generate the s...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L835-L961
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
_get_repo_details
python
def _get_repo_details(saltenv): ''' Return repo details for the specified saltenv as a namedtuple ''' contextkey = 'winrepo._get_repo_details.{0}'.format(saltenv) if contextkey in __context__: (winrepo_source_dir, local_dest, winrepo_file) = __context__[contextkey] else: winrepo...
Return repo details for the specified saltenv as a namedtuple
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L964-L1040
[ "def safe_path(path, allow_path=None):\n r'''\n .. versionadded:: 2017.7.3\n\n Checks that the path is safe for modification by Salt. For example, you\n wouldn't want to have salt delete the contents of ``C:\\Windows``. The\n following directories are considered unsafe:\n\n - C:\\, D:\\, E:\\, etc...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
genrepo
python
def genrepo(**kwargs): ''' Generate package metadata db based on files within the winrepo_source_dir Kwargs: saltenv (str): Salt environment. Default: ``base`` verbose (bool): Return verbose data structure which includes 'success_list', a list of all sls files and ...
Generate package metadata db based on files within the winrepo_source_dir Kwargs: saltenv (str): Salt environment. Default: ``base`` verbose (bool): Return verbose data structure which includes 'success_list', a list of all sls files and the package names contained within....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1043-L1143
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
_get_source_sum
python
def _get_source_sum(source_hash, file_path, saltenv): ''' Extract the hash sum, whether it is in a remote hash file, or just a string. ''' ret = dict() schemes = ('salt', 'http', 'https', 'ftp', 'swift', 's3', 'file') invalid_hash_msg = ("Source hash '{0}' format is invalid. It must be in " ...
Extract the hash sum, whether it is in a remote hash file, or just a string.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1218-L1252
null
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
_get_msiexec
python
def _get_msiexec(use_msiexec): ''' Return if msiexec.exe will be used and the command to invoke it. ''' if use_msiexec is False: return False, '' if isinstance(use_msiexec, six.string_types): if os.path.isfile(use_msiexec): return True, use_msiexec else: ...
Return if msiexec.exe will be used and the command to invoke it.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1255-L1271
null
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
install
python
def install(name=None, refresh=False, pkgs=None, **kwargs): r''' Install the passed package(s) on the system using winrepo Args: name (str): The name of a single package, or a comma-separated list of packages to install. (no spaces after the commas) refresh (bool):...
r''' Install the passed package(s) on the system using winrepo Args: name (str): The name of a single package, or a comma-separated list of packages to install. (no spaces after the commas) refresh (bool): Boolean value representing whether or not to refres...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1274-L1723
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
upgrade
python
def upgrade(**kwargs): ''' Upgrade all software. Currently not implemented Kwargs: saltenv (str): The salt environment to use. Default ``base``. refresh (bool): Refresh package metadata. Default ``True``. .. note:: This feature is not yet implemented for Windows. Returns: ...
Upgrade all software. Currently not implemented Kwargs: saltenv (str): The salt environment to use. Default ``base``. refresh (bool): Refresh package metadata. Default ``True``. .. note:: This feature is not yet implemented for Windows. Returns: dict: Empty dict, until imp...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1726-L1754
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...
saltstack/salt
salt/modules/win_pkg.py
remove
python
def remove(name=None, pkgs=None, **kwargs): ''' Remove the passed package(s) from the system using winrepo .. versionadded:: 0.16.0 Args: name (str): The name(s) of the package(s) to be uninstalled. Can be a single package or a comma delimited list of packages, no space...
Remove the passed package(s) from the system using winrepo .. versionadded:: 0.16.0 Args: name (str): The name(s) of the package(s) to be uninstalled. Can be a single package or a comma delimited list of packages, no spaces. pkgs (list): A list of packages ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pkg.py#L1757-L2044
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \...
# -*- coding: utf-8 -*- ''' A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-overrid...