partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
beacon
Scan for processes and fire events Example Config .. code-block:: yaml beacons: ps: - processes: salt-master: running mysql: stopped The config above sets up beacons to check that processes are running or stopped.
salt/beacons/ps.py
def beacon(config): ''' Scan for processes and fire events Example Config .. code-block:: yaml beacons: ps: - processes: salt-master: running mysql: stopped The config above sets up beacons to check that processes are running or s...
def beacon(config): ''' Scan for processes and fire events Example Config .. code-block:: yaml beacons: ps: - processes: salt-master: running mysql: stopped The config above sets up beacons to check that processes are running or s...
[ "Scan", "for", "processes", "and", "fire", "events" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/ps.py#L53-L94
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "procs", "=", "[", "]", "for", "proc", "in", "psutil", ".", "process_iter", "(", ")", ":", "_name", "=", "proc", ".", "name", "(", ")", "if", "_name", "not", "in", "procs", ":", "p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
List the nodes, ask all 'vagrant' minions, return dict of grains (enhanced). CLI Example: .. code-block:: bash salt-call -F
salt/cloud/clouds/vagrant.py
def list_nodes_full(call=None): ''' List the nodes, ask all 'vagrant' minions, return dict of grains (enhanced). CLI Example: .. code-block:: bash salt-call -F ''' ret = _list_nodes(call) for key, grains in ret.items(): # clean up some hyperverbose grains -- everything is too mu...
def list_nodes_full(call=None): ''' List the nodes, ask all 'vagrant' minions, return dict of grains (enhanced). CLI Example: .. code-block:: bash salt-call -F ''' ret = _list_nodes(call) for key, grains in ret.items(): # clean up some hyperverbose grains -- everything is too mu...
[ "List", "the", "nodes", "ask", "all", "vagrant", "minions", "return", "dict", "of", "grains", "(", "enhanced", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vagrant.py#L125-L148
[ "def", "list_nodes_full", "(", "call", "=", "None", ")", ":", "ret", "=", "_list_nodes", "(", "call", ")", "for", "key", ",", "grains", "in", "ret", ".", "items", "(", ")", ":", "# clean up some hyperverbose grains -- everything is too much", "try", ":", "del"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_nodes
List the nodes, ask all 'vagrant' minions, return dict of grains.
salt/cloud/clouds/vagrant.py
def _list_nodes(call=None): ''' List the nodes, ask all 'vagrant' minions, return dict of grains. ''' local = salt.client.LocalClient() ret = local.cmd('salt-cloud:driver:vagrant', 'grains.items', '', tgt_type='grain') return ret
def _list_nodes(call=None): ''' List the nodes, ask all 'vagrant' minions, return dict of grains. ''' local = salt.client.LocalClient() ret = local.cmd('salt-cloud:driver:vagrant', 'grains.items', '', tgt_type='grain') return ret
[ "List", "the", "nodes", "ask", "all", "vagrant", "minions", "return", "dict", "of", "grains", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vagrant.py#L151-L157
[ "def", "_list_nodes", "(", "call", "=", "None", ")", ":", "local", "=", "salt", ".", "client", ".", "LocalClient", "(", ")", "ret", "=", "local", ".", "cmd", "(", "'salt-cloud:driver:vagrant'", ",", "'grains.items'", ",", "''", ",", "tgt_type", "=", "'gr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Provision a single machine CLI Example: .. code-block:: bash salt-cloud -p my_profile new_node_1
salt/cloud/clouds/vagrant.py
def create(vm_): ''' Provision a single machine CLI Example: .. code-block:: bash salt-cloud -p my_profile new_node_1 ''' name = vm_['name'] machine = config.get_cloud_config_value( 'machine', vm_, __opts__, default='') vm_['machine'] = machine host = config.get_c...
def create(vm_): ''' Provision a single machine CLI Example: .. code-block:: bash salt-cloud -p my_profile new_node_1 ''' name = vm_['name'] machine = config.get_cloud_config_value( 'machine', vm_, __opts__, default='') vm_['machine'] = machine host = config.get_c...
[ "Provision", "a", "single", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vagrant.py#L186-L248
[ "def", "create", "(", "vm_", ")", ":", "name", "=", "vm_", "[", "'name'", "]", "machine", "=", "config", ".", "get_cloud_config_value", "(", "'machine'", ",", "vm_", ",", "__opts__", ",", "default", "=", "''", ")", "vm_", "[", "'machine'", "]", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine
salt/cloud/clouds/vagrant.py
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a, or --action.' ...
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a, or --action.' ...
[ "Destroy", "a", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vagrant.py#L264-L316
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a, or --action.'", ")", "opts", "=", "__opts__", "__utils__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
Reboot a vagrant minion. name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name
salt/cloud/clouds/vagrant.py
def reboot(name, call=None): ''' Reboot a vagrant minion. name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' if call != 'action': raise SaltCloudException( 'The reboot action must be called with -a or ...
def reboot(name, call=None): ''' Reboot a vagrant minion. name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' if call != 'action': raise SaltCloudException( 'The reboot action must be called with -a or ...
[ "Reboot", "a", "vagrant", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vagrant.py#L320-L342
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudException", "(", "'The reboot action must be called with -a or --action.'", ")", "my_info", "=", "_get_my_info", "(", "name", ")", "profile_na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear_rtag
Remove the rtag file
salt/utils/pkg/__init__.py
def clear_rtag(opts): ''' Remove the rtag file ''' try: os.remove(rtag(opts)) except OSError as exc: if exc.errno != errno.ENOENT: # Using __str__() here to get the fully-formatted error message # (error number, error message, path) log.warning('En...
def clear_rtag(opts): ''' Remove the rtag file ''' try: os.remove(rtag(opts)) except OSError as exc: if exc.errno != errno.ENOENT: # Using __str__() here to get the fully-formatted error message # (error number, error message, path) log.warning('En...
[ "Remove", "the", "rtag", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/__init__.py#L28-L38
[ "def", "clear_rtag", "(", "opts", ")", ":", "try", ":", "os", ".", "remove", "(", "rtag", "(", "opts", ")", ")", "except", "OSError", "as", "exc", ":", "if", "exc", ".", "errno", "!=", "errno", ".", "ENOENT", ":", "# Using __str__() here to get the fully...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
write_rtag
Write the rtag file
salt/utils/pkg/__init__.py
def write_rtag(opts): ''' Write the rtag file ''' rtag_file = rtag(opts) if not os.path.exists(rtag_file): try: with salt.utils.files.fopen(rtag_file, 'w+'): pass except OSError as exc: log.warning('Encountered error writing rtag: %s', exc.__st...
def write_rtag(opts): ''' Write the rtag file ''' rtag_file = rtag(opts) if not os.path.exists(rtag_file): try: with salt.utils.files.fopen(rtag_file, 'w+'): pass except OSError as exc: log.warning('Encountered error writing rtag: %s', exc.__st...
[ "Write", "the", "rtag", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/__init__.py#L41-L51
[ "def", "write_rtag", "(", "opts", ")", ":", "rtag_file", "=", "rtag", "(", "opts", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "rtag_file", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "rtag_file...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_refresh
Check whether or not a refresh is necessary Returns: - True if refresh evaluates as True - False if refresh is False - A boolean if refresh is not False and the rtag file exists
salt/utils/pkg/__init__.py
def check_refresh(opts, refresh=None): ''' Check whether or not a refresh is necessary Returns: - True if refresh evaluates as True - False if refresh is False - A boolean if refresh is not False and the rtag file exists ''' return bool( salt.utils.data.is_true(refresh) or ...
def check_refresh(opts, refresh=None): ''' Check whether or not a refresh is necessary Returns: - True if refresh evaluates as True - False if refresh is False - A boolean if refresh is not False and the rtag file exists ''' return bool( salt.utils.data.is_true(refresh) or ...
[ "Check", "whether", "or", "not", "a", "refresh", "is", "necessary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/__init__.py#L54-L67
[ "def", "check_refresh", "(", "opts", ",", "refresh", "=", "None", ")", ":", "return", "bool", "(", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "refresh", ")", "or", "(", "os", ".", "path", ".", "isfile", "(", "rtag", "(", "opts", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
match_version
Returns the first version of the list of available versions which matches the desired version comparison expression, or None if no match is found.
salt/utils/pkg/__init__.py
def match_version(desired, available, cmp_func=None, ignore_epoch=False): ''' Returns the first version of the list of available versions which matches the desired version comparison expression, or None if no match is found. ''' oper, version = split_comparison(desired) if not oper: oper...
def match_version(desired, available, cmp_func=None, ignore_epoch=False): ''' Returns the first version of the list of available versions which matches the desired version comparison expression, or None if no match is found. ''' oper, version = split_comparison(desired) if not oper: oper...
[ "Returns", "the", "first", "version", "of", "the", "list", "of", "available", "versions", "which", "matches", "the", "desired", "version", "comparison", "expression", "or", "None", "if", "no", "match", "is", "found", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/__init__.py#L80-L95
[ "def", "match_version", "(", "desired", ",", "available", ",", "cmp_func", "=", "None", ",", "ignore_epoch", "=", "False", ")", ":", "oper", ",", "version", "=", "split_comparison", "(", "desired", ")", "if", "not", "oper", ":", "oper", "=", "'=='", "for...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_auth
Set up openstack credentials
salt/modules/swift.py
def _auth(profile=None): ''' Set up openstack credentials ''' if profile: credentials = __salt__['config.option'](profile) user = credentials['keystone.user'] password = credentials.get('keystone.password', None) tenant = credentials['keystone.tenant'] auth_url = ...
def _auth(profile=None): ''' Set up openstack credentials ''' if profile: credentials = __salt__['config.option'](profile) user = credentials['keystone.user'] password = credentials.get('keystone.password', None) tenant = credentials['keystone.tenant'] auth_url = ...
[ "Set", "up", "openstack", "credentials" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swift.py#L71-L104
[ "def", "_auth", "(", "profile", "=", "None", ")", ":", "if", "profile", ":", "credentials", "=", "__salt__", "[", "'config.option'", "]", "(", "profile", ")", "user", "=", "credentials", "[", "'keystone.user'", "]", "password", "=", "credentials", ".", "ge...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Delete a container, or delete an object from a container. CLI Example to delete a container:: salt myminion swift.delete mycontainer CLI Example to delete an object from a container:: salt myminion swift.delete mycontainer remoteobject
salt/modules/swift.py
def delete(cont, path=None, profile=None): ''' Delete a container, or delete an object from a container. CLI Example to delete a container:: salt myminion swift.delete mycontainer CLI Example to delete an object from a container:: salt myminion swift.delete mycontainer remoteobject ...
def delete(cont, path=None, profile=None): ''' Delete a container, or delete an object from a container. CLI Example to delete a container:: salt myminion swift.delete mycontainer CLI Example to delete an object from a container:: salt myminion swift.delete mycontainer remoteobject ...
[ "Delete", "a", "container", "or", "delete", "an", "object", "from", "a", "container", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swift.py#L107-L124
[ "def", "delete", "(", "cont", ",", "path", "=", "None", ",", "profile", "=", "None", ")", ":", "swift_conn", "=", "_auth", "(", "profile", ")", "if", "path", "is", "None", ":", "return", "swift_conn", ".", "delete_container", "(", "cont", ")", "else", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
List the contents of a container, or return an object from a container. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response. CLI Example to list containers: .. code-block:: bash salt myminion swift.get CLI Example to list...
salt/modules/swift.py
def get(cont=None, path=None, local_file=None, return_bin=False, profile=None): ''' List the contents of a container, or return an object from a container. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response. CLI Example to list con...
def get(cont=None, path=None, local_file=None, return_bin=False, profile=None): ''' List the contents of a container, or return an object from a container. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response. CLI Example to list con...
[ "List", "the", "contents", "of", "a", "container", "or", "return", "an", "object", "from", "a", "container", ".", "Set", "return_bin", "to", "True", "in", "order", "to", "retrieve", "an", "object", "wholesale", ".", "Otherwise", "Salt", "will", "attempt", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swift.py#L127-L172
[ "def", "get", "(", "cont", "=", "None", ",", "path", "=", "None", ",", "local_file", "=", "None", ",", "return_bin", "=", "False", ",", "profile", "=", "None", ")", ":", "swift_conn", "=", "_auth", "(", "profile", ")", "if", "cont", "is", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
put
Create a new container, or upload an object to a container. CLI Example to create a container: .. code-block:: bash salt myminion swift.put mycontainer CLI Example to upload an object to a container: .. code-block:: bash salt myminion swift.put mycontainer remotepath local_file=/pa...
salt/modules/swift.py
def put(cont, path=None, local_file=None, profile=None): ''' Create a new container, or upload an object to a container. CLI Example to create a container: .. code-block:: bash salt myminion swift.put mycontainer CLI Example to upload an object to a container: .. code-block:: bash ...
def put(cont, path=None, local_file=None, profile=None): ''' Create a new container, or upload an object to a container. CLI Example to create a container: .. code-block:: bash salt myminion swift.put mycontainer CLI Example to upload an object to a container: .. code-block:: bash ...
[ "Create", "a", "new", "container", "or", "upload", "an", "object", "to", "a", "container", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swift.py#L179-L202
[ "def", "put", "(", "cont", ",", "path", "=", "None", ",", "local_file", "=", "None", ",", "profile", "=", "None", ")", ":", "swift_conn", "=", "_auth", "(", "profile", ")", "if", "path", "is", "None", ":", "return", "swift_conn", ".", "put_container", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_account_policy
Get the entire accountPolicy and return it as a dictionary. For use by this module only :param str name: The user name :return: a dictionary containing all values for the accountPolicy :rtype: dict :raises: CommandExecutionError on user not found or any other unknown error
salt/modules/mac_shadow.py
def _get_account_policy(name): ''' Get the entire accountPolicy and return it as a dictionary. For use by this module only :param str name: The user name :return: a dictionary containing all values for the accountPolicy :rtype: dict :raises: CommandExecutionError on user not found or any ...
def _get_account_policy(name): ''' Get the entire accountPolicy and return it as a dictionary. For use by this module only :param str name: The user name :return: a dictionary containing all values for the accountPolicy :rtype: dict :raises: CommandExecutionError on user not found or any ...
[ "Get", "the", "entire", "accountPolicy", "and", "return", "it", "as", "a", "dictionary", ".", "For", "use", "by", "this", "module", "only" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L45-L75
[ "def", "_get_account_policy", "(", "name", ")", ":", "cmd", "=", "'pwpolicy -u {0} -getpolicy'", ".", "format", "(", "name", ")", "try", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "cmd", ")", "except", "Comman...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_account_policy
Set a value in the user accountPolicy. For use by this module only :param str name: The user name :param str policy: The policy to apply :return: True if success, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or any other unknown error
salt/modules/mac_shadow.py
def _set_account_policy(name, policy): ''' Set a value in the user accountPolicy. For use by this module only :param str name: The user name :param str policy: The policy to apply :return: True if success, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or an...
def _set_account_policy(name, policy): ''' Set a value in the user accountPolicy. For use by this module only :param str name: The user name :param str policy: The policy to apply :return: True if success, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or an...
[ "Set", "a", "value", "in", "the", "user", "accountPolicy", ".", "For", "use", "by", "this", "module", "only" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L78-L97
[ "def", "_set_account_policy", "(", "name", ",", "policy", ")", ":", "cmd", "=", "'pwpolicy -u {0} -setpolicy \"{1}\"'", ".", "format", "(", "name", ",", "policy", ")", "try", ":", "return", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_account_policy_data_value
Return the value for a key in the accountPolicy section of the user's plist file. For use by this module only :param str name: The username :param str key: The accountPolicy key :return: The value contained within the key :rtype: str :raises: CommandExecutionError on user not found or any oth...
salt/modules/mac_shadow.py
def _get_account_policy_data_value(name, key): ''' Return the value for a key in the accountPolicy section of the user's plist file. For use by this module only :param str name: The username :param str key: The accountPolicy key :return: The value contained within the key :rtype: str ...
def _get_account_policy_data_value(name, key): ''' Return the value for a key in the accountPolicy section of the user's plist file. For use by this module only :param str name: The username :param str key: The accountPolicy key :return: The value contained within the key :rtype: str ...
[ "Return", "the", "value", "for", "a", "key", "in", "the", "accountPolicy", "section", "of", "the", "user", "s", "plist", "file", ".", "For", "use", "by", "this", "module", "only" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L100-L121
[ "def", "_get_account_policy_data_value", "(", "name", ",", "key", ")", ":", "cmd", "=", "'dscl . -readpl /Users/{0} accountPolicyData {1}'", ".", "format", "(", "name", ",", "key", ")", "try", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "exec...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_convert_to_datetime
Converts a unix timestamp to a human readable date/time :param float unix_timestamp: A unix timestamp :return: A date/time in the format YYYY-mm-dd HH:MM:SS :rtype: str
salt/modules/mac_shadow.py
def _convert_to_datetime(unix_timestamp): ''' Converts a unix timestamp to a human readable date/time :param float unix_timestamp: A unix timestamp :return: A date/time in the format YYYY-mm-dd HH:MM:SS :rtype: str ''' try: unix_timestamp = float(unix_timestamp) return date...
def _convert_to_datetime(unix_timestamp): ''' Converts a unix timestamp to a human readable date/time :param float unix_timestamp: A unix timestamp :return: A date/time in the format YYYY-mm-dd HH:MM:SS :rtype: str ''' try: unix_timestamp = float(unix_timestamp) return date...
[ "Converts", "a", "unix", "timestamp", "to", "a", "human", "readable", "date", "/", "time" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L124-L137
[ "def", "_convert_to_datetime", "(", "unix_timestamp", ")", ":", "try", ":", "unix_timestamp", "=", "float", "(", "unix_timestamp", ")", "return", "datetime", ".", "fromtimestamp", "(", "unix_timestamp", ")", ".", "strftime", "(", "'%Y-%m-%d %H:%M:%S'", ")", "excep...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info
Return information for the specified user :param str name: The username :return: A dictionary containing the user's shadow information :rtype: dict CLI Example: .. code-block:: bash salt '*' shadow.info admin
salt/modules/mac_shadow.py
def info(name): ''' Return information for the specified user :param str name: The username :return: A dictionary containing the user's shadow information :rtype: dict CLI Example: .. code-block:: bash salt '*' shadow.info admin ''' try: data = pwd.getpwnam(name)...
def info(name): ''' Return information for the specified user :param str name: The username :return: A dictionary containing the user's shadow information :rtype: dict CLI Example: .. code-block:: bash salt '*' shadow.info admin ''' try: data = pwd.getpwnam(name)...
[ "Return", "information", "for", "the", "specified", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L140-L183
[ "def", "info", "(", "name", ")", ":", "try", ":", "data", "=", "pwd", ".", "getpwnam", "(", "name", ")", "return", "{", "'name'", ":", "data", ".", "pw_name", ",", "'passwd'", ":", "data", ".", "pw_passwd", ",", "'account_created'", ":", "get_account_c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_account_created
Get the date/time the account was created :param str name: The username of the account :return: The date/time the account was created (yyyy-mm-dd hh:mm:ss) :rtype: str :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash salt...
salt/modules/mac_shadow.py
def get_account_created(name): ''' Get the date/time the account was created :param str name: The username of the account :return: The date/time the account was created (yyyy-mm-dd hh:mm:ss) :rtype: str :raises: CommandExecutionError on user not found or any other unknown error CLI Examp...
def get_account_created(name): ''' Get the date/time the account was created :param str name: The username of the account :return: The date/time the account was created (yyyy-mm-dd hh:mm:ss) :rtype: str :raises: CommandExecutionError on user not found or any other unknown error CLI Examp...
[ "Get", "the", "date", "/", "time", "the", "account", "was", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L186-L209
[ "def", "get_account_created", "(", "name", ")", ":", "ret", "=", "_get_account_policy_data_value", "(", "name", ",", "'creationTime'", ")", "unix_timestamp", "=", "salt", ".", "utils", ".", "mac_utils", ".", "parse_return", "(", "ret", ")", "date_text", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_login_failed_count
Get the the number of failed login attempts :param str name: The username of the account :return: The number of failed login attempts :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash salt '*' shadow.get_login_...
salt/modules/mac_shadow.py
def get_login_failed_count(name): ''' Get the the number of failed login attempts :param str name: The username of the account :return: The number of failed login attempts :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-bl...
def get_login_failed_count(name): ''' Get the the number of failed login attempts :param str name: The username of the account :return: The number of failed login attempts :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-bl...
[ "Get", "the", "the", "number", "of", "failed", "login", "attempts" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L238-L257
[ "def", "get_login_failed_count", "(", "name", ")", ":", "ret", "=", "_get_account_policy_data_value", "(", "name", ",", "'failedLoginCount'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "parse_return", "(", "ret", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_maxdays
Set the maximum age of the password in days :param str name: The username of the account :param int days: The maximum age of the account in days :return: True if successful, False if not :rtype: bool :raises: CommandExecutionError on user not found or any other unknown error CLI Example: ...
salt/modules/mac_shadow.py
def set_maxdays(name, days): ''' Set the maximum age of the password in days :param str name: The username of the account :param int days: The maximum age of the account in days :return: True if successful, False if not :rtype: bool :raises: CommandExecutionError on user not found or any...
def set_maxdays(name, days): ''' Set the maximum age of the password in days :param str name: The username of the account :param int days: The maximum age of the account in days :return: True if successful, False if not :rtype: bool :raises: CommandExecutionError on user not found or any...
[ "Set", "the", "maximum", "age", "of", "the", "password", "in", "days" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L287-L311
[ "def", "set_maxdays", "(", "name", ",", "days", ")", ":", "minutes", "=", "days", "*", "24", "*", "60", "_set_account_policy", "(", "name", ",", "'maxMinutesUntilChangePassword={0}'", ".", "format", "(", "minutes", ")", ")", "return", "get_maxdays", "(", "na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_maxdays
Get the maximum age of the password :param str name: The username of the account :return: The maximum age of the password in days :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash salt '*' shadow.get_maxdays ad...
salt/modules/mac_shadow.py
def get_maxdays(name): ''' Get the maximum age of the password :param str name: The username of the account :return: The maximum age of the password in days :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash ...
def get_maxdays(name): ''' Get the maximum age of the password :param str name: The username of the account :return: The maximum age of the password in days :rtype: int :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash ...
[ "Get", "the", "maximum", "age", "of", "the", "password" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L314-L337
[ "def", "get_maxdays", "(", "name", ")", ":", "policies", "=", "_get_account_policy", "(", "name", ")", "if", "'maxMinutesUntilChangePassword'", "in", "policies", ":", "max_minutes", "=", "policies", "[", "'maxMinutesUntilChangePassword'", "]", "return", "int", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_change
Sets the date on which the password expires. The user will be required to change their password. Format is mm/dd/yyyy :param str name: The name of the user account :param date date: The date the password will expire. Must be in mm/dd/yyyy format. :return: True if successful, otherwise False ...
salt/modules/mac_shadow.py
def set_change(name, date): ''' Sets the date on which the password expires. The user will be required to change their password. Format is mm/dd/yyyy :param str name: The name of the user account :param date date: The date the password will expire. Must be in mm/dd/yyyy format. :retur...
def set_change(name, date): ''' Sets the date on which the password expires. The user will be required to change their password. Format is mm/dd/yyyy :param str name: The name of the user account :param date date: The date the password will expire. Must be in mm/dd/yyyy format. :retur...
[ "Sets", "the", "date", "on", "which", "the", "password", "expires", ".", "The", "user", "will", "be", "required", "to", "change", "their", "password", ".", "Format", "is", "mm", "/", "dd", "/", "yyyy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L402-L426
[ "def", "set_change", "(", "name", ",", "date", ")", ":", "_set_account_policy", "(", "name", ",", "'usingExpirationDate=1 expirationDateGMT={0}'", ".", "format", "(", "date", ")", ")", "return", "get_change", "(", "name", ")", "==", "date" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_expire
Sets the date on which the account expires. The user will not be able to login after this date. Date format is mm/dd/yyyy :param str name: The name of the user account :param datetime date: The date the account will expire. Format must be mm/dd/yyyy. :return: True if successful, False if not ...
salt/modules/mac_shadow.py
def set_expire(name, date): ''' Sets the date on which the account expires. The user will not be able to login after this date. Date format is mm/dd/yyyy :param str name: The name of the user account :param datetime date: The date the account will expire. Format must be mm/dd/yyyy. :r...
def set_expire(name, date): ''' Sets the date on which the account expires. The user will not be able to login after this date. Date format is mm/dd/yyyy :param str name: The name of the user account :param datetime date: The date the account will expire. Format must be mm/dd/yyyy. :r...
[ "Sets", "the", "date", "on", "which", "the", "account", "expires", ".", "The", "user", "will", "not", "be", "able", "to", "login", "after", "this", "date", ".", "Date", "format", "is", "mm", "/", "dd", "/", "yyyy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L454-L478
[ "def", "set_expire", "(", "name", ",", "date", ")", ":", "_set_account_policy", "(", "name", ",", "'usingHardExpirationDate=1 hardExpireDateGMT={0}'", ".", "format", "(", "date", ")", ")", "return", "get_expire", "(", "name", ")", "==", "date" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_password
Deletes the account password :param str name: The user name of the account :return: True if successful, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash salt '*' shadow.del_password username
salt/modules/mac_shadow.py
def del_password(name): ''' Deletes the account password :param str name: The user name of the account :return: True if successful, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash sal...
def del_password(name): ''' Deletes the account password :param str name: The user name of the account :return: True if successful, otherwise False :rtype: bool :raises: CommandExecutionError on user not found or any other unknown error CLI Example: .. code-block:: bash sal...
[ "Deletes", "the", "account", "password" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L506-L536
[ "def", "del_password", "(", "name", ")", ":", "# This removes the password", "cmd", "=", "\"dscl . -passwd /Users/{0} ''\"", ".", "format", "(", "name", ")", "try", ":", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ")", "exc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_password
Set the password for a named user (insecure, the password will be in the process list while the command is running) :param str name: The name of the local user, which is assumed to be in the local directory service :param str password: The plaintext password to set :return: True if successful...
salt/modules/mac_shadow.py
def set_password(name, password): ''' Set the password for a named user (insecure, the password will be in the process list while the command is running) :param str name: The name of the local user, which is assumed to be in the local directory service :param str password: The plaintext pa...
def set_password(name, password): ''' Set the password for a named user (insecure, the password will be in the process list while the command is running) :param str name: The name of the local user, which is assumed to be in the local directory service :param str password: The plaintext pa...
[ "Set", "the", "password", "for", "a", "named", "user", "(", "insecure", "the", "password", "will", "be", "in", "the", "process", "list", "while", "the", "command", "is", "running", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_shadow.py#L539-L568
[ "def", "set_password", "(", "name", ",", "password", ")", ":", "cmd", "=", "\"dscl . -passwd /Users/{0} '{1}'\"", ".", "format", "(", "name", ",", "password", ")", "try", ":", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the RabbitMQ policy exists. Reference: http://www.rabbitmq.com/ha.html name Policy name pattern A regex of queues to apply the policy to definition A json dict describing the policy priority Priority (defaults to 0) vhost Virtual host to apply to ...
salt/states/rabbitmq_policy.py
def present(name, pattern, definition, priority=0, vhost='/', runas=None, apply_to=None): ''' Ensure the RabbitMQ policy exists. Reference: http://www.rabbitmq.com/ha.html name Policy name pattern A regex of qu...
def present(name, pattern, definition, priority=0, vhost='/', runas=None, apply_to=None): ''' Ensure the RabbitMQ policy exists. Reference: http://www.rabbitmq.com/ha.html name Policy name pattern A regex of qu...
[ "Ensure", "the", "RabbitMQ", "policy", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_policy.py#L37-L124
[ "def", "present", "(", "name", ",", "pattern", ",", "definition", ",", "priority", "=", "0", ",", "vhost", "=", "'/'", ",", "runas", "=", "None", ",", "apply_to", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure the named policy is absent Reference: http://www.rabbitmq.com/ha.html name The name of the policy to remove runas Name of the user to run the command as
salt/states/rabbitmq_policy.py
def absent(name, vhost='/', runas=None): ''' Ensure the named policy is absent Reference: http://www.rabbitmq.com/ha.html name The name of the policy to remove runas Name of the user to run the command as ''' ret = {'name': name, 'result': True, 'comme...
def absent(name, vhost='/', runas=None): ''' Ensure the named policy is absent Reference: http://www.rabbitmq.com/ha.html name The name of the policy to remove runas Name of the user to run the command as ''' ret = {'name': name, 'result': True, 'comme...
[ "Ensure", "the", "named", "policy", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_policy.py#L127-L165
[ "def", "absent", "(", "name", ",", "vhost", "=", "'/'", ",", "runas", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "policy_exists", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_configured_provider
Return the first configured instance.
salt/cloud/clouds/openstack.py
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('auth', 'region_name'), log_message=False, ) or config.is_provider_configured( __opts__, __active_provide...
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('auth', 'region_name'), log_message=False, ) or config.is_provider_configured( __opts__, __active_provide...
[ "Return", "the", "first", "configured", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L259-L269
[ "def", "get_configured_provider", "(", ")", ":", "return", "config", ".", "is_provider_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "__virtualname__", ",", "(", "'auth'", ",", "'region_name'", ")", ",", "log_message", "=", "False", ",", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
preferred_ip
Return the preferred Internet protocol. Either 'ipv4' (default) or 'ipv6'.
salt/cloud/clouds/openstack.py
def preferred_ip(vm_, ips): ''' Return the preferred Internet protocol. Either 'ipv4' (default) or 'ipv6'. ''' proto = config.get_cloud_config_value( 'protocol', vm_, __opts__, default='ipv4', search_global=False ) family = socket.AF_INET if proto == 'ipv6': family = socket....
def preferred_ip(vm_, ips): ''' Return the preferred Internet protocol. Either 'ipv4' (default) or 'ipv6'. ''' proto = config.get_cloud_config_value( 'protocol', vm_, __opts__, default='ipv4', search_global=False ) family = socket.AF_INET if proto == 'ipv6': family = socket....
[ "Return", "the", "preferred", "Internet", "protocol", ".", "Either", "ipv4", "(", "default", ")", "or", "ipv6", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L286-L303
[ "def", "preferred_ip", "(", "vm_", ",", "ips", ")", ":", "proto", "=", "config", ".", "get_cloud_config_value", "(", "'protocol'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'ipv4'", ",", "search_global", "=", "False", ")", "family", "=", "socket",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_conn
Return a conn object for the passed VM data
salt/cloud/clouds/openstack.py
def get_conn(): ''' Return a conn object for the passed VM data ''' if __active_provider_name__ in __context__: return __context__[__active_provider_name__] vm_ = get_configured_provider() profile = vm_.pop('profile', None) if profile is not None: vm_ = __utils__['dictupdate....
def get_conn(): ''' Return a conn object for the passed VM data ''' if __active_provider_name__ in __context__: return __context__[__active_provider_name__] vm_ = get_configured_provider() profile = vm_.pop('profile', None) if profile is not None: vm_ = __utils__['dictupdate....
[ "Return", "a", "conn", "object", "for", "the", "passed", "VM", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L314-L327
[ "def", "get_conn", "(", ")", ":", "if", "__active_provider_name__", "in", "__context__", ":", "return", "__context__", "[", "__active_provider_name__", "]", "vm_", "=", "get_configured_provider", "(", ")", "profile", "=", "vm_", ".", "pop", "(", "'profile'", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
Return a list of VMs CLI Example .. code-block:: bash salt-cloud -f list_nodes myopenstack
salt/cloud/clouds/openstack.py
def list_nodes(conn=None, call=None): ''' Return a list of VMs CLI Example .. code-block:: bash salt-cloud -f list_nodes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) r...
def list_nodes(conn=None, call=None): ''' Return a list of VMs CLI Example .. code-block:: bash salt-cloud -f list_nodes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) r...
[ "Return", "a", "list", "of", "VMs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L330-L350
[ "def", "list_nodes", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "for", "nod...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_min
Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack
salt/cloud/clouds/openstack.py
def list_nodes_min(conn=None, call=None): ''' Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_min function must be called wi...
def list_nodes_min(conn=None, call=None): ''' Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_min function must be called wi...
[ "Return", "a", "list", "of", "VMs", "with", "minimal", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L353-L373
[ "def", "list_nodes_min", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_min function must be called with -f or --function.'", ")", "if", "conn", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack
salt/cloud/clouds/openstack.py
def list_nodes_full(conn=None, call=None): ''' Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function mus...
def list_nodes_full(conn=None, call=None): ''' Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function mus...
[ "Return", "a", "list", "of", "VMs", "with", "all", "the", "information", "about", "them" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L389-L418
[ "def", "list_nodes_full", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_full function must be called with -f or --function.'", ")", "if", "conn", "is", "None",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_select
Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack
salt/cloud/clouds/openstack.py
def list_nodes_select(conn=None, call=None): ''' Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select funct...
def list_nodes_select(conn=None, call=None): ''' Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select funct...
[ "Return", "a", "list", "of", "VMs", "with", "the", "fields", "from", "query", ".", "selection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L421-L438
[ "def", "list_nodes_select", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_select function must be called with -f or --function.'", ")", "return", "__utils__", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver
salt/cloud/clouds/openstack.py
def show_instance(name, conn=None, call=None): ''' Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance...
def show_instance(name, conn=None, call=None): ''' Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance...
[ "Get", "VM", "on", "this", "OpenStack", "account" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L441-L477
[ "def", "show_instance", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "if", "conn", "is", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack
salt/cloud/clouds/openstack.py
def avail_images(conn=None, call=None): ''' List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_imag...
def avail_images(conn=None, call=None): ''' List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_imag...
[ "List", "available", "images", "for", "OpenStack" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L480-L499
[ "def", "avail_images", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack
salt/cloud/clouds/openstack.py
def avail_sizes(conn=None, call=None): ''' List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes fu...
def avail_sizes(conn=None, call=None): ''' List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes fu...
[ "List", "available", "sizes", "for", "OpenStack" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L502-L521
[ "def", "avail_sizes", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_networks
List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack
salt/cloud/clouds/openstack.py
def list_networks(conn=None, call=None): ''' List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_networks function must be called with ' '-f ...
def list_networks(conn=None, call=None): ''' List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_networks function must be called with ' '-f ...
[ "List", "networks", "for", "OpenStack" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L524-L542
[ "def", "list_networks", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_networks function must be called with '", "'-f or --function'", ")", "if", "conn", "is", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_subnets
List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net
salt/cloud/clouds/openstack.py
def list_subnets(conn=None, call=None, kwargs=None): ''' List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net ''' if call == 'action': raise SaltCloudSystemExit( '...
def list_subnets(conn=None, call=None, kwargs=None): ''' List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net ''' if call == 'action': raise SaltCloudSystemExit( '...
[ "List", "subnets", "in", "a", "virtual", "network" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L545-L568
[ "def", "list_subnets", "(", "conn", "=", "None", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_subnets function must be called with '", "'-f or --function.'", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_clean_create_kwargs
Sanatize kwargs to be sent to create_server
salt/cloud/clouds/openstack.py
def _clean_create_kwargs(**kwargs): ''' Sanatize kwargs to be sent to create_server ''' VALID_OPTS = { 'name': six.string_types, 'image': six.string_types, 'flavor': six.string_types, 'auto_ip': bool, 'ips': list, 'ip_pool': six.string_types, 'root...
def _clean_create_kwargs(**kwargs): ''' Sanatize kwargs to be sent to create_server ''' VALID_OPTS = { 'name': six.string_types, 'image': six.string_types, 'flavor': six.string_types, 'auto_ip': bool, 'ips': list, 'ip_pool': six.string_types, 'root...
[ "Sanatize", "kwargs", "to", "be", "sent", "to", "create_server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L571-L616
[ "def", "_clean_create_kwargs", "(", "*", "*", "kwargs", ")", ":", "VALID_OPTS", "=", "{", "'name'", ":", "six", ".", "string_types", ",", "'image'", ":", "six", ".", "string_types", ",", "'flavor'", ":", "six", ".", "string_types", ",", "'auto_ip'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request_instance
Request an instance to be built
salt/cloud/clouds/openstack.py
def request_instance(vm_, conn=None, call=None): ''' Request an instance to be built ''' if call == 'function': # Technically this function may be called other ways too, but it # definitely cannot be called with --function. raise SaltCloudSystemExit( 'The request_inst...
def request_instance(vm_, conn=None, call=None): ''' Request an instance to be built ''' if call == 'function': # Technically this function may be called other ways too, but it # definitely cannot be called with --function. raise SaltCloudSystemExit( 'The request_inst...
[ "Request", "an", "instance", "to", "be", "built" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L619-L658
[ "def", "request_instance", "(", "vm_", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "# Technically this function may be called other ways too, but it", "# definitely cannot be called with --function.", "raise", "Salt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict
salt/cloud/clouds/openstack.py
def create(vm_): ''' Create a single VM from a data dict ''' deploy = config.get_cloud_config_value('deploy', vm_, __opts__) key_filename = config.get_cloud_config_value( 'ssh_key_file', vm_, __opts__, search_global=False, default=None ) if key_filename is not None and not os.path.is...
def create(vm_): ''' Create a single VM from a data dict ''' deploy = config.get_cloud_config_value('deploy', vm_, __opts__) key_filename = config.get_cloud_config_value( 'ssh_key_file', vm_, __opts__, search_global=False, default=None ) if key_filename is not None and not os.path.is...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L661-L770
[ "def", "create", "(", "vm_", ")", ":", "deploy", "=", "config", ".", "get_cloud_config_value", "(", "'deploy'", ",", "vm_", ",", "__opts__", ")", "key_filename", "=", "config", ".", "get_cloud_config_value", "(", "'ssh_key_file'", ",", "vm_", ",", "__opts__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Delete a single VM
salt/cloud/clouds/openstack.py
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
[ "Delete", "a", "single", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L773-L816
[ "def", "destroy", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network name=mysubnet
salt/cloud/clouds/openstack.py
def call(conn=None, call=None, kwargs=None): ''' Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network na...
def call(conn=None, call=None, kwargs=None): ''' Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network na...
[ "Call", "function", "from", "shade", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L819-L858
[ "def", "call", "(", "conn", "=", "None", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The call function must be called with '", "'-f or --function.'", ")", "if", "'f...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
merge
Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge '{foo: Foo}' '{bar: Bar}'
salt/modules/slsutil.py
def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False): ''' Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge ...
def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False): ''' Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge ...
[ "Merge", "a", "data", "structure", "into", "another", "by", "choosing", "a", "merge", "strategy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L37-L56
[ "def", "merge", "(", "obj_a", ",", "obj_b", ",", "strategy", "=", "'smart'", ",", "renderer", "=", "'yaml'", ",", "merge_lists", "=", "False", ")", ":", "return", "salt", ".", "utils", ".", "dictupdate", ".", "merge", "(", "obj_a", ",", "obj_b", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
merge_all
.. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupdate. :type renderer: String :param renderer: Renderer type. Used to d...
salt/modules/slsutil.py
def merge_all(lst, strategy='smart', renderer='yaml', merge_lists=False): ''' .. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupd...
def merge_all(lst, strategy='smart', renderer='yaml', merge_lists=False): ''' .. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupd...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L59-L92
[ "def", "merge_all", "(", "lst", ",", "strategy", "=", "'smart'", ",", "renderer", "=", "'yaml'", ",", "merge_lists", "=", "False", ")", ":", "ret", "=", "{", "}", "for", "obj", "in", "lst", ":", "ret", "=", "salt", ".", "utils", ".", "dictupdate", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
renderer
Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of Salt's "renderer pipes" system to run a string or file through a pipe of any of the loa...
salt/modules/slsutil.py
def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs): ''' Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of ...
def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs): ''' Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of ...
[ "Parse", "a", "string", "or", "file", "through", "Salt", "s", "renderer", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L95-L186
[ "def", "renderer", "(", "path", "=", "None", ",", "string", "=", "None", ",", "default_renderer", "=", "'jinja|yaml'", ",", "*", "*", "kwargs", ")", ":", "if", "not", "path", "and", "not", "string", ":", "raise", "salt", ".", "exceptions", ".", "SaltIn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
serialize
Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja {% set json_string = salt.slsutil.serialize('json', ...
salt/modules/slsutil.py
def serialize(serializer, obj, **mod_kwargs): ''' Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja ...
def serialize(serializer, obj, **mod_kwargs): ''' Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja ...
[ "Serialize", "a", "Python", "object", "using", "a", ":", "py", ":", "mod", ":", "serializer", "module", "<salt", ".", "serializers", ">" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L206-L225
[ "def", "serialize", "(", "serializer", ",", "obj", ",", "*", "*", "mod_kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "mod_kwargs", ")", "return", "_get_serialize_fn", "(", "serializer", ",", "'se...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deserialize
Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil.deserialize 'json' \\ stream_or_string='{"foo": "Foo!"}' ...
salt/modules/slsutil.py
def deserialize(serializer, stream_or_string, **mod_kwargs): ''' Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil....
def deserialize(serializer, stream_or_string, **mod_kwargs): ''' Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil....
[ "Deserialize", "a", "Python", "object", "using", "a", ":", "py", ":", "mod", ":", "serializer", "module", "<salt", ".", "serializers", ">" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L228-L250
[ "def", "deserialize", "(", "serializer", ",", "stream_or_string", ",", "*", "*", "mod_kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "mod_kwargs", ")", "return", "_get_serialize_fn", "(", "serializer"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
banner
Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, warning users not to modify the file. This function simplifies and standardizes those comment blocks. :param width: The width, in character...
salt/modules/slsutil.py
def banner(width=72, commentchar='#', borderchar='#', blockstart=None, blockend=None, title=None, text=None, newline=False): ''' Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, ...
def banner(width=72, commentchar='#', borderchar='#', blockstart=None, blockend=None, title=None, text=None, newline=False): ''' Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, ...
[ "Create", "a", "standardized", "comment", "block", "to", "include", "in", "a", "templated", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L253-L339
[ "def", "banner", "(", "width", "=", "72", ",", "commentchar", "=", "'#'", ",", "borderchar", "=", "'#'", ",", "blockstart", "=", "None", ",", "blockend", "=", "None", ",", "title", "=", "None", ",", "text", "=", "None", ",", "newline", "=", "False", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_storage_conn
.. versionadded:: 2015.8.0 Return a storage_conn object for the storage account
salt/utils/msazure.py
def get_storage_conn(storage_account=None, storage_key=None, opts=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if opts is None: opts = {} if not storage_account: storage_account = opts.get('storage_account', None) if not sto...
def get_storage_conn(storage_account=None, storage_key=None, opts=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if opts is None: opts = {} if not storage_account: storage_account = opts.get('storage_account', None) if not sto...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L26-L40
[ "def", "get_storage_conn", "(", "storage_account", "=", "None", ",", "storage_key", "=", "None", ",", "opts", "=", "None", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "if", "not", "storage_account", ":", "storage_account", "=", "opt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_blobs
.. versionadded:: 2015.8.0 List blobs associated with the container
salt/utils/msazure.py
def list_blobs(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 List blobs associated with the container ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit( code=42, msg='A...
def list_blobs(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 List blobs associated with the container ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit( code=42, msg='A...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L43-L70
[ "def", "list_blobs", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
put_blob
.. versionadded:: 2015.8.0 Upload a blob
salt/utils/msazure.py
def put_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Upload a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "container...
def put_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Upload a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "container...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L73-L120
[ "def", "put_blob", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_blob
.. versionadded:: 2015.8.0 Download a blob
salt/utils/msazure.py
def get_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Download a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "contain...
def get_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Download a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "contain...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L123-L167
[ "def", "get_blob", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
object_to_dict
.. versionadded:: 2015.8.0 Convert an object to a dictionary
salt/utils/msazure.py
def object_to_dict(obj): ''' .. versionadded:: 2015.8.0 Convert an object to a dictionary ''' if isinstance(obj, list) or isinstance(obj, tuple): ret = [] for item in obj: ret.append(object_to_dict(item)) elif hasattr(obj, '__dict__'): ret = {} for it...
def object_to_dict(obj): ''' .. versionadded:: 2015.8.0 Convert an object to a dictionary ''' if isinstance(obj, list) or isinstance(obj, tuple): ret = [] for item in obj: ret.append(object_to_dict(item)) elif hasattr(obj, '__dict__'): ret = {} for it...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L170-L188
[ "def", "object_to_dict", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "list", ")", "or", "isinstance", "(", "obj", ",", "tuple", ")", ":", "ret", "=", "[", "]", "for", "item", "in", "obj", ":", "ret", ".", "append", "(", "object_to_di...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltCloud.run
Execute the salt-cloud command line
salt/cloud/cli.py
def run(self): ''' Execute the salt-cloud command line ''' # Parse shell arguments self.parse_args() salt_master_user = self.config.get('user') if salt_master_user is None: salt_master_user = salt.utils.user.get_user() if not check_user(salt_...
def run(self): ''' Execute the salt-cloud command line ''' # Parse shell arguments self.parse_args() salt_master_user = self.config.get('user') if salt_master_user is None: salt_master_user = salt.utils.user.get_user() if not check_user(salt_...
[ "Execute", "the", "salt", "-", "cloud", "command", "line" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/cli.py#L41-L397
[ "def", "run", "(", "self", ")", ":", "# Parse shell arguments", "self", ".", "parse_args", "(", ")", "salt_master_user", "=", "self", ".", "config", ".", "get", "(", "'user'", ")", "if", "salt_master_user", "is", "None", ":", "salt_master_user", "=", "salt",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_exists
Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file options See :mod:`salt.modules.htpasswd.useradd` force Touch the file even if user already created runas Th...
salt/states/webutil.py
def user_exists(name, password=None, htpasswd_file=None, options='', force=False, runas=None, update=False): ''' Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file opti...
def user_exists(name, password=None, htpasswd_file=None, options='', force=False, runas=None, update=False): ''' Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file opti...
[ "Make", "sure", "the", "user", "is", "inside", "the", "specified", "htpasswd", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/webutil.py#L36-L104
[ "def", "user_exists", "(", "name", ",", "password", "=", "None", ",", "htpasswd_file", "=", "None", ",", "options", "=", "''", ",", "force", "=", "False", ",", "runas", "=", "None", ",", "update", "=", "False", ")", ":", "ret", "=", "{", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_absent
Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with
salt/states/webutil.py
def user_absent(name, htpasswd_file=None, runas=None): ''' Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with ''' ret = {'name': name, 'chang...
def user_absent(name, htpasswd_file=None, runas=None): ''' Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with ''' ret = {'name': name, 'chang...
[ "Make", "sure", "the", "user", "is", "not", "in", "the", "specified", "htpasswd", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/webutil.py#L107-L150
[ "def", "user_absent", "(", "name", ",", "htpasswd_file", "=", "None", ",", "runas", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "None", "}", "exi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run_task
Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. code-block:: bash salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \\ backend=redis://localhost wait_for_result=true task_name The task name, e.g. tasks.sleep ...
salt/modules/celery.py
def run_task(task_name, args=None, kwargs=None, broker=None, backend=None, wait_for_result=False, timeout=None, propagate=True, interval=0.5, no_ack=True, raise_timeout=True, config=None): ''' Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. ...
def run_task(task_name, args=None, kwargs=None, broker=None, backend=None, wait_for_result=False, timeout=None, propagate=True, interval=0.5, no_ack=True, raise_timeout=True, config=None): ''' Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. ...
[ "Execute", "celery", "tasks", ".", "For", "celery", "specific", "parameters", "see", "celery", "documentation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/celery.py#L40-L110
[ "def", "run_task", "(", "task_name", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "broker", "=", "None", ",", "backend", "=", "None", ",", "wait_for_result", "=", "False", ",", "timeout", "=", "None", ",", "propagate", "=", "True", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.run
Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatternty...
salt/client/api.py
def run(self, cmd): ''' Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', ...
def run(self, cmd): ''' Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', ...
[ "Execute", "the", "salt", "command", "given", "by", "cmd", "dict", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L70-L137
[ "def", "run", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "dict", "(", "cmd", ")", "# make copy", "client", "=", "'minion'", "# default to local minion client", "mode", "=", "cmd", ".", "get", "(", "'mode'", ",", "'async'", ")", "# check for wheel or runn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.signature
Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token': 'salttokenstring', 'username': 'u...
salt/client/api.py
def signature(self, cmd): ''' Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token':...
def signature(self, cmd): ''' Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token':...
[ "Convenience", "function", "that", "returns", "dict", "of", "function", "signature", "(", "s", ")", "specified", "by", "cmd", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L177-L211
[ "def", "signature", "(", "self", ",", "cmd", ")", ":", "cmd", "[", "'client'", "]", "=", "'minion'", "if", "len", "(", "cmd", "[", "'module'", "]", ".", "split", "(", "'.'", ")", ")", ">", "2", "and", "cmd", "[", "'module'", "]", ".", "split", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient._signature
Expects everything that signature does and also a client type string. client can either be master or minion.
salt/client/api.py
def _signature(self, cmd): ''' Expects everything that signature does and also a client type string. client can either be master or minion. ''' result = {} client = cmd.get('client', 'minion') if client == 'minion': cmd['fun'] = 'sys.argspec' ...
def _signature(self, cmd): ''' Expects everything that signature does and also a client type string. client can either be master or minion. ''' result = {} client = cmd.get('client', 'minion') if client == 'minion': cmd['fun'] = 'sys.argspec' ...
[ "Expects", "everything", "that", "signature", "does", "and", "also", "a", "client", "type", "string", ".", "client", "can", "either", "be", "master", "or", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L213-L234
[ "def", "_signature", "(", "self", ",", "cmd", ")", ":", "result", "=", "{", "}", "client", "=", "cmd", ".", "get", "(", "'client'", ",", "'minion'", ")", "if", "client", "==", "'minion'", ":", "cmd", "[", "'fun'", "]", "=", "'sys.argspec'", "cmd", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.create_token
Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', 'eauth': 'eauthtypestring', } exam...
salt/client/api.py
def create_token(self, creds): ''' Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', ...
def create_token(self, creds): ''' Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', ...
[ "Create", "token", "with", "creds", ".", "Token", "authorizes", "salt", "access", "if", "successful", "authentication", "with", "the", "credentials", "in", "creds", ".", "creds", "format", "is", "as", "follows", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L236-L293
[ "def", "create_token", "(", "self", ",", "creds", ")", ":", "try", ":", "tokenage", "=", "self", ".", "resolver", ".", "mk_token", "(", "creds", ")", "except", "Exception", "as", "ex", ":", "raise", "EauthAuthenticationError", "(", "\"Authentication failed wit...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.verify_token
If token is valid Then returns user name associated with token Else False.
salt/client/api.py
def verify_token(self, token): ''' If token is valid Then returns user name associated with token Else False. ''' try: result = self.resolver.get_token(token) except Exception as ex: raise EauthAuthenticationError( "Token validation...
def verify_token(self, token): ''' If token is valid Then returns user name associated with token Else False. ''' try: result = self.resolver.get_token(token) except Exception as ex: raise EauthAuthenticationError( "Token validation...
[ "If", "token", "is", "valid", "Then", "returns", "user", "name", "associated", "with", "token", "Else", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L295-L306
[ "def", "verify_token", "(", "self", ",", "token", ")", ":", "try", ":", "result", "=", "self", ".", "resolver", ".", "get_token", "(", "token", ")", "except", "Exception", "as", "ex", ":", "raise", "EauthAuthenticationError", "(", "\"Token validation failed wi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.get_event
Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until next event becomes available.
salt/client/api.py
def get_event(self, wait=0.25, tag='', full=False): ''' Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until...
def get_event(self, wait=0.25, tag='', full=False): ''' Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until...
[ "Get", "a", "single", "salt", "event", ".", "If", "no", "events", "are", "available", "then", "block", "for", "up", "to", "wait", "seconds", ".", "Return", "the", "event", "if", "it", "matches", "the", "tag", "(", "or", "tag", "is", "empty", ")", "Ot...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L308-L317
[ "def", "get_event", "(", "self", ",", "wait", "=", "0.25", ",", "tag", "=", "''", ",", "full", "=", "False", ")", ":", "return", "self", ".", "event", ".", "get_event", "(", "wait", "=", "wait", ",", "tag", "=", "tag", ",", "full", "=", "full", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
APIClient.fire_event
fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication
salt/client/api.py
def fire_event(self, data, tag): ''' fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication ''' return self.event.fire_event(data, salt.utils.event.tagify(...
def fire_event(self, data, tag): ''' fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication ''' return self.event.fire_event(data, salt.utils.event.tagify(...
[ "fires", "event", "with", "data", "and", "tag", "This", "only", "works", "if", "api", "is", "running", "with", "same", "user", "permissions", "as", "master", "Need", "to", "convert", "this", "to", "a", "master", "call", "with", "appropriate", "authentication...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L319-L326
[ "def", "fire_event", "(", "self", ",", "data", ",", "tag", ")", ":", "return", "self", ".", "event", ".", "fire_event", "(", "data", ",", "salt", ".", "utils", ".", "event", ".", "tagify", "(", "tag", ",", "'wui'", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_zone
Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone
salt/modules/win_timezone.py
def get_zone(): ''' Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone ''' cmd = ['tzutil', '/g'] r...
def get_zone(): ''' Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone ''' cmd = ['tzutil', '/g'] r...
[ "Get", "current", "timezone", "(", "i", ".", "e", ".", "America", "/", "Denver", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L201-L223
[ "def", "get_zone", "(", ")", ":", "cmd", "=", "[", "'tzutil'", ",", "'/g'", "]", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "res", "[", "'retcode'", "]", "or", "not", "res", "[", "'s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_offset
Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset
salt/modules/win_timezone.py
def get_offset(): ''' Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset ''' # http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and...
def get_offset(): ''' Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset ''' # http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and...
[ "Get", "current", "numeric", "timezone", "offset", "from", "UTC", "(", "i", ".", "e", ".", "-", "0700", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L226-L244
[ "def", "get_offset", "(", ")", ":", "# http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and-pytz-localize-vs-normalize/", "tz_object", "=", "pytz", ".", "timezone", "(", "get_zone", "(", ")", ")", "utc_time", "=", "pytz", ".", "utc", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_zonecode
Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode
salt/modules/win_timezone.py
def get_zonecode(): ''' Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode ''' tz_object = pytz.timezone(get_zone()) loc_time = tz_object.localize(datetime.utcnow()) ...
def get_zonecode(): ''' Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode ''' tz_object = pytz.timezone(get_zone()) loc_time = tz_object.localize(datetime.utcnow()) ...
[ "Get", "current", "timezone", "(", "i", ".", "e", ".", "PST", "MDT", "etc", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L247-L262
[ "def", "get_zonecode", "(", ")", ":", "tz_object", "=", "pytz", ".", "timezone", "(", "get_zone", "(", ")", ")", "loc_time", "=", "tz_object", ".", "localize", "(", "datetime", ".", "utcnow", "(", ")", ")", "return", "loc_time", ".", "tzname", "(", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_zone
Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash salt '*' timezone.set_zone 'Ameri...
salt/modules/win_timezone.py
def set_zone(timezone): ''' Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash ...
def set_zone(timezone): ''' Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash ...
[ "Sets", "the", "timezone", "using", "the", "tzutil", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L265-L303
[ "def", "set_zone", "(", "timezone", ")", ":", "# if it's one of the key's just use it", "if", "timezone", ".", "lower", "(", ")", "in", "mapper", ".", "win_to_unix", ":", "win_zone", "=", "timezone", "elif", "timezone", ".", "lower", "(", ")", "in", "mapper", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
zone_compare
Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list`` function Returns: bool: ``...
salt/modules/win_timezone.py
def zone_compare(timezone): ''' Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list``...
def zone_compare(timezone): ''' Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list``...
[ "Compares", "the", "given", "timezone", "with", "the", "machine", "timezone", ".", "Mostly", "useful", "for", "running", "state", "checks", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L306-L338
[ "def", "zone_compare", "(", "timezone", ")", ":", "# if it's one of the key's just use it", "if", "timezone", ".", "lower", "(", ")", "in", "mapper", ".", "win_to_unix", ":", "check_zone", "=", "timezone", "elif", "timezone", ".", "lower", "(", ")", "in", "map...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
activate
Install and activate the given product key name The 5x5 product key given to you by Microsoft
salt/states/win_license.py
def activate(name): ''' Install and activate the given product key name The 5x5 product key given to you by Microsoft ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} product_key = name license_info = __salt__['license.info']...
def activate(name): ''' Install and activate the given product key name The 5x5 product key given to you by Microsoft ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} product_key = name license_info = __salt__['license.info']...
[ "Install", "and", "activate", "the", "given", "product", "key" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_license.py#L33-L71
[ "def", "activate", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "product_key", "=", "name", "license_info", "=", "__salt__", "[", "'lic...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mode
Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group``
salt/states/quota.py
def mode(name, mode, quotatype): ''' Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group`` ''' ret = {'name': name, 'changes': {}, 'result':...
def mode(name, mode, quotatype): ''' Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group`` ''' ret = {'name': name, 'changes': {}, 'result':...
[ "Set", "the", "quota", "for", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/quota.py#L26-L62
[ "def", "mode", "(", "name", ",", "mode", ",", "quotatype", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "fun", "=", "'off'", "if", "mode", "is",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
report
Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data
salt/modules/quota.py
def report(mount): ''' Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data ''' ret = {mount: {}} ret[mount]['User Quotas'] = _parse_quota(mount, '-u') ret[mount]['Group Quotas'] = _parse_quota(mount, '-g') return ret
def report(mount): ''' Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data ''' ret = {mount: {}} ret[mount]['User Quotas'] = _parse_quota(mount, '-u') ret[mount]['Group Quotas'] = _parse_quota(mount, '-g') return ret
[ "Report", "on", "quotas", "for", "a", "specific", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L38-L51
[ "def", "report", "(", "mount", ")", ":", "ret", "=", "{", "mount", ":", "{", "}", "}", "ret", "[", "mount", "]", "[", "'User Quotas'", "]", "=", "_parse_quota", "(", "mount", ",", "'-u'", ")", "ret", "[", "mount", "]", "[", "'Group Quotas'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_quota
Parse the output from repquota. Requires that -u -g are passed in
salt/modules/quota.py
def _parse_quota(mount, opts): ''' Parse the output from repquota. Requires that -u -g are passed in ''' cmd = 'repquota -vp {0} {1}'.format(opts, mount) out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() mode = 'header' if '-u' in opts: quotatype = 'Users' elif '-g...
def _parse_quota(mount, opts): ''' Parse the output from repquota. Requires that -u -g are passed in ''' cmd = 'repquota -vp {0} {1}'.format(opts, mount) out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() mode = 'header' if '-u' in opts: quotatype = 'Users' elif '-g...
[ "Parse", "the", "output", "from", "repquota", ".", "Requires", "that", "-", "u", "-", "g", "are", "passed", "in" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L54-L94
[ "def", "_parse_quota", "(", "mount", ",", "opts", ")", ":", "cmd", "=", "'repquota -vp {0} {1}'", ".", "format", "(", "opts", ",", "mount", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "sp...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000
salt/modules/quota.py
def set_(device, **kwargs): ''' Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000 ''' empty = {'block-soft-...
def set_(device, **kwargs): ''' Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000 ''' empty = {'block-soft-...
[ "Calls", "out", "to", "setquota", "for", "a", "specific", "user", "or", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L97-L155
[ "def", "set_", "(", "device", ",", "*", "*", "kwargs", ")", ":", "empty", "=", "{", "'block-soft-limit'", ":", "0", ",", "'block-hard-limit'", ":", "0", ",", "'file-soft-limit'", ":", "0", ",", "'file-hard-limit'", ":", "0", "}", "current", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stats
Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats
salt/modules/quota.py
def stats(): ''' Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats ''' ret = {} out = __salt__['cmd.run']('quotastats').splitlines() for line in out: if not line: continue comps = line....
def stats(): ''' Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats ''' ret = {} out = __salt__['cmd.run']('quotastats').splitlines() for line in out: if not line: continue comps = line....
[ "Runs", "the", "quotastats", "command", "and", "returns", "the", "parsed", "output" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L172-L190
[ "def", "stats", "(", ")", ":", "ret", "=", "{", "}", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'quotastats'", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "if", "not", "line", ":", "continue", "comps", "=", "line", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
on
Turns on the quota system CLI Example: .. code-block:: bash salt '*' quota.on
salt/modules/quota.py
def on(device): ''' Turns on the quota system CLI Example: .. code-block:: bash salt '*' quota.on ''' cmd = 'quotaon {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
def on(device): ''' Turns on the quota system CLI Example: .. code-block:: bash salt '*' quota.on ''' cmd = 'quotaon {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
[ "Turns", "on", "the", "quota", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L193-L205
[ "def", "on", "(", "device", ")", ":", "cmd", "=", "'quotaon {0}'", ".", "format", "(", "device", ")", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
off
Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off
salt/modules/quota.py
def off(device): ''' Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off ''' cmd = 'quotaoff {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
def off(device): ''' Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off ''' cmd = 'quotaoff {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
[ "Turns", "off", "the", "quota", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L208-L220
[ "def", "off", "(", "device", ")", ":", "cmd", "=", "'quotaoff {0}'", ".", "format", "(", "device", ")", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_mode
Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode
salt/modules/quota.py
def get_mode(device): ''' Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode ''' ret = {} cmd = 'quotaon -p {0}'.format(device) out = __salt__['cmd.run'](cmd, python_shell=False) for line in out.splitlines...
def get_mode(device): ''' Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode ''' ret = {} cmd = 'quotaon -p {0}'.format(device) out = __salt__['cmd.run'](cmd, python_shell=False) for line in out.splitlines...
[ "Report", "whether", "the", "quota", "system", "for", "this", "device", "is", "on", "or", "off" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L223-L251
[ "def", "get_mode", "(", "device", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'quotaon -p {0}'", ".", "format", "(", "device", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "for", "line", "in...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create.
salt/states/pagerduty_user.py
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create. ''' return __salt__['pagerduty_util.resource_present']('users', ...
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create. ''' return __salt__['pagerduty_util.resource_present']('users', ...
[ "Ensure", "pagerduty", "user", "exists", ".", "Arguments", "match", "those", "supported", "by", "https", ":", "//", "developer", ".", "pagerduty", ".", "com", "/", "documentation", "/", "rest", "/", "users", "/", "create", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_user.py#L28-L40
[ "def", "present", "(", "profile", "=", "'pagerduty'", ",", "subdomain", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "__salt__", "[", "'pagerduty_util.resource_present'", "]", "(", "'users'", ",", "[", "'email'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check
Generate rsync options
salt/modules/rsync.py
def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh): ''' Generate rsync options ''' options = ['-avz'] if delete: options.append('--delete') if force: options.append('--force') if update: options.append('--update') if rsh: o...
def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh): ''' Generate rsync options ''' options = ['-avz'] if delete: options.append('--delete') if force: options.append('--force') if update: options.append('--update') if rsh: o...
[ "Generate", "rsync", "options" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L38-L66
[ "def", "_check", "(", "delete", ",", "force", ",", "update", ",", "passwordfile", ",", "exclude", ",", "excludefrom", ",", "dryrun", ",", "rsh", ")", ":", "options", "=", "[", "'-avz'", "]", "if", "delete", ":", "options", ".", "append", "(", "'--delet...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rsync
.. versionchanged:: 2016.3.0 Return data now contains just the output of the rsync command, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Rsync files from src to dst src The source location where files will be rsynced from. ...
salt/modules/rsync.py
def rsync(src, dst, delete=False, force=False, update=False, passwordfile=None, exclude=None, excludefrom=None, dryrun=False, rsh=None, additional_opts=None, saltenv='base'): ''' .. versionchanged:: 201...
def rsync(src, dst, delete=False, force=False, update=False, passwordfile=None, exclude=None, excludefrom=None, dryrun=False, rsh=None, additional_opts=None, saltenv='base'): ''' .. versionchanged:: 201...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "output", "of", "the", "rsync", "command", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ":", "func", ":", "cmd", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L69-L219
[ "def", "rsync", "(", "src", ",", "dst", ",", "delete", "=", "False", ",", "force", "=", "False", ",", "update", "=", "False", ",", "passwordfile", "=", "None", ",", "exclude", "=", "None", ",", "excludefrom", "=", "None", ",", "dryrun", "=", "False",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
.. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash salt '*' rsync.version
salt/modules/rsync.py
def version(): ''' .. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash sal...
def version(): ''' .. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash sal...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "version", "number", "as", "a", "string", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ":", "func", ":", "cmd", "....
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L222-L246
[ "def", "version", "(", ")", ":", "try", ":", "out", "=", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "[", "'rsync'", ",", "'--version'", "]", ",", "python_shell", "=", "False", ")", "except", "(", "IOError", ",", "OSError", ")", "as", "exc", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config
.. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync config file conf_path : /etc/rsyncd.conf Path...
salt/modules/rsync.py
def config(conf_path='/etc/rsyncd.conf'): ''' .. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync conf...
def config(conf_path='/etc/rsyncd.conf'): ''' .. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync conf...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "contents", "of", "the", "rsyncd", ".", "conf", "as", "a", "string", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L249-L288
[ "def", "config", "(", "conf_path", "=", "'/etc/rsyncd.conf'", ")", ":", "ret", "=", "''", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "conf_path", ",", "'r'", ")", "as", "fp_", ":", "for", "line", "in", "fp_", ":", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure an role exists name Name of the role description An arbitrary description of the role
salt/states/keystone_role.py
def present(name, auth=None, **kwargs): ''' Ensure an role exists name Name of the role description An arbitrary description of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_k...
def present(name, auth=None, **kwargs): ''' Ensure an role exists name Name of the role description An arbitrary description of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_k...
[ "Ensure", "an", "role", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_role.py#L40-L75
[ "def", "present", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "kwargs", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure role does not exist name Name of the role
salt/states/keystone_role.py
def absent(name, auth=None, **kwargs): ''' Ensure role does not exist name Name of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) kwargs['name'] = name role = __salt__['...
def absent(name, auth=None, **kwargs): ''' Ensure role does not exist name Name of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) kwargs['name'] = name role = __salt__['...
[ "Ensure", "role", "does", "not", "exist" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_role.py#L78-L106
[ "def", "absent", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "__salt__", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' assistive.install /usr/bin/o...
salt/modules/mac_assistive.py
def install(app_id, enable=True): ''' Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash ...
def install(app_id, enable=True): ''' Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash ...
[ "Install", "a", "bundle", "ID", "or", "command", "as", "being", "allowed", "to", "use", "assistive", "access", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L39-L78
[ "def", "install", "(", "app_id", ",", "enable", "=", "True", ")", ":", "ge_el_capitan", "=", "True", "if", "_LooseVersion", "(", "__grains__", "[", "'osrelease'", "]", ")", ">=", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "'10.11'", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enable
Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' assistive.enable /usr/bin/osascript sa...
salt/modules/mac_assistive.py
def enable(app_id, enabled=True): ''' Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' ...
def enable(app_id, enabled=True): ''' Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' ...
[ "Enable", "or", "disable", "an", "existing", "assistive", "access", "application", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L103-L143
[ "def", "enable", "(", "app_id", ",", "enabled", "=", "True", ")", ":", "enable_str", "=", "'1'", "if", "enabled", "else", "'0'", "for", "a", "in", "_get_assistive_access", "(", ")", ":", "if", "app_id", "==", "a", "[", "0", "]", ":", "cmd", "=", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove com.smileonmymac.textexpander
salt/modules/mac_assistive.py
def remove(app_id): ''' Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove c...
def remove(app_id): ''' Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove c...
[ "Remove", "a", "bundle", "ID", "or", "command", "as", "being", "allowed", "to", "use", "assistive", "access", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L168-L199
[ "def", "remove", "(", "app_id", ")", ":", "cmd", "=", "'sqlite3 \"/Library/Application Support/com.apple.TCC/TCC.db\" '", "'\"DELETE from access where client=\\'{0}\\'\"'", ".", "format", "(", "app_id", ")", "call", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_assistive_access
Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not.
salt/modules/mac_assistive.py
def _get_assistive_access(): ''' Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not. ''' cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT * FROM access"' call = __salt__['cmd.run_all']( ...
def _get_assistive_access(): ''' Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not. ''' cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT * FROM access"' call = __salt__['cmd.run_all']( ...
[ "Get", "a", "list", "of", "all", "of", "the", "assistive", "access", "applications", "installed", "returns", "as", "a", "ternary", "showing", "whether", "each", "app", "is", "enabled", "or", "not", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L210-L232
[ "def", "_get_assistive_access", "(", ")", ":", "cmd", "=", "'sqlite3 \"/Library/Application Support/com.apple.TCC/TCC.db\" \"SELECT * FROM access\"'", "call", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'debug'", ",", "python_shell"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deserialize
Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module.
salt/serializers/yaml.py
def deserialize(stream_or_string, **options): ''' Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module. ''' options.setdefault('Loader', Loader) try: r...
def deserialize(stream_or_string, **options): ''' Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module. ''' options.setdefault('Loader', Loader) try: r...
[ "Deserialize", "any", "string", "of", "stream", "like", "object", "into", "a", "Python", "data", "structure", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yaml.py#L41-L64
[ "def", "deserialize", "(", "stream_or_string", ",", "*", "*", "options", ")", ":", "options", ".", "setdefault", "(", "'Loader'", ",", "Loader", ")", "try", ":", "return", "yaml", ".", "load", "(", "stream_or_string", ",", "*", "*", "options", ")", "exce...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
serialize
Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module.
salt/serializers/yaml.py
def serialize(obj, **options): ''' Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module. ''' options.setdefault('Dumper', Dumper) try: response = yaml.dump(obj, **options) if response.endswith('\n...\n...
def serialize(obj, **options): ''' Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module. ''' options.setdefault('Dumper', Dumper) try: response = yaml.dump(obj, **options) if response.endswith('\n...\n...
[ "Serialize", "Python", "data", "to", "YAML", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yaml.py#L67-L85
[ "def", "serialize", "(", "obj", ",", "*", "*", "options", ")", ":", "options", ".", "setdefault", "(", "'Dumper'", ",", "Dumper", ")", "try", ":", "response", "=", "yaml", ".", "dump", "(", "obj", ",", "*", "*", "options", ")", "if", "response", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_cert_serial
Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name>
salt/modules/win_certutil.py
def get_cert_serial(cert_file): ''' Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name> ''' cmd = "certutil.exe -silent -verify {0}".format...
def get_cert_serial(cert_file): ''' Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name> ''' cmd = "certutil.exe -silent -verify {0}".format...
[ "Get", "the", "serial", "number", "of", "a", "certificate", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L32-L52
[ "def", "get_cert_serial", "(", "cert_file", ")", ":", "cmd", "=", "\"certutil.exe -silent -verify {0}\"", ".", "format", "(", "cert_file", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "# match serial number by paragraph to work with multiple lang...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_stored_cert_serials
Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store>
salt/modules/win_certutil.py
def get_stored_cert_serials(store): ''' Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store> ''' cmd = "certutil.exe -store {0}...
def get_stored_cert_serials(store): ''' Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store> ''' cmd = "certutil.exe -store {0}...
[ "Get", "all", "of", "the", "certificate", "serials", "in", "the", "specified", "store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L55-L72
[ "def", "get_stored_cert_serials", "(", "store", ")", ":", "cmd", "=", "\"certutil.exe -store {0}\"", ".", "format", "(", "store", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "# match serial numbers by header position to work with multiple langua...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_store
Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment to use this is ignored if the path is local CL...
salt/modules/win_certutil.py
def add_store(source, store, saltenv='base'): ''' Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment t...
def add_store(source, store, saltenv='base'): ''' Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment t...
[ "Add", "the", "given", "cert", "into", "the", "given", "Certificate", "Store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L75-L98
[ "def", "add_store", "(", "source", ",", "store", ",", "saltenv", "=", "'base'", ")", ":", "cert_file", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", "saltenv", ")", "cmd", "=", "\"certutil.exe -addstore {0} {1}\"", ".", "format", "(", "st...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_store
Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt environment to use this is ignored if the path is local...
salt/modules/win_certutil.py
def del_store(source, store, saltenv='base'): ''' Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt envir...
def del_store(source, store, saltenv='base'): ''' Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt envir...
[ "Delete", "the", "given", "cert", "into", "the", "given", "Certificate", "Store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L101-L125
[ "def", "del_store", "(", "source", ",", "store", ",", "saltenv", "=", "'base'", ")", ":", "cert_file", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", "saltenv", ")", "serial", "=", "get_cert_serial", "(", "cert_file", ")", "cmd", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so make sure that information is not duplicated in these two arg...
salt/states/ddns.py
def present(name, zone, ttl, data, rdtype='A', **kwargs): ''' Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so...
def present(name, zone, ttl, data, rdtype='A', **kwargs): ''' Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so...
[ "Ensures", "that", "the", "named", "DNS", "record", "is", "present", "with", "the", "given", "ttl", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ddns.py#L35-L91
[ "def", "present", "(", "name", ",", "zone", ",", "ttl", ",", "data", ",", "rdtype", "=", "'A'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'co...
e8541fd6e744ab0df786c0f76102e41631f45d46