partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
_fingerprint
Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None public_key The public key to return the fingerprint for...
salt/modules/ssh.py
def _fingerprint(public_key, fingerprint_hash_type): ''' Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None ...
def _fingerprint(public_key, fingerprint_hash_type): ''' Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None ...
[ "Return", "a", "public", "key", "fingerprint", "based", "on", "its", "base64", "-", "encoded", "representation" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L242-L287
[ "def", "_fingerprint", "(", "public_key", ",", "fingerprint_hash_type", ")", ":", "if", "fingerprint_hash_type", ":", "hash_type", "=", "fingerprint_hash_type", ".", "lower", "(", ")", "else", ":", "hash_type", "=", "'sha256'", "try", ":", "hash_func", "=", "get...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
host_keys
Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/etc/ssh certs=False
salt/modules/ssh.py
def host_keys(keydir=None, private=True, certs=True): ''' Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/e...
def host_keys(keydir=None, private=True, certs=True): ''' Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/e...
[ "Return", "the", "minion", "s", "host", "keys" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L314-L370
[ "def", "host_keys", "(", "keydir", "=", "None", ",", "private", "=", "True", ",", "certs", "=", "True", ")", ":", "# TODO: support parsing sshd_config for the key directory", "if", "not", "keydir", ":", "if", "__grains__", "[", "'kernel'", "]", "==", "'Linux'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auth_keys
Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root salt '*' ssh.auth_keys user="[user1, user2]"
salt/modules/ssh.py
def auth_keys(user=None, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root ...
def auth_keys(user=None, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root ...
[ "Return", "the", "authorized", "keys", "for", "users" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L373-L413
[ "def", "auth_keys", "(", "user", "=", "None", ",", "config", "=", "'.ssh/authorized_keys'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if", "not", "user", ":", "user", "=", "__salt__", "[", "'user.list_users'", "]", "(", ")", "old_output_when_one_us...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_key_file
Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: .. code-block:: bash salt '*' ssh.check_key_file root salt://ssh/keyfile
salt/modules/ssh.py
def check_key_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: ....
def check_key_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: ....
[ "Check", "a", "keyfile", "from", "a", "source", "destination", "against", "the", "local", "keys", "and", "return", "the", "keys", "to", "change" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L416-L452
[ "def", "check_key_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "keyfile", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_key
Check to see if a key needs updating, returns "update", "add" or "exists" CLI Example: .. code-block:: bash salt '*' ssh.check_key <user> <key> <enc> <comment> <options>
salt/modules/ssh.py
def check_key(user, key, enc, comment, options, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Check to see if a key needs updating, returns "update", "add" or "exists" CLI Ex...
def check_key(user, key, enc, comment, options, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Check to see if a key needs updating, returns "update", "add" or "exists" CLI Ex...
[ "Check", "to", "see", "if", "a", "key", "needs", "updating", "returns", "update", "add", "or", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L455-L502
[ "def", "check_key", "(", "user", ",", "key", ",", "enc", ",", "comment", ",", "options", ",", "config", "=", "'.ssh/authorized_keys'", ",", "cache_keys", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if", "cache_keys", "is", "None", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_auth_key_from_file
Remove an authorized key from the specified user's authorized key file, using a file as source CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key_from_file <user> salt://ssh_keys/<user>.id_rsa.pub
salt/modules/ssh.py
def rm_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file, using a file...
def rm_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file, using a file...
[ "Remove", "an", "authorized", "key", "from", "the", "specified", "user", "s", "authorized", "key", "file", "using", "a", "file", "as", "source" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L505-L554
[ "def", "rm_auth_key_from_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "lfile", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_auth_key
Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key>
salt/modules/ssh.py
def rm_auth_key(user, key, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key> ''' ...
def rm_auth_key(user, key, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key> ''' ...
[ "Remove", "an", "authorized", "key", "from", "the", "specified", "user", "s", "authorized", "key", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L557-L631
[ "def", "rm_auth_key", "(", "user", ",", "key", ",", "config", "=", "'.ssh/authorized_keys'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "current", "=", "auth_keys", "(", "user", ",", "config", "=", "config", ",", "fingerprint_hash_type", "=", "finger...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_auth_key_from_file
Add a key to the authorized_keys file, using a file as the source. CLI Example: .. code-block:: bash salt '*' ssh.set_auth_key_from_file <user> salt://ssh_keys/<user>.id_rsa.pub
salt/modules/ssh.py
def set_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Add a key to the authorized_keys file, using a file as the source. CLI Example...
def set_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Add a key to the authorized_keys file, using a file as the source. CLI Example...
[ "Add", "a", "key", "to", "the", "authorized_keys", "file", "using", "a", "file", "as", "the", "source", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L634-L689
[ "def", "set_auth_key_from_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "# TODO: add support for pulling keys from other file sources as well", "lfile", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_auth_key
Add a key to the authorized_keys file. The "key" parameter must only be the string of text that is the encoded key. If the key begins with "ssh-rsa" or ends with user@host, remove those from the key before passing it to this function. CLI Example: .. code-block:: bash salt '*' ssh.set_aut...
salt/modules/ssh.py
def set_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Add a key to the authorized_keys file. The "key" parameter must only be the string of text th...
def set_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Add a key to the authorized_keys file. The "key" parameter must only be the string of text th...
[ "Add", "a", "key", "to", "the", "authorized_keys", "file", ".", "The", "key", "parameter", "must", "only", "be", "the", "string", "of", "text", "that", "is", "the", "encoded", "key", ".", "If", "the", "key", "begins", "with", "ssh", "-", "rsa", "or", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L692-L796
[ "def", "set_auth_key", "(", "user", ",", "key", ",", "enc", "=", "'ssh-rsa'", ",", "comment", "=", "''", ",", "options", "=", "None", ",", "config", "=", "'.ssh/authorized_keys'", ",", "cache_keys", "=", "None", ",", "fingerprint_hash_type", "=", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_matched_host_line_numbers
Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one.
salt/modules/ssh.py
def _get_matched_host_line_numbers(lines, enc): ''' Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one. ''' enc = enc if enc else "rsa" for i, line in enumerate(lines): if i % 2 == ...
def _get_matched_host_line_numbers(lines, enc): ''' Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one. ''' enc = enc if enc else "rsa" for i, line in enumerate(lines): if i % 2 == ...
[ "Helper", "function", "which", "parses", "ssh", "-", "keygen", "-", "F", "function", "output", "and", "yield", "line", "number", "of", "known_hosts", "entries", "with", "encryption", "key", "type", "matching", "enc", "one", "by", "one", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L799-L812
[ "def", "_get_matched_host_line_numbers", "(", "lines", ",", "enc", ")", ":", "enc", "=", "enc", "if", "enc", "else", "\"rsa\"", "for", "i", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "i", "%", "2", "==", "0", ":", "line_no", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_openssh_output
Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one.
salt/modules/ssh.py
def _parse_openssh_output(lines, fingerprint_hash_type=None): ''' Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one. ''' for line in lines: # We don't need any whitespace-only containing lines or arbitrary doubled newl...
def _parse_openssh_output(lines, fingerprint_hash_type=None): ''' Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one. ''' for line in lines: # We don't need any whitespace-only containing lines or arbitrary doubled newl...
[ "Helper", "function", "which", "parses", "ssh", "-", "keygen", "-", "F", "and", "ssh", "-", "keyscan", "function", "output", "and", "yield", "dict", "with", "keys", "information", "one", "by", "one", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L815-L838
[ "def", "_parse_openssh_output", "(", "lines", ",", "fingerprint_hash_type", "=", "None", ")", ":", "for", "line", "in", "lines", ":", "# We don't need any whitespace-only containing lines or arbitrary doubled newlines", "line", "=", "line", ".", "strip", "(", ")", "if",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_known_host_entries
.. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any. If there are no entries for a matching hostname, return None. CLI Example: .. code-block:: bash salt '*' ssh.get_known_host_entries <user> <hostname>
salt/modules/ssh.py
def get_known_host_entries(user, hostname, config=None, port=None, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any....
def get_known_host_entries(user, hostname, config=None, port=None, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any....
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L842-L873
[ "def", "get_known_host_entries", "(", "user", ",", "hostname", ",", "config", "=", "None", ",", "port", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "full", "=", "_get_known_hosts_file", "(", "config", "=", "config", ",", "user", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
recv_known_host_entries
.. versionadded:: 2018.3.0 Retrieve information about host public keys from remote server hostname The name of the remote host (e.g. "github.com") enc Defines what type of key is being used, can be ed25519, ecdsa ssh-rsa or ssh-dss port Optional parameter, denoting th...
salt/modules/ssh.py
def recv_known_host_entries(hostname, enc=None, port=None, hash_known_hosts=True, timeout=5, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Retrieve infor...
def recv_known_host_entries(hostname, enc=None, port=None, hash_known_hosts=True, timeout=5, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Retrieve infor...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L877-L963
[ "def", "recv_known_host_entries", "(", "hostname", ",", "enc", "=", "None", ",", "port", "=", "None", ",", "hash_known_hosts", "=", "True", ",", "timeout", "=", "5", ",", "fingerprint_hash_type", "=", "None", ")", ":", "# The following list of OSes have an old ver...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_known_host
Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up both). If provided key or fingerprint doesn't match with stored value, return "update", if no value is found for a given host, return "add", otherwise ...
salt/modules/ssh.py
def check_known_host(user=None, hostname=None, key=None, fingerprint=None, config=None, port=None, fingerprint_hash_type=None): ''' Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up ...
def check_known_host(user=None, hostname=None, key=None, fingerprint=None, config=None, port=None, fingerprint_hash_type=None): ''' Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up ...
[ "Check", "the", "record", "in", "known_hosts", "file", "either", "by", "its", "value", "or", "by", "fingerprint", "(", "it", "s", "enough", "to", "set", "up", "either", "key", "or", "fingerprint", "you", "don", "t", "need", "to", "set", "up", "both", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L966-L1010
[ "def", "check_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "key", "=", "None", ",", "fingerprint", "=", "None", ",", "config", "=", "None", ",", "port", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_known_host
Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname>
salt/modules/ssh.py
def rm_known_host(user=None, hostname=None, config=None, port=None): ''' Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname> ''' if not hostname: return {'status': 'error', ...
def rm_known_host(user=None, hostname=None, config=None, port=None): ''' Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname> ''' if not hostname: return {'status': 'error', ...
[ "Remove", "all", "keys", "belonging", "to", "hostname", "from", "a", "known_hosts", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L1013-L1044
[ "def", "rm_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "config", "=", "None", ",", "port", "=", "None", ")", ":", "if", "not", "hostname", ":", "return", "{", "'status'", ":", "'error'", ",", "'error'", ":", "'hostname arg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_known_host
Download SSH public key from remote host "hostname", optionally validate its fingerprint against "fingerprint" variable and save the record in the known_hosts file. If such a record does already exists in there, do nothing. user The user who owns the ssh authorized keys file to modify hos...
salt/modules/ssh.py
def set_known_host(user=None, hostname=None, fingerprint=None, key=None, port=None, enc=None, config=None, hash_known_hosts=True, timeout=5, fingerpr...
def set_known_host(user=None, hostname=None, fingerprint=None, key=None, port=None, enc=None, config=None, hash_known_hosts=True, timeout=5, fingerpr...
[ "Download", "SSH", "public", "key", "from", "remote", "host", "hostname", "optionally", "validate", "its", "fingerprint", "against", "fingerprint", "variable", "and", "save", "the", "record", "in", "the", "known_hosts", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L1047-L1260
[ "def", "set_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "fingerprint", "=", "None", ",", "key", "=", "None", ",", "port", "=", "None", ",", "enc", "=", "None", ",", "config", "=", "None", ",", "hash_known_hosts", "=", "T...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_option
Look up the value for an option.
salt/utils/boto3mod.py
def _option(value): ''' Look up the value for an option. ''' if value in __opts__: return __opts__[value] master_opts = __pillar__.get('master', {}) if value in master_opts: return master_opts[value] if value in __pillar__: return __pillar__[value]
def _option(value): ''' Look up the value for an option. ''' if value in __opts__: return __opts__[value] master_opts = __pillar__.get('master', {}) if value in master_opts: return master_opts[value] if value in __pillar__: return __pillar__[value]
[ "Look", "up", "the", "value", "for", "an", "option", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L83-L93
[ "def", "_option", "(", "value", ")", ":", "if", "value", "in", "__opts__", ":", "return", "__opts__", "[", "value", "]", "master_opts", "=", "__pillar__", ".", "get", "(", "'master'", ",", "{", "}", ")", "if", "value", "in", "master_opts", ":", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_connection
Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile')
salt/utils/boto3mod.py
def get_connection(service, module=None, region=None, key=None, keyid=None, profile=None): ''' Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile') ''' module = module or service c...
def get_connection(service, module=None, region=None, key=None, keyid=None, profile=None): ''' Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile') ''' module = module or service c...
[ "Return", "a", "boto", "connection", "for", "the", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L181-L216
[ "def", "get_connection", "(", "service", ",", "module", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "module", "=", "module", "or", "service", "cxkey", ",", "regio...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_region
Retrieve the region for a particular AWS service based on configured region and/or profile.
salt/utils/boto3mod.py
def get_region(service, region, profile): """ Retrieve the region for a particular AWS service based on configured region and/or profile. """ _, region, _, _ = _get_profile(service, region, None, None, profile) return region
def get_region(service, region, profile): """ Retrieve the region for a particular AWS service based on configured region and/or profile. """ _, region, _, _ = _get_profile(service, region, None, None, profile) return region
[ "Retrieve", "the", "region", "for", "a", "particular", "AWS", "service", "based", "on", "configured", "region", "and", "/", "or", "profile", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L231-L237
[ "def", "get_region", "(", "service", ",", "region", ",", "profile", ")", ":", "_", ",", "region", ",", "_", ",", "_", "=", "_get_profile", "(", "service", ",", "region", ",", "None", ",", "None", ",", "profile", ")", "return", "region" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
assign_funcs
Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partials'](__name__, 'ec2')
salt/utils/boto3mod.py
def assign_funcs(modname, service, module=None, get_conn_funcname='_get_conn', cache_id_funcname='_cache_id', exactly_one_funcname='_exactly_one'): ''' Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partial...
def assign_funcs(modname, service, module=None, get_conn_funcname='_get_conn', cache_id_funcname='_cache_id', exactly_one_funcname='_exactly_one'): ''' Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partial...
[ "Assign", "_get_conn", "and", "_cache_id", "functions", "to", "the", "named", "module", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L284-L301
[ "def", "assign_funcs", "(", "modname", ",", "service", ",", "module", "=", "None", ",", "get_conn_funcname", "=", "'_get_conn'", ",", "cache_id_funcname", "=", "'_cache_id'", ",", "exactly_one_funcname", "=", "'_exactly_one'", ")", ":", "mod", "=", "sys", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
paged_call
Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained.
salt/utils/boto3mod.py
def paged_call(function, *args, **kwargs): """Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained. """ marker_flag = kwargs.pop('marker_flag', 'NextMarker') marker_arg = kwargs.pop('marker_arg', 'Marker') while True: ret =...
def paged_call(function, *args, **kwargs): """Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained. """ marker_flag = kwargs.pop('marker_flag', 'NextMarker') marker_arg = kwargs.pop('marker_arg', 'Marker') while True: ret =...
[ "Retrieve", "full", "set", "of", "values", "from", "a", "boto3", "API", "call", "that", "may", "truncate", "its", "results", "yielding", "each", "page", "as", "it", "is", "obtained", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L304-L316
[ "def", "paged_call", "(", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "marker_flag", "=", "kwargs", ".", "pop", "(", "'marker_flag'", ",", "'NextMarker'", ")", "marker_arg", "=", "kwargs", ".", "pop", "(", "'marker_arg'", ",", "'Mark...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_normalize_dir
Normalize the directory to make comparison possible
salt/modules/win_path.py
def _normalize_dir(string_): ''' Normalize the directory to make comparison possible ''' return os.path.normpath(salt.utils.stringutils.to_unicode(string_))
def _normalize_dir(string_): ''' Normalize the directory to make comparison possible ''' return os.path.normpath(salt.utils.stringutils.to_unicode(string_))
[ "Normalize", "the", "directory", "to", "make", "comparison", "possible" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L48-L52
[ "def", "_normalize_dir", "(", "string_", ")", ":", "return", "os", ".", "path", ".", "normpath", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "string_", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_path
Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path
salt/modules/win_path.py
def get_path(): ''' Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path ''' ret = salt.utils.stringutils.to_unicode( __utils__['reg.read_value']( 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Contr...
def get_path(): ''' Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path ''' ret = salt.utils.stringutils.to_unicode( __utils__['reg.read_value']( 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Contr...
[ "Returns", "a", "list", "of", "items", "in", "the", "SYSTEM", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L76-L94
[ "def", "get_path", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "__utils__", "[", "'reg.read_value'", "]", "(", "'HKEY_LOCAL_MACHINE'", ",", "'SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment'", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path.exists 'c:\\python27\\' ...
salt/modules/win_path.py
def exists(path): ''' Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path...
def exists(path): ''' Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path...
[ "Check", "if", "the", "directory", "is", "configured", "in", "the", "SYSTEM", "path", "Case", "-", "insensitive", "and", "ignores", "trailing", "backslash" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L97-L116
[ "def", "exists", "(", "path", ")", ":", "path", "=", "_normalize_dir", "(", "path", ")", "sysPath", "=", "get_path", "(", ")", "return", "path", ".", "lower", "(", ")", "in", "(", "x", ".", "lower", "(", ")", "for", "x", "in", "sysPath", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If the registry was updated, and this value is set to...
salt/modules/win_path.py
def add(path, index=None, **kwargs): ''' Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If t...
def add(path, index=None, **kwargs): ''' Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If t...
[ "Add", "the", "directory", "to", "the", "SYSTEM", "path", "in", "the", "index", "location", ".", "Returns", "True", "if", "successful", "otherwise", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L123-L285
[ "def", "add", "(", "path", ",", "index", "=", "None", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "rehash_", "=", "kwargs", ".", "pop", "(", "'rehash'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment variables. Set this to ``Fal...
salt/modules/win_path.py
def remove(path, **kwargs): r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment vari...
def remove(path, **kwargs): r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment vari...
[ "r", "Remove", "the", "directory", "from", "the", "SYSTEM", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L288-L361
[ "def", "remove", "(", "path", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "rehash_", "=", "kwargs", ".", "pop", "(", "'rehash'", ",", "True", ")", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
output
Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: character to separate columns. Default: ``" ...
salt/output/table_out.py
def output(ret, **kwargs): ''' Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: chara...
def output(ret, **kwargs): ''' Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: chara...
[ "Display", "the", "output", "as", "table", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L309-L370
[ "def", "output", "(", "ret", ",", "*", "*", "kwargs", ")", ":", "# to facilitate re-use", "if", "'opts'", "in", "kwargs", ":", "global", "__opts__", "# pylint: disable=W0601", "__opts__", "=", "kwargs", ".", "pop", "(", "'opts'", ")", "# Prefer kwargs before opt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
TableDisplay.ustring
Build the unicode string to be displayed.
salt/output/table_out.py
def ustring(self, indent, color, msg, prefix='', suffix='', endc=None): '''Build the unicode string to be displayed.''' if endc is None: endc = self.ENDC # pylint: disable=no-member inde...
def ustring(self, indent, color, msg, prefix='', suffix='', endc=None): '''Build the unicode string to be displayed.''' if endc is None: endc = self.ENDC # pylint: disable=no-member inde...
[ "Build", "the", "unicode", "string", "to", "be", "displayed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L102-L119
[ "def", "ustring", "(", "self", ",", "indent", ",", "color", ",", "msg", ",", "prefix", "=", "''", ",", "suffix", "=", "''", ",", "endc", "=", "None", ")", ":", "if", "endc", "is", "None", ":", "endc", "=", "self", ".", "ENDC", "# pylint: disable=no...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
TableDisplay.wrap_onspace
When the text inside the column is longer then the width, will split by space and continue on the next line.
salt/output/table_out.py
def wrap_onspace(self, text): ''' When the text inside the column is longer then the width, will split by space and continue on the next line.''' def _truncate(line, word): return '{line}{part}{word}'.format( line=line, part=' \n'[(le...
def wrap_onspace(self, text): ''' When the text inside the column is longer then the width, will split by space and continue on the next line.''' def _truncate(line, word): return '{line}{part}{word}'.format( line=line, part=' \n'[(le...
[ "When", "the", "text", "inside", "the", "column", "is", "longer", "then", "the", "width", "will", "split", "by", "space", "and", "continue", "on", "the", "next", "line", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L121-L133
[ "def", "wrap_onspace", "(", "self", ",", "text", ")", ":", "def", "_truncate", "(", "line", ",", "word", ")", ":", "return", "'{line}{part}{word}'", ".", "format", "(", "line", "=", "line", ",", "part", "=", "' \\n'", "[", "(", "len", "(", "line", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
TableDisplay.prepare_rows
Prepare rows content to be displayed.
salt/output/table_out.py
def prepare_rows(self, rows, indent, has_header): '''Prepare rows content to be displayed.''' out = [] def row_wrapper(row): new_rows = [ self.wrapfunc(item).split('\n') for item in row ...
def prepare_rows(self, rows, indent, has_header): '''Prepare rows content to be displayed.''' out = [] def row_wrapper(row): new_rows = [ self.wrapfunc(item).split('\n') for item in row ...
[ "Prepare", "rows", "content", "to", "be", "displayed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L135-L204
[ "def", "prepare_rows", "(", "self", ",", "rows", ",", "indent", ",", "has_header", ")", ":", "out", "=", "[", "]", "def", "row_wrapper", "(", "row", ")", ":", "new_rows", "=", "[", "self", ".", "wrapfunc", "(", "item", ")", ".", "split", "(", "'\\n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
TableDisplay.display_rows
Prepares row content and displays.
salt/output/table_out.py
def display_rows(self, rows, labels, indent): '''Prepares row content and displays.''' out = [] if not rows: return out first_row_type = type(rows[0]) # all rows must have the same datatype con...
def display_rows(self, rows, labels, indent): '''Prepares row content and displays.''' out = [] if not rows: return out first_row_type = type(rows[0]) # all rows must have the same datatype con...
[ "Prepares", "row", "content", "and", "displays", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L206-L250
[ "def", "display_rows", "(", "self", ",", "rows", ",", "labels", ",", "indent", ")", ":", "out", "=", "[", "]", "if", "not", "rows", ":", "return", "out", "first_row_type", "=", "type", "(", "rows", "[", "0", "]", ")", "# all rows must have the same datat...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
TableDisplay.display
Display table(s).
salt/output/table_out.py
def display(self, ret, indent, out, rows_key=None, labels_key=None): '''Display table(s).''' rows = [] labels = None if isinstance(ret, dict): if not rows_key or (rows_key and rows_key in list(...
def display(self, ret, indent, out, rows_key=None, labels_key=None): '''Display table(s).''' rows = [] labels = None if isinstance(ret, dict): if not rows_key or (rows_key and rows_key in list(...
[ "Display", "table", "(", "s", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L252-L306
[ "def", "display", "(", "self", ",", "ret", ",", "indent", ",", "out", ",", "rows_key", "=", "None", ",", "labels_key", "=", "None", ")", ":", "rows", "=", "[", "]", "labels", "=", "None", "if", "isinstance", "(", "ret", ",", "dict", ")", ":", "if...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_absent
internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder to destroy the dataset recursive : boolean also destroy all the child datasets r...
salt/states/zfs.py
def _absent(name, dataset_type, force=False, recursive=False, recursive_all=False): ''' internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder ...
def _absent(name, dataset_type, force=False, recursive=False, recursive_all=False): ''' internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder ...
[ "internal", "shared", "function", "for", "*", "_absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L77-L135
[ "def", "_absent", "(", "name", ",", "dataset_type", ",", "force", "=", "False", ",", "recursive", "=", "False", ",", "recursive_all", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filesystem_absent
ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -r) .. warning:: If a volume with ``name`` exists, this st...
salt/states/zfs.py
def filesystem_absent(name, force=False, recursive=False): ''' ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -...
def filesystem_absent(name, force=False, recursive=False): ''' ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -...
[ "ensure", "filesystem", "is", "absent", "on", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L138-L162
[ "def", "filesystem_absent", "(", "name", ",", "force", "=", "False", ",", "recursive", "=", "False", ")", ":", "if", "not", "__utils__", "[", "'zfs.is_dataset'", "]", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
snapshot_absent
ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -r) recursive_all : boolean recursively destroy all dependents, ...
salt/states/zfs.py
def snapshot_absent(name, force=False, recursive=False, recursive_all=False): ''' ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets...
def snapshot_absent(name, force=False, recursive=False, recursive_all=False): ''' ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets...
[ "ensure", "snapshot", "is", "absent", "on", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L192-L214
[ "def", "snapshot_absent", "(", "name", ",", "force", "=", "False", ",", "recursive", "=", "False", ",", "recursive_all", "=", "False", ")", ":", "if", "not", "__utils__", "[", "'zfs.is_snapshot'", "]", "(", "name", ")", ":", "ret", "=", "{", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
hold_absent
ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems.
salt/states/zfs.py
def hold_absent(name, snapshot, recursive=False): ''' ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems. ''...
def hold_absent(name, snapshot, recursive=False): ''' ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems. ''...
[ "ensure", "hold", "is", "absent", "on", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L239-L306
[ "def", "hold_absent", "(", "name", ",", "snapshot", ",", "recursive", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## log configuration...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_dataset_present
internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_parent : boolean creates all the non-existing paren...
salt/states/zfs.py
def _dataset_present(dataset_type, name, volume_size=None, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string ...
def _dataset_present(dataset_type, name, volume_size=None, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string ...
[ "internal", "handler", "for", "filesystem_present", "/", "volume_present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L382-L557
[ "def", "_dataset_present", "(", "dataset_type", ",", "name", ",", "volume_size", "=", "None", ",", "sparse", "=", "False", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "ret", "=", "{", "'n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filesystem_present
ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command line using the -o option is ignored. cloned_from : string name of snapshot to clone ...
salt/states/zfs.py
def filesystem_present(name, create_parent=False, properties=None, cloned_from=None): ''' ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command ...
def filesystem_present(name, create_parent=False, properties=None, cloned_from=None): ''' ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command ...
[ "ensure", "filesystem", "exists", "and", "has", "properties", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L560-L589
[ "def", "filesystem_present", "(", "name", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "return", "_dataset_present", "(", "'filesystem'", ",", "name", ",", "create_parent", "=", "create_parent", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
volume_present
ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_parent : boolean creates all the non-existing parent datasets. any property specified on the command line usi...
salt/states/zfs.py
def volume_present(name, volume_size, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_pare...
def volume_present(name, volume_size, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_pare...
[ "ensure", "volume", "exists", "and", "has", "properties", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L592-L633
[ "def", "volume_present", "(", "name", ",", "volume_size", ",", "sparse", "=", "False", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "return", "_dataset_present", "(", "'volume'", ",", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
bookmark_present
ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot
salt/states/zfs.py
def bookmark_present(name, snapshot): ''' ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} ## log configuration log.debug('zf...
def bookmark_present(name, snapshot): ''' ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} ## log configuration log.debug('zf...
[ "ensure", "bookmark", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L636-L693
[ "def", "bookmark_present", "(", "name", ",", "snapshot", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## log configuration", "log", ".", "debug", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
snapshot_present
ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .. note: Properties are only set at creation time
salt/states/zfs.py
def snapshot_present(name, recursive=False, properties=None): ''' ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .....
def snapshot_present(name, recursive=False, properties=None): ''' ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .....
[ "ensure", "snapshot", "exists", "and", "has", "properties", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L696-L754
[ "def", "snapshot_present", "(", "name", ",", "recursive", "=", "False", ",", "properties", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
promoted
ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset
salt/states/zfs.py
def promoted(name): ''' ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset ''' ret = {'name': name, 'changes': {...
def promoted(name): ''' ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset ''' ret = {'name': name, 'changes': {...
[ "ensure", "a", "dataset", "is", "not", "a", "clone" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L757-L807
[ "def", "promoted", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## check we if we have a valid dataset name", "if", "not", "__utils__", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_schedule_snapshot_retrieve
Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots : OrderedDict preseeded OrderedDict with configuration
salt/states/zfs.py
def _schedule_snapshot_retrieve(dataset, prefix, snapshots): ''' Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots...
def _schedule_snapshot_retrieve(dataset, prefix, snapshots): ''' Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots...
[ "Update", "snapshots", "dict", "with", "current", "snapshots" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L810-L847
[ "def", "_schedule_snapshot_retrieve", "(", "dataset", ",", "prefix", ",", "snapshots", ")", ":", "## NOTE: retrieve all snapshots for the dataset", "for", "snap", "in", "sorted", "(", "__salt__", "[", "'zfs.list'", "]", "(", "dataset", ",", "*", "*", "{", "'recurs...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_schedule_snapshot_prepare
Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots : OrderedDict preseeded OrderedDict with configuration
salt/states/zfs.py
def _schedule_snapshot_prepare(dataset, prefix, snapshots): ''' Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snap...
def _schedule_snapshot_prepare(dataset, prefix, snapshots): ''' Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snap...
[ "Update", "snapshots", "dict", "with", "info", "for", "a", "new", "snapshot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L850-L906
[ "def", "_schedule_snapshot_prepare", "(", "dataset", ",", "prefix", ",", "snapshots", ")", ":", "## NOTE: generate new snapshot name", "snapshot_create_name", "=", "'{dataset}@{prefix}-{timestamp}'", ".", "format", "(", "dataset", "=", "dataset", ",", "prefix", "=", "pr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
scheduled_snapshot
maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' recursive : boolean create snapshots for all children also schedule :...
salt/states/zfs.py
def scheduled_snapshot(name, prefix, recursive=True, schedule=None): ''' maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' ...
def scheduled_snapshot(name, prefix, recursive=True, schedule=None): ''' maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' ...
[ "maintain", "a", "set", "of", "snapshots", "based", "on", "a", "schedule" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L909-L1085
[ "def", "scheduled_snapshot", "(", "name", ",", "prefix", ",", "recursive", "=", "True", ",", "schedule", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_getUserSid
return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None
salt/modules/win_dacl.py
def _getUserSid(user): ''' return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None ''' ret = {} sid_pattern = r'^S-1(-\d+){1,}$' if user and re.match(sid_pattern, user, re.I): try: sid = win32security.GetBina...
def _getUserSid(user): ''' return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None ''' ret = {} sid_pattern = r'^S-1(-\d+){1,}$' if user and re.match(sid_pattern, user, re.I): try: sid = win32security.GetBina...
[ "return", "a", "state", "error", "dictionary", "with", "sid", "as", "a", "field", "if", "it", "could", "be", "returned", "if", "user", "is", "None", "sid", "will", "also", "be", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L304-L338
[ "def", "_getUserSid", "(", "user", ")", ":", "ret", "=", "{", "}", "sid_pattern", "=", "r'^S-1(-\\d+){1,}$'", "if", "user", "and", "re", ".", "match", "(", "sid_pattern", ",", "user", ",", "re", ".", "I", ")", ":", "try", ":", "sid", "=", "win32secur...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_dacl
Gets the DACL of a path
salt/modules/win_dacl.py
def _get_dacl(path, objectType): ''' Gets the DACL of a path ''' try: dacl = win32security.GetNamedSecurityInfo( path, objectType, win32security.DACL_SECURITY_INFORMATION ).GetSecurityDescriptorDacl() except Exception: dacl = None return dacl
def _get_dacl(path, objectType): ''' Gets the DACL of a path ''' try: dacl = win32security.GetNamedSecurityInfo( path, objectType, win32security.DACL_SECURITY_INFORMATION ).GetSecurityDescriptorDacl() except Exception: dacl = None return dacl
[ "Gets", "the", "DACL", "of", "a", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L350-L360
[ "def", "_get_dacl", "(", "path", ",", "objectType", ")", ":", "try", ":", "dacl", "=", "win32security", ".", "GetNamedSecurityInfo", "(", "path", ",", "objectType", ",", "win32security", ".", "DACL_SECURITY_INFORMATION", ")", ".", "GetSecurityDescriptorDacl", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the ACL CLI Example: .. code-block:: bash ...
salt/modules/win_dacl.py
def get(path, objectType, user=None): ''' Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the A...
def get(path, objectType, user=None): ''' Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the A...
[ "Get", "the", "ACL", "of", "an", "object", ".", "Will", "filter", "by", "user", "if", "one", "is", "provided", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L363-L395
[ "def", "get", "(", "path", ",", "objectType", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'Path'", ":", "path", ",", "'ACLs'", ":", "[", "]", "}", "sidRet", "=", "_getUserSid", "(", "user", ")", "if", "path", "and", "objectType", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_ace
r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for Regist...
salt/modules/win_dacl.py
def add_ace(path, objectType, user, permission, acetype, propagation): r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permissio...
def add_ace(path, objectType, user, permission, acetype, propagation): r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permissio...
[ "r", "add", "an", "ace", "to", "an", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L398-L467
[ "def", "add_ace", "(", "path", ",", "objectType", ",", "user", ",", "permission", ",", "acetype", ",", "propagation", ")", ":", "ret", "=", "{", "'result'", ":", "None", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "if", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_ace
r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for...
salt/modules/win_dacl.py
def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=None): r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny fo...
def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=None): r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny fo...
[ "r", "remove", "an", "ace", "to", "an", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L470-L540
[ "def", "rm_ace", "(", "path", ",", "objectType", ",", "user", ",", "permission", "=", "None", ",", "acetype", "=", "None", ",", "propagation", "=", "None", ")", ":", "ret", "=", "{", "'result'", ":", "None", ",", "'changes'", ":", "{", "}", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ace_to_text
helper function to convert an ace to a textual representation
salt/modules/win_dacl.py
def _ace_to_text(ace, objectType): ''' helper function to convert an ace to a textual representation ''' dc = daclConstants() objectType = dc.getObjectTypeBit(objectType) try: userSid = win32security.LookupAccountSid('', ace[2]) if userSid[1]: userSid = '{1}\\{0}'.for...
def _ace_to_text(ace, objectType): ''' helper function to convert an ace to a textual representation ''' dc = daclConstants() objectType = dc.getObjectTypeBit(objectType) try: userSid = win32security.LookupAccountSid('', ace[2]) if userSid[1]: userSid = '{1}\\{0}'.for...
[ "helper", "function", "to", "convert", "an", "ace", "to", "a", "textual", "representation" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L543-L578
[ "def", "_ace_to_text", "(", "ace", ",", "objectType", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "try", ":", "userSid", "=", "win32security", ".", "LookupAccountSid", "(", "''", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_dacl_inheritance
helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables copy (bool): Copy inherited ACEs to the DACL before disabling inheritance clear (bool...
salt/modules/win_dacl.py
def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=False): ''' helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables cop...
def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=False): ''' helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables cop...
[ "helper", "function", "to", "set", "the", "inheritance", "Args", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L581-L650
[ "def", "_set_dacl_inheritance", "(", "path", ",", "objectType", ",", "inheritance", "=", "True", ",", "copy", "=", "True", ",", "clear", "=", "False", ")", ":", "ret", "=", "{", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enable_inheritance
enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary containing the results CLI Example: .. code-block:: bash ...
salt/modules/win_dacl.py
def enable_inheritance(path, objectType, clear=False): ''' enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary ...
def enable_inheritance(path, objectType, clear=False): ''' enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary ...
[ "enable", "/", "disable", "inheritance", "on", "an", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L653-L674
[ "def", "enable_inheritance", "(", "path", ",", "objectType", ",", "clear", "=", "False", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "path", "=", "dc", ".", "processPath", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable_inheritance
Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dict): A dictionary containing the results CLI Example: .. ...
salt/modules/win_dacl.py
def disable_inheritance(path, objectType, copy=True): ''' Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dic...
def disable_inheritance(path, objectType, copy=True): ''' Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dic...
[ "Disable", "inheritance", "on", "an", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L677-L698
[ "def", "disable_inheritance", "(", "path", ",", "objectType", ",", "copy", "=", "True", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "path", "=", "dc", ".", "processPath", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_inheritance
Check a specified path to verify if inheritance is enabled Args: path: path of the registry key or file system object to check objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: if provided, will consider only the ACEs for that user Returns (bool): 'Inheritance' of True/F...
salt/modules/win_dacl.py
def check_inheritance(path, objectType, user=None): ''' Check a specified path to verify if inheritance is enabled Args: path: path of the registry key or file system object to check objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: if provided, will consider only the...
def check_inheritance(path, objectType, user=None): ''' Check a specified path to verify if inheritance is enabled Args: path: path of the registry key or file system object to check objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: if provided, will consider only the...
[ "Check", "a", "specified", "path", "to", "verify", "if", "inheritance", "is", "enabled" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L701-L745
[ "def", "check_inheritance", "(", "path", ",", "objectType", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'result'", ":", "False", ",", "'Inheritance'", ":", "False", ",", "'comment'", ":", "''", "}", "sidRet", "=", "_getUserSid", "(", "user", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_ace
Checks a path to verify the ACE (access control entry) specified exists Args: path: path to the file/reg key objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: user that the ACL is for permission: permission to test for (READ, FULLCONTROL, etc) acetype: the...
salt/modules/win_dacl.py
def check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False): ''' Checks a path to verify the ACE (access control entry) specified exists Args: path: path to the file/reg key objectType: The type of object (FILE, DIRECTORY, REGISTRY) ...
def check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False): ''' Checks a path to verify the ACE (access control entry) specified exists Args: path: path to the file/reg key objectType: The type of object (FILE, DIRECTORY, REGISTRY) ...
[ "Checks", "a", "path", "to", "verify", "the", "ACE", "(", "access", "control", "entry", ")", "specified", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L748-L810
[ "def", "check_ace", "(", "path", ",", "objectType", ",", "user", ",", "permission", "=", "None", ",", "acetype", "=", "None", ",", "propagation", "=", "None", ",", "exactPermissionMatch", "=", "False", ")", ":", "ret", "=", "{", "'result'", ":", "False",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getObjectTypeBit
returns the bit value of the string object type
salt/modules/win_dacl.py
def getObjectTypeBit(self, t): ''' returns the bit value of the string object type ''' if isinstance(t, string_types): t = t.upper() try: return self.objectType[t] except KeyError: raise CommandExecutionError(( ...
def getObjectTypeBit(self, t): ''' returns the bit value of the string object type ''' if isinstance(t, string_types): t = t.upper() try: return self.objectType[t] except KeyError: raise CommandExecutionError(( ...
[ "returns", "the", "bit", "value", "of", "the", "string", "object", "type" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L193-L206
[ "def", "getObjectTypeBit", "(", "self", ",", "t", ")", ":", "if", "isinstance", "(", "t", ",", "string_types", ")", ":", "t", "=", "t", ".", "upper", "(", ")", "try", ":", "return", "self", ".", "objectType", "[", "t", "]", "except", "KeyError", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getSecurityHkey
returns the necessary string value for an HKEY for the win32security module
salt/modules/win_dacl.py
def getSecurityHkey(self, s): ''' returns the necessary string value for an HKEY for the win32security module ''' try: return self.hkeys_security[s] except KeyError: raise CommandExecutionError(( 'No HKEY named "{0}". It should be one of t...
def getSecurityHkey(self, s): ''' returns the necessary string value for an HKEY for the win32security module ''' try: return self.hkeys_security[s] except KeyError: raise CommandExecutionError(( 'No HKEY named "{0}". It should be one of t...
[ "returns", "the", "necessary", "string", "value", "for", "an", "HKEY", "for", "the", "win32security", "module" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L208-L217
[ "def", "getSecurityHkey", "(", "self", ",", "s", ")", ":", "try", ":", "return", "self", ".", "hkeys_security", "[", "s", "]", "except", "KeyError", ":", "raise", "CommandExecutionError", "(", "(", "'No HKEY named \"{0}\". It should be one of the following: {1}'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getPermissionBit
returns a permission bit of the string permission value for the specified object type
salt/modules/win_dacl.py
def getPermissionBit(self, t, m): ''' returns a permission bit of the string permission value for the specified object type ''' try: if isinstance(m, string_types): return self.rights[t][m]['BITS'] else: return m except KeyE...
def getPermissionBit(self, t, m): ''' returns a permission bit of the string permission value for the specified object type ''' try: if isinstance(m, string_types): return self.rights[t][m]['BITS'] else: return m except KeyE...
[ "returns", "a", "permission", "bit", "of", "the", "string", "permission", "value", "for", "the", "specified", "object", "type" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L219-L231
[ "def", "getPermissionBit", "(", "self", ",", "t", ",", "m", ")", ":", "try", ":", "if", "isinstance", "(", "m", ",", "string_types", ")", ":", "return", "self", ".", "rights", "[", "t", "]", "[", "m", "]", "[", "'BITS'", "]", "else", ":", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getPermissionText
returns the permission textual representation of a specified permission bit/object type
salt/modules/win_dacl.py
def getPermissionText(self, t, m): ''' returns the permission textual representation of a specified permission bit/object type ''' try: return self.rights[t][m]['TEXT'] except KeyError: raise CommandExecutionError(( 'No right "{0}". It sho...
def getPermissionText(self, t, m): ''' returns the permission textual representation of a specified permission bit/object type ''' try: return self.rights[t][m]['TEXT'] except KeyError: raise CommandExecutionError(( 'No right "{0}". It sho...
[ "returns", "the", "permission", "textual", "representation", "of", "a", "specified", "permission", "bit", "/", "object", "type" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L233-L242
[ "def", "getPermissionText", "(", "self", ",", "t", ",", "m", ")", ":", "try", ":", "return", "self", ".", "rights", "[", "t", "]", "[", "m", "]", "[", "'TEXT'", "]", "except", "KeyError", ":", "raise", "CommandExecutionError", "(", "(", "'No right \"{0...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getAceTypeBit
returns the acetype bit of a text value
salt/modules/win_dacl.py
def getAceTypeBit(self, t): ''' returns the acetype bit of a text value ''' try: return self.validAceTypes[t]['BITS'] except KeyError: raise CommandExecutionError(( 'No ACE type "{0}". It should be one of the following: {1}' ...
def getAceTypeBit(self, t): ''' returns the acetype bit of a text value ''' try: return self.validAceTypes[t]['BITS'] except KeyError: raise CommandExecutionError(( 'No ACE type "{0}". It should be one of the following: {1}' ...
[ "returns", "the", "acetype", "bit", "of", "a", "text", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L244-L253
[ "def", "getAceTypeBit", "(", "self", ",", "t", ")", ":", "try", ":", "return", "self", ".", "validAceTypes", "[", "t", "]", "[", "'BITS'", "]", "except", "KeyError", ":", "raise", "CommandExecutionError", "(", "(", "'No ACE type \"{0}\". It should be one of the...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getAceTypeText
returns the textual representation of a acetype bit
salt/modules/win_dacl.py
def getAceTypeText(self, t): ''' returns the textual representation of a acetype bit ''' try: return self.validAceTypes[t]['TEXT'] except KeyError: raise CommandExecutionError(( 'No ACE type "{0}". It should be one of the following: {1}' ...
def getAceTypeText(self, t): ''' returns the textual representation of a acetype bit ''' try: return self.validAceTypes[t]['TEXT'] except KeyError: raise CommandExecutionError(( 'No ACE type "{0}". It should be one of the following: {1}' ...
[ "returns", "the", "textual", "representation", "of", "a", "acetype", "bit" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L255-L264
[ "def", "getAceTypeText", "(", "self", ",", "t", ")", ":", "try", ":", "return", "self", ".", "validAceTypes", "[", "t", "]", "[", "'TEXT'", "]", "except", "KeyError", ":", "raise", "CommandExecutionError", "(", "(", "'No ACE type \"{0}\". It should be one of th...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.getPropagationBit
returns the propagation bit of a text value
salt/modules/win_dacl.py
def getPropagationBit(self, t, p): ''' returns the propagation bit of a text value ''' try: return self.validPropagations[t][p]['BITS'] except KeyError: raise CommandExecutionError(( 'No propagation type of "{0}". It should be one of the f...
def getPropagationBit(self, t, p): ''' returns the propagation bit of a text value ''' try: return self.validPropagations[t][p]['BITS'] except KeyError: raise CommandExecutionError(( 'No propagation type of "{0}". It should be one of the f...
[ "returns", "the", "propagation", "bit", "of", "a", "text", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L266-L275
[ "def", "getPropagationBit", "(", "self", ",", "t", ",", "p", ")", ":", "try", ":", "return", "self", ".", "validPropagations", "[", "t", "]", "[", "p", "]", "[", "'BITS'", "]", "except", "KeyError", ":", "raise", "CommandExecutionError", "(", "(", "'No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
daclConstants.processPath
processes a path/object type combo and returns: registry types with the correct HKEY text representation files/directories with environment variables expanded
salt/modules/win_dacl.py
def processPath(self, path, objectType): ''' processes a path/object type combo and returns: registry types with the correct HKEY text representation files/directories with environment variables expanded ''' if objectType == win32security.SE_REGISTRY_KEY: ...
def processPath(self, path, objectType): ''' processes a path/object type combo and returns: registry types with the correct HKEY text representation files/directories with environment variables expanded ''' if objectType == win32security.SE_REGISTRY_KEY: ...
[ "processes", "a", "path", "/", "object", "type", "combo", "and", "returns", ":", "registry", "types", "with", "the", "correct", "HKEY", "text", "representation", "files", "/", "directories", "with", "environment", "variables", "expanded" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L288-L301
[ "def", "processPath", "(", "self", ",", "path", ",", "objectType", ")", ":", "if", "objectType", "==", "win32security", ".", "SE_REGISTRY_KEY", ":", "splt", "=", "path", ".", "split", "(", "\"\\\\\"", ")", "hive", "=", "self", ".", "getSecurityHkey", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure a subnet exists and is up-to-date name Name of the subnet network_name_or_id The unique name or ID of the attached network. If a non-unique name is supplied, an exception is raised. allocation_pools A list of dictionaries of the start and end addresses for t...
salt/states/neutron_subnet.py
def present(name, auth=None, **kwargs): ''' Ensure a subnet exists and is up-to-date name Name of the subnet network_name_or_id The unique name or ID of the attached network. If a non-unique name is supplied, an exception is raised. allocation_pools A list of dicti...
def present(name, auth=None, **kwargs): ''' Ensure a subnet exists and is up-to-date name Name of the subnet network_name_or_id The unique name or ID of the attached network. If a non-unique name is supplied, an exception is raised. allocation_pools A list of dicti...
[ "Ensure", "a", "subnet", "exists", "and", "is", "up", "-", "to", "-", "date" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_subnet.py#L62-L139
[ "def", "present", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "kwargs", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure a subnet does not exists name Name of the subnet
salt/states/neutron_subnet.py
def absent(name, auth=None): ''' Ensure a subnet does not exists name Name of the subnet ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['neutronng.setup_clouds'](auth) subnet = __salt__['neutronng.subnet_get'](name...
def absent(name, auth=None): ''' Ensure a subnet does not exists name Name of the subnet ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['neutronng.setup_clouds'](auth) subnet = __salt__['neutronng.subnet_get'](name...
[ "Ensure", "a", "subnet", "does", "not", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_subnet.py#L142-L170
[ "def", "absent", "(", "name", ",", "auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "__salt__", "[", "'neutronng.setup_clouds'", "]...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_determine_host
Determine what the most resource free host is based on the given data
salt/runners/virt.py
def _determine_host(data, omit=''): ''' Determine what the most resource free host is based on the given data ''' # This is just checking for the host with the most free ram, this needs # to be much more complicated. host = '' bestmem = 0 for hv_, comps in six.iteritems(data): if...
def _determine_host(data, omit=''): ''' Determine what the most resource free host is based on the given data ''' # This is just checking for the host with the most free ram, this needs # to be much more complicated. host = '' bestmem = 0 for hv_, comps in six.iteritems(data): if...
[ "Determine", "what", "the", "most", "resource", "free", "host", "is", "based", "on", "the", "given", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L25-L41
[ "def", "_determine_host", "(", "data", ",", "omit", "=", "''", ")", ":", "# This is just checking for the host with the most free ram, this needs", "# to be much more complicated.", "host", "=", "''", "bestmem", "=", "0", "for", "hv_", ",", "comps", "in", "six", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_find_vm
Scan the query data for the named VM
salt/runners/virt.py
def _find_vm(name, data, quiet=False): ''' Scan the query data for the named VM ''' for hv_ in data: # Check if data is a dict, and not '"virt.full_info" is not available.' if not isinstance(data[hv_], dict): continue if name in data[hv_].get('vm_info', {}): ...
def _find_vm(name, data, quiet=False): ''' Scan the query data for the named VM ''' for hv_ in data: # Check if data is a dict, and not '"virt.full_info" is not available.' if not isinstance(data[hv_], dict): continue if name in data[hv_].get('vm_info', {}): ...
[ "Scan", "the", "query", "data", "for", "the", "named", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L44-L57
[ "def", "_find_vm", "(", "name", ",", "data", ",", "quiet", "=", "False", ")", ":", "for", "hv_", "in", "data", ":", "# Check if data is a dict, and not '\"virt.full_info\" is not available.'", "if", "not", "isinstance", "(", "data", "[", "hv_", "]", ",", "dict",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Query the virtual machines. When called without options all hosts are detected and a full query is returned. A single host can be passed in to specify an individual host to query.
salt/runners/virt.py
def query(host=None, quiet=False): ''' Query the virtual machines. When called without options all hosts are detected and a full query is returned. A single host can be passed in to specify an individual host to query. ''' if quiet: log.warning("'quiet' is deprecated. Please migrate to -...
def query(host=None, quiet=False): ''' Query the virtual machines. When called without options all hosts are detected and a full query is returned. A single host can be passed in to specify an individual host to query. ''' if quiet: log.warning("'quiet' is deprecated. Please migrate to -...
[ "Query", "the", "virtual", "machines", ".", "When", "called", "without", "options", "all", "hosts", "are", "detected", "and", "a", "full", "query", "is", "returned", ".", "A", "single", "host", "can", "be", "passed", "in", "to", "specify", "an", "individua...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L60-L94
[ "def", "query", "(", "host", "=", "None", ",", "quiet", "=", "False", ")", ":", "if", "quiet", ":", "log", ".", "warning", "(", "\"'quiet' is deprecated. Please migrate to --quiet\"", ")", "ret", "=", "{", "}", "client", "=", "salt", ".", "client", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list
List the virtual machines on each host, this is a simplified query, showing only the virtual machine names belonging to each host. A single host can be passed in to specify an individual host to list.
salt/runners/virt.py
def list(host=None, quiet=False, hyper=None): # pylint: disable=redefined-builtin ''' List the virtual machines on each host, this is a simplified query, showing only the virtual machine names belonging to each host. A single host can be passed in to specify an individual host to list. ''' ...
def list(host=None, quiet=False, hyper=None): # pylint: disable=redefined-builtin ''' List the virtual machines on each host, this is a simplified query, showing only the virtual machine names belonging to each host. A single host can be passed in to specify an individual host to list. ''' ...
[ "List", "the", "virtual", "machines", "on", "each", "host", "this", "is", "a", "simplified", "query", "showing", "only", "the", "virtual", "machine", "names", "belonging", "to", "each", "host", ".", "A", "single", "host", "can", "be", "passed", "in", "to",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L97-L136
[ "def", "list", "(", "host", "=", "None", ",", "quiet", "=", "False", ",", "hyper", "=", "None", ")", ":", "# pylint: disable=redefined-builtin", "if", "quiet", ":", "log", ".", "warning", "(", "\"'quiet' is deprecated. Please migrate to --quiet\"", ")", "ret", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
host_info
Return information about the host connected to this master
salt/runners/virt.py
def host_info(host=None): ''' Return information about the host connected to this master ''' data = query(host, quiet=True) for id_ in data: if 'vm_info' in data[id_]: data[id_].pop('vm_info') __jid_event__.fire_event({'data': data, 'outputter': 'nested'}, 'progress') ret...
def host_info(host=None): ''' Return information about the host connected to this master ''' data = query(host, quiet=True) for id_ in data: if 'vm_info' in data[id_]: data[id_].pop('vm_info') __jid_event__.fire_event({'data': data, 'outputter': 'nested'}, 'progress') ret...
[ "Return", "information", "about", "the", "host", "connected", "to", "this", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L150-L159
[ "def", "host_info", "(", "host", "=", "None", ")", ":", "data", "=", "query", "(", "host", ",", "quiet", "=", "True", ")", "for", "id_", "in", "data", ":", "if", "'vm_info'", "in", "data", "[", "id_", "]", ":", "data", "[", "id_", "]", ".", "po...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
This routine is used to create a new virtual machine. This routines takes a number of options to determine what the newly created virtual machine will look like. name The mandatory name of the new virtual machine. The name option is also the minion id, all minions must have an id. cpu ...
salt/runners/virt.py
def init( name, cpu, mem, image, hypervisor='kvm', host=None, seed=True, nic='default', install=True, start=True, disk='default', saltenv='base', enable_vnc=False, seed_cmd='seed.apply', enable_qcow=F...
def init( name, cpu, mem, image, hypervisor='kvm', host=None, seed=True, nic='default', install=True, start=True, disk='default', saltenv='base', enable_vnc=False, seed_cmd='seed.apply', enable_qcow=F...
[ "This", "routine", "is", "used", "to", "create", "a", "new", "virtual", "machine", ".", "This", "routines", "takes", "a", "number", "of", "options", "to", "determine", "what", "the", "newly", "created", "virtual", "machine", "will", "look", "like", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L162-L317
[ "def", "init", "(", "name", ",", "cpu", ",", "mem", ",", "image", ",", "hypervisor", "=", "'kvm'", ",", "host", "=", "None", ",", "seed", "=", "True", ",", "nic", "=", "'default'", ",", "install", "=", "True", ",", "start", "=", "True", ",", "dis...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_info
Return the information on the named VM
salt/runners/virt.py
def vm_info(name, quiet=False): ''' Return the information on the named VM ''' data = query(quiet=True) return _find_vm(name, data, quiet)
def vm_info(name, quiet=False): ''' Return the information on the named VM ''' data = query(quiet=True) return _find_vm(name, data, quiet)
[ "Return", "the", "information", "on", "the", "named", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L320-L325
[ "def", "vm_info", "(", "name", ",", "quiet", "=", "False", ")", ":", "data", "=", "query", "(", "quiet", "=", "True", ")", "return", "_find_vm", "(", "name", ",", "data", ",", "quiet", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reset
Force power down and restart an existing VM
salt/runners/virt.py
def reset(name): ''' Force power down and restart an existing VM ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event({'message': 'Failed to find VM {0} to reset'.format(name)}, 'progress') ...
def reset(name): ''' Force power down and restart an existing VM ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event({'message': 'Failed to find VM {0} to reset'.format(name)}, 'progress') ...
[ "Force", "power", "down", "and", "restart", "an", "existing", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L328-L350
[ "def", "reset", "(", "name", ")", ":", "ret", "=", "{", "}", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "data", "=", "vm_info", "(", "name", ",", "quiet", "=", "True", ")", "if", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
purge
Destroy the named VM
salt/runners/virt.py
def purge(name, delete_key=True): ''' Destroy the named VM ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event({'error': 'Failed to find VM {0} to purge'.format(name)}, 'progress') re...
def purge(name, delete_key=True): ''' Destroy the named VM ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event({'error': 'Failed to find VM {0} to purge'.format(name)}, 'progress') re...
[ "Destroy", "the", "named", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L409-L437
[ "def", "purge", "(", "name", ",", "delete_key", "=", "True", ")", ":", "ret", "=", "{", "}", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "data", "=", "vm_info", "(", "name", ",", "quie...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
migrate
Migrate a VM from one host to another. This routine will just start the migration and display information on how to look up the progress.
salt/runners/virt.py
def migrate(name, target=''): ''' Migrate a VM from one host to another. This routine will just start the migration and display information on how to look up the progress. ''' client = salt.client.get_local_client(__opts__['conf_file']) data = query(quiet=True) origin_data = _find_vm(name, d...
def migrate(name, target=''): ''' Migrate a VM from one host to another. This routine will just start the migration and display information on how to look up the progress. ''' client = salt.client.get_local_client(__opts__['conf_file']) data = query(quiet=True) origin_data = _find_vm(name, d...
[ "Migrate", "a", "VM", "from", "one", "host", "to", "another", ".", "This", "routine", "will", "just", "start", "the", "migration", "and", "display", "information", "on", "how", "to", "look", "up", "the", "progress", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L497-L531
[ "def", "migrate", "(", "name", ",", "target", "=", "''", ")", ":", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "data", "=", "query", "(", "quiet", "=", "True", ")", "origin_data", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install a certificate cert The certificate to install password The password for the certificate being installed formatted in the way described for openssl command in the PASS PHRASE ARGUMENTS section. Note: The password given here will show up as plaintext in the job returned ...
salt/modules/mac_keychain.py
def install(cert, password, keychain="/Library/Keychains/System.keychain", allow_any=False, keychain_password=None): ''' Install a certificate cert The certificate to install password The password for the certificate being installed forma...
def install(cert, password, keychain="/Library/Keychains/System.keychain", allow_any=False, keychain_password=None): ''' Install a certificate cert The certificate to install password The password for the certificate being installed forma...
[ "Install", "a", "certificate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L44-L88
[ "def", "install", "(", "cert", ",", "password", ",", "keychain", "=", "\"/Library/Keychains/System.keychain\"", ",", "allow_any", "=", "False", ",", "keychain_password", "=", "None", ")", ":", "if", "keychain_password", "is", "not", "None", ":", "unlock_keychain",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall
Uninstall a certificate from a keychain cert_name The name of the certificate to remove keychain The keychain to install the certificate to, this defaults to /Library/Keychains/System.keychain keychain_password If your keychain is likely to be locked pass the password and ...
salt/modules/mac_keychain.py
def uninstall(cert_name, keychain="/Library/Keychains/System.keychain", keychain_password=None): ''' Uninstall a certificate from a keychain cert_name The name of the certificate to remove keychain The keychain to install the certificate to, this defaults to...
def uninstall(cert_name, keychain="/Library/Keychains/System.keychain", keychain_password=None): ''' Uninstall a certificate from a keychain cert_name The name of the certificate to remove keychain The keychain to install the certificate to, this defaults to...
[ "Uninstall", "a", "certificate", "from", "a", "keychain" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L91-L121
[ "def", "uninstall", "(", "cert_name", ",", "keychain", "=", "\"/Library/Keychains/System.keychain\"", ",", "keychain_password", "=", "None", ")", ":", "if", "keychain_password", "is", "not", "None", ":", "unlock_keychain", "(", "keychain", ",", "keychain_password", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_certs
List all of the installed certificates keychain The keychain to install the certificate to, this defaults to /Library/Keychains/System.keychain CLI Example: .. code-block:: bash salt '*' keychain.list_certs
salt/modules/mac_keychain.py
def list_certs(keychain="/Library/Keychains/System.keychain"): ''' List all of the installed certificates keychain The keychain to install the certificate to, this defaults to /Library/Keychains/System.keychain CLI Example: .. code-block:: bash salt '*' keychain.list_cert...
def list_certs(keychain="/Library/Keychains/System.keychain"): ''' List all of the installed certificates keychain The keychain to install the certificate to, this defaults to /Library/Keychains/System.keychain CLI Example: .. code-block:: bash salt '*' keychain.list_cert...
[ "List", "all", "of", "the", "installed", "certificates" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L124-L141
[ "def", "list_certs", "(", "keychain", "=", "\"/Library/Keychains/System.keychain\"", ")", ":", "cmd", "=", "'security find-certificate -a {0} | grep -o \"alis\".*\\\\\" | '", "'grep -o \\'\\\\\"[-A-Za-z0-9.:() ]*\\\\\"\\''", ".", "format", "(", "_quote", "(", "keychain", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_friendly_name
Get the friendly name of the given certificate cert The certificate to install password The password for the certificate being installed formatted in the way described for openssl command in the PASS PHRASE ARGUMENTS section Note: The password given here will show up as plaint...
salt/modules/mac_keychain.py
def get_friendly_name(cert, password): ''' Get the friendly name of the given certificate cert The certificate to install password The password for the certificate being installed formatted in the way described for openssl command in the PASS PHRASE ARGUMENTS section N...
def get_friendly_name(cert, password): ''' Get the friendly name of the given certificate cert The certificate to install password The password for the certificate being installed formatted in the way described for openssl command in the PASS PHRASE ARGUMENTS section N...
[ "Get", "the", "friendly", "name", "of", "the", "given", "certificate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L144-L167
[ "def", "get_friendly_name", "(", "cert", ",", "password", ")", ":", "cmd", "=", "'openssl pkcs12 -in {0} -passin pass:{1} -info -nodes -nokeys 2> /dev/null | '", "'grep friendlyName:'", ".", "format", "(", "_quote", "(", "cert", ")", ",", "_quote", "(", "password", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_default_keychain
Get the default keychain user The user to check the default keychain of domain The domain to use valid values are user|system|common|dynamic, the default is user CLI Example: .. code-block:: bash salt '*' keychain.get_default_keychain
salt/modules/mac_keychain.py
def get_default_keychain(user=None, domain="user"): ''' Get the default keychain user The user to check the default keychain of domain The domain to use valid values are user|system|common|dynamic, the default is user CLI Example: .. code-block:: bash salt '*' keycha...
def get_default_keychain(user=None, domain="user"): ''' Get the default keychain user The user to check the default keychain of domain The domain to use valid values are user|system|common|dynamic, the default is user CLI Example: .. code-block:: bash salt '*' keycha...
[ "Get", "the", "default", "keychain" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L170-L187
[ "def", "get_default_keychain", "(", "user", "=", "None", ",", "domain", "=", "\"user\"", ")", ":", "cmd", "=", "\"security default-keychain -d {0}\"", ".", "format", "(", "domain", ")", "return", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "runas", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_default_keychain
Set the default keychain keychain The location of the keychain to set as default domain The domain to use valid values are user|system|common|dynamic, the default is user user The user to set the default keychain as CLI Example: .. code-block:: bash salt '*' key...
salt/modules/mac_keychain.py
def set_default_keychain(keychain, domain="user", user=None): ''' Set the default keychain keychain The location of the keychain to set as default domain The domain to use valid values are user|system|common|dynamic, the default is user user The user to set the default key...
def set_default_keychain(keychain, domain="user", user=None): ''' Set the default keychain keychain The location of the keychain to set as default domain The domain to use valid values are user|system|common|dynamic, the default is user user The user to set the default key...
[ "Set", "the", "default", "keychain" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L190-L210
[ "def", "set_default_keychain", "(", "keychain", ",", "domain", "=", "\"user\"", ",", "user", "=", "None", ")", ":", "cmd", "=", "\"security default-keychain -d {0} -s {1}\"", ".", "format", "(", "domain", ",", "keychain", ")", "return", "__salt__", "[", "'cmd.ru...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_hash
Returns the hash of a certificate in the keychain. name The name of the certificate (which you can get from keychain.get_friendly_name) or the location of a p12 file. password The password that is used in the certificate. Only required if your passing a p12 file. Note: This wil...
salt/modules/mac_keychain.py
def get_hash(name, password=None): ''' Returns the hash of a certificate in the keychain. name The name of the certificate (which you can get from keychain.get_friendly_name) or the location of a p12 file. password The password that is used in the certificate. Only required if ...
def get_hash(name, password=None): ''' Returns the hash of a certificate in the keychain. name The name of the certificate (which you can get from keychain.get_friendly_name) or the location of a p12 file. password The password that is used in the certificate. Only required if ...
[ "Returns", "the", "hash", "of", "a", "certificate", "in", "the", "keychain", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L236-L265
[ "def", "get_hash", "(", "name", ",", "password", "=", "None", ")", ":", "if", "'.p12'", "in", "name", "[", "-", "4", ":", "]", ":", "cmd", "=", "'openssl pkcs12 -in {0} -passin pass:{1} -passout pass:{1}'", ".", "format", "(", "name", ",", "password", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Ensure the SQS queue exists. name Name of the SQS queue. region Region to create the queue user Name of the user performing the SQS operations opts Include additional arguments and options to the aws command line
salt/states/aws_sqs.py
def exists( name, region, user=None, opts=False): ''' Ensure the SQS queue exists. name Name of the SQS queue. region Region to create the queue user Name of the user performing the SQS operations opts Include additional argumen...
def exists( name, region, user=None, opts=False): ''' Ensure the SQS queue exists. name Name of the SQS queue. region Region to create the queue user Name of the user performing the SQS operations opts Include additional argumen...
[ "Ensure", "the", "SQS", "queue", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/aws_sqs.py#L30-L70
[ "def", "exists", "(", "name", ",", "region", ",", "user", "=", "None", ",", "opts", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Remove the named SQS queue if it exists. name Name of the SQS queue. region Region to remove the queue from user Name of the user performing the SQS operations opts Include additional arguments and options to the aws command line
salt/states/aws_sqs.py
def absent( name, region, user=None, opts=False): ''' Remove the named SQS queue if it exists. name Name of the SQS queue. region Region to remove the queue from user Name of the user performing the SQS operations opts Include a...
def absent( name, region, user=None, opts=False): ''' Remove the named SQS queue if it exists. name Name of the SQS queue. region Region to remove the queue from user Name of the user performing the SQS operations opts Include a...
[ "Remove", "the", "named", "SQS", "queue", "if", "it", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/aws_sqs.py#L73-L112
[ "def", "absent", "(", "name", ",", "region", ",", "user", "=", "None", ",", "opts", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_op
>>> _parse_op('>') 'gt' >>> _parse_op('>=') 'ge' >>> _parse_op('=>') 'ge' >>> _parse_op('=> ') 'ge' >>> _parse_op('<') 'lt' >>> _parse_op('<=') 'le' >>> _parse_op('==') 'eq' >>> _parse_op(' <= ') 'le'
setup.py
def _parse_op(op): ''' >>> _parse_op('>') 'gt' >>> _parse_op('>=') 'ge' >>> _parse_op('=>') 'ge' >>> _parse_op('=> ') 'ge' >>> _parse_op('<') 'lt' >>> _parse_op('<=') 'le' >>> _parse_op('==') 'eq' >>> _parse_op(' <= ') 'le' ''' op = op.strip() ...
def _parse_op(op): ''' >>> _parse_op('>') 'gt' >>> _parse_op('>=') 'ge' >>> _parse_op('=>') 'ge' >>> _parse_op('=> ') 'ge' >>> _parse_op('<') 'lt' >>> _parse_op('<=') 'le' >>> _parse_op('==') 'eq' >>> _parse_op(' <= ') 'le' ''' op = op.strip() ...
[ ">>>", "_parse_op", "(", ">", ")", "gt", ">>>", "_parse_op", "(", ">", "=", ")", "ge", ">>>", "_parse_op", "(", "=", ">", ")", "ge", ">>>", "_parse_op", "(", "=", ">", ")", "ge", ">>>", "_parse_op", "(", "<", ")", "lt", ">>>", "_parse_op", "(", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L142-L175
[ "def", "_parse_op", "(", "op", ")", ":", "op", "=", "op", ".", "strip", "(", ")", "if", "'>'", "in", "op", ":", "if", "'='", "in", "op", ":", "return", "'ge'", "else", ":", "return", "'gt'", "elif", "'<'", "in", "op", ":", "if", "'='", "in", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_ver
>>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4") '3.4' >>> _parse_ver('"3.4"') '3.4' >>> _parse_ver('"2.6.17"') '2.6.17'
setup.py
def _parse_ver(ver): ''' >>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4") '3.4' >>> _parse_ver('"3.4"') '3.4' >>> _parse_ver('"2.6.17"') '2.6.17' ''' if '#' in ver: ver, _ = ver.split('#', 1) ver = ver.strip() return ver.strip('\'').st...
def _parse_ver(ver): ''' >>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4") '3.4' >>> _parse_ver('"3.4"') '3.4' >>> _parse_ver('"2.6.17"') '2.6.17' ''' if '#' in ver: ver, _ = ver.split('#', 1) ver = ver.strip() return ver.strip('\'').st...
[ ">>>", "_parse_ver", "(", "3", ".", "4", "#", "pyzmq", "17", ".", "1", ".", "0", "stopped", "building", "wheels", "for", "python3", ".", "4", ")", "3", ".", "4", ">>>", "_parse_ver", "(", "3", ".", "4", ")", "3", ".", "4", ">>>", "_parse_ver", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L178-L190
[ "def", "_parse_ver", "(", "ver", ")", ":", "if", "'#'", "in", "ver", ":", "ver", ",", "_", "=", "ver", ".", "split", "(", "'#'", ",", "1", ")", "ver", "=", "ver", ".", "strip", "(", ")", "return", "ver", ".", "strip", "(", "'\\''", ")", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_ver
>>> _check_ver('2.7.15', 'gt', '2.7') True >>> _check_ver('2.7.15', 'gt', '2.7.15') False >>> _check_ver('2.7.15', 'ge', '2.7.15') True >>> _check_ver('2.7.15', 'eq', '2.7.15') True
setup.py
def _check_ver(pyver, op, wanted): ''' >>> _check_ver('2.7.15', 'gt', '2.7') True >>> _check_ver('2.7.15', 'gt', '2.7.15') False >>> _check_ver('2.7.15', 'ge', '2.7.15') True >>> _check_ver('2.7.15', 'eq', '2.7.15') True ''' pyver = distutils.version.LooseVersion(pyver) w...
def _check_ver(pyver, op, wanted): ''' >>> _check_ver('2.7.15', 'gt', '2.7') True >>> _check_ver('2.7.15', 'gt', '2.7.15') False >>> _check_ver('2.7.15', 'ge', '2.7.15') True >>> _check_ver('2.7.15', 'eq', '2.7.15') True ''' pyver = distutils.version.LooseVersion(pyver) w...
[ ">>>", "_check_ver", "(", "2", ".", "7", ".", "15", "gt", "2", ".", "7", ")", "True", ">>>", "_check_ver", "(", "2", ".", "7", ".", "15", "gt", "2", ".", "7", ".", "15", ")", "False", ">>>", "_check_ver", "(", "2", ".", "7", ".", "15", "ge"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L193-L206
[ "def", "_check_ver", "(", "pyver", ",", "op", ",", "wanted", ")", ":", "pyver", "=", "distutils", ".", "version", ".", "LooseVersion", "(", "pyver", ")", "wanted", "=", "distutils", ".", "version", ".", "LooseVersion", "(", "wanted", ")", "return", "geta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_pkgs
List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs
salt/modules/mac_portspkg.py
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # 'removed', 'p...
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # 'removed', 'p...
[ "List", "the", "packages", "currently", "installed", "in", "a", "dict", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L87-L129
[ "def", "list_pkgs", "(", "versions_as_list", "=", "False", ",", "*", "*", "kwargs", ")", ":", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "versions_as_list", ")", "# 'removed', 'purge_desired' not yet implemented or not applicable"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
Removes packages with ``port uninstall``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.16.0 ...
salt/modules/mac_portspkg.py
def remove(name=None, pkgs=None, **kwargs): ''' Removes packages with ``port uninstall``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if th...
def remove(name=None, pkgs=None, **kwargs): ''' Removes packages with ``port uninstall``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if th...
[ "Removes", "packages", "with", "port", "uninstall", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L187-L240
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "pkg_params", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ",", "pkgs", ",", "*", "*", "kwargs", ")", "[", "0", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install the passed package(s) with ``port install`` name The name of the formula to be installed. Note that this parameter is ignored if "pkgs" is passed. CLI Example: .. code-block:: bash salt '*' pkg.install <package name> version Specify a version to p...
salt/modules/mac_portspkg.py
def install(name=None, refresh=False, pkgs=None, **kwargs): ''' Install the passed package(s) with ``port install`` name The name of the formula to be installed. Note that this parameter is ignored if "pkgs" is passed. CLI Example: .. code-block:: bash salt '*...
def install(name=None, refresh=False, pkgs=None, **kwargs): ''' Install the passed package(s) with ``port install`` name The name of the formula to be installed. Note that this parameter is ignored if "pkgs" is passed. CLI Example: .. code-block:: bash salt '*...
[ "Install", "the", "passed", "package", "(", "s", ")", "with", "port", "install" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L243-L355
[ "def", "install", "(", "name", "=", "None", ",", "refresh", "=", "False", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "pkg_params", ",", "pkg_type", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ",", "pkgs", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
refresh_db
Update ports with ``port selfupdate`` CLI Example: .. code-block:: bash salt mac pkg.refresh_db
salt/modules/mac_portspkg.py
def refresh_db(**kwargs): ''' Update ports with ``port selfupdate`` CLI Example: .. code-block:: bash salt mac pkg.refresh_db ''' # Remove rtag file to keep multiple refreshes from happening in pkg states salt.utils.pkg.clear_rtag(__opts__) cmd = ['port', 'selfupdate'] ret...
def refresh_db(**kwargs): ''' Update ports with ``port selfupdate`` CLI Example: .. code-block:: bash salt mac pkg.refresh_db ''' # Remove rtag file to keep multiple refreshes from happening in pkg states salt.utils.pkg.clear_rtag(__opts__) cmd = ['port', 'selfupdate'] ret...
[ "Update", "ports", "with", "port", "selfupdate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L392-L405
[ "def", "refresh_db", "(", "*", "*", "kwargs", ")", ":", "# Remove rtag file to keep multiple refreshes from happening in pkg states", "salt", ".", "utils", ".", "pkg", ".", "clear_rtag", "(", "__opts__", ")", "cmd", "=", "[", "'port'", ",", "'selfupdate'", "]", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``. If the uri provided does not start with ``sdb://`` or the value is not successfully set, return ``False``. CLI Example: .. code-block:: bash salt '*' sdb.set sdb://mymemcached/foo bar
salt/modules/sdb.py
def set_(uri, value): ''' Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``. If the uri provided does not start with ``sdb://`` or the value is not successfully set, return ``False``. CLI Example: .. code-block:: bash salt '*' sdb.set sdb://mymemcached/foo bar ...
def set_(uri, value): ''' Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``. If the uri provided does not start with ``sdb://`` or the value is not successfully set, return ``False``. CLI Example: .. code-block:: bash salt '*' sdb.set sdb://mymemcached/foo bar ...
[ "Set", "a", "value", "in", "a", "db", "using", "a", "uri", "in", "the", "form", "of", "sdb", ":", "//", "<profile", ">", "/", "<key", ">", ".", "If", "the", "uri", "provided", "does", "not", "start", "with", "sdb", ":", "//", "or", "the", "value"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sdb.py#L31-L43
[ "def", "set_", "(", "uri", ",", "value", ")", ":", "return", "salt", ".", "utils", ".", "sdb", ".", "sdb_set", "(", "uri", ",", "value", ",", "__opts__", ",", "__utils__", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_or_set_hash
Perform a one-time generation of a hash and write it to sdb. If that value has already been set return the value instead. This is useful for generating passwords or keys that are specific to multiple minions that need to be stored somewhere centrally. State Example: .. code-block:: yaml ...
salt/modules/sdb.py
def get_or_set_hash(uri, length=8, chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'): ''' Perform a one-time generation of a hash and write it to sdb. If that value has already been set return the value instead. This is useful for generating passwords or keys that are specific...
def get_or_set_hash(uri, length=8, chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'): ''' Perform a one-time generation of a hash and write it to sdb. If that value has already been set return the value instead. This is useful for generating passwords or keys that are specific...
[ "Perform", "a", "one", "-", "time", "generation", "of", "a", "hash", "and", "write", "it", "to", "sdb", ".", "If", "that", "value", "has", "already", "been", "set", "return", "the", "value", "instead", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sdb.py#L61-L94
[ "def", "get_or_set_hash", "(", "uri", ",", "length", "=", "8", ",", "chars", "=", "'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'", ")", ":", "return", "salt", ".", "utils", ".", "sdb", ".", "sdb_get_or_set_hash", "(", "uri", ",", "__opts__", ",", "length"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_temp_exists
Checks if the ip exists as a temporary rule based on the method supplied, (tempallow, tempdeny).
salt/modules/csf.py
def _temp_exists(method, ip): ''' Checks if the ip exists as a temporary rule based on the method supplied, (tempallow, tempdeny). ''' _type = method.replace('temp', '').upper() cmd = "csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'".format(_type=_...
def _temp_exists(method, ip): ''' Checks if the ip exists as a temporary rule based on the method supplied, (tempallow, tempdeny). ''' _type = method.replace('temp', '').upper() cmd = "csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'".format(_type=_...
[ "Checks", "if", "the", "ip", "exists", "as", "a", "temporary", "rule", "based", "on", "the", "method", "supplied", "(", "tempallow", "tempdeny", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L31-L39
[ "def", "_temp_exists", "(", "method", ",", "ip", ")", ":", "_type", "=", "method", ".", "replace", "(", "'temp'", ",", "''", ")", ".", "upper", "(", ")", "cmd", "=", "\"csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'\"",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Returns true a rule for the ip already exists based on the method supplied. Returns false if not found. CLI Example: .. code-block:: bash salt '*' csf.exists allow 1.2.3.4 salt '*' csf.exists tempdeny 1.2.3.4
salt/modules/csf.py
def exists(method, ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', ttl=None, comment=''): ''' Returns true a rule for the ip already exists based on the method supplied. Returns false ...
def exists(method, ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', ttl=None, comment=''): ''' Returns true a rule for the ip already exists based on the method supplied. Returns false ...
[ "Returns", "true", "a", "rule", "for", "the", "ip", "already", "exists", "based", "on", "the", "method", "supplied", ".", "Returns", "false", "if", "not", "found", ".", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L47-L73
[ "def", "exists", "(", "method", ",", "ip", ",", "port", "=", "None", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'d'", ",", "ttl", "=", "None", ",", "comment", "=", "''", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__csf_cmd
Execute csf command
salt/modules/csf.py
def __csf_cmd(cmd): ''' Execute csf command ''' csf_cmd = '{0} {1}'.format(salt.utils.path.which('csf'), cmd) out = __salt__['cmd.run_all'](csf_cmd) if out['retcode'] != 0: if not out['stderr']: ret = out['stdout'] else: ret = out['stderr'] raise ...
def __csf_cmd(cmd): ''' Execute csf command ''' csf_cmd = '{0} {1}'.format(salt.utils.path.which('csf'), cmd) out = __salt__['cmd.run_all'](csf_cmd) if out['retcode'] != 0: if not out['stderr']: ret = out['stdout'] else: ret = out['stderr'] raise ...
[ "Execute", "csf", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L76-L93
[ "def", "__csf_cmd", "(", "cmd", ")", ":", "csf_cmd", "=", "'{0} {1}'", ".", "format", "(", "salt", ".", "utils", ".", "path", ".", "which", "(", "'csf'", ")", ",", "cmd", ")", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "csf_cmd", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_build_args
Returns the cmd args for csf basic allow/deny commands.
salt/modules/csf.py
def _build_args(method, ip, comment): ''' Returns the cmd args for csf basic allow/deny commands. ''' opt = _get_opt(method) args = '{0} {1}'.format(opt, ip) if comment: args += ' {0}'.format(comment) return args
def _build_args(method, ip, comment): ''' Returns the cmd args for csf basic allow/deny commands. ''' opt = _get_opt(method) args = '{0} {1}'.format(opt, ip) if comment: args += ' {0}'.format(comment) return args
[ "Returns", "the", "cmd", "args", "for", "csf", "basic", "allow", "/", "deny", "commands", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L121-L129
[ "def", "_build_args", "(", "method", ",", "ip", ",", "comment", ")", ":", "opt", "=", "_get_opt", "(", "method", ")", "args", "=", "'{0} {1}'", ".", "format", "(", "opt", ",", "ip", ")", "if", "comment", ":", "args", "+=", "' {0}'", ".", "format", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_access_rule
Handles the cmd execution for allow and deny commands.
salt/modules/csf.py
def _access_rule(method, ip=None, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', comment=''): ''' Handles the cmd execution for allow and deny commands. ''' if _status...
def _access_rule(method, ip=None, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', comment=''): ''' Handles the cmd execution for allow and deny commands. ''' if _status...
[ "Handles", "the", "cmd", "execution", "for", "allow", "and", "deny", "commands", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L132-L159
[ "def", "_access_rule", "(", "method", ",", "ip", "=", "None", ",", "port", "=", "None", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'d'", ",", "comment", "=", "''", ")", ":", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_csf_to_list
Extract comma-separated values from a csf.conf option and return a list.
salt/modules/csf.py
def _csf_to_list(option): ''' Extract comma-separated values from a csf.conf option and return a list. ''' result = [] line = get_option(option) if line: csv = line.split('=')[1].replace(' ', '').replace('"', '') result = csv.split(',') return result
def _csf_to_list(option): ''' Extract comma-separated values from a csf.conf option and return a list. ''' result = [] line = get_option(option) if line: csv = line.split('=')[1].replace(' ', '').replace('"', '') result = csv.split(',') return result
[ "Extract", "comma", "-", "separated", "values", "from", "a", "csf", ".", "conf", "option", "and", "return", "a", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L204-L214
[ "def", "_csf_to_list", "(", "option", ")", ":", "result", "=", "[", "]", "line", "=", "get_option", "(", "option", ")", "if", "line", ":", "csv", "=", "line", ".", "split", "(", "'='", ")", "[", "1", "]", ".", "replace", "(", "' '", ",", "''", ...
e8541fd6e744ab0df786c0f76102e41631f45d46