id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
36,700
saltstack/salt
salt/runners/net.py
_get_mine
def _get_mine(fun): ''' Return the mine function from all the targeted minions. Just a small helper to avoid redundant pieces of code. ''' if fun in _CACHE and _CACHE[fun]: return _CACHE[fun] net_runner_opts = _get_net_runner_opts() _CACHE[fun] = __salt__['mine.get'](net_runner_opts....
python
def _get_mine(fun): ''' Return the mine function from all the targeted minions. Just a small helper to avoid redundant pieces of code. ''' if fun in _CACHE and _CACHE[fun]: return _CACHE[fun] net_runner_opts = _get_net_runner_opts() _CACHE[fun] = __salt__['mine.get'](net_runner_opts....
[ "def", "_get_mine", "(", "fun", ")", ":", "if", "fun", "in", "_CACHE", "and", "_CACHE", "[", "fun", "]", ":", "return", "_CACHE", "[", "fun", "]", "net_runner_opts", "=", "_get_net_runner_opts", "(", ")", "_CACHE", "[", "fun", "]", "=", "__salt__", "["...
Return the mine function from all the targeted minions. Just a small helper to avoid redundant pieces of code.
[ "Return", "the", "mine", "function", "from", "all", "the", "targeted", "minions", ".", "Just", "a", "small", "helper", "to", "avoid", "redundant", "pieces", "of", "code", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/net.py#L135-L146
36,701
saltstack/salt
salt/runners/net.py
_find_interfaces_ip
def _find_interfaces_ip(mac): ''' Helper to search the interfaces IPs using the MAC address. ''' try: mac = napalm_helpers.convert(napalm_helpers.mac, mac) except AddrFormatError: return ('', '', []) all_interfaces = _get_mine('net.interfaces') all_ipaddrs = _get_mine('net.i...
python
def _find_interfaces_ip(mac): ''' Helper to search the interfaces IPs using the MAC address. ''' try: mac = napalm_helpers.convert(napalm_helpers.mac, mac) except AddrFormatError: return ('', '', []) all_interfaces = _get_mine('net.interfaces') all_ipaddrs = _get_mine('net.i...
[ "def", "_find_interfaces_ip", "(", "mac", ")", ":", "try", ":", "mac", "=", "napalm_helpers", ".", "convert", "(", "napalm_helpers", ".", "mac", ",", "mac", ")", "except", "AddrFormatError", ":", "return", "(", "''", ",", "''", ",", "[", "]", ")", "all...
Helper to search the interfaces IPs using the MAC address.
[ "Helper", "to", "search", "the", "interfaces", "IPs", "using", "the", "MAC", "address", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/net.py#L183-L213
36,702
saltstack/salt
salt/runners/net.py
_find_interfaces_mac
def _find_interfaces_mac(ip): # pylint: disable=invalid-name ''' Helper to get the interfaces hardware address using the IP Address. ''' all_interfaces = _get_mine('net.interfaces') all_ipaddrs = _get_mine('net.ipaddrs') for device, device_ipaddrs in six.iteritems(all_ipaddrs): if not ...
python
def _find_interfaces_mac(ip): # pylint: disable=invalid-name ''' Helper to get the interfaces hardware address using the IP Address. ''' all_interfaces = _get_mine('net.interfaces') all_ipaddrs = _get_mine('net.ipaddrs') for device, device_ipaddrs in six.iteritems(all_ipaddrs): if not ...
[ "def", "_find_interfaces_mac", "(", "ip", ")", ":", "# pylint: disable=invalid-name", "all_interfaces", "=", "_get_mine", "(", "'net.interfaces'", ")", "all_ipaddrs", "=", "_get_mine", "(", "'net.ipaddrs'", ")", "for", "device", ",", "device_ipaddrs", "in", "six", "...
Helper to get the interfaces hardware address using the IP Address.
[ "Helper", "to", "get", "the", "interfaces", "hardware", "address", "using", "the", "IP", "Address", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/net.py#L216-L235
36,703
saltstack/salt
salt/runners/net.py
multi_find
def multi_find(*patterns, **kwargs): ''' Execute multiple search tasks. This function is based on the `find` function. Depending on the search items, some information might overlap. Optional arguments: best: ``True`` Return only the best match with the interfaces IP networks wh...
python
def multi_find(*patterns, **kwargs): ''' Execute multiple search tasks. This function is based on the `find` function. Depending on the search items, some information might overlap. Optional arguments: best: ``True`` Return only the best match with the interfaces IP networks wh...
[ "def", "multi_find", "(", "*", "patterns", ",", "*", "*", "kwargs", ")", ":", "out", "=", "{", "}", "for", "pattern", "in", "set", "(", "patterns", ")", ":", "search_result", "=", "find", "(", "pattern", ",", "best", "=", "kwargs", ".", "get", "(",...
Execute multiple search tasks. This function is based on the `find` function. Depending on the search items, some information might overlap. Optional arguments: best: ``True`` Return only the best match with the interfaces IP networks when the saerching pattern is a valid IP Address or...
[ "Execute", "multiple", "search", "tasks", ".", "This", "function", "is", "based", "on", "the", "find", "function", ".", "Depending", "on", "the", "search", "items", "some", "information", "might", "overlap", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/net.py#L910-L967
36,704
saltstack/salt
salt/modules/augeas_cfg.py
_recurmatch
def _recurmatch(path, aug): ''' Recursive generator providing the infrastructure for augtools print behavior. This function is based on test_augeas.py from Harald Hoyer <harald@redhat.com> in the python-augeas repository ''' if path: clean_path = path.rstrip('/*') yield...
python
def _recurmatch(path, aug): ''' Recursive generator providing the infrastructure for augtools print behavior. This function is based on test_augeas.py from Harald Hoyer <harald@redhat.com> in the python-augeas repository ''' if path: clean_path = path.rstrip('/*') yield...
[ "def", "_recurmatch", "(", "path", ",", "aug", ")", ":", "if", "path", ":", "clean_path", "=", "path", ".", "rstrip", "(", "'/*'", ")", "yield", "(", "clean_path", ",", "aug", ".", "get", "(", "path", ")", ")", "for", "i", "in", "aug", ".", "matc...
Recursive generator providing the infrastructure for augtools print behavior. This function is based on test_augeas.py from Harald Hoyer <harald@redhat.com> in the python-augeas repository
[ "Recursive", "generator", "providing", "the", "infrastructure", "for", "augtools", "print", "behavior", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L75-L91
36,705
saltstack/salt
salt/modules/augeas_cfg.py
_lstrip_word
def _lstrip_word(word, prefix): ''' Return a copy of the string after the specified prefix was removed from the beginning of the string ''' if six.text_type(word).startswith(prefix): return six.text_type(word)[len(prefix):] return word
python
def _lstrip_word(word, prefix): ''' Return a copy of the string after the specified prefix was removed from the beginning of the string ''' if six.text_type(word).startswith(prefix): return six.text_type(word)[len(prefix):] return word
[ "def", "_lstrip_word", "(", "word", ",", "prefix", ")", ":", "if", "six", ".", "text_type", "(", "word", ")", ".", "startswith", "(", "prefix", ")", ":", "return", "six", ".", "text_type", "(", "word", ")", "[", "len", "(", "prefix", ")", ":", "]",...
Return a copy of the string after the specified prefix was removed from the beginning of the string
[ "Return", "a", "copy", "of", "the", "string", "after", "the", "specified", "prefix", "was", "removed", "from", "the", "beginning", "of", "the", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L94-L102
36,706
saltstack/salt
salt/modules/augeas_cfg.py
_check_load_paths
def _check_load_paths(load_path): ''' Checks the validity of the load_path, returns a sanitized version with invalid paths removed. ''' if load_path is None or not isinstance(load_path, six.string_types): return None _paths = [] for _path in load_path.split(':'): if os.path...
python
def _check_load_paths(load_path): ''' Checks the validity of the load_path, returns a sanitized version with invalid paths removed. ''' if load_path is None or not isinstance(load_path, six.string_types): return None _paths = [] for _path in load_path.split(':'): if os.path...
[ "def", "_check_load_paths", "(", "load_path", ")", ":", "if", "load_path", "is", "None", "or", "not", "isinstance", "(", "load_path", ",", "six", ".", "string_types", ")", ":", "return", "None", "_paths", "=", "[", "]", "for", "_path", "in", "load_path", ...
Checks the validity of the load_path, returns a sanitized version with invalid paths removed.
[ "Checks", "the", "validity", "of", "the", "load_path", "returns", "a", "sanitized", "version", "with", "invalid", "paths", "removed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L105-L124
36,707
saltstack/salt
salt/modules/augeas_cfg.py
get
def get(path, value='', load_path=None): ''' Get a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.get /files/etc/hosts/1/ ipaddr path The path to get the value of value The optional value to get .. versionadded:: 2016.3.0 ...
python
def get(path, value='', load_path=None): ''' Get a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.get /files/etc/hosts/1/ ipaddr path The path to get the value of value The optional value to get .. versionadded:: 2016.3.0 ...
[ "def", "get", "(", "path", ",", "value", "=", "''", ",", "load_path", "=", "None", ")", ":", "load_path", "=", "_check_load_paths", "(", "load_path", ")", "aug", "=", "_Augeas", "(", "loadpath", "=", "load_path", ")", "ret", "=", "{", "}", "path", "=...
Get a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.get /files/etc/hosts/1/ ipaddr path The path to get the value of value The optional value to get .. versionadded:: 2016.3.0 load_path A colon-spearated list of director...
[ "Get", "a", "value", "for", "a", "specific", "augeas", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L264-L306
36,708
saltstack/salt
salt/modules/augeas_cfg.py
setvalue
def setvalue(*args): ''' Set a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.setvalue /files/etc/hosts/1/canonical localhost This will set the first entry in /etc/hosts to localhost CLI Example: .. code-block:: bash salt '*' augeas....
python
def setvalue(*args): ''' Set a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.setvalue /files/etc/hosts/1/canonical localhost This will set the first entry in /etc/hosts to localhost CLI Example: .. code-block:: bash salt '*' augeas....
[ "def", "setvalue", "(", "*", "args", ")", ":", "load_path", "=", "None", "load_paths", "=", "[", "x", "for", "x", "in", "args", "if", "six", ".", "text_type", "(", "x", ")", ".", "startswith", "(", "'load_path='", ")", "]", "if", "load_paths", ":", ...
Set a value for a specific augeas path CLI Example: .. code-block:: bash salt '*' augeas.setvalue /files/etc/hosts/1/canonical localhost This will set the first entry in /etc/hosts to localhost CLI Example: .. code-block:: bash salt '*' augeas.setvalue /files/etc/hosts/01/ipad...
[ "Set", "a", "value", "for", "a", "specific", "augeas", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L309-L391
36,709
saltstack/salt
salt/modules/augeas_cfg.py
ls
def ls(path, load_path=None): # pylint: disable=C0103 ''' List the direct children of a node CLI Example: .. code-block:: bash salt '*' augeas.ls /files/etc/passwd path The path to list .. versionadded:: 2016.3.0 load_path A colon-spearated list of directories ...
python
def ls(path, load_path=None): # pylint: disable=C0103 ''' List the direct children of a node CLI Example: .. code-block:: bash salt '*' augeas.ls /files/etc/passwd path The path to list .. versionadded:: 2016.3.0 load_path A colon-spearated list of directories ...
[ "def", "ls", "(", "path", ",", "load_path", "=", "None", ")", ":", "# pylint: disable=C0103", "def", "_match", "(", "path", ")", ":", "''' Internal match function '''", "try", ":", "matches", "=", "aug", ".", "match", "(", "salt", ".", "utils", ".", "strin...
List the direct children of a node CLI Example: .. code-block:: bash salt '*' augeas.ls /files/etc/passwd path The path to list .. versionadded:: 2016.3.0 load_path A colon-spearated list of directories that modules should be searched in. This is in addition to ...
[ "List", "the", "direct", "children", "of", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L475-L523
36,710
saltstack/salt
salt/modules/augeas_cfg.py
tree
def tree(path, load_path=None): ''' Returns recursively the complete tree of a node CLI Example: .. code-block:: bash salt '*' augeas.tree /files/etc/ path The base of the recursive listing .. versionadded:: 2016.3.0 load_path A colon-spearated list of directori...
python
def tree(path, load_path=None): ''' Returns recursively the complete tree of a node CLI Example: .. code-block:: bash salt '*' augeas.tree /files/etc/ path The base of the recursive listing .. versionadded:: 2016.3.0 load_path A colon-spearated list of directori...
[ "def", "tree", "(", "path", ",", "load_path", "=", "None", ")", ":", "load_path", "=", "_check_load_paths", "(", "load_path", ")", "aug", "=", "_Augeas", "(", "loadpath", "=", "load_path", ")", "path", "=", "path", ".", "rstrip", "(", "'/'", ")", "+", ...
Returns recursively the complete tree of a node CLI Example: .. code-block:: bash salt '*' augeas.tree /files/etc/ path The base of the recursive listing .. versionadded:: 2016.3.0 load_path A colon-spearated list of directories that modules should be searched i...
[ "Returns", "recursively", "the", "complete", "tree", "of", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/augeas_cfg.py#L526-L552
36,711
saltstack/salt
salt/modules/kernelpkg_linux_apt.py
cleanup
def cleanup(keep_latest=True): ''' Remove all unused kernel packages from the system. keep_latest : True In the event that the active kernel is not the latest one installed, setting this to True will retain the latest kernel package, in addition to the active one. If False, all kernel ...
python
def cleanup(keep_latest=True): ''' Remove all unused kernel packages from the system. keep_latest : True In the event that the active kernel is not the latest one installed, setting this to True will retain the latest kernel package, in addition to the active one. If False, all kernel ...
[ "def", "cleanup", "(", "keep_latest", "=", "True", ")", ":", "removed", "=", "[", "]", "# Loop over all installed kernel packages", "for", "kernel", "in", "list_installed", "(", ")", ":", "# Keep the active kernel package", "if", "kernel", "==", "active", "(", ")"...
Remove all unused kernel packages from the system. keep_latest : True In the event that the active kernel is not the latest one installed, setting this to True will retain the latest kernel package, in addition to the active one. If False, all kernel packages other than the active one will ...
[ "Remove", "all", "unused", "kernel", "packages", "from", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kernelpkg_linux_apt.py#L231-L262
36,712
saltstack/salt
salt/modules/kernelpkg_linux_apt.py
_cmp_version
def _cmp_version(item1, item2): ''' Compare function for package version sorting ''' vers1 = _LooseVersion(item1) vers2 = _LooseVersion(item2) if vers1 < vers2: return -1 if vers1 > vers2: return 1 return 0
python
def _cmp_version(item1, item2): ''' Compare function for package version sorting ''' vers1 = _LooseVersion(item1) vers2 = _LooseVersion(item2) if vers1 < vers2: return -1 if vers1 > vers2: return 1 return 0
[ "def", "_cmp_version", "(", "item1", ",", "item2", ")", ":", "vers1", "=", "_LooseVersion", "(", "item1", ")", "vers2", "=", "_LooseVersion", "(", "item2", ")", "if", "vers1", "<", "vers2", ":", "return", "-", "1", "if", "vers1", ">", "vers2", ":", "...
Compare function for package version sorting
[ "Compare", "function", "for", "package", "version", "sorting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kernelpkg_linux_apt.py#L279-L290
36,713
saltstack/salt
salt/states/redismod.py
string
def string(name, value, expire=None, expireat=None, **connection_args): ''' Ensure that the key exists in redis with the value specified name Redis key to manage value Data to persist in key expire Sets time to live for key in seconds expireat Sets expiration ...
python
def string(name, value, expire=None, expireat=None, **connection_args): ''' Ensure that the key exists in redis with the value specified name Redis key to manage value Data to persist in key expire Sets time to live for key in seconds expireat Sets expiration ...
[ "def", "string", "(", "name", ",", "value", ",", "expire", "=", "None", ",", "expireat", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True",...
Ensure that the key exists in redis with the value specified name Redis key to manage value Data to persist in key expire Sets time to live for key in seconds expireat Sets expiration time for key via UNIX timestamp, overrides `expire`
[ "Ensure", "that", "the", "key", "exists", "in", "redis", "with", "the", "value", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/redismod.py#L46-L81
36,714
saltstack/salt
salt/states/redismod.py
absent
def absent(name, keys=None, **connection_args): ''' Ensure key absent from redis name Key to ensure absent from redis keys list of keys to ensure absent, name will be ignored if this is used ''' ret = {'name': name, 'changes': {}, 'result': True, ...
python
def absent(name, keys=None, **connection_args): ''' Ensure key absent from redis name Key to ensure absent from redis keys list of keys to ensure absent, name will be ignored if this is used ''' ret = {'name': name, 'changes': {}, 'result': True, ...
[ "def", "absent", "(", "name", ",", "keys", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Key(s) specified already...
Ensure key absent from redis name Key to ensure absent from redis keys list of keys to ensure absent, name will be ignored if this is used
[ "Ensure", "key", "absent", "from", "redis" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/redismod.py#L84-L117
36,715
saltstack/salt
salt/states/redismod.py
slaveof
def slaveof(name, sentinel_host=None, sentinel_port=None, sentinel_password=None, **connection_args): ''' Set this redis instance as a slave. .. versionadded: 2016.3.0 name Master to make this a slave of sentinel_host Ip of the sentinel to check for the master sentinel_port ...
python
def slaveof(name, sentinel_host=None, sentinel_port=None, sentinel_password=None, **connection_args): ''' Set this redis instance as a slave. .. versionadded: 2016.3.0 name Master to make this a slave of sentinel_host Ip of the sentinel to check for the master sentinel_port ...
[ "def", "slaveof", "(", "name", ",", "sentinel_host", "=", "None", ",", "sentinel_port", "=", "None", ",", "sentinel_password", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", ...
Set this redis instance as a slave. .. versionadded: 2016.3.0 name Master to make this a slave of sentinel_host Ip of the sentinel to check for the master sentinel_port Port of the sentinel to check for the master
[ "Set", "this", "redis", "instance", "as", "a", "slave", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/redismod.py#L120-L173
36,716
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.__one_equals_true
def __one_equals_true(value): ''' Test for ``1`` as a number or a string and return ``True`` if it is. Args: value: string or number or None. Returns: bool: ``True`` if 1 otherwise ``False``. ''' if isinstance(value, six.integer_types) and value ...
python
def __one_equals_true(value): ''' Test for ``1`` as a number or a string and return ``True`` if it is. Args: value: string or number or None. Returns: bool: ``True`` if 1 otherwise ``False``. ''' if isinstance(value, six.integer_types) and value ...
[ "def", "__one_equals_true", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "integer_types", ")", "and", "value", "==", "1", ":", "return", "True", "elif", "(", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ...
Test for ``1`` as a number or a string and return ``True`` if it is. Args: value: string or number or None. Returns: bool: ``True`` if 1 otherwise ``False``.
[ "Test", "for", "1", "as", "a", "number", "or", "a", "string", "and", "return", "True", "if", "it", "is", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L264-L280
36,717
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.install_time
def install_time(self): ''' Return the install time, or provide an estimate of install time. Installers or even self upgrading software must/should update the date held within InstallDate field when they change versions. Some installers do not set ``InstallDate`` at all so we us...
python
def install_time(self): ''' Return the install time, or provide an estimate of install time. Installers or even self upgrading software must/should update the date held within InstallDate field when they change versions. Some installers do not set ``InstallDate`` at all so we us...
[ "def", "install_time", "(", "self", ")", ":", "time1970", "=", "self", ".", "__mod_time1970", "# time of last resort", "try", ":", "# pylint: disable=no-member", "date_string", ",", "item_type", "=", "win32api", ".", "RegQueryValueEx", "(", "self", ".", "__reg_unins...
Return the install time, or provide an estimate of install time. Installers or even self upgrading software must/should update the date held within InstallDate field when they change versions. Some installers do not set ``InstallDate`` at all so we use the last modified time on the regi...
[ "Return", "the", "install", "time", "or", "provide", "an", "estimate", "of", "install", "time", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L311-L341
36,718
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.get_install_value
def get_install_value(self, value_name, wanted_type=None): ''' For the uninstall section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match ...
python
def get_install_value(self, value_name, wanted_type=None): ''' For the uninstall section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match ...
[ "def", "get_install_value", "(", "self", ",", "value_name", ",", "wanted_type", "=", "None", ")", ":", "try", ":", "item_value", ",", "item_type", "=", "self", ".", "__reg_query_value", "(", "self", ".", "__reg_uninstall_handle", ",", "value_name", ")", "excep...
For the uninstall section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match None is return. wanted_type support values are ``str`` ``i...
[ "For", "the", "uninstall", "section", "of", "the", "registry", "return", "the", "name", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L343-L368
36,719
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.get_product_value
def get_product_value(self, value_name, wanted_type=None): ''' For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match ...
python
def get_product_value(self, value_name, wanted_type=None): ''' For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match ...
[ "def", "get_product_value", "(", "self", ",", "value_name", ",", "wanted_type", "=", "None", ")", ":", "if", "not", "self", ".", "__reg_products_handle", ":", "return", "None", "subkey", ",", "search_value_name", "=", "os", ".", "path", ".", "split", "(", ...
For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match None is return. wanted_type support values are ``str`` ``int...
[ "For", "the", "product", "section", "of", "the", "registry", "return", "the", "name", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L382-L420
36,720
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.upgrade_code
def upgrade_code(self): ''' For installers which follow the Microsoft Installer standard, returns the ``Upgrade code``. Returns: value (str): ``Upgrade code`` GUID for installed software. ''' if not self.__squid: # Must have a valid squid for an u...
python
def upgrade_code(self): ''' For installers which follow the Microsoft Installer standard, returns the ``Upgrade code``. Returns: value (str): ``Upgrade code`` GUID for installed software. ''' if not self.__squid: # Must have a valid squid for an u...
[ "def", "upgrade_code", "(", "self", ")", ":", "if", "not", "self", ".", "__squid", ":", "# Must have a valid squid for an upgrade code to exist", "return", "''", "# GUID/SQUID are unique, so it does not matter if they are 32bit or", "# 64bit or user install so all items are cached in...
For installers which follow the Microsoft Installer standard, returns the ``Upgrade code``. Returns: value (str): ``Upgrade code`` GUID for installed software.
[ "For", "installers", "which", "follow", "the", "Microsoft", "Installer", "standard", "returns", "the", "Upgrade", "code", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L423-L484
36,721
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.list_patches
def list_patches(self): ''' For installers which follow the Microsoft Installer standard, returns a list of patches applied. Returns: value (list): Long name of the patch. ''' if not self.__squid: # Must have a valid squid for an upgrade code to e...
python
def list_patches(self): ''' For installers which follow the Microsoft Installer standard, returns a list of patches applied. Returns: value (list): Long name of the patch. ''' if not self.__squid: # Must have a valid squid for an upgrade code to e...
[ "def", "list_patches", "(", "self", ")", ":", "if", "not", "self", ".", "__squid", ":", "# Must have a valid squid for an upgrade code to exist", "return", "[", "]", "if", "self", ".", "__patch_list", "is", "None", ":", "# Read in the upgrade codes in this section of th...
For installers which follow the Microsoft Installer standard, returns a list of patches applied. Returns: value (list): Long name of the patch.
[ "For", "installers", "which", "follow", "the", "Microsoft", "Installer", "standard", "returns", "a", "list", "of", "patches", "applied", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L487-L548
36,722
saltstack/salt
salt/utils/pkg/win.py
RegSoftwareInfo.version_binary
def version_binary(self): ''' Return version number which is stored in binary format. Returns: str: <major 0-255>.<minior 0-255>.<build 0-65535> or None if not found ''' # Under MSI 'Version' is a 'REG_DWORD' which then sets other registry # values like Displ...
python
def version_binary(self): ''' Return version number which is stored in binary format. Returns: str: <major 0-255>.<minior 0-255>.<build 0-65535> or None if not found ''' # Under MSI 'Version' is a 'REG_DWORD' which then sets other registry # values like Displ...
[ "def", "version_binary", "(", "self", ")", ":", "# Under MSI 'Version' is a 'REG_DWORD' which then sets other registry", "# values like DisplayVersion to x.x.x to the same value.", "# However not everyone plays by the rules, so we need to check first.", "# version_binary_data will be None if the r...
Return version number which is stored in binary format. Returns: str: <major 0-255>.<minior 0-255>.<build 0-65535> or None if not found
[ "Return", "version", "number", "which", "is", "stored", "in", "binary", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L601-L643
36,723
saltstack/salt
salt/utils/pkg/win.py
WinSoftware.pkg_version_list
def pkg_version_list(self, pkg_id): ''' Returns information on a package. Args: pkg_id (str): Package Id of the software/component. Returns: list: List of version numbers installed. ''' pkg_data = self.__reg_software.get(pkg_id, None) if ...
python
def pkg_version_list(self, pkg_id): ''' Returns information on a package. Args: pkg_id (str): Package Id of the software/component. Returns: list: List of version numbers installed. ''' pkg_data = self.__reg_software.get(pkg_id, None) if ...
[ "def", "pkg_version_list", "(", "self", ",", "pkg_id", ")", ":", "pkg_data", "=", "self", ".", "__reg_software", ".", "get", "(", "pkg_id", ",", "None", ")", "if", "not", "pkg_data", ":", "return", "[", "]", "if", "isinstance", "(", "pkg_data", ",", "l...
Returns information on a package. Args: pkg_id (str): Package Id of the software/component. Returns: list: List of version numbers installed.
[ "Returns", "information", "on", "a", "package", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L803-L823
36,724
saltstack/salt
salt/utils/pkg/win.py
WinSoftware.__version_capture_slp
def __version_capture_slp(self, pkg_id, version_binary, version_display, display_name): ''' This returns the version and where the version string came from, based on instructions under ``version_capture``, if ``version_capture`` is missing, it defaults to value of display-version. ...
python
def __version_capture_slp(self, pkg_id, version_binary, version_display, display_name): ''' This returns the version and where the version string came from, based on instructions under ``version_capture``, if ``version_capture`` is missing, it defaults to value of display-version. ...
[ "def", "__version_capture_slp", "(", "self", ",", "pkg_id", ",", "version_binary", ",", "version_display", ",", "display_name", ")", ":", "if", "self", ".", "__pkg_obj", "and", "hasattr", "(", "self", ".", "__pkg_obj", ",", "'version_capture'", ")", ":", "vers...
This returns the version and where the version string came from, based on instructions under ``version_capture``, if ``version_capture`` is missing, it defaults to value of display-version. Args: pkg_id (str): Publisher of the software/component. version_binary (str): Na...
[ "This", "returns", "the", "version", "and", "where", "the", "version", "string", "came", "from", "based", "on", "instructions", "under", "version_capture", "if", "version_capture", "is", "missing", "it", "defaults", "to", "value", "of", "display", "-", "version"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/win.py#L952-L993
36,725
saltstack/salt
salt/utils/gitfs.py
enforce_types
def enforce_types(key, val): ''' Force params to be strings unless they should remain a different type ''' non_string_params = { 'ssl_verify': bool, 'insecure_auth': bool, 'disable_saltenv_mapping': bool, 'env_whitelist': 'stringlist', 'env_blacklist': 'stringlist...
python
def enforce_types(key, val): ''' Force params to be strings unless they should remain a different type ''' non_string_params = { 'ssl_verify': bool, 'insecure_auth': bool, 'disable_saltenv_mapping': bool, 'env_whitelist': 'stringlist', 'env_blacklist': 'stringlist...
[ "def", "enforce_types", "(", "key", ",", "val", ")", ":", "non_string_params", "=", "{", "'ssl_verify'", ":", "bool", ",", "'insecure_auth'", ":", "bool", ",", "'disable_saltenv_mapping'", ":", "bool", ",", "'env_whitelist'", ":", "'stringlist'", ",", "'env_blac...
Force params to be strings unless they should remain a different type
[ "Force", "params", "to", "be", "strings", "unless", "they", "should", "remain", "a", "different", "type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L153-L204
36,726
saltstack/salt
salt/utils/gitfs.py
GitProvider.add_conf_overlay
def add_conf_overlay(cls, name): ''' Programmatically determine config value based on the desired saltenv ''' def _getconf(self, tgt_env='base'): strip_sep = lambda x: x.rstrip(os.sep) \ if name in ('root', 'mountpoint') \ else x if...
python
def add_conf_overlay(cls, name): ''' Programmatically determine config value based on the desired saltenv ''' def _getconf(self, tgt_env='base'): strip_sep = lambda x: x.rstrip(os.sep) \ if name in ('root', 'mountpoint') \ else x if...
[ "def", "add_conf_overlay", "(", "cls", ",", "name", ")", ":", "def", "_getconf", "(", "self", ",", "tgt_env", "=", "'base'", ")", ":", "strip_sep", "=", "lambda", "x", ":", "x", ".", "rstrip", "(", "os", ".", "sep", ")", "if", "name", "in", "(", ...
Programmatically determine config value based on the desired saltenv
[ "Programmatically", "determine", "config", "value", "based", "on", "the", "desired", "saltenv" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L509-L570
36,727
saltstack/salt
salt/utils/gitfs.py
GitProvider.check_root
def check_root(self): ''' Check if the relative root path exists in the checked-out copy of the remote. Return the full path to that relative root if it does exist, otherwise return None. ''' # No need to pass an environment to self.root() here since per-saltenv #...
python
def check_root(self): ''' Check if the relative root path exists in the checked-out copy of the remote. Return the full path to that relative root if it does exist, otherwise return None. ''' # No need to pass an environment to self.root() here since per-saltenv #...
[ "def", "check_root", "(", "self", ")", ":", "# No need to pass an environment to self.root() here since per-saltenv", "# configuration is a gitfs-only feature and check_root() is not used", "# for gitfs.", "root_dir", "=", "salt", ".", "utils", ".", "path", ".", "join", "(", "s...
Check if the relative root path exists in the checked-out copy of the remote. Return the full path to that relative root if it does exist, otherwise return None.
[ "Check", "if", "the", "relative", "root", "path", "exists", "in", "the", "checked", "-", "out", "copy", "of", "the", "remote", ".", "Return", "the", "full", "path", "to", "that", "relative", "root", "if", "it", "does", "exist", "otherwise", "return", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L572-L588
36,728
saltstack/salt
salt/utils/gitfs.py
GitProvider.clean_stale_refs
def clean_stale_refs(self): ''' Remove stale refs so that they are no longer seen as fileserver envs ''' cleaned = [] cmd_str = 'git remote prune origin' # Attempt to force all output to plain ascii english, which is what some parsing code # may expect. #...
python
def clean_stale_refs(self): ''' Remove stale refs so that they are no longer seen as fileserver envs ''' cleaned = [] cmd_str = 'git remote prune origin' # Attempt to force all output to plain ascii english, which is what some parsing code # may expect. #...
[ "def", "clean_stale_refs", "(", "self", ")", ":", "cleaned", "=", "[", "]", "cmd_str", "=", "'git remote prune origin'", "# Attempt to force all output to plain ascii english, which is what some parsing code", "# may expect.", "# According to stackoverflow (http://goo.gl/l74GC8), we ar...
Remove stale refs so that they are no longer seen as fileserver envs
[ "Remove", "stale", "refs", "so", "that", "they", "are", "no", "longer", "seen", "as", "fileserver", "envs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L590-L631
36,729
saltstack/salt
salt/utils/gitfs.py
GitProvider.enforce_git_config
def enforce_git_config(self): ''' For the config options which need to be maintained in the git config, ensure that the git config file is configured as desired. ''' git_config = os.path.join(self.gitdir, 'config') conf = salt.utils.configparser.GitConfigParser() ...
python
def enforce_git_config(self): ''' For the config options which need to be maintained in the git config, ensure that the git config file is configured as desired. ''' git_config = os.path.join(self.gitdir, 'config') conf = salt.utils.configparser.GitConfigParser() ...
[ "def", "enforce_git_config", "(", "self", ")", ":", "git_config", "=", "os", ".", "path", ".", "join", "(", "self", ".", "gitdir", ",", "'config'", ")", "conf", "=", "salt", ".", "utils", ".", "configparser", ".", "GitConfigParser", "(", ")", "if", "no...
For the config options which need to be maintained in the git config, ensure that the git config file is configured as desired.
[ "For", "the", "config", "options", "which", "need", "to", "be", "maintained", "in", "the", "git", "config", "ensure", "that", "the", "git", "config", "file", "is", "configured", "as", "desired", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L674-L762
36,730
saltstack/salt
salt/utils/gitfs.py
GitProvider.gen_lock
def gen_lock(self, lock_type='update', timeout=0, poll_interval=0.5): ''' Set and automatically clear a lock ''' if not isinstance(lock_type, six.string_types): raise GitLockError( errno.EINVAL, 'Invalid lock_type \'{0}\''.format(lock_type) ...
python
def gen_lock(self, lock_type='update', timeout=0, poll_interval=0.5): ''' Set and automatically clear a lock ''' if not isinstance(lock_type, six.string_types): raise GitLockError( errno.EINVAL, 'Invalid lock_type \'{0}\''.format(lock_type) ...
[ "def", "gen_lock", "(", "self", ",", "lock_type", "=", "'update'", ",", "timeout", "=", "0", ",", "poll_interval", "=", "0.5", ")", ":", "if", "not", "isinstance", "(", "lock_type", ",", "six", ".", "string_types", ")", ":", "raise", "GitLockError", "(",...
Set and automatically clear a lock
[ "Set", "and", "automatically", "clear", "a", "lock" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L894-L945
36,731
saltstack/salt
salt/utils/gitfs.py
GitProvider.get_checkout_target
def get_checkout_target(self): ''' Resolve dynamically-set branch ''' if self.role == 'git_pillar' and self.branch == '__env__': try: return self.all_saltenvs except AttributeError: # all_saltenvs not configured for this remote ...
python
def get_checkout_target(self): ''' Resolve dynamically-set branch ''' if self.role == 'git_pillar' and self.branch == '__env__': try: return self.all_saltenvs except AttributeError: # all_saltenvs not configured for this remote ...
[ "def", "get_checkout_target", "(", "self", ")", ":", "if", "self", ".", "role", "==", "'git_pillar'", "and", "self", ".", "branch", "==", "'__env__'", ":", "try", ":", "return", "self", ".", "all_saltenvs", "except", "AttributeError", ":", "# all_saltenvs not ...
Resolve dynamically-set branch
[ "Resolve", "dynamically", "-", "set", "branch" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1001-L1017
36,732
saltstack/salt
salt/utils/gitfs.py
GitProvider.get_tree
def get_tree(self, tgt_env): ''' Return a tree object for the specified environment ''' if not self.env_is_exposed(tgt_env): return None tgt_ref = self.ref(tgt_env) if tgt_ref is None: return None for ref_type in self.ref_types: ...
python
def get_tree(self, tgt_env): ''' Return a tree object for the specified environment ''' if not self.env_is_exposed(tgt_env): return None tgt_ref = self.ref(tgt_env) if tgt_ref is None: return None for ref_type in self.ref_types: ...
[ "def", "get_tree", "(", "self", ",", "tgt_env", ")", ":", "if", "not", "self", ".", "env_is_exposed", "(", "tgt_env", ")", ":", "return", "None", "tgt_ref", "=", "self", ".", "ref", "(", "tgt_env", ")", "if", "tgt_ref", "is", "None", ":", "return", "...
Return a tree object for the specified environment
[ "Return", "a", "tree", "object", "for", "the", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1019-L1045
36,733
saltstack/salt
salt/utils/gitfs.py
GitProvider.linkdir_walk
def linkdir_walk(self): ''' Return the expected result of an os.walk on the linkdir, based on the mountpoint value. ''' try: # Use cached linkdir_walk if we've already run this return self._linkdir_walk except AttributeError: self._link...
python
def linkdir_walk(self): ''' Return the expected result of an os.walk on the linkdir, based on the mountpoint value. ''' try: # Use cached linkdir_walk if we've already run this return self._linkdir_walk except AttributeError: self._link...
[ "def", "linkdir_walk", "(", "self", ")", ":", "try", ":", "# Use cached linkdir_walk if we've already run this", "return", "self", ".", "_linkdir_walk", "except", "AttributeError", ":", "self", ".", "_linkdir_walk", "=", "[", "]", "try", ":", "parts", "=", "self",...
Return the expected result of an os.walk on the linkdir, based on the mountpoint value.
[ "Return", "the", "expected", "result", "of", "an", "os", ".", "walk", "on", "the", "linkdir", "based", "on", "the", "mountpoint", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1064-L1097
36,734
saltstack/salt
salt/utils/gitfs.py
GitPython.dir_list
def dir_list(self, tgt_env): ''' Get list of directories for the target environment using GitPython ''' ret = set() tree = self.get_tree(tgt_env) if not tree: return ret if self.root(tgt_env): try: tree = tree / self.root(tg...
python
def dir_list(self, tgt_env): ''' Get list of directories for the target environment using GitPython ''' ret = set() tree = self.get_tree(tgt_env) if not tree: return ret if self.root(tgt_env): try: tree = tree / self.root(tg...
[ "def", "dir_list", "(", "self", ",", "tgt_env", ")", ":", "ret", "=", "set", "(", ")", "tree", "=", "self", ".", "get_tree", "(", "tgt_env", ")", "if", "not", "tree", ":", "return", "ret", "if", "self", ".", "root", "(", "tgt_env", ")", ":", "try...
Get list of directories for the target environment using GitPython
[ "Get", "list", "of", "directories", "for", "the", "target", "environment", "using", "GitPython" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1222-L1245
36,735
saltstack/salt
salt/utils/gitfs.py
GitPython.envs
def envs(self): ''' Check the refs and return a list of the ones which can be used as salt environments. ''' ref_paths = [x.path for x in self.repo.refs] return self._get_envs_from_ref_paths(ref_paths)
python
def envs(self): ''' Check the refs and return a list of the ones which can be used as salt environments. ''' ref_paths = [x.path for x in self.repo.refs] return self._get_envs_from_ref_paths(ref_paths)
[ "def", "envs", "(", "self", ")", ":", "ref_paths", "=", "[", "x", ".", "path", "for", "x", "in", "self", ".", "repo", ".", "refs", "]", "return", "self", ".", "_get_envs_from_ref_paths", "(", "ref_paths", ")" ]
Check the refs and return a list of the ones which can be used as salt environments.
[ "Check", "the", "refs", "and", "return", "a", "list", "of", "the", "ones", "which", "can", "be", "used", "as", "salt", "environments", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1247-L1253
36,736
saltstack/salt
salt/utils/gitfs.py
GitPython.file_list
def file_list(self, tgt_env): ''' Get file list for the target environment using GitPython ''' files = set() symlinks = {} tree = self.get_tree(tgt_env) if not tree: # Not found, return empty objects return files, symlinks if self.r...
python
def file_list(self, tgt_env): ''' Get file list for the target environment using GitPython ''' files = set() symlinks = {} tree = self.get_tree(tgt_env) if not tree: # Not found, return empty objects return files, symlinks if self.r...
[ "def", "file_list", "(", "self", ",", "tgt_env", ")", ":", "files", "=", "set", "(", ")", "symlinks", "=", "{", "}", "tree", "=", "self", ".", "get_tree", "(", "tgt_env", ")", "if", "not", "tree", ":", "# Not found, return empty objects", "return", "file...
Get file list for the target environment using GitPython
[ "Get", "file", "list", "for", "the", "target", "environment", "using", "GitPython" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1293-L1325
36,737
saltstack/salt
salt/utils/gitfs.py
GitPython.get_tree_from_sha
def get_tree_from_sha(self, ref): ''' Return a git.Tree object matching a SHA ''' try: return self.repo.rev_parse(ref).tree except (gitdb.exc.ODBError, AttributeError): return None
python
def get_tree_from_sha(self, ref): ''' Return a git.Tree object matching a SHA ''' try: return self.repo.rev_parse(ref).tree except (gitdb.exc.ODBError, AttributeError): return None
[ "def", "get_tree_from_sha", "(", "self", ",", "ref", ")", ":", "try", ":", "return", "self", ".", "repo", ".", "rev_parse", "(", "ref", ")", ".", "tree", "except", "(", "gitdb", ".", "exc", ".", "ODBError", ",", "AttributeError", ")", ":", "return", ...
Return a git.Tree object matching a SHA
[ "Return", "a", "git", ".", "Tree", "object", "matching", "a", "SHA" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1393-L1400
36,738
saltstack/salt
salt/utils/gitfs.py
Pygit2.clean_stale_refs
def clean_stale_refs(self, local_refs=None): # pylint: disable=arguments-differ ''' Clean stale local refs so they don't appear as fileserver environments ''' try: if pygit2.GIT_FETCH_PRUNE: # Don't need to clean anything, pygit2 can do it by itself ...
python
def clean_stale_refs(self, local_refs=None): # pylint: disable=arguments-differ ''' Clean stale local refs so they don't appear as fileserver environments ''' try: if pygit2.GIT_FETCH_PRUNE: # Don't need to clean anything, pygit2 can do it by itself ...
[ "def", "clean_stale_refs", "(", "self", ",", "local_refs", "=", "None", ")", ":", "# pylint: disable=arguments-differ", "try", ":", "if", "pygit2", ".", "GIT_FETCH_PRUNE", ":", "# Don't need to clean anything, pygit2 can do it by itself", "return", "[", "]", "except", "...
Clean stale local refs so they don't appear as fileserver environments
[ "Clean", "stale", "local", "refs", "so", "they", "don", "t", "appear", "as", "fileserver", "environments" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1619-L1638
36,739
saltstack/salt
salt/utils/gitfs.py
Pygit2.dir_list
def dir_list(self, tgt_env): ''' Get a list of directories for the target environment using pygit2 ''' def _traverse(tree, blobs, prefix): ''' Traverse through a pygit2 Tree object recursively, accumulating all the empty directories within it in the "b...
python
def dir_list(self, tgt_env): ''' Get a list of directories for the target environment using pygit2 ''' def _traverse(tree, blobs, prefix): ''' Traverse through a pygit2 Tree object recursively, accumulating all the empty directories within it in the "b...
[ "def", "dir_list", "(", "self", ",", "tgt_env", ")", ":", "def", "_traverse", "(", "tree", ",", "blobs", ",", "prefix", ")", ":", "'''\n Traverse through a pygit2 Tree object recursively, accumulating all\n the empty directories within it in the \"blobs\" li...
Get a list of directories for the target environment using pygit2
[ "Get", "a", "list", "of", "directories", "for", "the", "target", "environment", "using", "pygit2" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1668-L1717
36,740
saltstack/salt
salt/utils/gitfs.py
Pygit2.file_list
def file_list(self, tgt_env): ''' Get file list for the target environment using pygit2 ''' def _traverse(tree, blobs, prefix): ''' Traverse through a pygit2 Tree object recursively, accumulating all the file paths and symlink info in the "blobs" dict ...
python
def file_list(self, tgt_env): ''' Get file list for the target environment using pygit2 ''' def _traverse(tree, blobs, prefix): ''' Traverse through a pygit2 Tree object recursively, accumulating all the file paths and symlink info in the "blobs" dict ...
[ "def", "file_list", "(", "self", ",", "tgt_env", ")", ":", "def", "_traverse", "(", "tree", ",", "blobs", ",", "prefix", ")", ":", "'''\n Traverse through a pygit2 Tree object recursively, accumulating all\n the file paths and symlink info in the \"blobs\" d...
Get file list for the target environment using pygit2
[ "Get", "file", "list", "for", "the", "target", "environment", "using", "pygit2" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1792-L1847
36,741
saltstack/salt
salt/utils/gitfs.py
Pygit2.get_tree_from_sha
def get_tree_from_sha(self, ref): ''' Return a pygit2.Tree object matching a SHA ''' try: return self.repo.revparse_single(ref).tree except (KeyError, TypeError, ValueError, AttributeError): return None
python
def get_tree_from_sha(self, ref): ''' Return a pygit2.Tree object matching a SHA ''' try: return self.repo.revparse_single(ref).tree except (KeyError, TypeError, ValueError, AttributeError): return None
[ "def", "get_tree_from_sha", "(", "self", ",", "ref", ")", ":", "try", ":", "return", "self", ".", "repo", ".", "revparse_single", "(", "ref", ")", ".", "tree", "except", "(", "KeyError", ",", "TypeError", ",", "ValueError", ",", "AttributeError", ")", ":...
Return a pygit2.Tree object matching a SHA
[ "Return", "a", "pygit2", ".", "Tree", "object", "matching", "a", "SHA" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1910-L1917
36,742
saltstack/salt
salt/utils/gitfs.py
Pygit2.setup_callbacks
def setup_callbacks(self): ''' Assign attributes for pygit2 callbacks ''' if PYGIT2_VERSION >= _LooseVersion('0.23.2'): self.remotecallbacks = pygit2.RemoteCallbacks( credentials=self.credentials) if not self.ssl_verify: # Override ...
python
def setup_callbacks(self): ''' Assign attributes for pygit2 callbacks ''' if PYGIT2_VERSION >= _LooseVersion('0.23.2'): self.remotecallbacks = pygit2.RemoteCallbacks( credentials=self.credentials) if not self.ssl_verify: # Override ...
[ "def", "setup_callbacks", "(", "self", ")", ":", "if", "PYGIT2_VERSION", ">=", "_LooseVersion", "(", "'0.23.2'", ")", ":", "self", ".", "remotecallbacks", "=", "pygit2", ".", "RemoteCallbacks", "(", "credentials", "=", "self", ".", "credentials", ")", "if", ...
Assign attributes for pygit2 callbacks
[ "Assign", "attributes", "for", "pygit2", "callbacks" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L1919-L1940
36,743
saltstack/salt
salt/utils/gitfs.py
GitBase.clear_cache
def clear_cache(self): ''' Completely clear cache ''' errors = [] for rdir in (self.cache_root, self.file_list_cachedir): if os.path.exists(rdir): try: shutil.rmtree(rdir) except OSError as exc: e...
python
def clear_cache(self): ''' Completely clear cache ''' errors = [] for rdir in (self.cache_root, self.file_list_cachedir): if os.path.exists(rdir): try: shutil.rmtree(rdir) except OSError as exc: e...
[ "def", "clear_cache", "(", "self", ")", ":", "errors", "=", "[", "]", "for", "rdir", "in", "(", "self", ".", "cache_root", ",", "self", ".", "file_list_cachedir", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "rdir", ")", ":", "try", ":", ...
Completely clear cache
[ "Completely", "clear", "cache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2312-L2325
36,744
saltstack/salt
salt/utils/gitfs.py
GitBase.clear_lock
def clear_lock(self, remote=None, lock_type='update'): ''' Clear update.lk for all remotes ''' cleared = [] errors = [] for repo in self.remotes: if remote: # Specific remote URL/pattern was passed, ensure that the URL # matches...
python
def clear_lock(self, remote=None, lock_type='update'): ''' Clear update.lk for all remotes ''' cleared = [] errors = [] for repo in self.remotes: if remote: # Specific remote URL/pattern was passed, ensure that the URL # matches...
[ "def", "clear_lock", "(", "self", ",", "remote", "=", "None", ",", "lock_type", "=", "'update'", ")", ":", "cleared", "=", "[", "]", "errors", "=", "[", "]", "for", "repo", "in", "self", ".", "remotes", ":", "if", "remote", ":", "# Specific remote URL/...
Clear update.lk for all remotes
[ "Clear", "update", ".", "lk", "for", "all", "remotes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2327-L2347
36,745
saltstack/salt
salt/utils/gitfs.py
GitBase.fetch_remotes
def fetch_remotes(self, remotes=None): ''' Fetch all remotes and return a boolean to let the calling function know whether or not any remotes were updated in the process of fetching ''' if remotes is None: remotes = [] elif not isinstance(remotes, list): ...
python
def fetch_remotes(self, remotes=None): ''' Fetch all remotes and return a boolean to let the calling function know whether or not any remotes were updated in the process of fetching ''' if remotes is None: remotes = [] elif not isinstance(remotes, list): ...
[ "def", "fetch_remotes", "(", "self", ",", "remotes", "=", "None", ")", ":", "if", "remotes", "is", "None", ":", "remotes", "=", "[", "]", "elif", "not", "isinstance", "(", "remotes", ",", "list", ")", ":", "log", ".", "error", "(", "'Invalid \\'remotes...
Fetch all remotes and return a boolean to let the calling function know whether or not any remotes were updated in the process of fetching
[ "Fetch", "all", "remotes", "and", "return", "a", "boolean", "to", "let", "the", "calling", "function", "know", "whether", "or", "not", "any", "remotes", "were", "updated", "in", "the", "process", "of", "fetching" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2349-L2382
36,746
saltstack/salt
salt/utils/gitfs.py
GitBase.update_intervals
def update_intervals(self): ''' Returns a dictionary mapping remote IDs to their intervals, designed to be used for variable update intervals in salt.master.FileserverUpdate. A remote's ID is defined here as a tuple of the GitPython/Pygit2 object's "id" and "name" attributes, wi...
python
def update_intervals(self): ''' Returns a dictionary mapping remote IDs to their intervals, designed to be used for variable update intervals in salt.master.FileserverUpdate. A remote's ID is defined here as a tuple of the GitPython/Pygit2 object's "id" and "name" attributes, wi...
[ "def", "update_intervals", "(", "self", ")", ":", "return", "{", "(", "repo", ".", "id", ",", "getattr", "(", "repo", ",", "'name'", ",", "None", ")", ")", ":", "repo", ".", "update_interval", "for", "repo", "in", "self", ".", "remotes", "}" ]
Returns a dictionary mapping remote IDs to their intervals, designed to be used for variable update intervals in salt.master.FileserverUpdate. A remote's ID is defined here as a tuple of the GitPython/Pygit2 object's "id" and "name" attributes, with None being assumed as the "name" valu...
[ "Returns", "a", "dictionary", "mapping", "remote", "IDs", "to", "their", "intervals", "designed", "to", "be", "used", "for", "variable", "update", "intervals", "in", "salt", ".", "master", ".", "FileserverUpdate", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2462-L2472
36,747
saltstack/salt
salt/utils/gitfs.py
GitBase.verify_provider
def verify_provider(self): ''' Determine which provider to use ''' if 'verified_{0}_provider'.format(self.role) in self.opts: self.provider = self.opts['verified_{0}_provider'.format(self.role)] else: desired_provider = self.opts.get('{0}_provider'.format(...
python
def verify_provider(self): ''' Determine which provider to use ''' if 'verified_{0}_provider'.format(self.role) in self.opts: self.provider = self.opts['verified_{0}_provider'.format(self.role)] else: desired_provider = self.opts.get('{0}_provider'.format(...
[ "def", "verify_provider", "(", "self", ")", ":", "if", "'verified_{0}_provider'", ".", "format", "(", "self", ".", "role", ")", "in", "self", ".", "opts", ":", "self", ".", "provider", "=", "self", ".", "opts", "[", "'verified_{0}_provider'", ".", "format"...
Determine which provider to use
[ "Determine", "which", "provider", "to", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2474-L2511
36,748
saltstack/salt
salt/utils/gitfs.py
GitBase.write_remote_map
def write_remote_map(self): ''' Write the remote_map.txt ''' remote_map = salt.utils.path.join(self.cache_root, 'remote_map.txt') try: with salt.utils.files.fopen(remote_map, 'w+') as fp_: timestamp = \ datetime.now().strftime('%d %...
python
def write_remote_map(self): ''' Write the remote_map.txt ''' remote_map = salt.utils.path.join(self.cache_root, 'remote_map.txt') try: with salt.utils.files.fopen(remote_map, 'w+') as fp_: timestamp = \ datetime.now().strftime('%d %...
[ "def", "write_remote_map", "(", "self", ")", ":", "remote_map", "=", "salt", ".", "utils", ".", "path", ".", "join", "(", "self", ".", "cache_root", ",", "'remote_map.txt'", ")", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "("...
Write the remote_map.txt
[ "Write", "the", "remote_map", ".", "txt" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2616-L2643
36,749
saltstack/salt
salt/utils/gitfs.py
GitFS.symlink_list
def symlink_list(self, load): ''' Return a dict of all symlinks based on a given path in the repo ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if not salt.utils.stringutils.is_hex(load['saltenv']) \ and lo...
python
def symlink_list(self, load): ''' Return a dict of all symlinks based on a given path in the repo ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if not salt.utils.stringutils.is_hex(load['saltenv']) \ and lo...
[ "def", "symlink_list", "(", "self", ",", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "if", "not", "salt", ".", "utils", ".", "stringutils", ".", "is_hex", "(", "...
Return a dict of all symlinks based on a given path in the repo
[ "Return", "a", "dict", "of", "all", "symlinks", "based", "on", "a", "given", "path", "in", "the", "repo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gitfs.py#L2988-L3006
36,750
saltstack/salt
salt/fileserver/minionfs.py
_is_exposed
def _is_exposed(minion): ''' Check if the minion is exposed, based on the whitelist and blacklist ''' return salt.utils.stringutils.check_whitelist_blacklist( minion, whitelist=__opts__['minionfs_whitelist'], blacklist=__opts__['minionfs_blacklist'] )
python
def _is_exposed(minion): ''' Check if the minion is exposed, based on the whitelist and blacklist ''' return salt.utils.stringutils.check_whitelist_blacklist( minion, whitelist=__opts__['minionfs_whitelist'], blacklist=__opts__['minionfs_blacklist'] )
[ "def", "_is_exposed", "(", "minion", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "check_whitelist_blacklist", "(", "minion", ",", "whitelist", "=", "__opts__", "[", "'minionfs_whitelist'", "]", ",", "blacklist", "=", "__opts__", "[", "'m...
Check if the minion is exposed, based on the whitelist and blacklist
[ "Check", "if", "the", "minion", "is", "exposed", "based", "on", "the", "whitelist", "and", "blacklist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/minionfs.py#L65-L73
36,751
saltstack/salt
salt/modules/trafficserver.py
_subprocess
def _subprocess(cmd): ''' Function to standardize the subprocess call ''' log.debug('Running: "%s"', ' '.join(cmd)) try: proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) ret = salt.utils.stringutils.to_unicode(proc.communicate()[0]).strip() retcode = proc.wait() ...
python
def _subprocess(cmd): ''' Function to standardize the subprocess call ''' log.debug('Running: "%s"', ' '.join(cmd)) try: proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) ret = salt.utils.stringutils.to_unicode(proc.communicate()[0]).strip() retcode = proc.wait() ...
[ "def", "_subprocess", "(", "cmd", ")", ":", "log", ".", "debug", "(", "'Running: \"%s\"'", ",", "' '", ".", "join", "(", "cmd", ")", ")", "try", ":", "proc", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "stdout", "=", "subprocess", ".", "PIPE", ...
Function to standardize the subprocess call
[ "Function", "to", "standardize", "the", "subprocess", "call" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/trafficserver.py#L53-L72
36,752
saltstack/salt
salt/modules/trafficserver.py
match_metric
def match_metric(regex): ''' Display the current values of all metrics whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_metric regex ''' if _TRAFFICCTL: cmd = _traffic_ctl('metric', 'match', regex...
python
def match_metric(regex): ''' Display the current values of all metrics whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_metric regex ''' if _TRAFFICCTL: cmd = _traffic_ctl('metric', 'match', regex...
[ "def", "match_metric", "(", "regex", ")", ":", "if", "_TRAFFICCTL", ":", "cmd", "=", "_traffic_ctl", "(", "'metric'", ",", "'match'", ",", "regex", ")", "else", ":", "cmd", "=", "_traffic_ctl", "(", "'-m'", ",", "regex", ")", "return", "_subprocess", "("...
Display the current values of all metrics whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_metric regex
[ "Display", "the", "current", "values", "of", "all", "metrics", "whose", "names", "match", "the", "given", "regular", "expression", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/trafficserver.py#L200-L216
36,753
saltstack/salt
salt/modules/trafficserver.py
match_config
def match_config(regex): ''' Display the current values of all configuration variables whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_config regex ''' if _TRAFFICCTL: cmd = _traffic_ctl('config'...
python
def match_config(regex): ''' Display the current values of all configuration variables whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_config regex ''' if _TRAFFICCTL: cmd = _traffic_ctl('config'...
[ "def", "match_config", "(", "regex", ")", ":", "if", "_TRAFFICCTL", ":", "cmd", "=", "_traffic_ctl", "(", "'config'", ",", "'match'", ",", "regex", ")", "else", ":", "cmd", "=", "_traffic_line", "(", "'-m'", ",", "regex", ")", "return", "_subprocess", "(...
Display the current values of all configuration variables whose names match the given regular expression. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.match_config regex
[ "Display", "the", "current", "values", "of", "all", "configuration", "variables", "whose", "names", "match", "the", "given", "regular", "expression", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/trafficserver.py#L219-L235
36,754
saltstack/salt
salt/modules/trafficserver.py
read_config
def read_config(*args): ''' Read Traffic Server configuration variable definitions. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.read_config proxy.config.http.keep_alive_post_out ''' ret = {} if _TRAFFICCTL: cmd = _traffic_ctl('config', 'get') ...
python
def read_config(*args): ''' Read Traffic Server configuration variable definitions. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.read_config proxy.config.http.keep_alive_post_out ''' ret = {} if _TRAFFICCTL: cmd = _traffic_ctl('config', 'get') ...
[ "def", "read_config", "(", "*", "args", ")", ":", "ret", "=", "{", "}", "if", "_TRAFFICCTL", ":", "cmd", "=", "_traffic_ctl", "(", "'config'", ",", "'get'", ")", "else", ":", "cmd", "=", "_traffic_line", "(", "'-r'", ")", "try", ":", "for", "arg", ...
Read Traffic Server configuration variable definitions. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.read_config proxy.config.http.keep_alive_post_out
[ "Read", "Traffic", "Server", "configuration", "variable", "definitions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/trafficserver.py#L238-L262
36,755
saltstack/salt
salt/modules/trafficserver.py
set_config
def set_config(variable, value): ''' Set the value of a Traffic Server configuration variable. variable Name of a Traffic Server configuration variable. value The new value to set. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.set_config pro...
python
def set_config(variable, value): ''' Set the value of a Traffic Server configuration variable. variable Name of a Traffic Server configuration variable. value The new value to set. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.set_config pro...
[ "def", "set_config", "(", "variable", ",", "value", ")", ":", "if", "_TRAFFICCTL", ":", "cmd", "=", "_traffic_ctl", "(", "'config'", ",", "'set'", ",", "variable", ",", "value", ")", "else", ":", "cmd", "=", "_traffic_line", "(", "'-s'", ",", "variable",...
Set the value of a Traffic Server configuration variable. variable Name of a Traffic Server configuration variable. value The new value to set. .. versionadded:: 2016.11.0 .. code-block:: bash salt '*' trafficserver.set_config proxy.config.http.keep_alive_post_out 0
[ "Set", "the", "value", "of", "a", "Traffic", "Server", "configuration", "variable", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/trafficserver.py#L292-L315
36,756
saltstack/salt
salt/cloud/libcloudfuncs.py
node_state
def node_state(id_): ''' Libcloud supported node states ''' states_int = { 0: 'RUNNING', 1: 'REBOOTING', 2: 'TERMINATED', 3: 'PENDING', 4: 'UNKNOWN', 5: 'STOPPED', 6: 'SUSPENDED', 7: 'ERROR', 8: 'PAUSED'} states_str = { ...
python
def node_state(id_): ''' Libcloud supported node states ''' states_int = { 0: 'RUNNING', 1: 'REBOOTING', 2: 'TERMINATED', 3: 'PENDING', 4: 'UNKNOWN', 5: 'STOPPED', 6: 'SUSPENDED', 7: 'ERROR', 8: 'PAUSED'} states_str = { ...
[ "def", "node_state", "(", "id_", ")", ":", "states_int", "=", "{", "0", ":", "'RUNNING'", ",", "1", ":", "'REBOOTING'", ",", "2", ":", "'TERMINATED'", ",", "3", ":", "'PENDING'", ",", "4", ":", "'UNKNOWN'", ",", "5", ":", "'STOPPED'", ",", "6", ":"...
Libcloud supported node states
[ "Libcloud", "supported", "node", "states" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L54-L82
36,757
saltstack/salt
salt/cloud/libcloudfuncs.py
check_libcloud_version
def check_libcloud_version(reqver=LIBCLOUD_MINIMAL_VERSION, why=None): ''' Compare different libcloud versions ''' if not HAS_LIBCLOUD: return False if not isinstance(reqver, (list, tuple)): raise RuntimeError( '\'reqver\' needs to passed as a tuple or list, i.e., (0, 14...
python
def check_libcloud_version(reqver=LIBCLOUD_MINIMAL_VERSION, why=None): ''' Compare different libcloud versions ''' if not HAS_LIBCLOUD: return False if not isinstance(reqver, (list, tuple)): raise RuntimeError( '\'reqver\' needs to passed as a tuple or list, i.e., (0, 14...
[ "def", "check_libcloud_version", "(", "reqver", "=", "LIBCLOUD_MINIMAL_VERSION", ",", "why", "=", "None", ")", ":", "if", "not", "HAS_LIBCLOUD", ":", "return", "False", "if", "not", "isinstance", "(", "reqver", ",", "(", "list", ",", "tuple", ")", ")", ":"...
Compare different libcloud versions
[ "Compare", "different", "libcloud", "versions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L85-L115
36,758
saltstack/salt
salt/cloud/libcloudfuncs.py
get_node
def get_node(conn, name): ''' Return a libcloud node for the named VM ''' nodes = conn.list_nodes() for node in nodes: if node.name == name: __utils__['cloud.cache_node'](salt.utils.data.simple_types_filter(node.__dict__), __active_provider_name__, __opts__) return no...
python
def get_node(conn, name): ''' Return a libcloud node for the named VM ''' nodes = conn.list_nodes() for node in nodes: if node.name == name: __utils__['cloud.cache_node'](salt.utils.data.simple_types_filter(node.__dict__), __active_provider_name__, __opts__) return no...
[ "def", "get_node", "(", "conn", ",", "name", ")", ":", "nodes", "=", "conn", ".", "list_nodes", "(", ")", "for", "node", "in", "nodes", ":", "if", "node", ".", "name", "==", "name", ":", "__utils__", "[", "'cloud.cache_node'", "]", "(", "salt", ".", ...
Return a libcloud node for the named VM
[ "Return", "a", "libcloud", "node", "for", "the", "named", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L118-L126
36,759
saltstack/salt
salt/cloud/libcloudfuncs.py
get_location
def get_location(conn, vm_): ''' Return the location object to use ''' locations = conn.list_locations() vm_location = config.get_cloud_config_value('location', vm_, __opts__) if not six.PY3: vm_location = vm_location.encode( 'ascii', 'salt-cloud-force-ascii' ) f...
python
def get_location(conn, vm_): ''' Return the location object to use ''' locations = conn.list_locations() vm_location = config.get_cloud_config_value('location', vm_, __opts__) if not six.PY3: vm_location = vm_location.encode( 'ascii', 'salt-cloud-force-ascii' ) f...
[ "def", "get_location", "(", "conn", ",", "vm_", ")", ":", "locations", "=", "conn", ".", "list_locations", "(", ")", "vm_location", "=", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", ",", "__opts__", ")", "if", "not", "six", ".", ...
Return the location object to use
[ "Return", "the", "location", "object", "to", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L241-L270
36,760
saltstack/salt
salt/cloud/libcloudfuncs.py
reboot
def reboot(name, conn=None): ''' Reboot a single VM ''' if not conn: conn = get_conn() # pylint: disable=E0602 node = get_node(conn, name) if node is None: log.error('Unable to find the VM %s', name) log.info('Rebooting VM: %s', name) ret = conn.reboot_node(node) i...
python
def reboot(name, conn=None): ''' Reboot a single VM ''' if not conn: conn = get_conn() # pylint: disable=E0602 node = get_node(conn, name) if node is None: log.error('Unable to find the VM %s', name) log.info('Rebooting VM: %s', name) ret = conn.reboot_node(node) i...
[ "def", "reboot", "(", "name", ",", "conn", "=", "None", ")", ":", "if", "not", "conn", ":", "conn", "=", "get_conn", "(", ")", "# pylint: disable=E0602", "node", "=", "get_node", "(", "conn", ",", "name", ")", "if", "node", "is", "None", ":", "log", ...
Reboot a single VM
[ "Reboot", "a", "single", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L412-L438
36,761
saltstack/salt
salt/cloud/libcloudfuncs.py
conn_has_method
def conn_has_method(conn, method_name): ''' Find if the provided connection object has a specific method ''' if method_name in dir(conn): return True log.error('Method \'%s\' not yet supported!', method_name) return False
python
def conn_has_method(conn, method_name): ''' Find if the provided connection object has a specific method ''' if method_name in dir(conn): return True log.error('Method \'%s\' not yet supported!', method_name) return False
[ "def", "conn_has_method", "(", "conn", ",", "method_name", ")", ":", "if", "method_name", "in", "dir", "(", "conn", ")", ":", "return", "True", "log", ".", "error", "(", "'Method \\'%s\\' not yet supported!'", ",", "method_name", ")", "return", "False" ]
Find if the provided connection object has a specific method
[ "Find", "if", "the", "provided", "connection", "object", "has", "a", "specific", "method" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/libcloudfuncs.py#L519-L527
36,762
saltstack/salt
salt/modules/influxdbmod.py
db_exists
def db_exists(name, **client_args): ''' Checks if a database exists in InfluxDB. name Name of the database to check. CLI Example: .. code-block:: bash salt '*' influxdb.db_exists <name> ''' if name in [db['name'] for db in list_dbs(**client_args)]: return True ...
python
def db_exists(name, **client_args): ''' Checks if a database exists in InfluxDB. name Name of the database to check. CLI Example: .. code-block:: bash salt '*' influxdb.db_exists <name> ''' if name in [db['name'] for db in list_dbs(**client_args)]: return True ...
[ "def", "db_exists", "(", "name", ",", "*", "*", "client_args", ")", ":", "if", "name", "in", "[", "db", "[", "'name'", "]", "for", "db", "in", "list_dbs", "(", "*", "*", "client_args", ")", "]", ":", "return", "True", "return", "False" ]
Checks if a database exists in InfluxDB. name Name of the database to check. CLI Example: .. code-block:: bash salt '*' influxdb.db_exists <name>
[ "Checks", "if", "a", "database", "exists", "in", "InfluxDB", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L95-L111
36,763
saltstack/salt
salt/modules/influxdbmod.py
create_db
def create_db(name, **client_args): ''' Create a database. name Name of the database to create. CLI Example: .. code-block:: bash salt '*' influxdb.create_db <name> ''' if db_exists(name, **client_args): log.info('DB \'%s\' already exists', name) return Fa...
python
def create_db(name, **client_args): ''' Create a database. name Name of the database to create. CLI Example: .. code-block:: bash salt '*' influxdb.create_db <name> ''' if db_exists(name, **client_args): log.info('DB \'%s\' already exists', name) return Fa...
[ "def", "create_db", "(", "name", ",", "*", "*", "client_args", ")", ":", "if", "db_exists", "(", "name", ",", "*", "*", "client_args", ")", ":", "log", ".", "info", "(", "'DB \\'%s\\' already exists'", ",", "name", ")", "return", "False", "client", "=", ...
Create a database. name Name of the database to create. CLI Example: .. code-block:: bash salt '*' influxdb.create_db <name>
[ "Create", "a", "database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L114-L134
36,764
saltstack/salt
salt/modules/influxdbmod.py
user_info
def user_info(name, **client_args): ''' Get information about given user. name Name of the user for which to get information. CLI Example: .. code-block:: bash salt '*' influxdb.user_info <name> ''' matching_users = (user for user in list_users(**client_args) ...
python
def user_info(name, **client_args): ''' Get information about given user. name Name of the user for which to get information. CLI Example: .. code-block:: bash salt '*' influxdb.user_info <name> ''' matching_users = (user for user in list_users(**client_args) ...
[ "def", "user_info", "(", "name", ",", "*", "*", "client_args", ")", ":", "matching_users", "=", "(", "user", "for", "user", "in", "list_users", "(", "*", "*", "client_args", ")", "if", "user", ".", "get", "(", "'user'", ")", "==", "name", ")", "try",...
Get information about given user. name Name of the user for which to get information. CLI Example: .. code-block:: bash salt '*' influxdb.user_info <name>
[ "Get", "information", "about", "given", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L194-L213
36,765
saltstack/salt
salt/modules/influxdbmod.py
set_user_password
def set_user_password(name, passwd, **client_args): ''' Change password of a user. name Name of the user for whom to set the password. passwd New password of the user. CLI Example: .. code-block:: bash salt '*' influxdb.set_user_password <name> <password> ''' ...
python
def set_user_password(name, passwd, **client_args): ''' Change password of a user. name Name of the user for whom to set the password. passwd New password of the user. CLI Example: .. code-block:: bash salt '*' influxdb.set_user_password <name> <password> ''' ...
[ "def", "set_user_password", "(", "name", ",", "passwd", ",", "*", "*", "client_args", ")", ":", "if", "not", "user_exists", "(", "name", ",", "*", "*", "client_args", ")", ":", "log", ".", "info", "(", "'User \\'%s\\' does not exist'", ",", "name", ")", ...
Change password of a user. name Name of the user for whom to set the password. passwd New password of the user. CLI Example: .. code-block:: bash salt '*' influxdb.set_user_password <name> <password>
[ "Change", "password", "of", "a", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L247-L270
36,766
saltstack/salt
salt/modules/influxdbmod.py
remove_user
def remove_user(name, **client_args): ''' Remove a user. name Name of the user to remove CLI Example: .. code-block:: bash salt '*' influxdb.remove_user <name> ''' if not user_exists(name, **client_args): log.info('User \'%s\' does not exist', name) return...
python
def remove_user(name, **client_args): ''' Remove a user. name Name of the user to remove CLI Example: .. code-block:: bash salt '*' influxdb.remove_user <name> ''' if not user_exists(name, **client_args): log.info('User \'%s\' does not exist', name) return...
[ "def", "remove_user", "(", "name", ",", "*", "*", "client_args", ")", ":", "if", "not", "user_exists", "(", "name", ",", "*", "*", "client_args", ")", ":", "log", ".", "info", "(", "'User \\'%s\\' does not exist'", ",", "name", ")", "return", "False", "c...
Remove a user. name Name of the user to remove CLI Example: .. code-block:: bash salt '*' influxdb.remove_user <name>
[ "Remove", "a", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L311-L331
36,767
saltstack/salt
salt/modules/influxdbmod.py
retention_policy_exists
def retention_policy_exists(database, name, **client_args): ''' Check if retention policy with given name exists. database Name of the database for which the retention policy was defined. name Name of the retention policy to check. CLI Example: .. code-block:: bash ...
python
def retention_policy_exists(database, name, **client_args): ''' Check if retention policy with given name exists. database Name of the database for which the retention policy was defined. name Name of the retention policy to check. CLI Example: .. code-block:: bash ...
[ "def", "retention_policy_exists", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "if", "get_retention_policy", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "return", "True", "return", "False" ]
Check if retention policy with given name exists. database Name of the database for which the retention policy was defined. name Name of the retention policy to check. CLI Example: .. code-block:: bash salt '*' influxdb.retention_policy_exists metrics default
[ "Check", "if", "retention", "policy", "with", "given", "name", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L360-L380
36,768
saltstack/salt
salt/modules/influxdbmod.py
drop_retention_policy
def drop_retention_policy(database, name, **client_args): ''' Drop a retention policy. database Name of the database for which the retention policy will be dropped. name Name of the retention policy to drop. CLI Example: .. code-block:: bash salt '*' influxdb.drop_re...
python
def drop_retention_policy(database, name, **client_args): ''' Drop a retention policy. database Name of the database for which the retention policy will be dropped. name Name of the retention policy to drop. CLI Example: .. code-block:: bash salt '*' influxdb.drop_re...
[ "def", "drop_retention_policy", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "client", ".", "drop_retention_policy", "(", "name", ",", "database", ")", "return", "True" ]
Drop a retention policy. database Name of the database for which the retention policy will be dropped. name Name of the retention policy to drop. CLI Example: .. code-block:: bash salt '*' influxdb.drop_retention_policy mydb mypr
[ "Drop", "a", "retention", "policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L383-L402
36,769
saltstack/salt
salt/modules/influxdbmod.py
create_retention_policy
def create_retention_policy(database, name, duration, replication, default=False, **client_args): ''' Create a retention policy. database Name of the database ...
python
def create_retention_policy(database, name, duration, replication, default=False, **client_args): ''' Create a retention policy. database Name of the database ...
[ "def", "create_retention_policy", "(", "database", ",", "name", ",", "duration", ",", "replication", ",", "default", "=", "False", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "client", ".", "create_r...
Create a retention policy. database Name of the database for which the retention policy will be created. name Name of the new retention policy. duration Duration of the new retention policy. Durations such as 1h, 90m, 12h, 7d, and 4w, are all supported and mean 1 ...
[ "Create", "a", "retention", "policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L405-L447
36,770
saltstack/salt
salt/modules/influxdbmod.py
list_privileges
def list_privileges(name, **client_args): ''' List privileges from a user. name Name of the user from whom privileges will be listed. CLI Example: .. code-block:: bash salt '*' influxdb.list_privileges <name> ''' client = _client(**client_args) res = {} for item ...
python
def list_privileges(name, **client_args): ''' List privileges from a user. name Name of the user from whom privileges will be listed. CLI Example: .. code-block:: bash salt '*' influxdb.list_privileges <name> ''' client = _client(**client_args) res = {} for item ...
[ "def", "list_privileges", "(", "name", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "res", "=", "{", "}", "for", "item", "in", "client", ".", "get_list_privileges", "(", "name", ")", ":", "res", ...
List privileges from a user. name Name of the user from whom privileges will be listed. CLI Example: .. code-block:: bash salt '*' influxdb.list_privileges <name>
[ "List", "privileges", "from", "a", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L495-L513
36,771
saltstack/salt
salt/modules/influxdbmod.py
revoke_privilege
def revoke_privilege(database, privilege, username, **client_args): ''' Revoke a privilege on a database from a user. database Name of the database to grant the privilege on. privilege Privilege to grant. Can be one of 'read', 'write' or 'all'. username Name of the user to...
python
def revoke_privilege(database, privilege, username, **client_args): ''' Revoke a privilege on a database from a user. database Name of the database to grant the privilege on. privilege Privilege to grant. Can be one of 'read', 'write' or 'all'. username Name of the user to...
[ "def", "revoke_privilege", "(", "database", ",", "privilege", ",", "username", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "client", ".", "revoke_privilege", "(", "privilege", ",", "database", ",", "...
Revoke a privilege on a database from a user. database Name of the database to grant the privilege on. privilege Privilege to grant. Can be one of 'read', 'write' or 'all'. username Name of the user to grant the privilege to.
[ "Revoke", "a", "privilege", "on", "a", "database", "from", "a", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L535-L551
36,772
saltstack/salt
salt/modules/influxdbmod.py
continuous_query_exists
def continuous_query_exists(database, name, **client_args): ''' Check if continuous query with given name exists on the database. database Name of the database for which the continuous query was defined. name Name of the continuous query to check. CLI Example: .. code...
python
def continuous_query_exists(database, name, **client_args): ''' Check if continuous query with given name exists on the database. database Name of the database for which the continuous query was defined. name Name of the continuous query to check. CLI Example: .. code...
[ "def", "continuous_query_exists", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "if", "get_continuous_query", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "return", "True", "return", "False" ]
Check if continuous query with given name exists on the database. database Name of the database for which the continuous query was defined. name Name of the continuous query to check. CLI Example: .. code-block:: bash salt '*' influxdb.continuous_query_exists metrics...
[ "Check", "if", "continuous", "query", "with", "given", "name", "exists", "on", "the", "database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L554-L574
36,773
saltstack/salt
salt/modules/influxdbmod.py
get_continuous_query
def get_continuous_query(database, name, **client_args): ''' Get an existing continuous query. database Name of the database for which the continuous query was defined. name Name of the continuous query to get. CLI Example: .. code-block:: bash salt '*' influ...
python
def get_continuous_query(database, name, **client_args): ''' Get an existing continuous query. database Name of the database for which the continuous query was defined. name Name of the continuous query to get. CLI Example: .. code-block:: bash salt '*' influ...
[ "def", "get_continuous_query", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "try", ":", "for", "db", ",", "cqs", "in", "client", ".", "query", "(", "'SHOW CONTINUOUS QU...
Get an existing continuous query. database Name of the database for which the continuous query was defined. name Name of the continuous query to get. CLI Example: .. code-block:: bash salt '*' influxdb.get_continuous_query mydb cq_month
[ "Get", "an", "existing", "continuous", "query", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L577-L602
36,774
saltstack/salt
salt/modules/influxdbmod.py
create_continuous_query
def create_continuous_query(database, name, query, resample_time=None, coverage_period=None, **client_args): ''' Create a continuous query. database Name of the database for which the continuous query will be created on. name Name of the continuous query to create. query ...
python
def create_continuous_query(database, name, query, resample_time=None, coverage_period=None, **client_args): ''' Create a continuous query. database Name of the database for which the continuous query will be created on. name Name of the continuous query to create. query ...
[ "def", "create_continuous_query", "(", "database", ",", "name", ",", "query", ",", "resample_time", "=", "None", ",", "coverage_period", "=", "None", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "full...
Create a continuous query. database Name of the database for which the continuous query will be created on. name Name of the continuous query to create. query The continuous query string. resample_time : None Duration between continuous query resampling. ...
[ "Create", "a", "continuous", "query", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L605-L645
36,775
saltstack/salt
salt/modules/influxdbmod.py
drop_continuous_query
def drop_continuous_query(database, name, **client_args): ''' Drop a continuous query. database Name of the database for which the continuous query will be drop from. name Name of the continuous query to drop. CLI Example: .. code-block:: bash salt '*' influx...
python
def drop_continuous_query(database, name, **client_args): ''' Drop a continuous query. database Name of the database for which the continuous query will be drop from. name Name of the continuous query to drop. CLI Example: .. code-block:: bash salt '*' influx...
[ "def", "drop_continuous_query", "(", "database", ",", "name", ",", "*", "*", "client_args", ")", ":", "client", "=", "_client", "(", "*", "*", "client_args", ")", "query", "=", "'DROP CONTINUOUS QUERY {0} ON {1}'", ".", "format", "(", "name", ",", "database", ...
Drop a continuous query. database Name of the database for which the continuous query will be drop from. name Name of the continuous query to drop. CLI Example: .. code-block:: bash salt '*' influxdb.drop_continuous_query mydb my_cq
[ "Drop", "a", "continuous", "query", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L648-L669
36,776
saltstack/salt
salt/modules/influxdbmod.py
_pull_query_results
def _pull_query_results(resultset): ''' Parses a ResultSet returned from InfluxDB into a dictionary of results, grouped by series names and optional JSON-encoded grouping tags. ''' _results = collections.defaultdict(lambda: {}) for _header, _values in resultset.items(): _header, _group_t...
python
def _pull_query_results(resultset): ''' Parses a ResultSet returned from InfluxDB into a dictionary of results, grouped by series names and optional JSON-encoded grouping tags. ''' _results = collections.defaultdict(lambda: {}) for _header, _values in resultset.items(): _header, _group_t...
[ "def", "_pull_query_results", "(", "resultset", ")", ":", "_results", "=", "collections", ".", "defaultdict", "(", "lambda", ":", "{", "}", ")", "for", "_header", ",", "_values", "in", "resultset", ".", "items", "(", ")", ":", "_header", ",", "_group_tags"...
Parses a ResultSet returned from InfluxDB into a dictionary of results, grouped by series names and optional JSON-encoded grouping tags.
[ "Parses", "a", "ResultSet", "returned", "from", "InfluxDB", "into", "a", "dictionary", "of", "results", "grouped", "by", "series", "names", "and", "optional", "JSON", "-", "encoded", "grouping", "tags", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/influxdbmod.py#L672-L684
36,777
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer._get_recursive_difference
def _get_recursive_difference(self, type): '''Returns the recursive diff between dict values''' if type == 'intersect': return [recursive_diff(item['old'], item['new']) for item in self._intersect] elif type == 'added': return [recursive_diff({}, item) for item in self._a...
python
def _get_recursive_difference(self, type): '''Returns the recursive diff between dict values''' if type == 'intersect': return [recursive_diff(item['old'], item['new']) for item in self._intersect] elif type == 'added': return [recursive_diff({}, item) for item in self._a...
[ "def", "_get_recursive_difference", "(", "self", ",", "type", ")", ":", "if", "type", "==", "'intersect'", ":", "return", "[", "recursive_diff", "(", "item", "[", "'old'", "]", ",", "item", "[", "'new'", "]", ")", "for", "item", "in", "self", ".", "_in...
Returns the recursive diff between dict values
[ "Returns", "the", "recursive", "diff", "between", "dict", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L69-L88
36,778
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.remove_diff
def remove_diff(self, diff_key=None, diff_list='intersect'): '''Deletes an attribute from all of the intersect objects''' if diff_list == 'intersect': for item in self._intersect: item['old'].pop(diff_key, None) item['new'].pop(diff_key, None) if diff_...
python
def remove_diff(self, diff_key=None, diff_list='intersect'): '''Deletes an attribute from all of the intersect objects''' if diff_list == 'intersect': for item in self._intersect: item['old'].pop(diff_key, None) item['new'].pop(diff_key, None) if diff_...
[ "def", "remove_diff", "(", "self", ",", "diff_key", "=", "None", ",", "diff_list", "=", "'intersect'", ")", ":", "if", "diff_list", "==", "'intersect'", ":", "for", "item", "in", "self", ".", "_intersect", ":", "item", "[", "'old'", "]", ".", "pop", "(...
Deletes an attribute from all of the intersect objects
[ "Deletes", "an", "attribute", "from", "all", "of", "the", "intersect", "objects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L105-L113
36,779
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.diffs
def diffs(self): ''' Returns a list of dictionaries with key value pairs. The values are the differences between the items identified by the key. ''' differences = [] for item in self._get_recursive_difference(type='all'): if item.diffs: if ite...
python
def diffs(self): ''' Returns a list of dictionaries with key value pairs. The values are the differences between the items identified by the key. ''' differences = [] for item in self._get_recursive_difference(type='all'): if item.diffs: if ite...
[ "def", "diffs", "(", "self", ")", ":", "differences", "=", "[", "]", "for", "item", "in", "self", ".", "_get_recursive_difference", "(", "type", "=", "'all'", ")", ":", "if", "item", ".", "diffs", ":", "if", "item", ".", "past_dict", ":", "differences"...
Returns a list of dictionaries with key value pairs. The values are the differences between the items identified by the key.
[ "Returns", "a", "list", "of", "dictionaries", "with", "key", "value", "pairs", ".", "The", "values", "are", "the", "differences", "between", "the", "items", "identified", "by", "the", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L116-L128
36,780
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.changes_str
def changes_str(self): '''Returns a string describing the changes''' changes = '' for item in self._get_recursive_difference(type='intersect'): if item.diffs: changes = ''.join([changes, # Tabulate comment deeper, show the key attrib...
python
def changes_str(self): '''Returns a string describing the changes''' changes = '' for item in self._get_recursive_difference(type='intersect'): if item.diffs: changes = ''.join([changes, # Tabulate comment deeper, show the key attrib...
[ "def", "changes_str", "(", "self", ")", ":", "changes", "=", "''", "for", "item", "in", "self", ".", "_get_recursive_difference", "(", "type", "=", "'intersect'", ")", ":", "if", "item", ".", "diffs", ":", "changes", "=", "''", ".", "join", "(", "[", ...
Returns a string describing the changes
[ "Returns", "a", "string", "describing", "the", "changes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L131-L158
36,781
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.changes_str2
def changes_str2(self, tab_string=' '): ''' Returns a string in a more compact format describing the changes. The output better alligns with the one in recursive_diff. ''' changes = [] for item in self._get_recursive_difference(type='intersect'): if item.dif...
python
def changes_str2(self, tab_string=' '): ''' Returns a string in a more compact format describing the changes. The output better alligns with the one in recursive_diff. ''' changes = [] for item in self._get_recursive_difference(type='intersect'): if item.dif...
[ "def", "changes_str2", "(", "self", ",", "tab_string", "=", "' '", ")", ":", "changes", "=", "[", "]", "for", "item", "in", "self", ".", "_get_recursive_difference", "(", "type", "=", "'intersect'", ")", ":", "if", "item", ".", "diffs", ":", "changes", ...
Returns a string in a more compact format describing the changes. The output better alligns with the one in recursive_diff.
[ "Returns", "a", "string", "in", "a", "more", "compact", "format", "describing", "the", "changes", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L161-L185
36,782
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.new_values
def new_values(self): '''Returns the new values from the diff''' def get_new_values_and_key(item): values = item.new_values if item.past_dict: values.update({self._key: item.past_dict[self._key]}) else: # This is a new item as it has no...
python
def new_values(self): '''Returns the new values from the diff''' def get_new_values_and_key(item): values = item.new_values if item.past_dict: values.update({self._key: item.past_dict[self._key]}) else: # This is a new item as it has no...
[ "def", "new_values", "(", "self", ")", ":", "def", "get_new_values_and_key", "(", "item", ")", ":", "values", "=", "item", ".", "new_values", "if", "item", ".", "past_dict", ":", "values", ".", "update", "(", "{", "self", ".", "_key", ":", "item", ".",...
Returns the new values from the diff
[ "Returns", "the", "new", "values", "from", "the", "diff" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L188-L201
36,783
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.old_values
def old_values(self): '''Returns the old values from the diff''' def get_old_values_and_key(item): values = item.old_values values.update({self._key: item.past_dict[self._key]}) return values return [get_old_values_and_key(el) for el in self._...
python
def old_values(self): '''Returns the old values from the diff''' def get_old_values_and_key(item): values = item.old_values values.update({self._key: item.past_dict[self._key]}) return values return [get_old_values_and_key(el) for el in self._...
[ "def", "old_values", "(", "self", ")", ":", "def", "get_old_values_and_key", "(", "item", ")", ":", "values", "=", "item", ".", "old_values", "values", ".", "update", "(", "{", "self", ".", "_key", ":", "item", ".", "past_dict", "[", "self", ".", "_key...
Returns the old values from the diff
[ "Returns", "the", "old", "values", "from", "the", "diff" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L204-L213
36,784
saltstack/salt
salt/utils/listdiffer.py
ListDictDiffer.changed
def changed(self, selection='all'): ''' Returns the list of changed values. The key is added to each item. selection Specifies the desired changes. Supported values are ``all`` - all changed items are included in the output ``inter...
python
def changed(self, selection='all'): ''' Returns the list of changed values. The key is added to each item. selection Specifies the desired changes. Supported values are ``all`` - all changed items are included in the output ``inter...
[ "def", "changed", "(", "self", ",", "selection", "=", "'all'", ")", ":", "changed", "=", "[", "]", "if", "selection", "==", "'all'", ":", "for", "recursive_item", "in", "self", ".", "_get_recursive_difference", "(", "type", "=", "'all'", ")", ":", "# We ...
Returns the list of changed values. The key is added to each item. selection Specifies the desired changes. Supported values are ``all`` - all changed items are included in the output ``intersect`` - changed items present in both lists are include...
[ "Returns", "the", "list", "of", "changed", "values", ".", "The", "key", "is", "added", "to", "each", "item", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/listdiffer.py#L215-L250
36,785
saltstack/salt
salt/modules/win_file.py
_resolve_symlink
def _resolve_symlink(path, max_depth=64): ''' Resolves the given symlink path to its real path, up to a maximum of the `max_depth` parameter which defaults to 64. If the path is not a symlink path, it is simply returned. ''' if sys.getwindowsversion().major < 6: raise SaltInvocationErro...
python
def _resolve_symlink(path, max_depth=64): ''' Resolves the given symlink path to its real path, up to a maximum of the `max_depth` parameter which defaults to 64. If the path is not a symlink path, it is simply returned. ''' if sys.getwindowsversion().major < 6: raise SaltInvocationErro...
[ "def", "_resolve_symlink", "(", "path", ",", "max_depth", "=", "64", ")", ":", "if", "sys", ".", "getwindowsversion", "(", ")", ".", "major", "<", "6", ":", "raise", "SaltInvocationError", "(", "'Symlinks are only supported on Windows Vista or later.'", ")", "# ma...
Resolves the given symlink path to its real path, up to a maximum of the `max_depth` parameter which defaults to 64. If the path is not a symlink path, it is simply returned.
[ "Resolves", "the", "given", "symlink", "path", "to", "its", "real", "path", "up", "to", "a", "maximum", "of", "the", "max_depth", "parameter", "which", "defaults", "to", "64", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L214-L236
36,786
saltstack/salt
salt/modules/win_file.py
get_user
def get_user(path, follow_symlinks=True): ''' Return the user that owns a given file Symlinks are followed by default to mimic Unix behavior. Specify `follow_symlinks=False` to turn off this behavior. Args: path (str): The path to the file or directory follow_symlinks (bool): ...
python
def get_user(path, follow_symlinks=True): ''' Return the user that owns a given file Symlinks are followed by default to mimic Unix behavior. Specify `follow_symlinks=False` to turn off this behavior. Args: path (str): The path to the file or directory follow_symlinks (bool): ...
[ "def", "get_user", "(", "path", ",", "follow_symlinks", "=", "True", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "raise", "CommandExecutionError", "(", "'Path not found: {0}'", ".", "format", "(", "path", ")", ")", "# ...
Return the user that owns a given file Symlinks are followed by default to mimic Unix behavior. Specify `follow_symlinks=False` to turn off this behavior. Args: path (str): The path to the file or directory follow_symlinks (bool): If the object specified by ``path`` is a symli...
[ "Return", "the", "user", "that", "owns", "a", "given", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L555-L591
36,787
saltstack/salt
salt/modules/win_file.py
lchown
def lchown(path, user, group=None, pgroup=None): ''' Chown a file, pass the file the desired user and group without following any symlinks. Under Windows, the group parameter will be ignored. This is because while files in Windows do have a 'primary group' property, this is rarely used. It ge...
python
def lchown(path, user, group=None, pgroup=None): ''' Chown a file, pass the file the desired user and group without following any symlinks. Under Windows, the group parameter will be ignored. This is because while files in Windows do have a 'primary group' property, this is rarely used. It ge...
[ "def", "lchown", "(", "path", ",", "user", ",", "group", "=", "None", ",", "pgroup", "=", "None", ")", ":", "if", "group", ":", "func_name", "=", "'{0}.lchown'", ".", "format", "(", "__virtualname__", ")", "if", "__opts__", ".", "get", "(", "'fun'", ...
Chown a file, pass the file the desired user and group without following any symlinks. Under Windows, the group parameter will be ignored. This is because while files in Windows do have a 'primary group' property, this is rarely used. It generally has no bearing on permissions unless intentionall...
[ "Chown", "a", "file", "pass", "the", "file", "the", "desired", "user", "and", "group", "without", "following", "any", "symlinks", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L625-L671
36,788
saltstack/salt
salt/modules/win_file.py
stats
def stats(path, hash_type='sha256', follow_symlinks=True): ''' Return a dict containing the stats about a given file Under Windows, `gid` will equal `uid` and `group` will equal `user`. While a file in Windows does have a 'primary group', this rarely used attribute generally has no bearing on perm...
python
def stats(path, hash_type='sha256', follow_symlinks=True): ''' Return a dict containing the stats about a given file Under Windows, `gid` will equal `uid` and `group` will equal `user`. While a file in Windows does have a 'primary group', this rarely used attribute generally has no bearing on perm...
[ "def", "stats", "(", "path", ",", "hash_type", "=", "'sha256'", ",", "follow_symlinks", "=", "True", ")", ":", "# This is to mirror the behavior of file.py. `check_file_meta` expects an", "# empty dictionary when the file does not exist", "if", "not", "os", ".", "path", "."...
Return a dict containing the stats about a given file Under Windows, `gid` will equal `uid` and `group` will equal `user`. While a file in Windows does have a 'primary group', this rarely used attribute generally has no bearing on permissions unless intentionally configured and is only used to support...
[ "Return", "a", "dict", "containing", "the", "stats", "about", "a", "given", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L802-L876
36,789
saltstack/salt
salt/modules/win_file.py
get_attributes
def get_attributes(path): ''' Return a dictionary object with the Windows file attributes for a file. Args: path (str): The path to the file or directory Returns: dict: A dictionary of file attributes CLI Example: .. code-block:: bash salt '*' file.get_attributes...
python
def get_attributes(path): ''' Return a dictionary object with the Windows file attributes for a file. Args: path (str): The path to the file or directory Returns: dict: A dictionary of file attributes CLI Example: .. code-block:: bash salt '*' file.get_attributes...
[ "def", "get_attributes", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "raise", "CommandExecutionError", "(", "'Path not found: {0}'", ".", "format", "(", "path", ")", ")", "# set up dictionary for attribute values"...
Return a dictionary object with the Windows file attributes for a file. Args: path (str): The path to the file or directory Returns: dict: A dictionary of file attributes CLI Example: .. code-block:: bash salt '*' file.get_attributes c:\\temp\\a.txt
[ "Return", "a", "dictionary", "object", "with", "the", "Windows", "file", "attributes", "for", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L879-L939
36,790
saltstack/salt
salt/modules/win_file.py
set_attributes
def set_attributes(path, archive=None, hidden=None, normal=None, notIndexed=None, readonly=None, system=None, temporary=None): ''' Set file attributes for a file. Note that the normal attribute means that all others are false. So setting it will clear all others. Args: path...
python
def set_attributes(path, archive=None, hidden=None, normal=None, notIndexed=None, readonly=None, system=None, temporary=None): ''' Set file attributes for a file. Note that the normal attribute means that all others are false. So setting it will clear all others. Args: path...
[ "def", "set_attributes", "(", "path", ",", "archive", "=", "None", ",", "hidden", "=", "None", ",", "normal", "=", "None", ",", "notIndexed", "=", "None", ",", "readonly", "=", "None", ",", "system", "=", "None", ",", "temporary", "=", "None", ")", "...
Set file attributes for a file. Note that the normal attribute means that all others are false. So setting it will clear all others. Args: path (str): The path to the file or directory archive (bool): Sets the archive attribute. Default is None hidden (bool): Sets the hidden attribute...
[ "Set", "file", "attributes", "for", "a", "file", ".", "Note", "that", "the", "normal", "attribute", "means", "that", "all", "others", "are", "false", ".", "So", "setting", "it", "will", "clear", "all", "others", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L942-L1016
36,791
saltstack/salt
salt/modules/win_file.py
remove
def remove(path, force=False): ''' Remove the named file or directory Args: path (str): The path to the file or directory to remove. force (bool): Remove even if marked Read-Only. Default is False Returns: bool: True if successful, False if unsuccessful CLI Example: ....
python
def remove(path, force=False): ''' Remove the named file or directory Args: path (str): The path to the file or directory to remove. force (bool): Remove even if marked Read-Only. Default is False Returns: bool: True if successful, False if unsuccessful CLI Example: ....
[ "def", "remove", "(", "path", ",", "force", "=", "False", ")", ":", "# This must be a recursive function in windows to properly deal with", "# Symlinks. The shutil.rmtree function will remove the contents of", "# the Symlink source in windows.", "path", "=", "os", ".", "path", "....
Remove the named file or directory Args: path (str): The path to the file or directory to remove. force (bool): Remove even if marked Read-Only. Default is False Returns: bool: True if successful, False if unsuccessful CLI Example: .. code-block:: bash salt '*' file....
[ "Remove", "the", "named", "file", "or", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1048-L1107
36,792
saltstack/salt
salt/modules/win_file.py
symlink
def symlink(src, link): ''' Create a symbolic link to a file This is only supported with Windows Vista or later and must be executed by a user with the SeCreateSymbolicLink privilege. The behavior of this function matches the Unix equivalent, with one exception - invalid symlinks cannot be cre...
python
def symlink(src, link): ''' Create a symbolic link to a file This is only supported with Windows Vista or later and must be executed by a user with the SeCreateSymbolicLink privilege. The behavior of this function matches the Unix equivalent, with one exception - invalid symlinks cannot be cre...
[ "def", "symlink", "(", "src", ",", "link", ")", ":", "# When Python 3.2 or later becomes the minimum version, this function can be", "# replaced with the built-in os.symlink function, which supports Windows.", "if", "sys", ".", "getwindowsversion", "(", ")", ".", "major", "<", ...
Create a symbolic link to a file This is only supported with Windows Vista or later and must be executed by a user with the SeCreateSymbolicLink privilege. The behavior of this function matches the Unix equivalent, with one exception - invalid symlinks cannot be created. The source path must exist. ...
[ "Create", "a", "symbolic", "link", "to", "a", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1110-L1161
36,793
saltstack/salt
salt/modules/win_file.py
is_link
def is_link(path): ''' Check if the path is a symlink This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: path (s...
python
def is_link(path): ''' Check if the path is a symlink This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: path (s...
[ "def", "is_link", "(", "path", ")", ":", "if", "sys", ".", "getwindowsversion", "(", ")", ".", "major", "<", "6", ":", "raise", "SaltInvocationError", "(", "'Symlinks are only supported on Windows Vista or later.'", ")", "try", ":", "return", "salt", ".", "utils...
Check if the path is a symlink This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: path (str): The path to a file or dire...
[ "Check", "if", "the", "path", "is", "a", "symlink" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1164-L1192
36,794
saltstack/salt
salt/modules/win_file.py
readlink
def readlink(path): ''' Return the path that a symlink points to This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: ...
python
def readlink(path): ''' Return the path that a symlink points to This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: ...
[ "def", "readlink", "(", "path", ")", ":", "if", "sys", ".", "getwindowsversion", "(", ")", ".", "major", "<", "6", ":", "raise", "SaltInvocationError", "(", "'Symlinks are only supported on Windows Vista or later.'", ")", "try", ":", "return", "salt", ".", "util...
Return the path that a symlink points to This is only supported on Windows Vista or later. Inline with Unix behavior, this function will raise an error if the path is not a symlink, however, the error raised will be a SaltInvocationError, not an OSError. Args: path (str): The path to the ...
[ "Return", "the", "path", "that", "a", "symlink", "points", "to" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1195-L1227
36,795
saltstack/salt
salt/modules/win_file.py
mkdir
def mkdir(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Ensure that the directory is available and permissions are set. Args: path (str): The full path to the directory. owner (str): ...
python
def mkdir(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Ensure that the directory is available and permissions are set. Args: path (str): The full path to the directory. owner (str): ...
[ "def", "mkdir", "(", "path", ",", "owner", "=", "None", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "False", ")", ":", "# Make sure the drive is valid", "drive", "=", "os", ".", "pa...
Ensure that the directory is available and permissions are set. Args: path (str): The full path to the directory. owner (str): The owner of the directory. If not passed, it will be the account that created the directory, likely SYSTEM grant_perms (dict...
[ "Ensure", "that", "the", "directory", "is", "available", "and", "permissions", "are", "set", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1230-L1332
36,796
saltstack/salt
salt/modules/win_file.py
makedirs_
def makedirs_(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Ensure that the parent directory containing this path is available. Args: path (str): The full path to the direct...
python
def makedirs_(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Ensure that the parent directory containing this path is available. Args: path (str): The full path to the direct...
[ "def", "makedirs_", "(", "path", ",", "owner", "=", "None", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "False", ")", ":", "path", "=", "os", ".", "path", ".", "expanduser", "("...
Ensure that the parent directory containing this path is available. Args: path (str): The full path to the directory. .. note:: The path must end with a trailing slash otherwise the directory(s) will be created up to the parent directory. For ...
[ "Ensure", "that", "the", "parent", "directory", "containing", "this", "path", "is", "available", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1335-L1463
36,797
saltstack/salt
salt/modules/win_file.py
makedirs_perms
def makedirs_perms(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=True): ''' Set owner and permissions for each directory created. Args: path (str): The full pat...
python
def makedirs_perms(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=True): ''' Set owner and permissions for each directory created. Args: path (str): The full pat...
[ "def", "makedirs_perms", "(", "path", ",", "owner", "=", "None", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "True", ")", ":", "# Expand any environment variables", "path", "=", "os", ...
Set owner and permissions for each directory created. Args: path (str): The full path to the directory. owner (str): The owner of the directory. If not passed, it will be the account that created the directory, likely SYSTEM. grant_perms (dict): ...
[ "Set", "owner", "and", "permissions", "for", "each", "directory", "created", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1466-L1576
36,798
saltstack/salt
salt/modules/win_file.py
check_perms
def check_perms(path, ret=None, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Check owner and permissions for the passed directory. This function checks the permissions and se...
python
def check_perms(path, ret=None, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Check owner and permissions for the passed directory. This function checks the permissions and se...
[ "def", "check_perms", "(", "path", ",", "ret", "=", "None", ",", "owner", "=", "None", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "False", ")", ":", "if", "not", "os", ".", "...
Check owner and permissions for the passed directory. This function checks the permissions and sets them, returning the changes made. Used by the file state to populate the return dict Args: path (str): The full path to the directory. ret (dict): A dictionary to ap...
[ "Check", "owner", "and", "permissions", "for", "the", "passed", "directory", ".", "This", "function", "checks", "the", "permissions", "and", "sets", "them", "returning", "the", "changes", "made", ".", "Used", "by", "the", "file", "state", "to", "populate", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_file.py#L1579-L1649
36,799
saltstack/salt
salt/beacons/haproxy.py
beacon
def beacon(config): ''' Check if current number of sessions of a server for a specific haproxy backend is over a defined threshold. .. code-block:: yaml beacons: haproxy: - backends: www-backend: threshold: 45 server...
python
def beacon(config): ''' Check if current number of sessions of a server for a specific haproxy backend is over a defined threshold. .. code-block:: yaml beacons: haproxy: - backends: www-backend: threshold: 45 server...
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "for", "backend", "in", "_config", ".", "get", "(", "'backends'", ",", "(", ")",...
Check if current number of sessions of a server for a specific haproxy backend is over a defined threshold. .. code-block:: yaml beacons: haproxy: - backends: www-backend: threshold: 45 servers: - web1 ...
[ "Check", "if", "current", "number", "of", "sessions", "of", "a", "server", "for", "a", "specific", "haproxy", "backend", "is", "over", "a", "defined", "threshold", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/haproxy.py#L62-L101