id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
36,400
saltstack/salt
salt/renderers/gpg.py
_decrypt_ciphertext
def _decrypt_ciphertext(cipher): ''' Given a block of ciphertext as a string, and a gpg object, try to decrypt the cipher and return the decrypted string. If the cipher cannot be decrypted, log the error, and return the ciphertext back out. ''' try: cipher = salt.utils.stringutils.to_uni...
python
def _decrypt_ciphertext(cipher): ''' Given a block of ciphertext as a string, and a gpg object, try to decrypt the cipher and return the decrypted string. If the cipher cannot be decrypted, log the error, and return the ciphertext back out. ''' try: cipher = salt.utils.stringutils.to_uni...
[ "def", "_decrypt_ciphertext", "(", "cipher", ")", ":", "try", ":", "cipher", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "cipher", ")", ".", "replace", "(", "r'\\n'", ",", "'\\n'", ")", "except", "UnicodeDecodeError", ":", "# cip...
Given a block of ciphertext as a string, and a gpg object, try to decrypt the cipher and return the decrypted string. If the cipher cannot be decrypted, log the error, and return the ciphertext back out.
[ "Given", "a", "block", "of", "ciphertext", "as", "a", "string", "and", "a", "gpg", "object", "try", "to", "decrypt", "the", "cipher", "and", "return", "the", "decrypted", "string", ".", "If", "the", "cipher", "cannot", "be", "decrypted", "log", "the", "e...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L329-L363
36,401
saltstack/salt
salt/renderers/gpg.py
render
def render(gpg_data, saltenv='base', sls='', argline='', **kwargs): ''' Create a gpg object given a gpg_keydir, and then use it to try to decrypt the data to be rendered. ''' if not _get_gpg_exec(): raise SaltRenderError('GPG unavailable') log.debug('Reading GPG keys from: %s', _get_key_...
python
def render(gpg_data, saltenv='base', sls='', argline='', **kwargs): ''' Create a gpg object given a gpg_keydir, and then use it to try to decrypt the data to be rendered. ''' if not _get_gpg_exec(): raise SaltRenderError('GPG unavailable') log.debug('Reading GPG keys from: %s', _get_key_...
[ "def", "render", "(", "gpg_data", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "argline", "=", "''", ",", "*", "*", "kwargs", ")", ":", "if", "not", "_get_gpg_exec", "(", ")", ":", "raise", "SaltRenderError", "(", "'GPG unavailable'", ")"...
Create a gpg object given a gpg_keydir, and then use it to try to decrypt the data to be rendered.
[ "Create", "a", "gpg", "object", "given", "a", "gpg_keydir", "and", "then", "use", "it", "to", "try", "to", "decrypt", "the", "data", "to", "be", "rendered", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L402-L412
36,402
saltstack/salt
salt/beacons/telegram_bot_msg.py
beacon
def beacon(config): ''' Emit a dict with a key "msgs" whose value is a list of messages sent to the configured bot by one of the allowed usernames. .. code-block:: yaml beacons: telegram_bot_msg: - token: "<bot access token>" - accept_from: - "<v...
python
def beacon(config): ''' Emit a dict with a key "msgs" whose value is a list of messages sent to the configured bot by one of the allowed usernames. .. code-block:: yaml beacons: telegram_bot_msg: - token: "<bot access token>" - accept_from: - "<v...
[ "def", "beacon", "(", "config", ")", ":", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "log", ".", "debug", "(", "'telegram_bot_msg beacon starting'", ")", "ret", "=", "[", "]", "output", "=", ...
Emit a dict with a key "msgs" whose value is a list of messages sent to the configured bot by one of the allowed usernames. .. code-block:: yaml beacons: telegram_bot_msg: - token: "<bot access token>" - accept_from: - "<valid username>" - in...
[ "Emit", "a", "dict", "with", "a", "key", "msgs", "whose", "value", "is", "a", "list", "of", "messages", "sent", "to", "the", "configured", "bot", "by", "one", "of", "the", "allowed", "usernames", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L58-L110
36,403
saltstack/salt
salt/tops/cobbler.py
top
def top(**kwargs): ''' Look up top data in Cobbler for a minion. ''' url = __opts__['cobbler.url'] user = __opts__['cobbler.user'] password = __opts__['cobbler.password'] minion_id = kwargs['opts']['id'] log.info("Querying cobbler for information for %r", minion_id) try: se...
python
def top(**kwargs): ''' Look up top data in Cobbler for a minion. ''' url = __opts__['cobbler.url'] user = __opts__['cobbler.user'] password = __opts__['cobbler.password'] minion_id = kwargs['opts']['id'] log.info("Querying cobbler for information for %r", minion_id) try: se...
[ "def", "top", "(", "*", "*", "kwargs", ")", ":", "url", "=", "__opts__", "[", "'cobbler.url'", "]", "user", "=", "__opts__", "[", "'cobbler.user'", "]", "password", "=", "__opts__", "[", "'cobbler.password'", "]", "minion_id", "=", "kwargs", "[", "'opts'",...
Look up top data in Cobbler for a minion.
[ "Look", "up", "top", "data", "in", "Cobbler", "for", "a", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tops/cobbler.py#L39-L61
36,404
saltstack/salt
salt/modules/locate.py
stats
def stats(): ''' Returns statistics about the locate database CLI Example: .. code-block:: bash salt '*' locate.stats ''' ret = {} cmd = 'locate -S' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.strip().split() if line.startswith...
python
def stats(): ''' Returns statistics about the locate database CLI Example: .. code-block:: bash salt '*' locate.stats ''' ret = {} cmd = 'locate -S' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.strip().split() if line.startswith...
[ "def", "stats", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'locate -S'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "comps", "=", "line", ".", "strip", "(",...
Returns statistics about the locate database CLI Example: .. code-block:: bash salt '*' locate.stats
[ "Returns", "statistics", "about", "the", "locate", "database" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/locate.py#L44-L63
36,405
saltstack/salt
salt/states/lxd.py
init
def init(name, storage_backend='dir', trust_password=None, network_address=None, network_port=None, storage_create_device=None, storage_create_loop=None, storage_pool=None, done_file='%SALT_CONFIG_DIR%/lxd_initialized'): ''' Initalizes the LXD Daemon, as LXD doesn't tell if its initia...
python
def init(name, storage_backend='dir', trust_password=None, network_address=None, network_port=None, storage_create_device=None, storage_create_loop=None, storage_pool=None, done_file='%SALT_CONFIG_DIR%/lxd_initialized'): ''' Initalizes the LXD Daemon, as LXD doesn't tell if its initia...
[ "def", "init", "(", "name", ",", "storage_backend", "=", "'dir'", ",", "trust_password", "=", "None", ",", "network_address", "=", "None", ",", "network_port", "=", "None", ",", "storage_create_device", "=", "None", ",", "storage_create_loop", "=", "None", ","...
Initalizes the LXD Daemon, as LXD doesn't tell if its initialized we touch the the done_file and check if it exist. This can only be called once per host unless you remove the done_file. name : Ignore this. This is just here for salt. storage_backend : Storage backend to use (zfs or d...
[ "Initalizes", "the", "LXD", "Daemon", "as", "LXD", "doesn", "t", "tell", "if", "its", "initialized", "we", "touch", "the", "the", "done_file", "and", "check", "if", "it", "exist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L54-L132
36,406
saltstack/salt
salt/states/lxd.py
config_managed
def config_managed(name, value, force_password=False): ''' Manage a LXD Server config setting. name : The name of the config key. value : Its value. force_password : False Set this to True if you want to set the password on every run. As we can't retrieve the pass...
python
def config_managed(name, value, force_password=False): ''' Manage a LXD Server config setting. name : The name of the config key. value : Its value. force_password : False Set this to True if you want to set the password on every run. As we can't retrieve the pass...
[ "def", "config_managed", "(", "name", ",", "value", ",", "force_password", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'value'", ":", "value", "if", "name", "!=", "'core.trust_password'", "else", "True", ",", "'force_password'", "...
Manage a LXD Server config setting. name : The name of the config key. value : Its value. force_password : False Set this to True if you want to set the password on every run. As we can't retrieve the password from LXD we can't check if the current one is the same...
[ "Manage", "a", "LXD", "Server", "config", "setting", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L135-L201
36,407
saltstack/salt
salt/states/lxd.py
authenticate
def authenticate(name, remote_addr, password, cert, key, verify_cert=True): ''' Authenticate with a remote peer. .. notes: This function makes every time you run this a connection to remote_addr, you better call this only once. remote_addr : An URL to a remote Server, you also...
python
def authenticate(name, remote_addr, password, cert, key, verify_cert=True): ''' Authenticate with a remote peer. .. notes: This function makes every time you run this a connection to remote_addr, you better call this only once. remote_addr : An URL to a remote Server, you also...
[ "def", "authenticate", "(", "name", ",", "remote_addr", ",", "password", ",", "cert", ",", "key", ",", "verify_cert", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'remote_addr'", ":", "remote_addr", ",", "'cert'", ":", "cert", "...
Authenticate with a remote peer. .. notes: This function makes every time you run this a connection to remote_addr, you better call this only once. remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr! Examples: ...
[ "Authenticate", "with", "a", "remote", "peer", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L204-L282
36,408
saltstack/salt
salt/states/ipmi.py
user_present
def user_present(name, uid, password, channel=14, callback=False, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs): ''' Ensure IPMI user and user privileges. name name of user (limit 16 bytes) uid user id number (1 to 7) password us...
python
def user_present(name, uid, password, channel=14, callback=False, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs): ''' Ensure IPMI user and user privileges. name name of user (limit 16 bytes) uid user id number (1 to 7) password us...
[ "def", "user_present", "(", "name", ",", "uid", ",", "password", ",", "channel", "=", "14", ",", "callback", "=", "False", ",", "link_auth", "=", "True", ",", "ipmi_msg", "=", "True", ",", "privilege_level", "=", "'administrator'", ",", "*", "*", "kwargs...
Ensure IPMI user and user privileges. name name of user (limit 16 bytes) uid user id number (1 to 7) password user password (limit 16 bytes) channel ipmi channel defaults to 14 for auto callback User Restricted to Callback False = User Privilege ...
[ "Ensure", "IPMI", "user", "and", "user", "privileges", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L150-L257
36,409
saltstack/salt
salt/matchers/cache_match.py
mmatch
def mmatch(expr, delimiter, greedy, search_type, regex_match=False, exact_match=False, opts=None): ''' Helper function to search for minions in master caches If 'greedy' return accepted minions that matched by the condition or absent in the c...
python
def mmatch(expr, delimiter, greedy, search_type, regex_match=False, exact_match=False, opts=None): ''' Helper function to search for minions in master caches If 'greedy' return accepted minions that matched by the condition or absent in the c...
[ "def", "mmatch", "(", "expr", ",", "delimiter", ",", "greedy", ",", "search_type", ",", "regex_match", "=", "False", ",", "exact_match", "=", "False", ",", "opts", "=", "None", ")", ":", "if", "not", "opts", ":", "opts", "=", "__opts__", "ckminions", "...
Helper function to search for minions in master caches If 'greedy' return accepted minions that matched by the condition or absent in the cache. If not 'greedy' return the only minions have cache data and matched by the condition.
[ "Helper", "function", "to", "search", "for", "minions", "in", "master", "caches", "If", "greedy", "return", "accepted", "minions", "that", "matched", "by", "the", "condition", "or", "absent", "in", "the", "cache", ".", "If", "not", "greedy", "return", "the",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/cache_match.py#L15-L34
36,410
saltstack/salt
salt/states/boto_lc.py
present
def present( name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, cloud_init=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, de...
python
def present( name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, cloud_init=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, de...
[ "def", "present", "(", "name", ",", "image_id", ",", "key_name", "=", "None", ",", "vpc_id", "=", "None", ",", "vpc_name", "=", "None", ",", "security_groups", "=", "None", ",", "user_data", "=", "None", ",", "cloud_init", "=", "None", ",", "instance_typ...
Ensure the launch configuration exists. name Name of the launch configuration. image_id AMI to use for instances. AMI must exist or creation of the launch configuration will fail. key_name Name of the EC2 key pair to use for instances. Key must exist or creation of...
[ "Ensure", "the", "launch", "configuration", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lc.py#L112-L293
36,411
saltstack/salt
salt/runners/spacewalk.py
_get_client_and_key
def _get_client_and_key(url, user, password, verbose=0): ''' Return the client object and session key for the client ''' session = {} session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True) session['key'] = session['client'].auth.login(user, password) ret...
python
def _get_client_and_key(url, user, password, verbose=0): ''' Return the client object and session key for the client ''' session = {} session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True) session['key'] = session['client'].auth.login(user, password) ret...
[ "def", "_get_client_and_key", "(", "url", ",", "user", ",", "password", ",", "verbose", "=", "0", ")", ":", "session", "=", "{", "}", "session", "[", "'client'", "]", "=", "six", ".", "moves", ".", "xmlrpc_client", ".", "Server", "(", "url", ",", "ve...
Return the client object and session key for the client
[ "Return", "the", "client", "object", "and", "session", "key", "for", "the", "client" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L99-L107
36,412
saltstack/salt
salt/runners/spacewalk.py
_get_session
def _get_session(server): ''' Get session and key ''' if server in _sessions: return _sessions[server] config = _get_spacewalk_configuration(server) if not config: raise Exception('No config for \'{0}\' found on master'.format(server)) session = _get_client_and_key(config['...
python
def _get_session(server): ''' Get session and key ''' if server in _sessions: return _sessions[server] config = _get_spacewalk_configuration(server) if not config: raise Exception('No config for \'{0}\' found on master'.format(server)) session = _get_client_and_key(config['...
[ "def", "_get_session", "(", "server", ")", ":", "if", "server", "in", "_sessions", ":", "return", "_sessions", "[", "server", "]", "config", "=", "_get_spacewalk_configuration", "(", "server", ")", "if", "not", "config", ":", "raise", "Exception", "(", "'No ...
Get session and key
[ "Get", "session", "and", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L117-L135
36,413
saltstack/salt
salt/runners/spacewalk.py
api
def api(server, command, *args, **kwargs): ''' Call the Spacewalk xmlrpc api. CLI Example: .. code-block:: bash salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", ...
python
def api(server, command, *args, **kwargs): ''' Call the Spacewalk xmlrpc api. CLI Example: .. code-block:: bash salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", ...
[ "def", "api", "(", "server", ",", "command", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "'arguments'", "in", "kwargs", ":", "arguments", "=", "kwargs", "[", "'arguments'", "]", "else", ":", "arguments", "=", "args", "call", "=", "'{0}...
Call the Spacewalk xmlrpc api. CLI Example: .. code-block:: bash salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", "Description"]' State Example: .. code-block:...
[ "Call", "the", "Spacewalk", "xmlrpc", "api", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L138-L183
36,414
saltstack/salt
salt/runners/spacewalk.py
addGroupsToKey
def addGroupsToKey(server, activation_key, groups): ''' Add server groups to a activation key CLI Example: .. code-block:: bash salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]' ''' try: client, key = _get_session(server) except Exceptio...
python
def addGroupsToKey(server, activation_key, groups): ''' Add server groups to a activation key CLI Example: .. code-block:: bash salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]' ''' try: client, key = _get_session(server) except Exceptio...
[ "def", "addGroupsToKey", "(", "server", ",", "activation_key", ",", "groups", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spac...
Add server groups to a activation key CLI Example: .. code-block:: bash salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]'
[ "Add", "server", "groups", "to", "a", "activation", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L186-L213
36,415
saltstack/salt
salt/runners/spacewalk.py
deleteAllGroups
def deleteAllGroups(server): ''' Delete all server groups from Spacewalk ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc) log.error(err_msg) return {'E...
python
def deleteAllGroups(server): ''' Delete all server groups from Spacewalk ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc) log.error(err_msg) return {'E...
[ "def", "deleteAllGroups", "(", "server", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spacewalk server ({0}): {1}'", ".", "format",...
Delete all server groups from Spacewalk
[ "Delete", "all", "server", "groups", "from", "Spacewalk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L216-L242
36,416
saltstack/salt
salt/runners/spacewalk.py
deleteAllSystems
def deleteAllSystems(server): ''' Delete all systems from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllSystems spacewalk01.domain.com ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'Exception raised when c...
python
def deleteAllSystems(server): ''' Delete all systems from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllSystems spacewalk01.domain.com ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'Exception raised when c...
[ "def", "deleteAllSystems", "(", "server", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spacewalk server ({0}): {1}'", ".", "format"...
Delete all systems from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllSystems spacewalk01.domain.com
[ "Delete", "all", "systems", "from", "Spacewalk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L245-L274
36,417
saltstack/salt
salt/runners/spacewalk.py
deleteAllActivationKeys
def deleteAllActivationKeys(server): ''' Delete all activation keys from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'E...
python
def deleteAllActivationKeys(server): ''' Delete all activation keys from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com ''' try: client, key = _get_session(server) except Exception as exc: err_msg = 'E...
[ "def", "deleteAllActivationKeys", "(", "server", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spacewalk server ({0}): {1}'", ".", "...
Delete all activation keys from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com
[ "Delete", "all", "activation", "keys", "from", "Spacewalk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L277-L309
36,418
saltstack/salt
salt/runners/spacewalk.py
unregister
def unregister(name, server_url): ''' Unregister specified server from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com ''' try: client, key = _get_session(server_url) except Exception as exc: err_msg = 'E...
python
def unregister(name, server_url): ''' Unregister specified server from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com ''' try: client, key = _get_session(server_url) except Exception as exc: err_msg = 'E...
[ "def", "unregister", "(", "name", ",", "server_url", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server_url", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spacewalk server ({0}): {1}'"...
Unregister specified server from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com
[ "Unregister", "specified", "server", "from", "Spacewalk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L312-L340
36,419
saltstack/salt
salt/states/boto3_elasticache.py
cache_subnet_group_present
def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no...
python
def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no...
[ "def", "cache_subnet_group_present", "(", "name", ",", "subnets", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", "ret", "=", "{", "'name'", ...
Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no more than 255 alphanumeric characters or hyphens. subnets A list of VPC subnets (IDs, Names, or a mix) for the cache subnet group. Ca...
[ "Ensure", "cache", "subnet", "group", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L1014-L1101
36,420
saltstack/salt
salt/states/boto3_elasticache.py
cache_subnet_group_absent
def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not n...
python
def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not n...
[ "def", "cache_subnet_group_absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ...
Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not needed, as 'name' is used if it's not provided. region Region to connect to. key ...
[ "Ensure", "a", "given", "cache", "subnet", "group", "is", "deleted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L1104-L1149
36,421
saltstack/salt
salt/modules/boto_cognitoidentity.py
create_identity_pool
def create_identity_pool(IdentityPoolName, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, region=None, key=None, k...
python
def create_identity_pool(IdentityPoolName, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, region=None, key=None, k...
[ "def", "create_identity_pool", "(", "IdentityPoolName", ",", "AllowUnauthenticatedIdentities", "=", "False", ",", "SupportedLoginProviders", "=", "None", ",", "DeveloperProviderName", "=", "None", ",", "OpenIdConnectProviderARNs", "=", "None", ",", "region", "=", "None"...
Creates a new identity pool. All parameters except for IdentityPoolName is optional. SupportedLoginProviders should be a dictionary mapping provider names to provider app IDs. OpenIdConnectProviderARNs should be a list of OpenID Connect provider ARNs. Returns the created identity pool if successful ...
[ "Creates", "a", "new", "identity", "pool", ".", "All", "parameters", "except", "for", "IdentityPoolName", "is", "optional", ".", "SupportedLoginProviders", "should", "be", "a", "dictionary", "mapping", "provider", "names", "to", "provider", "app", "IDs", ".", "O...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L179-L218
36,422
saltstack/salt
salt/modules/boto_cognitoidentity.py
_get_role_arn
def _get_role_arn(name, **conn_params): ''' Helper function to turn a name into an arn string, returns None if not able to resolve ''' if name.startswith('arn:aws:iam'): return name role = __salt__['boto_iam.describe_role'](name, **conn_params) rolearn = role.get('arn') if role else ...
python
def _get_role_arn(name, **conn_params): ''' Helper function to turn a name into an arn string, returns None if not able to resolve ''' if name.startswith('arn:aws:iam'): return name role = __salt__['boto_iam.describe_role'](name, **conn_params) rolearn = role.get('arn') if role else ...
[ "def", "_get_role_arn", "(", "name", ",", "*", "*", "conn_params", ")", ":", "if", "name", ".", "startswith", "(", "'arn:aws:iam'", ")", ":", "return", "name", "role", "=", "__salt__", "[", "'boto_iam.describe_role'", "]", "(", "name", ",", "*", "*", "co...
Helper function to turn a name into an arn string, returns None if not able to resolve
[ "Helper", "function", "to", "turn", "a", "name", "into", "an", "arn", "string", "returns", "None", "if", "not", "able", "to", "resolve" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L289-L299
36,423
saltstack/salt
salt/modules/boto_cognitoidentity.py
update_identity_pool
def update_identity_pool(IdentityPoolId, IdentityPoolName=None, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, ...
python
def update_identity_pool(IdentityPoolId, IdentityPoolName=None, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, ...
[ "def", "update_identity_pool", "(", "IdentityPoolId", ",", "IdentityPoolName", "=", "None", ",", "AllowUnauthenticatedIdentities", "=", "False", ",", "SupportedLoginProviders", "=", "None", ",", "DeveloperProviderName", "=", "None", ",", "OpenIdConnectProviderARNs", "=", ...
Updates the given IdentityPoolId's properties. All parameters except for IdentityPoolId, is optional. SupportedLoginProviders should be a dictionary mapping provider names to provider app IDs. OpenIdConnectProviderARNs should be a list of OpenID Connect provider ARNs. To clear SupportedLoginProvider...
[ "Updates", "the", "given", "IdentityPoolId", "s", "properties", ".", "All", "parameters", "except", "for", "IdentityPoolId", "is", "optional", ".", "SupportedLoginProviders", "should", "be", "a", "dictionary", "mapping", "provider", "names", "to", "provider", "app",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L354-L422
36,424
saltstack/salt
salt/modules/state.py
_snapper_pre
def _snapper_pre(opts, jid): ''' Create a snapper pre snapshot ''' snapper_pre = None try: if not opts['test'] and __opts__.get('snapper_states'): # Run the snapper pre snapshot snapper_pre = __salt__['snapper.create_snapshot']( config=__opts__.get...
python
def _snapper_pre(opts, jid): ''' Create a snapper pre snapshot ''' snapper_pre = None try: if not opts['test'] and __opts__.get('snapper_states'): # Run the snapper pre snapshot snapper_pre = __salt__['snapper.create_snapshot']( config=__opts__.get...
[ "def", "_snapper_pre", "(", "opts", ",", "jid", ")", ":", "snapper_pre", "=", "None", "try", ":", "if", "not", "opts", "[", "'test'", "]", "and", "__opts__", ".", "get", "(", "'snapper_states'", ")", ":", "# Run the snapper pre snapshot", "snapper_pre", "=",...
Create a snapper pre snapshot
[ "Create", "a", "snapper", "pre", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L135-L150
36,425
saltstack/salt
salt/modules/state.py
_snapper_post
def _snapper_post(opts, jid, pre_num): ''' Create the post states snapshot ''' try: if not opts['test'] and __opts__.get('snapper_states') and pre_num: # Run the snapper pre snapshot __salt__['snapper.create_snapshot']( config=__opts__.get('snapper_sta...
python
def _snapper_post(opts, jid, pre_num): ''' Create the post states snapshot ''' try: if not opts['test'] and __opts__.get('snapper_states') and pre_num: # Run the snapper pre snapshot __salt__['snapper.create_snapshot']( config=__opts__.get('snapper_sta...
[ "def", "_snapper_post", "(", "opts", ",", "jid", ",", "pre_num", ")", ":", "try", ":", "if", "not", "opts", "[", "'test'", "]", "and", "__opts__", ".", "get", "(", "'snapper_states'", ")", "and", "pre_num", ":", "# Run the snapper pre snapshot", "__salt__", ...
Create the post states snapshot
[ "Create", "the", "post", "states", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L153-L167
36,426
saltstack/salt
salt/modules/state.py
_get_pause
def _get_pause(jid, state_id=None): ''' Return the pause information for a given jid ''' pause_dir = os.path.join(__opts__['cachedir'], 'state_pause') pause_path = os.path.join(pause_dir, jid) if not os.path.exists(pause_dir): try: os.makedirs(pause_dir) except OSErro...
python
def _get_pause(jid, state_id=None): ''' Return the pause information for a given jid ''' pause_dir = os.path.join(__opts__['cachedir'], 'state_pause') pause_path = os.path.join(pause_dir, jid) if not os.path.exists(pause_dir): try: os.makedirs(pause_dir) except OSErro...
[ "def", "_get_pause", "(", "jid", ",", "state_id", "=", "None", ")", ":", "pause_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'state_pause'", ")", "pause_path", "=", "os", ".", "path", ".", "join", "(", "pa...
Return the pause information for a given jid
[ "Return", "the", "pause", "information", "for", "a", "given", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L170-L189
36,427
saltstack/salt
salt/modules/state.py
get_pauses
def get_pauses(jid=None): ''' Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set. ''' ret = {} active = __salt__['saltutil.is_running']('state.*') pause_dir = os.path.join(__opts__[...
python
def get_pauses(jid=None): ''' Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set. ''' ret = {} active = __salt__['saltutil.is_running']('state.*') pause_dir = os.path.join(__opts__[...
[ "def", "get_pauses", "(", "jid", "=", "None", ")", ":", "ret", "=", "{", "}", "active", "=", "__salt__", "[", "'saltutil.is_running'", "]", "(", "'state.*'", ")", "pause_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]"...
Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set.
[ "Get", "a", "report", "on", "all", "of", "the", "currently", "paused", "state", "runs", "and", "pause", "run", "settings", ".", "Optionally", "send", "in", "a", "jid", "if", "you", "only", "desire", "to", "see", "a", "single", "pause", "data", "set", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L192-L225
36,428
saltstack/salt
salt/modules/state.py
pause
def pause(jid, state_id=None, duration=None): ''' Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be pau...
python
def pause(jid, state_id=None, duration=None): ''' Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be pau...
[ "def", "pause", "(", "jid", ",", "state_id", "=", "None", ",", "duration", "=", "None", ")", ":", "jid", "=", "six", ".", "text_type", "(", "jid", ")", "if", "state_id", "is", "None", ":", "state_id", "=", "'__all__'", "data", ",", "pause_path", "=",...
Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be paused at the beginning of the next state run. The given...
[ "Set", "up", "a", "state", "id", "pause", "this", "instructs", "a", "running", "state", "to", "pause", "at", "a", "given", "state", "id", ".", "This", "needs", "to", "pass", "in", "the", "jid", "of", "the", "running", "state", "and", "can", "optionally...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L262-L294
36,429
saltstack/salt
salt/modules/state.py
resume
def resume(jid, state_id=None): ''' Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim:...
python
def resume(jid, state_id=None): ''' Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim:...
[ "def", "resume", "(", "jid", ",", "state_id", "=", "None", ")", ":", "jid", "=", "six", ".", "text_type", "(", "jid", ")", "if", "state_id", "is", "None", ":", "state_id", "=", "'__all__'", "data", ",", "pause_path", "=", "_get_pause", "(", "jid", ",...
Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim: pkg.installed: [] The state_...
[ "Remove", "a", "pause", "from", "a", "jid", "allowing", "it", "to", "continue", ".", "If", "the", "state_id", "is", "not", "specified", "then", "the", "a", "general", "pause", "will", "be", "resumed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L297-L328
36,430
saltstack/salt
salt/modules/state.py
low
def low(data, queue=False, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": ...
python
def low(data, queue=False, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": ...
[ "def", "low", "(", "data", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "try", ":", "st_", "=", "...
Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
[ "Execute", "a", "single", "low", "data", "call" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L431-L460
36,431
saltstack/salt
salt/modules/state.py
high
def high(data, test=None, queue=False, **kwargs): ''' Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
python
def high(data, test=None, queue=False, **kwargs): ''' Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
[ "def", "high", "(", "data", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", ...
Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '{"vim": {"pkg": ["installed"]}}'
[ "Execute", "the", "compound", "calls", "stored", "in", "a", "single", "set", "of", "high", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L480-L524
36,432
saltstack/salt
salt/modules/state.py
template
def template(tem, queue=False, **kwargs): ''' Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash sa...
python
def template(tem, queue=False, **kwargs): ''' Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash sa...
[ "def", "template", "(", "tem", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "conflict", "=", "_check_queue", "(", ...
Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash salt '*' state.template '<Path to template on the minion...
[ "Execute", "the", "information", "stored", "in", "a", "template", "file", "on", "the", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L527-L576
36,433
saltstack/salt
salt/modules/state.py
template_str
def template_str(tem, queue=False, **kwargs): ''' Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>' ''' conflict = _check_queue(queue, kwargs) if conflict is not None: return co...
python
def template_str(tem, queue=False, **kwargs): ''' Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>' ''' conflict = _check_queue(queue, kwargs) if conflict is not None: return co...
[ "def", "template_str", "(", "tem", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "opts", "=", "salt", ...
Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>'
[ "Execute", "the", "information", "stored", "in", "a", "string", "from", "an", "sls", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L579-L603
36,434
saltstack/salt
salt/modules/state.py
show_state_usage
def show_state_usage(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage ''' conflict = _check_...
python
def show_state_usage(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage ''' conflict = _check_...
[ "def", "show_state_usage", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "pillar", "=", "kwargs", ".", ...
Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage
[ "Retrieve", "the", "highstate", "data", "from", "the", "salt", "master", "to", "analyse", "used", "and", "unused", "states" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1560-L1593
36,435
saltstack/salt
salt/modules/state.py
show_states
def show_states(queue=False, **kwargs): ''' Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0 ''' conflict = _check_queue(queue, kwargs) if conflict is not None: asser...
python
def show_states(queue=False, **kwargs): ''' Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0 ''' conflict = _check_queue(queue, kwargs) if conflict is not None: asser...
[ "def", "show_states", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "assert", "False", "return", "conflict", "opts", "=", "s...
Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0
[ "Returns", "the", "list", "of", "states", "that", "will", "be", "applied", "on", "highstate", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1596-L1641
36,436
saltstack/salt
salt/modules/state.py
show_low_sls
def show_low_sls(mods, test=None, queue=False, **kwargs): ''' Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Cust...
python
def show_low_sls(mods, test=None, queue=False, **kwargs): ''' Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Cust...
[ "def", "show_low_sls", "(", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "confl...
Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Custom Pillar values, passed as a dictionary of key-value pairs ....
[ "Display", "the", "low", "data", "from", "a", "specific", "sls", ".", "The", "default", "environment", "is", "base", "use", "saltenv", "to", "specify", "a", "different", "environment", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1763-L1851
36,437
saltstack/salt
salt/modules/state.py
single
def single(fun, name, test=None, queue=False, **kwargs): ''' Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-v...
python
def single(fun, name, test=None, queue=False, **kwargs): ''' Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-v...
[ "def", "single", "(", "fun", ",", "name", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "retur...
Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-value maps, as you would in a YAML salt file. Alternatively, JSON ...
[ "Execute", "a", "single", "state", "function", "with", "the", "named", "kwargs", "returns", "False", "if", "insufficient", "data", "is", "sent", "to", "the", "command" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2032-L2099
36,438
saltstack/salt
salt/modules/state.py
clear_cache
def clear_cache(): ''' Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash ...
python
def clear_cache(): ''' Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash ...
[ "def", "clear_cache", "(", ")", ":", "ret", "=", "[", "]", "for", "fn_", "in", "os", ".", "listdir", "(", "__opts__", "[", "'cachedir'", "]", ")", ":", "if", "fn_", ".", "endswith", "(", "'.cache.p'", ")", ":", "path", "=", "os", ".", "path", "."...
Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash salt '*' state.clear_cach...
[ "Clear", "out", "cached", "state", "files", "forcing", "even", "cache", "runs", "to", "refresh", "the", "cache", "on", "the", "next", "state", "execution", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2102-L2124
36,439
saltstack/salt
salt/modules/state.py
pkg
def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): ''' Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '...
python
def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): ''' Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '...
[ "def", "pkg", "(", "pkg_path", ",", "pkg_sum", ",", "hash_type", ",", "test", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO - Add ability to download from salt master or other source", "popts", "=", "salt", ".", "utils", ".", "state", ".", "get_sls_opt...
Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '*' state.pkg /tmp/salt_state.tgz 760a9353810e36f6d81416366fc426dc md5
[ "Execute", "a", "packaged", "state", "run", "the", "packaged", "state", "run", "will", "exist", "in", "a", "tarball", "available", "locally", ".", "This", "packaged", "state", "can", "be", "generated", "using", "salt", "-", "ssh", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2127-L2200
36,440
saltstack/salt
salt/modules/state.py
disable
def disable(states): ''' Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed...
python
def disable(states): ''' Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed...
[ "def", "disable", "(", "states", ")", ":", "ret", "=", "{", "'res'", ":", "True", ",", "'msg'", ":", "''", "}", "states", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "states", ")", "msg", "=", "[", "]", "_disabled", "=", "__s...
Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed in a state.sls call. sa...
[ "Disable", "state", "runs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2203-L2251
36,441
saltstack/salt
salt/modules/state.py
enable
def enable(states): ''' Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed ...
python
def enable(states): ''' Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed ...
[ "def", "enable", "(", "states", ")", ":", "ret", "=", "{", "'res'", ":", "True", ",", "'msg'", ":", "''", "}", "states", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "states", ")", "log", ".", "debug", "(", "'states %s'", ",", ...
Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed in a state.sls call. sa...
[ "Enable", "state", "function", "or", "sls", "run" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2254-L2304
36,442
saltstack/salt
salt/modules/state.py
_disabled
def _disabled(funs): ''' Return messages for disabled states that match state functions in funs. ''' ret = [] _disabled = __salt__['grains.get']('state_runs_disabled') for state in funs: for _state in _disabled: if '.*' in _state: target_state = _state.spl...
python
def _disabled(funs): ''' Return messages for disabled states that match state functions in funs. ''' ret = [] _disabled = __salt__['grains.get']('state_runs_disabled') for state in funs: for _state in _disabled: if '.*' in _state: target_state = _state.spl...
[ "def", "_disabled", "(", "funs", ")", ":", "ret", "=", "[", "]", "_disabled", "=", "__salt__", "[", "'grains.get'", "]", "(", "'state_runs_disabled'", ")", "for", "state", "in", "funs", ":", "for", "_state", "in", "_disabled", ":", "if", "'.*'", "in", ...
Return messages for disabled states that match state functions in funs.
[ "Return", "messages", "for", "disabled", "states", "that", "match", "state", "functions", "in", "funs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2320-L2352
36,443
saltstack/salt
salt/states/grains.py
list_absent
def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be ...
python
def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be ...
[ "def", "list_absent", "(", "name", ",", "value", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'chang...
Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be provided. .. versionadded:: v2015.8.2 The grain should be `l...
[ "Delete", "a", "value", "from", "a", "grain", "formed", "as", "a", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L222-L295
36,444
saltstack/salt
salt/modules/chocolatey.py
_find_chocolatey
def _find_chocolatey(context, salt): ''' Returns the full path to chocolatey.bat on the host. ''' if 'chocolatey._path' in context: return context['chocolatey._path'] choc_defaults = ['C:\\Chocolatey\\bin\\chocolatey.bat', 'C:\\ProgramData\\Chocolatey\\bin\\chocolatey.ex...
python
def _find_chocolatey(context, salt): ''' Returns the full path to chocolatey.bat on the host. ''' if 'chocolatey._path' in context: return context['chocolatey._path'] choc_defaults = ['C:\\Chocolatey\\bin\\chocolatey.bat', 'C:\\ProgramData\\Chocolatey\\bin\\chocolatey.ex...
[ "def", "_find_chocolatey", "(", "context", ",", "salt", ")", ":", "if", "'chocolatey._path'", "in", "context", ":", "return", "context", "[", "'chocolatey._path'", "]", "choc_defaults", "=", "[", "'C:\\\\Chocolatey\\\\bin\\\\chocolatey.bat'", ",", "'C:\\\\ProgramData\\\...
Returns the full path to chocolatey.bat on the host.
[ "Returns", "the", "full", "path", "to", "chocolatey", ".", "bat", "on", "the", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L90-L109
36,445
saltstack/salt
salt/modules/chocolatey.py
chocolatey_version
def chocolatey_version(): ''' Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version ''' if 'chocolatey._version' in __context__: return __context__['chocolatey._version'] cmd = [_find_chocolatey...
python
def chocolatey_version(): ''' Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version ''' if 'chocolatey._version' in __context__: return __context__['chocolatey._version'] cmd = [_find_chocolatey...
[ "def", "chocolatey_version", "(", ")", ":", "if", "'chocolatey._version'", "in", "__context__", ":", "return", "__context__", "[", "'chocolatey._version'", "]", "cmd", "=", "[", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "]", "cmd", ".", "appe...
Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version
[ "Returns", "the", "version", "of", "Chocolatey", "installed", "on", "the", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L112-L130
36,446
saltstack/salt
salt/modules/chocolatey.py
bootstrap
def bootstrap(force=False): ''' Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these p...
python
def bootstrap(force=False): ''' Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these p...
[ "def", "bootstrap", "(", "force", "=", "False", ")", ":", "# Check if Chocolatey is already present in the path", "try", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "except", "CommandExecutionError", ":", "choc_path", "=", "Non...
Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these prerequisites are met by downloading and ...
[ "Download", "and", "install", "the", "latest", "version", "of", "the", "Chocolatey", "package", "manager", "via", "the", "official", "bootstrap", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L133-L226
36,447
saltstack/salt
salt/modules/chocolatey.py
list_
def list_(narrow=None, all_versions=False, pre_versions=False, source=None, local_only=False, exact=False): ''' Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results....
python
def list_(narrow=None, all_versions=False, pre_versions=False, source=None, local_only=False, exact=False): ''' Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results....
[ "def", "list_", "(", "narrow", "=", "None", ",", "all_versions", "=", "False", ",", "pre_versions", "=", "False", ",", "source", "=", "None", ",", "local_only", "=", "False", ",", "exact", "=", "False", ")", ":", "choc_path", "=", "_find_chocolatey", "("...
Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results. Searches against name/description/tag. Default is None. all_versions (bool): Display all available package versions in results. Default ...
[ "Instructs", "Chocolatey", "to", "pull", "a", "vague", "package", "list", "from", "the", "repository", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L229-L311
36,448
saltstack/salt
salt/modules/chocolatey.py
list_windowsfeatures
def list_windowsfeatures(): ''' Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfe...
python
def list_windowsfeatures(): ''' Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfe...
[ "def", "list_windowsfeatures", "(", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'list'", ",", "'--source'", ",", "'windowsfeatures'", "]", "result", "=", "__salt__", "[", "'cmd.r...
Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfeatures
[ "Instructs", "Chocolatey", "to", "pull", "a", "full", "package", "list", "from", "the", "Windows", "Features", "list", "via", "the", "Deployment", "Image", "Servicing", "and", "Management", "tool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L340-L363
36,449
saltstack/salt
salt/modules/chocolatey.py
install_cygwin
def install_cygwin(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation proces...
python
def install_cygwin(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation proces...
[ "def", "install_cygwin", "(", "name", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "source", "=", "'cygwin'", ",", "install_args", "=", "install_args", ",", "override_args", "=", "over...
Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation process i.e product key or feature list override_args Set to tr...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Cygwin", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L496-L523
36,450
saltstack/salt
salt/modules/chocolatey.py
install_gem
def install_gem(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to lates...
python
def install_gem(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to lates...
[ "def", "install_gem", "(", "name", ",", "version", "=", "None", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "version", "=", "version", ",", "source", "=", "'ruby'", ",", "install_...
Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to latest version available. install_args A list of install arguments you wa...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Ruby", "s", "Gems", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L526-L560
36,451
saltstack/salt
salt/modules/chocolatey.py
install_missing
def install_missing(name, version=None, source=None): ''' Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` i...
python
def install_missing(name, version=None, source=None): ''' Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` i...
[ "def", "install_missing", "(", "name", ",", "version", "=", "None", ",", "source", "=", "None", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "if", "_LooseVersion", "(", "chocolatey_version", "(", ")", ")", ">=", ...
Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` instead, as ``installmissing`` is deprecated as of that ver...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "if", "it", "doesn", "t", "already", "exist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L563-L611
36,452
saltstack/salt
salt/modules/chocolatey.py
install_python
def install_python(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defa...
python
def install_python(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defa...
[ "def", "install_python", "(", "name", ",", "version", "=", "None", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "version", "=", "version", ",", "source", "=", "'python'", ",", "ins...
Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to latest version available. install_args A list of install argume...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Python", "s", "easy_install", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L614-L647
36,453
saltstack/salt
salt/modules/chocolatey.py
install_webpi
def install_webpi(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to th...
python
def install_webpi(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to th...
[ "def", "install_webpi", "(", "name", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "source", "=", "'webpi'", ",", "install_args", "=", "install_args", ",", "override_args", "=", "overri...
Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation process i.e product key or feature list override_...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "the", "Microsoft", "Web", "PI", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L667-L694
36,454
saltstack/salt
salt/modules/chocolatey.py
uninstall
def uninstall(name, version=None, uninstall_args=None, override_args=False): ''' Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest...
python
def uninstall(name, version=None, uninstall_args=None, override_args=False): ''' Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest...
[ "def", "uninstall", "(", "name", ",", "version", "=", "None", ",", "uninstall_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "# chocolatey helpfully only supports a ...
Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest version installed. uninstall_args A list of uninstall arguments you...
[ "Instructs", "Chocolatey", "to", "uninstall", "a", "package", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L697-L744
36,455
saltstack/salt
salt/modules/chocolatey.py
update
def update(name, source=None, pre_versions=False): ''' Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the pa...
python
def update(name, source=None, pre_versions=False): ''' Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the pa...
[ "def", "update", "(", "name", ",", "source", "=", "None", ",", "pre_versions", "=", "False", ")", ":", "# chocolatey helpfully only supports a single package argument", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "if", "_LooseVersio...
Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the package comes from. Defaults to the official Chocolatey f...
[ "Instructs", "Chocolatey", "to", "update", "packages", "on", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L842-L887
36,456
saltstack/salt
salt/modules/chocolatey.py
version
def version(name, check_remote=False, source=None, pre_versions=False): ''' Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote...
python
def version(name, check_remote=False, source=None, pre_versions=False): ''' Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote...
[ "def", "version", "(", "name", ",", "check_remote", "=", "False", ",", "source", "=", "None", ",", "pre_versions", "=", "False", ")", ":", "installed", "=", "list_", "(", "narrow", "=", "name", ",", "local_only", "=", "True", ")", "installed", "=", "{"...
Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote (bool): Get the version number of the latest package from the remote fe...
[ "Instructs", "Chocolatey", "to", "check", "an", "installed", "package", "version", "and", "optionally", "compare", "it", "to", "one", "available", "from", "a", "remote", "feed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L890-L945
36,457
saltstack/salt
salt/modules/chocolatey.py
add_source
def add_source(name, source_location, username=None, password=None): ''' Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey ...
python
def add_source(name, source_location, username=None, password=None): ''' Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey ...
[ "def", "add_source", "(", "name", ",", "source_location", ",", "username", "=", "None", ",", "password", "=", "None", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'sources'", ...
Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey sources that need authentication credentials. password Provi...
[ "Instructs", "Chocolatey", "to", "add", "a", "source", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L948-L987
36,458
saltstack/salt
salt/modules/chocolatey.py
_change_source_state
def _change_source_state(name, state): ''' Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository. ''' choc_path = _find_chocolatey(__context__, __salt__) cmd = [choc_path, 'sourc...
python
def _change_source_state(name, state): ''' Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository. ''' choc_path = _find_chocolatey(__context__, __salt__) cmd = [choc_path, 'sourc...
[ "def", "_change_source_state", "(", "name", ",", "state", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'source'", ",", "state", ",", "'--name'", ",", "name", "]", "result", "=...
Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository.
[ "Instructs", "Chocolatey", "to", "change", "the", "state", "of", "a", "source", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L990-L1010
36,459
saltstack/salt
salt/modules/layman.py
add
def add(overlay): ''' Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name> ...
python
def add(overlay): ''' Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name> ...
[ "def", "add", "(", "overlay", ")", ":", "ret", "=", "list", "(", ")", "old_overlays", "=", "list_local", "(", ")", "cmd", "=", "'layman --quietness=0 --add {0}'", ".", "format", "(", "overlay", ")", "add_attempt", "=", "__salt__", "[", "'cmd.run_all'", "]", ...
Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name>
[ "Add", "the", "given", "overlay", "from", "the", "cached", "remote", "list", "to", "your", "locally", "installed", "overlays", ".", "Specify", "ALL", "to", "add", "all", "overlays", "from", "the", "remote", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L33-L65
36,460
saltstack/salt
salt/modules/layman.py
delete
def delete(overlay): ''' Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name> ''' ret = list() o...
python
def delete(overlay): ''' Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name> ''' ret = list() o...
[ "def", "delete", "(", "overlay", ")", ":", "ret", "=", "list", "(", ")", "old_overlays", "=", "list_local", "(", ")", "cmd", "=", "'layman --quietness=0 --delete {0}'", ".", "format", "(", "overlay", ")", "delete_attempt", "=", "__salt__", "[", "'cmd.run_all'"...
Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name>
[ "Remove", "the", "given", "overlay", "from", "the", "your", "locally", "installed", "overlays", ".", "Specify", "ALL", "to", "remove", "all", "overlays", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L68-L98
36,461
saltstack/salt
salt/modules/layman.py
list_local
def list_local(): ''' List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local ''' cmd = 'layman --quietness=1 --list-local --nocolor' out = __salt__['cmd.run'](cmd, python_shell=False).split('\n') ...
python
def list_local(): ''' List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local ''' cmd = 'layman --quietness=1 --list-local --nocolor' out = __salt__['cmd.run'](cmd, python_shell=False).split('\n') ...
[ "def", "list_local", "(", ")", ":", "cmd", "=", "'layman --quietness=1 --list-local --nocolor'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "split", "(", "'\\n'", ")", "ret", "=", "[", "line", "....
List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local
[ "List", "the", "locally", "installed", "overlays", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L119-L134
36,462
saltstack/salt
salt/auth/django.py
__django_auth_setup
def __django_auth_setup(): ''' Prepare the connection to the Django authentication framework ''' if django.VERSION >= (1, 7): django.setup() global DJANGO_AUTH_CLASS if DJANGO_AUTH_CLASS is not None: return # Versions 1.7 and later of Django don't pull models until # t...
python
def __django_auth_setup(): ''' Prepare the connection to the Django authentication framework ''' if django.VERSION >= (1, 7): django.setup() global DJANGO_AUTH_CLASS if DJANGO_AUTH_CLASS is not None: return # Versions 1.7 and later of Django don't pull models until # t...
[ "def", "__django_auth_setup", "(", ")", ":", "if", "django", ".", "VERSION", ">=", "(", "1", ",", "7", ")", ":", "django", ".", "setup", "(", ")", "global", "DJANGO_AUTH_CLASS", "if", "DJANGO_AUTH_CLASS", "is", "not", "None", ":", "return", "# Versions 1.7...
Prepare the connection to the Django authentication framework
[ "Prepare", "the", "connection", "to", "the", "Django", "authentication", "framework" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/django.py#L93-L116
36,463
saltstack/salt
salt/auth/django.py
auth
def auth(username, password): ''' Simple Django auth ''' django_auth_path = __opts__['django_auth_path'] if django_auth_path not in sys.path: sys.path.append(django_auth_path) os.environ.setdefault('DJANGO_SETTINGS_MODULE', __opts__['django_auth_settings']) __django_auth_setup() ...
python
def auth(username, password): ''' Simple Django auth ''' django_auth_path = __opts__['django_auth_path'] if django_auth_path not in sys.path: sys.path.append(django_auth_path) os.environ.setdefault('DJANGO_SETTINGS_MODULE', __opts__['django_auth_settings']) __django_auth_setup() ...
[ "def", "auth", "(", "username", ",", "password", ")", ":", "django_auth_path", "=", "__opts__", "[", "'django_auth_path'", "]", "if", "django_auth_path", "not", "in", "sys", ".", "path", ":", "sys", ".", "path", ".", "append", "(", "django_auth_path", ")", ...
Simple Django auth
[ "Simple", "Django", "auth" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/django.py#L119-L144
36,464
saltstack/salt
salt/matchers/confirm_top.py
confirm_top
def confirm_top(match, data, nodegroups=None): ''' Takes the data passed to a top file environment and determines if the data matches this minion ''' matcher = 'compound' if not data: log.error('Received bad data when setting the match from the top ' 'file') ret...
python
def confirm_top(match, data, nodegroups=None): ''' Takes the data passed to a top file environment and determines if the data matches this minion ''' matcher = 'compound' if not data: log.error('Received bad data when setting the match from the top ' 'file') ret...
[ "def", "confirm_top", "(", "match", ",", "data", ",", "nodegroups", "=", "None", ")", ":", "matcher", "=", "'compound'", "if", "not", "data", ":", "log", ".", "error", "(", "'Received bad data when setting the match from the top '", "'file'", ")", "return", "Fal...
Takes the data passed to a top file environment and determines if the data matches this minion
[ "Takes", "the", "data", "passed", "to", "a", "top", "file", "environment", "and", "determines", "if", "the", "data", "matches", "this", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/confirm_top.py#L15-L36
36,465
saltstack/salt
salt/modules/win_servermanager.py
list_installed
def list_installed(): ''' List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed ''' cmd = 'Get-WindowsFeature ' \...
python
def list_installed(): ''' List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed ''' cmd = 'Get-WindowsFeature ' \...
[ "def", "list_installed", "(", ")", ":", "cmd", "=", "'Get-WindowsFeature '", "'-ErrorAction SilentlyContinue '", "'-WarningAction SilentlyContinue '", "'| Select DisplayName,Name,Installed'", "features", "=", "_pshell_json", "(", "cmd", ")", "ret", "=", "{", "}", "for", "...
List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed
[ "List", "installed", "features", ".", "Supported", "on", "Windows", "Server", "2008", "and", "Windows", "8", "and", "newer", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L108-L133
36,466
saltstack/salt
salt/modules/win_servermanager.py
install
def install(feature, recurse=False, restart=False, source=None, exclude=None): r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time ...
python
def install(feature, recurse=False, restart=False, source=None, exclude=None): r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time ...
[ "def", "install", "(", "feature", ",", "recurse", "=", "False", ",", "restart", "=", "False", ",", "source", "=", "None", ",", "exclude", "=", "None", ")", ":", "# If it is a list of features, make it a comma delimited string", "if", "isinstance", "(", "feature", ...
r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time to complete un/installation, set -t with a long timeout Args: ...
[ "r", "Install", "a", "feature" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L136-L298
36,467
saltstack/salt
salt/modules/win_servermanager.py
remove
def remove(feature, remove_payload=False, restart=False): r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additi...
python
def remove(feature, remove_payload=False, restart=False): r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additi...
[ "def", "remove", "(", "feature", ",", "remove_payload", "=", "False", ",", "restart", "=", "False", ")", ":", "# If it is a list of features, make it a comma delimited string", "if", "isinstance", "(", "feature", ",", "list", ")", ":", "feature", "=", "','", ".", ...
r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additionally, some features take a while to complete install...
[ "r", "Remove", "an", "installed", "feature" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L301-L407
36,468
saltstack/salt
salt/modules/iwtools.py
list_interfaces
def list_interfaces(style=None): ''' List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces ''' ret = {} tmp = None iface = None out = __salt__['cmd.run']('iwconfig') for line in out.splitlines(): if not line: continue ...
python
def list_interfaces(style=None): ''' List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces ''' ret = {} tmp = None iface = None out = __salt__['cmd.run']('iwconfig') for line in out.splitlines(): if not line: continue ...
[ "def", "list_interfaces", "(", "style", "=", "None", ")", ":", "ret", "=", "{", "}", "tmp", "=", "None", "iface", "=", "None", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'iwconfig'", ")", "for", "line", "in", "out", ".", "splitlines", "(", ...
List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces
[ "List", "all", "of", "the", "wireless", "interfaces" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iwtools.py#L113-L155
36,469
saltstack/salt
salt/beacons/smartos_vmadm.py
beacon
def beacon(config): ''' Poll vmadm for changes ''' ret = [] # NOTE: lookup current images current_vms = __salt__['vmadm.list']( keyed=True, order='uuid,state,alias,hostname,dns_domain', ) # NOTE: apply configuration if VMADM_STATE['first_run']: log.info('App...
python
def beacon(config): ''' Poll vmadm for changes ''' ret = [] # NOTE: lookup current images current_vms = __salt__['vmadm.list']( keyed=True, order='uuid,state,alias,hostname,dns_domain', ) # NOTE: apply configuration if VMADM_STATE['first_run']: log.info('App...
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "# NOTE: lookup current images", "current_vms", "=", "__salt__", "[", "'vmadm.list'", "]", "(", "keyed", "=", "True", ",", "order", "=", "'uuid,state,alias,hostname,dns_domain'", ",", ")", "# NOTE: ...
Poll vmadm for changes
[ "Poll", "vmadm", "for", "changes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/smartos_vmadm.py#L69-L139
36,470
saltstack/salt
salt/modules/mssql.py
tsql_query
def tsql_query(query, **kwargs): ''' Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True ...
python
def tsql_query(query, **kwargs): ''' Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True ...
[ "def", "tsql_query", "(", "query", ",", "*", "*", "kwargs", ")", ":", "try", ":", "cur", "=", "_get_connection", "(", "*", "*", "kwargs", ")", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "query", ")", "# Making sure the result is JSON serializable...
Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True
[ "Run", "a", "SQL", "query", "and", "return", "query", "result", "as", "list", "of", "tuples", "or", "a", "list", "of", "dictionaries", "if", "as_dict", "was", "passed", "or", "an", "empty", "list", "if", "no", "data", "is", "available", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L74-L91
36,471
saltstack/salt
salt/modules/mssql.py
db_create
def db_create(database, containment='NONE', new_database_options=None, **kwargs): ''' Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME '''...
python
def db_create(database, containment='NONE', new_database_options=None, **kwargs): ''' Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME '''...
[ "def", "db_create", "(", "database", ",", "containment", "=", "'NONE'", ",", "new_database_options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "containment", "not", "in", "[", "'NONE'", ",", "'PARTIAL'", "]", ":", "return", "'CONTAINMENT can be o...
Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME
[ "Creates", "a", "new", "database", ".", "Does", "not", "update", "options", "of", "existing", "databases", ".", "new_database_options", "can", "only", "be", "a", "list", "of", "strings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L134-L164
36,472
saltstack/salt
salt/modules/mssql.py
db_remove
def db_remove(database_name, **kwargs): ''' Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME' ''' try: if db_exists(database_...
python
def db_remove(database_name, **kwargs): ''' Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME' ''' try: if db_exists(database_...
[ "def", "db_remove", "(", "database_name", ",", "*", "*", "kwargs", ")", ":", "try", ":", "if", "db_exists", "(", "database_name", ",", "*", "*", "kwargs", ")", "and", "database_name", "not", "in", "[", "'master'", ",", "'model'", ",", "'msdb'", ",", "'...
Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME'
[ "Drops", "a", "specific", "database", "from", "the", "MS", "SQL", "server", ".", "It", "will", "not", "drop", "any", "of", "master", "model", "msdb", "or", "tempdb", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L167-L191
36,473
saltstack/salt
salt/modules/mssql.py
role_exists
def role_exists(role, **kwargs): ''' Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner ''' # We should get one, and only one row return len(tsql_query(query='sp_helprole "{0}"'.format(role), as_dict=True, **kwargs)) == 1
python
def role_exists(role, **kwargs): ''' Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner ''' # We should get one, and only one row return len(tsql_query(query='sp_helprole "{0}"'.format(role), as_dict=True, **kwargs)) == 1
[ "def", "role_exists", "(", "role", ",", "*", "*", "kwargs", ")", ":", "# We should get one, and only one row", "return", "len", "(", "tsql_query", "(", "query", "=", "'sp_helprole \"{0}\"'", ".", "format", "(", "role", ")", ",", "as_dict", "=", "True", ",", ...
Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner
[ "Checks", "if", "a", "role", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L208-L220
36,474
saltstack/salt
salt/modules/mssql.py
role_create
def role_create(role, owner=None, grants=None, **kwargs): ''' Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash ...
python
def role_create(role, owner=None, grants=None, **kwargs): ''' Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash ...
[ "def", "role_create", "(", "role", ",", "owner", "=", "None", ",", "grants", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "grants", ":", "grants", "=", "[", "]", "sql", "=", "'CREATE ROLE {0}'", ".", "format", "(", "role", ")", "if"...
Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash salt minion mssql.role_create role=product01 owner=sysdba gran...
[ "Creates", "a", "new", "database", "role", ".", "If", "no", "owner", "is", "specified", "the", "role", "will", "be", "owned", "by", "the", "user", "that", "executes", "CREATE", "ROLE", "which", "is", "the", "user", "argument", "or", "mssql", ".", "user",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L223-L257
36,475
saltstack/salt
salt/modules/mssql.py
role_remove
def role_remove(role, **kwargs): ''' Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01 ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute('DROP ROLE {0}'...
python
def role_remove(role, **kwargs): ''' Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01 ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute('DROP ROLE {0}'...
[ "def", "role_remove", "(", "role", ",", "*", "*", "kwargs", ")", ":", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn", ".", "autocommit", "(", "True", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "cur", ".", ...
Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01
[ "Remove", "a", "database", "role", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L260-L279
36,476
saltstack/salt
salt/modules/mssql.py
login_exists
def login_exists(login, domain='', **kwargs): ''' Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN' ''' if domain: login = '{0}\\{1}'.format(domain, login) ...
python
def login_exists(login, domain='', **kwargs): ''' Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN' ''' if domain: login = '{0}\\{1}'.format(domain, login) ...
[ "def", "login_exists", "(", "login", ",", "domain", "=", "''", ",", "*", "*", "kwargs", ")", ":", "if", "domain", ":", "login", "=", "'{0}\\\\{1}'", ".", "format", "(", "domain", ",", "login", ")", "try", ":", "# We should get one, and only one row", "retu...
Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN'
[ "Find", "if", "a", "login", "exists", "in", "the", "MS", "SQL", "server", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "login" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L282-L300
36,477
saltstack/salt
salt/modules/mssql.py
login_remove
def login_remove(login, **kwargs): ''' Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute("DROP LOGIN [{0}]".format...
python
def login_remove(login, **kwargs): ''' Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute("DROP LOGIN [{0}]".format...
[ "def", "login_remove", "(", "login", ",", "*", "*", "kwargs", ")", ":", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn", ".", "autocommit", "(", "True", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "cur", ".", ...
Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME
[ "Removes", "an", "login", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L362-L381
36,478
saltstack/salt
salt/modules/mssql.py
user_exists
def user_exists(username, domain='', database=None, **kwargs): ''' Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME'] ''' ...
python
def user_exists(username, domain='', database=None, **kwargs): ''' Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME'] ''' ...
[ "def", "user_exists", "(", "username", ",", "domain", "=", "''", ",", "database", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "domain", ":", "username", "=", "'{0}\\\\{1}'", ".", "format", "(", "domain", ",", "username", ")", "if", "database"...
Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME']
[ "Find", "if", "an", "user", "exists", "in", "a", "specific", "database", "on", "the", "MS", "SQL", "server", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "username" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L384-L400
36,479
saltstack/salt
salt/modules/mssql.py
user_create
def user_create(username, login=None, domain='', database=None, roles=None, options=None, **kwargs): ''' Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: ...
python
def user_create(username, login=None, domain='', database=None, roles=None, options=None, **kwargs): ''' Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: ...
[ "def", "user_create", "(", "username", ",", "login", "=", "None", ",", "domain", "=", "''", ",", "database", "=", "None", ",", "roles", "=", "None", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "domain", "and", "not", "logi...
Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.user_create USERNAME database=DBNAME
[ "Creates", "a", "new", "user", ".", "If", "login", "is", "not", "specified", "the", "user", "will", "be", "created", "without", "a", "login", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "username", ".", "options", "can", "only", "be...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L416-L467
36,480
saltstack/salt
salt/modules/mssql.py
user_remove
def user_remove(username, **kwargs): ''' Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME ''' # 'database' argument is mandatory if 'database' not in kwargs: return False try: conn = _get_connection(**kwa...
python
def user_remove(username, **kwargs): ''' Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME ''' # 'database' argument is mandatory if 'database' not in kwargs: return False try: conn = _get_connection(**kwa...
[ "def", "user_remove", "(", "username", ",", "*", "*", "kwargs", ")", ":", "# 'database' argument is mandatory", "if", "'database'", "not", "in", "kwargs", ":", "return", "False", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn...
Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME
[ "Removes", "an", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L470-L492
36,481
saltstack/salt
salt/states/boto_cloudwatch_alarm.py
present
def present( name, attributes, region=None, key=None, keyid=None, profile=None): ''' Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm attributes. region Region to conn...
python
def present( name, attributes, region=None, key=None, keyid=None, profile=None): ''' Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm attributes. region Region to conn...
[ "def", "present", "(", "name", ",", "attributes", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'...
Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm attributes. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and ke...
[ "Ensure", "the", "cloudwatch", "alarm", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudwatch_alarm.py#L73-L177
36,482
saltstack/salt
salt/states/docker_container.py
_format_comments
def _format_comments(ret, comments): ''' DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict. ''' if isinstance(comments, six.string_types): ret['comment'] = comments else: ret['comment'] = '...
python
def _format_comments(ret, comments): ''' DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict. ''' if isinstance(comments, six.string_types): ret['comment'] = comments else: ret['comment'] = '...
[ "def", "_format_comments", "(", "ret", ",", "comments", ")", ":", "if", "isinstance", "(", "comments", ",", "six", ".", "string_types", ")", ":", "ret", "[", "'comment'", "]", "=", "comments", "else", ":", "ret", "[", "'comment'", "]", "=", "'. '", "."...
DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict.
[ "DRY", "code", "for", "joining", "comments", "together", "and", "conditionally", "adding", "a", "period", "at", "the", "end", "and", "adding", "this", "comment", "string", "to", "the", "state", "return", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L79-L90
36,483
saltstack/salt
salt/states/docker_container.py
_parse_networks
def _parse_networks(networks): ''' Common logic for parsing the networks ''' networks = salt.utils.args.split_input(networks or []) if not networks: networks = {} else: # We don't want to recurse the repack, as the values of the kwargs # being passed when connecting to th...
python
def _parse_networks(networks): ''' Common logic for parsing the networks ''' networks = salt.utils.args.split_input(networks or []) if not networks: networks = {} else: # We don't want to recurse the repack, as the values of the kwargs # being passed when connecting to th...
[ "def", "_parse_networks", "(", "networks", ")", ":", "networks", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "networks", "or", "[", "]", ")", "if", "not", "networks", ":", "networks", "=", "{", "}", "else", ":", "# We don't want to r...
Common logic for parsing the networks
[ "Common", "logic", "for", "parsing", "the", "networks" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L118-L186
36,484
saltstack/salt
salt/states/docker_container.py
_resolve_image
def _resolve_image(ret, image, client_timeout): ''' Resolve the image ID and pull the image if necessary ''' image_id = __salt__['docker.resolve_image_id'](image) if image_id is False: if not __opts__['test']: # Image not pulled locally, so try pulling it try: ...
python
def _resolve_image(ret, image, client_timeout): ''' Resolve the image ID and pull the image if necessary ''' image_id = __salt__['docker.resolve_image_id'](image) if image_id is False: if not __opts__['test']: # Image not pulled locally, so try pulling it try: ...
[ "def", "_resolve_image", "(", "ret", ",", "image", ",", "client_timeout", ")", ":", "image_id", "=", "__salt__", "[", "'docker.resolve_image_id'", "]", "(", "image", ")", "if", "image_id", "is", "False", ":", "if", "not", "__opts__", "[", "'test'", "]", ":...
Resolve the image ID and pull the image if necessary
[ "Resolve", "the", "image", "ID", "and", "pull", "the", "image", "if", "necessary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L189-L217
36,485
saltstack/salt
salt/states/docker_container.py
absent
def absent(name, force=False): ''' Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent mu...
python
def absent(name, force=False): ''' Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent mu...
[ "def", "absent", "(", "name", ",", "force", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "if", "name", "not", "in", "__salt__", "...
Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent multiple_containers: docker_contain...
[ "Ensure", "that", "a", "container", "is", "absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2488-L2549
36,486
saltstack/salt
salt/states/docker_container.py
mod_watch
def mod_watch(name, sfun=None, **kwargs): ''' The docker_container watcher, called to invoke the watch command. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function sho...
python
def mod_watch(name, sfun=None, **kwargs): ''' The docker_container watcher, called to invoke the watch command. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function sho...
[ "def", "mod_watch", "(", "name", ",", "sfun", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "sfun", "==", "'running'", ":", "watch_kwargs", "=", "copy", ".", "deepcopy", "(", "kwargs", ")", "if", "watch_kwargs", ".", "get", "(", "'watch_action'...
The docker_container watcher, called to invoke the watch command. .. 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 set by the state being triggered.
[ "The", "docker_container", "watcher", "called", "to", "invoke", "the", "watch", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2618-L2647
36,487
saltstack/salt
salt/cloud/clouds/vultrpy.py
list_nodes
def list_nodes(**kwargs): ''' Return basic data on nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {} for prop in 'id', 'image', 'size', 'state', 'private_ips', 'public_ips': ret[node][prop] = nodes[node][prop] return ret
python
def list_nodes(**kwargs): ''' Return basic data on nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {} for prop in 'id', 'image', 'size', 'state', 'private_ips', 'public_ips': ret[node][prop] = nodes[node][prop] return ret
[ "def", "list_nodes", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "nodes", "=", "list_nodes_full", "(", ")", "for", "node", "in", "nodes", ":", "ret", "[", "node", "]", "=", "{", "}", "for", "prop", "in", "'id'", ",", "'image'", ",", ...
Return basic data on nodes
[ "Return", "basic", "data", "on", "nodes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L160-L172
36,488
saltstack/salt
salt/cloud/clouds/vultrpy.py
list_nodes_full
def list_nodes_full(**kwargs): ''' Return all data on nodes ''' nodes = _query('server/list') ret = {} for node in nodes: name = nodes[node]['label'] ret[name] = nodes[node].copy() ret[name]['id'] = node ret[name]['image'] = nodes[node]['os'] ret[name]['s...
python
def list_nodes_full(**kwargs): ''' Return all data on nodes ''' nodes = _query('server/list') ret = {} for node in nodes: name = nodes[node]['label'] ret[name] = nodes[node].copy() ret[name]['id'] = node ret[name]['image'] = nodes[node]['os'] ret[name]['s...
[ "def", "list_nodes_full", "(", "*", "*", "kwargs", ")", ":", "nodes", "=", "_query", "(", "'server/list'", ")", "ret", "=", "{", "}", "for", "node", "in", "nodes", ":", "name", "=", "nodes", "[", "node", "]", "[", "'label'", "]", "ret", "[", "name"...
Return all data on nodes
[ "Return", "all", "data", "on", "nodes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L175-L192
36,489
saltstack/salt
salt/cloud/clouds/vultrpy.py
destroy
def destroy(name): ''' Remove a node from Vultr ''' node = show_instance(name, call='action') params = {'SUBID': node['SUBID']} result = _query('server/destroy', method='POST', decode=False, data=_urlencode(params)) # The return of a destroy call is empty in the case of a success. # Err...
python
def destroy(name): ''' Remove a node from Vultr ''' node = show_instance(name, call='action') params = {'SUBID': node['SUBID']} result = _query('server/destroy', method='POST', decode=False, data=_urlencode(params)) # The return of a destroy call is empty in the case of a success. # Err...
[ "def", "destroy", "(", "name", ")", ":", "node", "=", "show_instance", "(", "name", ",", "call", "=", "'action'", ")", "params", "=", "{", "'SUBID'", ":", "node", "[", "'SUBID'", "]", "}", "result", "=", "_query", "(", "'server/destroy'", ",", "method"...
Remove a node from Vultr
[ "Remove", "a", "node", "from", "Vultr" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L204-L217
36,490
saltstack/salt
salt/cloud/clouds/vultrpy.py
_lookup_vultrid
def _lookup_vultrid(which_key, availkey, keyname): ''' Helper function to retrieve a Vultr ID ''' if DETAILS == {}: _cache_provider_details() which_key = six.text_type(which_key) try: return DETAILS[availkey][which_key][keyname] except KeyError: return False
python
def _lookup_vultrid(which_key, availkey, keyname): ''' Helper function to retrieve a Vultr ID ''' if DETAILS == {}: _cache_provider_details() which_key = six.text_type(which_key) try: return DETAILS[availkey][which_key][keyname] except KeyError: return False
[ "def", "_lookup_vultrid", "(", "which_key", ",", "availkey", ",", "keyname", ")", ":", "if", "DETAILS", "==", "{", "}", ":", "_cache_provider_details", "(", ")", "which_key", "=", "six", ".", "text_type", "(", "which_key", ")", "try", ":", "return", "DETAI...
Helper function to retrieve a Vultr ID
[ "Helper", "function", "to", "retrieve", "a", "Vultr", "ID" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L251-L262
36,491
saltstack/salt
salt/cloud/clouds/vultrpy.py
_query
def _query(path, method='GET', data=None, params=None, header_dict=None, decode=True): ''' Perform a query directly against the Vultr REST API ''' api_key = config.get_cloud_config_value( 'api_key', get_configured_provider(), __opts__, search_global=False, ) manag...
python
def _query(path, method='GET', data=None, params=None, header_dict=None, decode=True): ''' Perform a query directly against the Vultr REST API ''' api_key = config.get_cloud_config_value( 'api_key', get_configured_provider(), __opts__, search_global=False, ) manag...
[ "def", "_query", "(", "path", ",", "method", "=", "'GET'", ",", "data", "=", "None", ",", "params", "=", "None", ",", "header_dict", "=", "None", ",", "decode", "=", "True", ")", ":", "api_key", "=", "config", ".", "get_cloud_config_value", "(", "'api_...
Perform a query directly against the Vultr REST API
[ "Perform", "a", "query", "directly", "against", "the", "Vultr", "REST", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L477-L519
36,492
saltstack/salt
salt/pillar/redismod.py
ext_pillar
def ext_pillar(minion_id, pillar, function, **kwargs): ''' Grabs external pillar data based on configured function ''' if function.startswith('_') or function not in globals(): return {} # Call specified function to pull redis data return globals()[function](minion_id, pillar, **kwargs)
python
def ext_pillar(minion_id, pillar, function, **kwargs): ''' Grabs external pillar data based on configured function ''' if function.startswith('_') or function not in globals(): return {} # Call specified function to pull redis data return globals()[function](minion_id, pillar, **kwargs)
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "function", ",", "*", "*", "kwargs", ")", ":", "if", "function", ".", "startswith", "(", "'_'", ")", "or", "function", "not", "in", "globals", "(", ")", ":", "return", "{", "}", "# Call specifi...
Grabs external pillar data based on configured function
[ "Grabs", "external", "pillar", "data", "based", "on", "configured", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L51-L58
36,493
saltstack/salt
salt/pillar/redismod.py
key_value
def key_value(minion_id, pillar, # pylint: disable=W0613 pillar_key='redis_pillar'): ''' Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted se...
python
def key_value(minion_id, pillar, # pylint: disable=W0613 pillar_key='redis_pillar'): ''' Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted se...
[ "def", "key_value", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "pillar_key", "=", "'redis_pillar'", ")", ":", "# Identify key type and process as needed based on that type", "key_type", "=", "__salt__", "[", "'redis.key_type'", "]", "(", "minion_id", ...
Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted sets. pillar_key Pillar key to return data into
[ "Looks", "for", "key", "in", "redis", "matching", "minion_id", "returns", "a", "structure", "based", "on", "the", "data", "type", "of", "the", "redis", "key", ".", "String", "for", "string", "type", "dict", "for", "hash", "type", "and", "lists", "for", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L61-L93
36,494
saltstack/salt
salt/pillar/redismod.py
key_json
def key_json(minion_id, pillar, # pylint: disable=W0613 pillar_key=None): ''' Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into '...
python
def key_json(minion_id, pillar, # pylint: disable=W0613 pillar_key=None): ''' Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into '...
[ "def", "key_json", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "pillar_key", "=", "None", ")", ":", "key_data", "=", "__salt__", "[", "'redis.get_key'", "]", "(", "minion_id", ")", "# Return nothing for non-existent keys", "if", "not", "key_data...
Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into
[ "Pulls", "a", "string", "from", "redis", "and", "deserializes", "it", "from", "json", ".", "Deserialized", "dictionary", "data", "loaded", "directly", "into", "top", "level", "if", "pillar_key", "is", "not", "set", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L96-L118
36,495
saltstack/salt
salt/states/jboss7.py
bindings_exist
def bindings_exist(name, jboss_config, bindings, profile=None): ''' Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see stat...
python
def bindings_exist(name, jboss_config, bindings, profile=None): ''' Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see stat...
[ "def", "bindings_exist", "(", "name", ",", "jboss_config", ",", "bindings", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\" ======================== STATE: jboss7.bindings_exist (name: %s) (profile: %s) \"", ",", "name", ",", "profile", ")", "log"...
Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see state description) bindings: Dict with bindings to set. profile:...
[ "Ensures", "that", "given", "JNDI", "binding", "are", "present", "on", "the", "server", ".", "If", "a", "binding", "doesn", "t", "exist", "on", "the", "server", "it", "will", "be", "created", ".", "If", "it", "already", "exists", "its", "value", "will", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/jboss7.py#L203-L261
36,496
saltstack/salt
salt/states/jboss7.py
reloaded
def reloaded(name, jboss_config, timeout=60, interval=5): ''' Reloads configuration of jboss server. jboss_config: Dict with connection properties (see state description) timeout: Time to wait until jboss is back in running state. Default timeout is 60s. interval: Interval b...
python
def reloaded(name, jboss_config, timeout=60, interval=5): ''' Reloads configuration of jboss server. jboss_config: Dict with connection properties (see state description) timeout: Time to wait until jboss is back in running state. Default timeout is 60s. interval: Interval b...
[ "def", "reloaded", "(", "name", ",", "jboss_config", ",", "timeout", "=", "60", ",", "interval", "=", "5", ")", ":", "log", ".", "debug", "(", "\" ======================== STATE: jboss7.reloaded (name: %s) \"", ",", "name", ")", "ret", "=", "{", "'name'", ":",...
Reloads configuration of jboss server. jboss_config: Dict with connection properties (see state description) timeout: Time to wait until jboss is back in running state. Default timeout is 60s. interval: Interval between state checks. Default interval is 5s. Decreasing the interval m...
[ "Reloads", "configuration", "of", "jboss", "server", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/jboss7.py#L484-L549
36,497
saltstack/salt
salt/modules/google_chat.py
send_message
def send_message(url, message): ''' Send a message to the google chat room specified in the webhook url. .. code-block:: bash salt '*' google_chat.send_message "https://chat.googleapis.com/v1/spaces/example_space/messages?key=example_key" "This is a test message" ''' headers = {'Content-Ty...
python
def send_message(url, message): ''' Send a message to the google chat room specified in the webhook url. .. code-block:: bash salt '*' google_chat.send_message "https://chat.googleapis.com/v1/spaces/example_space/messages?key=example_key" "This is a test message" ''' headers = {'Content-Ty...
[ "def", "send_message", "(", "url", ",", "message", ")", ":", "headers", "=", "{", "'Content-Type'", ":", "'application/json'", "}", "data", "=", "{", "'text'", ":", "message", "}", "result", "=", "__utils__", "[", "'http.query'", "]", "(", "url", ",", "'...
Send a message to the google chat room specified in the webhook url. .. code-block:: bash salt '*' google_chat.send_message "https://chat.googleapis.com/v1/spaces/example_space/messages?key=example_key" "This is a test message"
[ "Send", "a", "message", "to", "the", "google", "chat", "room", "specified", "in", "the", "webhook", "url", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/google_chat.py#L36-L56
36,498
saltstack/salt
salt/utils/error.py
fire_exception
def fire_exception(exc, opts, job=None, node='minion'): ''' Fire raw exception across the event bus ''' if job is None: job = {} event = salt.utils.event.SaltEvent(node, opts=opts, listen=False) event.fire_event(pack_exception(exc), '_salt_error')
python
def fire_exception(exc, opts, job=None, node='minion'): ''' Fire raw exception across the event bus ''' if job is None: job = {} event = salt.utils.event.SaltEvent(node, opts=opts, listen=False) event.fire_event(pack_exception(exc), '_salt_error')
[ "def", "fire_exception", "(", "exc", ",", "opts", ",", "job", "=", "None", ",", "node", "=", "'minion'", ")", ":", "if", "job", "is", "None", ":", "job", "=", "{", "}", "event", "=", "salt", ".", "utils", ".", "event", ".", "SaltEvent", "(", "nod...
Fire raw exception across the event bus
[ "Fire", "raw", "exception", "across", "the", "event", "bus" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/error.py#L44-L51
36,499
saltstack/salt
salt/renderers/msgpack.py
render
def render(msgpack_data, saltenv='base', sls='', **kws): ''' Accepts a message pack string or a file object, renders said data back to a python dict. .. note: This renderer is NOT intended for use in creating sls files by hand, but exists to allow for data backends to serialize the high...
python
def render(msgpack_data, saltenv='base', sls='', **kws): ''' Accepts a message pack string or a file object, renders said data back to a python dict. .. note: This renderer is NOT intended for use in creating sls files by hand, but exists to allow for data backends to serialize the high...
[ "def", "render", "(", "msgpack_data", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "*", "*", "kws", ")", ":", "if", "not", "isinstance", "(", "msgpack_data", ",", "six", ".", "string_types", ")", ":", "msgpack_data", "=", "msgpack_data", ...
Accepts a message pack string or a file object, renders said data back to a python dict. .. note: This renderer is NOT intended for use in creating sls files by hand, but exists to allow for data backends to serialize the highdata structure in an easily transportable way. This is to all...
[ "Accepts", "a", "message", "pack", "string", "or", "a", "file", "object", "renders", "said", "data", "back", "to", "a", "python", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/msgpack.py#L9-L29