id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
36,900
saltstack/salt
salt/utils/http.py
update_ca_bundle
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
python
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
[ "def", "update_ca_bundle", "(", "target", "=", "None", ",", "source", "=", "None", ",", "opts", "=", "None", ",", "merge_files", "=", "None", ",", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "if", "target", "is", "None", ":", ...
Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new location on disk will be created and updated. The default ``source`` is: http://curl.haxx.se/ca/cacert.pem This is ...
[ "Attempt", "to", "update", "the", "CA", "bundle", "file", "from", "a", "URL" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L753-L836
36,901
saltstack/salt
salt/utils/http.py
parse_cookie_header
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
python
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
[ "def", "parse_cookie_header", "(", "header", ")", ":", "attribs", "=", "(", "'expires'", ",", "'path'", ",", "'domain'", ",", "'version'", ",", "'httponly'", ",", "'secure'", ",", "'comment'", ",", "'max-age'", ")", "# Split into cookie(s); handles headers with mult...
Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies.
[ "Parse", "the", "Set", "-", "cookie", "header", "and", "return", "a", "list", "of", "cookies", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L861-L953
36,902
saltstack/salt
salt/utils/http.py
sanitize_url
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
python
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
[ "def", "sanitize_url", "(", "url", ",", "hide_fields", ")", ":", "if", "isinstance", "(", "hide_fields", ",", "list", ")", ":", "url_comps", "=", "splitquery", "(", "url", ")", "log_url", "=", "url_comps", "[", "0", "]", "if", "len", "(", "url_comps", ...
Make sure no secret fields show up in logs
[ "Make", "sure", "no", "secret", "fields", "show", "up", "in", "logs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L956-L977
36,903
saltstack/salt
salt/utils/http.py
_sanitize_url_components
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
python
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
[ "def", "_sanitize_url_components", "(", "comp_list", ",", "field", ")", ":", "if", "not", "comp_list", ":", "return", "''", "elif", "comp_list", "[", "0", "]", ".", "startswith", "(", "'{0}='", ".", "format", "(", "field", ")", ")", ":", "ret", "=", "'...
Recursive function to sanitize each component of the url.
[ "Recursive", "function", "to", "sanitize", "each", "component", "of", "the", "url", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L980-L993
36,904
saltstack/salt
salt/modules/namecheap_domains_ns.py
update
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
python
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
[ "def", "update", "(", "sld", ",", "tld", ",", "nameserver", ",", "old_ip", ",", "new_ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.update'", ")", "opts", "[", "'SLD'", "]", "=", "sld", ...
Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address new_ip New ip address CLI Example: .. code-blo...
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "updated", "successfully", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L90-L128
36,905
saltstack/salt
salt/modules/namecheap_domains_ns.py
delete
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
python
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
[ "def", "delete", "(", "sld", ",", "tld", ",", "nameserver", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.delete'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "="...
Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' namecheap_domains_ns.delete sld tld nameserver
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "deleted", "successfully" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L131-L161
36,906
saltstack/salt
salt/modules/namecheap_domains_ns.py
create
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
python
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
[ "def", "create", "(", "sld", ",", "tld", ",", "nameserver", ",", "ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.create'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'...
Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example: .. code-block:: bash salt '*' name...
[ "Creates", "a", "new", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "created", "successfully", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L164-L199
36,907
saltstack/salt
salt/modules/dnsmasq.py
version
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
python
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
[ "def", "version", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "return", "comps", "[", "2", "]"...
Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version
[ "Shows", "installed", "version", "of", "dnsmasq", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L35-L48
36,908
saltstack/salt
salt/modules/dnsmasq.py
fullversion
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
python
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
[ "def", "fullversion", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "version_num", "=", "comps", "...
Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion
[ "Shows", "installed", "version", "of", "dnsmasq", "and", "compile", "options", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L51-L67
36,909
saltstack/salt
salt/modules/dnsmasq.py
set_config
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
python
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
[ "def", "set_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ",", "follow", "=", "True", ",", "*", "*", "kwargs", ")", ":", "dnsopts", "=", "get_config", "(", "config_file", ")", "includes", "=", "[", "config_file", "]", "if", "follow", "is", "True...
Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not find it inside any files, it will append it to the main config file. Setting fo...
[ "Sets", "a", "value", "or", "a", "set", "of", "values", "in", "the", "specified", "file", ".", "By", "default", "if", "conf", "-", "dir", "is", "configured", "in", "this", "file", "salt", "will", "attempt", "to", "set", "the", "option", "in", "any", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L70-L131
36,910
saltstack/salt
salt/modules/dnsmasq.py
get_config
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
python
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
[ "def", "get_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ")", ":", "dnsopts", "=", "_parse_dnamasq", "(", "config_file", ")", "if", "'conf-dir'", "in", "dnsopts", ":", "for", "filename", "in", "os", ".", "listdir", "(", "dnsopts", "[", "'conf-dir'"...
Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config salt '*' dnsmasq.get_config config_file=/etc/dnsmasq.conf
[ "Dumps", "all", "options", "from", "the", "config", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L134-L160
36,911
saltstack/salt
salt/modules/dnsmasq.py
_parse_dnamasq
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
python
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
[ "def", "_parse_dnamasq", "(", "filename", ")", ":", "fileopts", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "raise", "CommandExecutionError", "(", "'Error: No such file \\'{0}\\''", ".", "format", "(", "filename", ...
Generic function for parsing dnsmasq files including includes.
[ "Generic", "function", "for", "parsing", "dnsmasq", "files", "including", "includes", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L163-L194
36,912
saltstack/salt
salt/output/key.py
output
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
python
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "color", "=", "salt", ".", "utils", ".", "color", ".", "get_colors", "(", "__opts__", ".", "get", "(", "'color'", ")", ",", "__opts__", ".", "get", "(",...
Read in the dict structure generated by the salt key API methods and print the structure.
[ "Read", "in", "the", "dict", "structure", "generated", "by", "the", "salt", "key", "API", "methods", "and", "print", "the", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/key.py#L16-L107
36,913
saltstack/salt
salt/engines/sqs_events.py
_get_sqs_conn
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
python
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
[ "def", "_get_sqs_conn", "(", "profile", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ")", ":", "if", "profile", ":", "if", "isinstance", "(", "profile", ",", "six", ".", "string_types", ")", ":", "_profile", "=", "_...
Get a boto connection to SQS.
[ "Get", "a", "boto", "connection", "to", "SQS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L105-L131
36,914
saltstack/salt
salt/engines/sqs_events.py
start
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
python
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
[ "def", "start", "(", "queue", ",", "profile", "=", "None", ",", "tag", "=", "'salt/engine/sqs'", ",", "owner_acct_id", "=", "None", ")", ":", "if", "__opts__", ".", "get", "(", "'__role'", ")", "==", "'master'", ":", "fire_master", "=", "salt", ".", "u...
Listen to sqs and fire message on event bus
[ "Listen", "to", "sqs", "and", "fire", "message", "on", "event", "bus" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L151-L172
36,915
saltstack/salt
salt/client/ssh/wrapper/cp.py
get_file
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
python
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
[ "def", "get_file", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ",", "makedirs", "=", "False", ",", "template", "=", "None", ",", "gzip", "=", "None", ")", ":", "if", "gzip", "is", "not", "None", ":", "log", ".", "warning", "(", "'The g...
Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_file. The argument is only accepted for interface compatibility.
[ "Send", "a", "file", "from", "the", "master", "to", "the", "location", "in", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L20-L50
36,916
saltstack/salt
salt/client/ssh/wrapper/cp.py
get_dir
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
python
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
[ "def", "get_dir", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ")", ":", "src", "=", "__context__", "[", "'fileclient'", "]", ".", "cache_dir", "(", "path", ",", "saltenv", ",", "cachedir", "=", "os", ".", "path", ".", "join", "(", "'salt...
Transfer a directory down
[ "Transfer", "a", "directory", "down" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L53-L67
36,917
saltstack/salt
salt/utils/immutabletypes.py
freeze
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
python
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
[ "def", "freeze", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "return", "ImmutableDict", "(", "obj", ")", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "return", "ImmutableList", "(", "obj", ")", "if", "isinst...
Freeze python types by turning them into immutable structures.
[ "Freeze", "python", "types", "by", "turning", "them", "into", "immutable", "structures", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/immutabletypes.py#L105-L115
36,918
saltstack/salt
salt/modules/alternatives.py
display
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
python
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
[ "def", "display", "(", "name", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out", "[", "'retcode'"...
Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor
[ "Display", "alternatives", "settings", "for", "defined", "command", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L53-L67
36,919
saltstack/salt
salt/modules/alternatives.py
show_link
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
python
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
[ "def", "show_link", "(", "name", ")", ":", "if", "__grains__", "[", "'os_family'", "]", "==", "'RedHat'", ":", "path", "=", "'/var/lib/'", "elif", "__grains__", "[", "'os_family'", "]", "==", "'Suse'", ":", "path", "=", "'/var/lib/rpm/'", "else", ":", "pat...
Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor
[ "Display", "master", "link", "for", "the", "alternative" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L70-L104
36,920
saltstack/salt
salt/modules/alternatives.py
check_exists
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
python
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
[ "def", "check_exists", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out"...
Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path
[ "Check", "if", "the", "given", "path", "is", "an", "alternative", "for", "a", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L125-L143
36,921
saltstack/salt
salt/modules/alternatives.py
install
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
python
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
[ "def", "install", "(", "name", ",", "link", ",", "path", ",", "priority", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--install'", ",", "link", ",", "name", ",", "path", ",", "six", ".", "text_type", "(", "priority", ")", "]", "out", ...
Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50
[ "Install", "symbolic", "links", "determining", "default", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L163-L177
36,922
saltstack/salt
salt/modules/alternatives.py
remove
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
python
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
[ "def", "remove", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--remove'", ",", "name", ",", "path", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if...
Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path
[ "Remove", "symbolic", "links", "determining", "the", "default", "commands", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L180-L194
36,923
saltstack/salt
salt/utils/pbm.py
get_placement_solver
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
python
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
[ "def", "get_placement_solver", "(", "service_instance", ")", ":", "stub", "=", "salt", ".", "utils", ".", "vmware", ".", "get_new_service_instance_stub", "(", "service_instance", ",", "ns", "=", "'pbm/2.0'", ",", "path", "=", "'/pbm/sdk'", ")", "pbm_si", "=", ...
Returns a placement solver service_instance Service instance to the host or vCenter
[ "Returns", "a", "placement", "solver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L98-L120
36,924
saltstack/salt
salt/utils/pbm.py
get_capability_definitions
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
python
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
[ "def", "get_capability_definitions", "(", "profile_manager", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "ResourceTypeEnum", ".", "STORAGE", ")", "try", ":", "cap_categories", "=", ...
Returns a list of all capability definitions. profile_manager Reference to the profile manager.
[ "Returns", "a", "list", "of", "all", "capability", "definitions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L123-L147
36,925
saltstack/salt
salt/utils/pbm.py
get_policies_by_id
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
python
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
[ "def", "get_policies_by_id", "(", "profile_manager", ",", "policy_ids", ")", ":", "try", ":", "return", "profile_manager", ".", "RetrieveContent", "(", "policy_ids", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as", "exc", ":", "log", ".", "except...
Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve.
[ "Returns", "a", "list", "of", "policies", "with", "the", "specified", "ids", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L150-L171
36,926
saltstack/salt
salt/utils/pbm.py
get_storage_policies
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
python
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
[ "def", "get_storage_policies", "(", "profile_manager", ",", "policy_names", "=", "None", ",", "get_all_policies", "=", "False", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "Resour...
Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default is None. get_all_policies Flag specifying to return all policies, regardless of the specified filter.
[ "Returns", "a", "list", "of", "the", "storage", "policies", "filtered", "by", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L174-L213
36,927
saltstack/salt
salt/utils/pbm.py
get_default_storage_policy_of_datastore
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
python
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
[ "def", "get_default_storage_policy_of_datastore", "(", "profile_manager", ",", "datastore", ")", ":", "# Retrieve all datastores visible", "hub", "=", "pbm", ".", "placement", ".", "PlacementHub", "(", "hubId", "=", "datastore", ".", "_moId", ",", "hubType", "=", "'...
Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore.
[ "Returns", "the", "default", "storage", "policy", "reference", "assigned", "to", "a", "datastore", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L267-L297
36,928
saltstack/salt
salt/sdb/redis_sdb.py
set_
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
python
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
[ "def", "set_", "(", "key", ",", "value", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", ...
Set a value into the Redis SDB.
[ "Set", "a", "value", "into", "the", "Redis", "SDB", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L51-L60
36,929
saltstack/salt
salt/sdb/redis_sdb.py
get
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
python
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
[ "def", "get", "(", "key", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", "redis", ".", ...
Get a value from the Redis SDB.
[ "Get", "a", "value", "from", "the", "Redis", "SDB", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L63-L72
36,930
saltstack/salt
salt/states/libcloud_loadbalancer.py
balancer_present
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
python
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
[ "def", "balancer_present", "(", "name", ",", "port", ",", "protocol", ",", "profile", ",", "algorithm", "=", "None", ",", "members", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balanc...
Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :param protocol: Loadbalancer protocol, defaults to http. :type protocol: ``str`` :param profile: The profil...
[ "Ensures", "a", "load", "balancer", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L76-L114
36,931
saltstack/salt
salt/states/libcloud_loadbalancer.py
balancer_absent
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
python
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
[ "def", "balancer_absent", "(", "name", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancers'", "]", "(", "profile", ")", "match", "=", "[", "z", "for", "z", "in", "balancers", "...
Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str``
[ "Ensures", "a", "load", "balancer", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L117-L133
36,932
saltstack/salt
salt/states/libcloud_loadbalancer.py
member_present
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
python
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
[ "def", "member_present", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")"...
Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to attach the member to :type balancer_id: ``str`` :param profile: The profil...
[ "Ensure", "a", "load", "balancer", "member", "is", "present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L136-L157
36,933
saltstack/salt
salt/states/libcloud_loadbalancer.py
member_absent
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
python
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
[ "def", "member_absent", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")",...
Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer you want to detach the member from :type balancer_id: ``str`` :param prof...
[ "Ensure", "a", "load", "balancer", "member", "is", "absent", "based", "on", "IP", "and", "Port" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L160-L181
36,934
saltstack/salt
salt/modules/sysbench.py
_parser
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
python
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
[ "def", "_parser", "(", "result", ")", ":", "# regexes to match", "_total_time", "=", "re", ".", "compile", "(", "r'total time:\\s*(\\d*.\\d*s)'", ")", "_total_execution", "=", "re", ".", "compile", "(", "r'event execution:\\s*(\\d*.\\d*s?)'", ")", "_min_response_time", ...
parses the output into a dictionary
[ "parses", "the", "output", "into", "a", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L25-L56
36,935
saltstack/salt
salt/modules/sysbench.py
cpu
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
python
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
[ "def", "cpu", "(", ")", ":", "# Test data", "max_primes", "=", "[", "500", ",", "1000", ",", "2500", ",", "5000", "]", "# Initializing the test variables", "test_command", "=", "'sysbench --test=cpu --cpu-max-prime={0} run'", "result", "=", "None", "ret_val", "=", ...
Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu
[ "Tests", "for", "the", "CPU", "performance", "of", "minions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L59-L85
36,936
saltstack/salt
salt/modules/sysbench.py
threads
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
python
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
[ "def", "threads", "(", ")", ":", "# Test data", "thread_yields", "=", "[", "100", ",", "200", ",", "500", ",", "1000", "]", "thread_locks", "=", "[", "2", ",", "4", ",", "8", ",", "16", "]", "# Initializing the test variables", "test_command", "=", "'sys...
This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads
[ "This", "tests", "the", "performance", "of", "the", "processor", "s", "scheduler" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L88-L116
36,937
saltstack/salt
salt/modules/sysbench.py
mutex
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
python
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
[ "def", "mutex", "(", ")", ":", "# Test options and the values they take", "# --mutex-num = [50,500,1000]", "# --mutex-locks = [10000,25000,50000]", "# --mutex-loops = [2500,5000,10000]", "# Test data (Orthogonal test cases)", "mutex_num", "=", "[", "50", ",", "50", ",", "50", ","...
Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex
[ "Tests", "the", "implementation", "of", "mutex" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L119-L155
36,938
saltstack/salt
salt/modules/sysbench.py
memory
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
python
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
[ "def", "memory", "(", ")", ":", "# test defaults", "# --memory-block-size = 10M", "# --memory-total-size = 1G", "# We test memory read / write against global / local scope of memory", "# Test data", "memory_oper", "=", "[", "'read'", ",", "'write'", "]", "memory_scope", "=", "[...
This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory
[ "This", "tests", "the", "memory", "for", "read", "and", "write", "operations", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L158-L193
36,939
saltstack/salt
salt/modules/sysbench.py
fileio
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
python
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
[ "def", "fileio", "(", ")", ":", "# Test data", "test_modes", "=", "[", "'seqwr'", ",", "'seqrewr'", ",", "'seqrd'", ",", "'rndrd'", ",", "'rndwr'", ",", "'rndrw'", "]", "# Initializing the required variables", "test_command", "=", "'sysbench --num-threads=16 --test=fi...
This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size The test consumes a lot of ...
[ "This", "tests", "for", "the", "file", "read", "and", "write", "operations", "Various", "modes", "of", "operations", "are" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L196-L244
36,940
saltstack/salt
salt/modules/linux_lvm.py
version
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
python
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
[ "def", "version", "(", ")", ":", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "ret", "=", "out", "[", "0", "]", ".", "split", "(", "': '", ")", "return", "ret", "[", "1"...
Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version
[ "Return", "LVM", "version", "from", "lvm", "version" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L32-L45
36,941
saltstack/salt
salt/modules/linux_lvm.py
fullversion
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
python
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
[ "def", "fullversion", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "comps", "=", "line", ".", "split"...
Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion
[ "Return", "all", "version", "info", "from", "lvm", "version" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L48-L64
36,942
saltstack/salt
salt/modules/linux_lvm.py
pvcreate
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
python
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
[ "def", "pvcreate", "(", "devices", ",", "override", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "not", "devices", ":", "return", "'Error: at least one device is required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", "...
Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
[ "Set", "a", "physical", "device", "to", "be", "used", "as", "an", "LVM", "physical", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L226-L278
36,943
saltstack/salt
salt/modules/linux_lvm.py
pvremove
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
python
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
[ "def", "pvremove", "(", "devices", ",", "override", "=", "True", ")", ":", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices", "=", "devices", ".", "split", "(", "','", ")", "cmd", "=", "[", "'pvremove'", ",", "'...
Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2
[ "Remove", "a", "physical", "device", "being", "used", "as", "an", "LVM", "physical", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L281-L317
36,944
saltstack/salt
salt/modules/linux_lvm.py
vgcreate
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
python
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
[ "def", "vgcreate", "(", "vgname", ",", "devices", ",", "*", "*", "kwargs", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_t...
Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
[ "Create", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L320-L348
36,945
saltstack/salt
salt/modules/linux_lvm.py
vgextend
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
python
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
[ "def", "vgextend", "(", "vgname", ",", "devices", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices",...
Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1
[ "Add", "physical", "volumes", "to", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L351-L372
36,946
saltstack/salt
salt/modules/linux_lvm.py
lvcreate
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
python
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
[ "def", "lvcreate", "(", "lvname", ",", "vgname", ",", "size", "=", "None", ",", "extents", "=", "None", ",", "snapshot", "=", "None", ",", "pv", "=", "None", ",", "thinvolume", "=", "False", ",", "thinpool", "=", "False", ",", "force", "=", "False", ...
Create a new logical volume, with option for which physical volume to be used CLI Examples: .. code-block:: bash salt '*' lvm.lvcreate new_volume_name vg_name size=10G salt '*' lvm.lvcreate new_volume_name vg_name extents=100 pv=/dev/sdb salt '*' lvm.lvcreate new_snapshot ...
[ "Create", "a", "new", "logical", "volume", "with", "option", "for", "which", "physical", "volume", "to", "be", "used" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L375-L465
36,947
saltstack/salt
salt/modules/linux_lvm.py
vgremove
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
python
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
[ "def", "vgremove", "(", "vgname", ")", ":", "cmd", "=", "[", "'vgremove'", ",", "'-f'", ",", "vgname", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "out", ".", "strip", "(", ")" ]
Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True
[ "Remove", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L468-L481
36,948
saltstack/salt
salt/modules/linux_lvm.py
lvremove
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
python
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
[ "def", "lvremove", "(", "lvname", ",", "vgname", ")", ":", "cmd", "=", "[", "'lvremove'", ",", "'-f'", ",", "'{0}/{1}'", ".", "format", "(", "vgname", ",", "lvname", ")", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_sh...
Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True
[ "Remove", "a", "given", "existing", "logical", "volume", "from", "a", "named", "existing", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L484-L496
36,949
saltstack/salt
salt/cloud/clouds/joyent.py
query_instance
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
python
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
[ "def", "query_instance", "(", "vm_", "=", "None", ",", "call", "=", "None", ")", ":", "if", "isinstance", "(", "vm_", ",", "six", ".", "string_types", ")", "and", "call", "==", "'action'", ":", "vm_", "=", "{", "'name'", ":", "vm_", ",", "'provider'"...
Query an instance upon creation from the Joyent API
[ "Query", "an", "instance", "upon", "creation", "from", "the", "Joyent", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L172-L235
36,950
saltstack/salt
salt/cloud/clouds/joyent.py
create_node
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
python
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
[ "def", "create_node", "(", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", "[", "'name'", "]", "size", "=", "kwargs", "[", "'size'", "]", "image", "=", "kwargs", "[", "'image'", "]", "location", "=", "kwargs", "[", "'location'", "]", "networks", ...
convenience function to make the rest api call for node creation.
[ "convenience", "function", "to", "make", "the", "rest", "api", "call", "for", "node", "creation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L325-L370
36,951
saltstack/salt
salt/cloud/clouds/joyent.py
has_method
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
python
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
[ "def", "has_method", "(", "obj", ",", "method_name", ")", ":", "if", "method_name", "in", "dir", "(", "obj", ")", ":", "return", "True", "log", ".", "error", "(", "'Method \\'%s\\' not yet supported!'", ",", "method_name", ")", "return", "False" ]
Find if the provided object has a specific method
[ "Find", "if", "the", "provided", "object", "has", "a", "specific", "method" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L590-L598
36,952
saltstack/salt
salt/cloud/clouds/joyent.py
list_nodes
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
python
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
[ "def", "list_nodes", "(", "full", "=", "False", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "if", "POL...
list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q
[ "list", "of", "nodes", "keeping", "only", "a", "brief", "listing" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L717-L755
36,953
saltstack/salt
salt/cloud/clouds/joyent.py
avail_images
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
python
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "user", "=", "config", "."...
Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images
[ "Get", "list", "of", "available", "images" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L805-L848
36,954
saltstack/salt
salt/cloud/clouds/joyent.py
avail_sizes
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
python
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "rcode", ",", "items", "=", ...
get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes
[ "get", "list", "of", "available", "packages" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L851-L870
36,955
saltstack/salt
salt/modules/upstart_service.py
_iter_service_names
def _iter_service_names(): ''' Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts ''' found = set() for line in glob.glob('/etc/init.d/*'): name = os.path.basename(line) found.add(name) yield name # Thi...
python
def _iter_service_names(): ''' Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts ''' found = set() for line in glob.glob('/etc/init.d/*'): name = os.path.basename(line) found.add(name) yield name # Thi...
[ "def", "_iter_service_names", "(", ")", ":", "found", "=", "set", "(", ")", "for", "line", "in", "glob", ".", "glob", "(", "'/etc/init.d/*'", ")", ":", "name", "=", "os", ".", "path", ".", "basename", "(", "line", ")", "found", ".", "add", "(", "na...
Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts
[ "Detect", "all", "of", "the", "service", "names", "available", "to", "upstart", "via", "init", "configuration", "files", "and", "via", "classic", "sysv", "init", "scripts" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L238-L265
36,956
saltstack/salt
salt/modules/upstart_service.py
get_enabled
def get_enabled(): ''' Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_enabled(name): ret.add(name) ...
python
def get_enabled(): ''' Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_enabled(name): ret.add(name) ...
[ "def", "get_enabled", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "name", "in", "_iter_service_names", "(", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "if", "_upstart_is_enabled", "(", "name", ")", ":", "ret", ".", "add", "(",...
Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled
[ "Return", "the", "enabled", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L268-L287
36,957
saltstack/salt
salt/modules/upstart_service.py
get_disabled
def get_disabled(): ''' Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_disabled(name): ret.add(name) ...
python
def get_disabled(): ''' Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_disabled(name): ret.add(name) ...
[ "def", "get_disabled", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "name", "in", "_iter_service_names", "(", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "if", "_upstart_is_disabled", "(", "name", ")", ":", "ret", ".", "add", "(...
Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled
[ "Return", "the", "disabled", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L290-L309
36,958
saltstack/salt
salt/modules/upstart_service.py
_upstart_disable
def _upstart_disable(name): ''' Disable an Upstart service. ''' if _upstart_is_disabled(name): return _upstart_is_disabled(name) override = '/etc/init/{0}.override'.format(name) with salt.utils.files.fopen(override, 'a') as ofile: ofile.write(salt.utils.stringutils.to_str('manual...
python
def _upstart_disable(name): ''' Disable an Upstart service. ''' if _upstart_is_disabled(name): return _upstart_is_disabled(name) override = '/etc/init/{0}.override'.format(name) with salt.utils.files.fopen(override, 'a') as ofile: ofile.write(salt.utils.stringutils.to_str('manual...
[ "def", "_upstart_disable", "(", "name", ")", ":", "if", "_upstart_is_disabled", "(", "name", ")", ":", "return", "_upstart_is_disabled", "(", "name", ")", "override", "=", "'/etc/init/{0}.override'", ".", "format", "(", "name", ")", "with", "salt", ".", "utils...
Disable an Upstart service.
[ "Disable", "an", "Upstart", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L499-L508
36,959
saltstack/salt
salt/modules/upstart_service.py
_upstart_enable
def _upstart_enable(name): ''' Enable an Upstart service. ''' if _upstart_is_enabled(name): return _upstart_is_enabled(name) override = '/etc/init/{0}.override'.format(name) files = ['/etc/init/{0}.conf'.format(name), override] for file_name in filter(os.path.isfile, files): ...
python
def _upstart_enable(name): ''' Enable an Upstart service. ''' if _upstart_is_enabled(name): return _upstart_is_enabled(name) override = '/etc/init/{0}.override'.format(name) files = ['/etc/init/{0}.conf'.format(name), override] for file_name in filter(os.path.isfile, files): ...
[ "def", "_upstart_enable", "(", "name", ")", ":", "if", "_upstart_is_enabled", "(", "name", ")", ":", "return", "_upstart_is_enabled", "(", "name", ")", "override", "=", "'/etc/init/{0}.override'", ".", "format", "(", "name", ")", "files", "=", "[", "'/etc/init...
Enable an Upstart service.
[ "Enable", "an", "Upstart", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L511-L535
36,960
saltstack/salt
salt/modules/upstart_service.py
disable
def disable(name, **kwargs): ''' Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' if _service_is_upstart(name): return _upstart_disable(name) executable = _get_service_exec() cmd = [executable...
python
def disable(name, **kwargs): ''' Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' if _service_is_upstart(name): return _upstart_disable(name) executable = _get_service_exec() cmd = [executable...
[ "def", "disable", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_disable", "(", "name", ")", "executable", "=", "_get_service_exec", "(", ")", "cmd", "=", "[", "executable", ",", "'...
Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name>
[ "Disable", "the", "named", "service", "from", "starting", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L555-L569
36,961
saltstack/salt
salt/modules/upstart_service.py
disabled
def disabled(name): ''' Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name> ''' if _service_is_upstart(name): return _upstart_is_disabled(name) else: if _service_is_sysv(name): ...
python
def disabled(name): ''' Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name> ''' if _service_is_upstart(name): return _upstart_is_disabled(name) else: if _service_is_sysv(name): ...
[ "def", "disabled", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_is_disabled", "(", "name", ")", "else", ":", "if", "_service_is_sysv", "(", "name", ")", ":", "return", "_sysv_is_disabled", "(", "name", ")", ...
Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name>
[ "Check", "to", "see", "if", "the", "named", "service", "is", "disabled", "to", "start", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L590-L605
36,962
saltstack/salt
salt/auth/yubico.py
__get_yubico_users
def __get_yubico_users(username): ''' Grab the YubiKey Client ID & Secret Key ''' user = {} try: if __opts__['yubico_users'].get(username, None): (user['id'], user['key']) = list(__opts__['yubico_users'][username].values()) else: return None except KeyErr...
python
def __get_yubico_users(username): ''' Grab the YubiKey Client ID & Secret Key ''' user = {} try: if __opts__['yubico_users'].get(username, None): (user['id'], user['key']) = list(__opts__['yubico_users'][username].values()) else: return None except KeyErr...
[ "def", "__get_yubico_users", "(", "username", ")", ":", "user", "=", "{", "}", "try", ":", "if", "__opts__", "[", "'yubico_users'", "]", ".", "get", "(", "username", ",", "None", ")", ":", "(", "user", "[", "'id'", "]", ",", "user", "[", "'key'", "...
Grab the YubiKey Client ID & Secret Key
[ "Grab", "the", "YubiKey", "Client", "ID", "&", "Secret", "Key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/yubico.py#L55-L69
36,963
saltstack/salt
salt/auth/yubico.py
auth
def auth(username, password): ''' Authenticate against yubico server ''' _cred = __get_yubico_users(username) client = Yubico(_cred['id'], _cred['key']) try: return client.verify(password) except yubico_exceptions.StatusCodeError as e: log.info('Unable to verify YubiKey `%s...
python
def auth(username, password): ''' Authenticate against yubico server ''' _cred = __get_yubico_users(username) client = Yubico(_cred['id'], _cred['key']) try: return client.verify(password) except yubico_exceptions.StatusCodeError as e: log.info('Unable to verify YubiKey `%s...
[ "def", "auth", "(", "username", ",", "password", ")", ":", "_cred", "=", "__get_yubico_users", "(", "username", ")", "client", "=", "Yubico", "(", "_cred", "[", "'id'", "]", ",", "_cred", "[", "'key'", "]", ")", "try", ":", "return", "client", ".", "...
Authenticate against yubico server
[ "Authenticate", "against", "yubico", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/yubico.py#L72-L84
36,964
saltstack/salt
salt/log/mixins.py
ExcInfoOnLogLevelFormatMixIn.format
def format(self, record): ''' Format the log record to include exc_info if the handler is enabled for a specific log level ''' formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format(record) exc_info_on_loglevel = getattr(record, 'exc_info_on_loglevel', None) ...
python
def format(self, record): ''' Format the log record to include exc_info if the handler is enabled for a specific log level ''' formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format(record) exc_info_on_loglevel = getattr(record, 'exc_info_on_loglevel', None) ...
[ "def", "format", "(", "self", ",", "record", ")", ":", "formatted_record", "=", "super", "(", "ExcInfoOnLogLevelFormatMixIn", ",", "self", ")", ".", "format", "(", "record", ")", "exc_info_on_loglevel", "=", "getattr", "(", "record", ",", "'exc_info_on_loglevel'...
Format the log record to include exc_info if the handler is enabled for a specific log level
[ "Format", "the", "log", "record", "to", "include", "exc_info", "if", "the", "handler", "is", "enabled", "for", "a", "specific", "log", "level" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/mixins.py#L90-L141
36,965
saltstack/salt
salt/modules/s3.py
delete
def delete(bucket, path=None, action=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt...
python
def delete(bucket, path=None, action=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt...
[ "def", "delete", "(", "bucket", ",", "path", "=", "None", ",", "action", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl", "=", "None", ",", "kms_keyid", "=", "None", ",", "location",...
Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt myminion s3.delete mybucket CLI Example to delete an object from a bucket:: salt myminion s3.delete mybucket remoteobject
[ "Delete", "a", "bucket", "or", "delete", "an", "object", "from", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L82-L120
36,966
saltstack/salt
salt/modules/s3.py
get
def get(bucket='', path='', return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' List the contents of a bucket, or return an object from a bucket. Se...
python
def get(bucket='', path='', return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' List the contents of a bucket, or return an object from a bucket. Se...
[ "def", "get", "(", "bucket", "=", "''", ",", "path", "=", "''", ",", "return_bin", "=", "False", ",", "action", "=", "None", ",", "local_file", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", ...
List the contents of a bucket, or return an object from a bucket. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response. CLI Example to list buckets: .. code-block:: bash salt myminion s3.get CLI Example to list the content...
[ "List", "the", "contents", "of", "a", "bucket", "or", "return", "an", "object", "from", "a", "bucket", ".", "Set", "return_bin", "to", "True", "in", "order", "to", "retrieve", "an", "object", "wholesale", ".", "Otherwise", "Salt", "will", "attempt", "to", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L123-L204
36,967
saltstack/salt
salt/modules/s3.py
head
def head(bucket, path='', key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt mymin...
python
def head(bucket, path='', key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt mymin...
[ "def", "head", "(", "bucket", ",", "path", "=", "''", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl", "=", "None", ",", "kms_keyid", "=", "None", ",", "location", "=", "None", ",", "role_arn", ...
Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt myminion s3.head mybucket salt myminion s3.head mybucket myfile.png
[ "Return", "the", "metadata", "for", "a", "bucket", "or", "an", "object", "in", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L207-L244
36,968
saltstack/salt
salt/modules/s3.py
put
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): ''' Create a new bucket, or upload an o...
python
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): ''' Create a new bucket, or upload an o...
[ "def", "put", "(", "bucket", ",", "path", "=", "None", ",", "return_bin", "=", "False", ",", "action", "=", "None", ",", "local_file", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl"...
Create a new bucket, or upload an object to a bucket. CLI Example to create a bucket: .. code-block:: bash salt myminion s3.put mybucket CLI Example to upload an object to a bucket: .. code-block:: bash salt myminion s3.put mybucket remotepath local_file=/path/to/file
[ "Create", "a", "new", "bucket", "or", "upload", "an", "object", "to", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L247-L300
36,969
saltstack/salt
salt/modules/s3.py
_get_key
def _get_key(key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable): ''' Examine the keys, and populate as necessary ''' if not key and __salt__['config.option']('s3.key'): key = __salt__['config.option']('s3.key') if not keyid and __salt__['config.opt...
python
def _get_key(key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable): ''' Examine the keys, and populate as necessary ''' if not key and __salt__['config.option']('s3.key'): key = __salt__['config.option']('s3.key') if not keyid and __salt__['config.opt...
[ "def", "_get_key", "(", "key", ",", "keyid", ",", "service_url", ",", "verify_ssl", ",", "kms_keyid", ",", "location", ",", "role_arn", ",", "path_style", ",", "https_enable", ")", ":", "if", "not", "key", "and", "__salt__", "[", "'config.option'", "]", "(...
Examine the keys, and populate as necessary
[ "Examine", "the", "keys", "and", "populate", "as", "necessary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L303-L346
36,970
saltstack/salt
salt/modules/pdbedit.py
generate_nt_hash
def generate_nt_hash(password): ''' Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd ''' return binascii.hexlify( hashlib.new( 'md4', password.encode('utf-16le') ).digest() ).upper()
python
def generate_nt_hash(password): ''' Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd ''' return binascii.hexlify( hashlib.new( 'md4', password.encode('utf-16le') ).digest() ).upper()
[ "def", "generate_nt_hash", "(", "password", ")", ":", "return", "binascii", ".", "hexlify", "(", "hashlib", ".", "new", "(", "'md4'", ",", "password", ".", "encode", "(", "'utf-16le'", ")", ")", ".", "digest", "(", ")", ")", ".", "upper", "(", ")" ]
Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd
[ "Generate", "a", "NT", "HASH" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L52-L67
36,971
saltstack/salt
salt/modules/pdbedit.py
get_user
def get_user(login, hashes=False): ''' Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee ''' users = list_users(verbose=True, hashes=has...
python
def get_user(login, hashes=False): ''' Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee ''' users = list_users(verbose=True, hashes=has...
[ "def", "get_user", "(", "login", ",", "hashes", "=", "False", ")", ":", "users", "=", "list_users", "(", "verbose", "=", "True", ",", "hashes", "=", "hashes", ")", "return", "users", "[", "login", "]", "if", "login", "in", "users", "else", "{", "}" ]
Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee
[ "Get", "user", "account", "details" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L127-L143
36,972
saltstack/salt
salt/modules/pdbedit.py
delete
def delete(login): ''' Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash ''' if login in list_users(False): res = __salt__['cmd.run_all']( 'pdbedit --delete {login}'.format(login=_quote_args(lo...
python
def delete(login): ''' Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash ''' if login in list_users(False): res = __salt__['cmd.run_all']( 'pdbedit --delete {login}'.format(login=_quote_args(lo...
[ "def", "delete", "(", "login", ")", ":", "if", "login", "in", "list_users", "(", "False", ")", ":", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'pdbedit --delete {login}'", ".", "format", "(", "login", "=", "_quote_args", "(", "login", ")", ...
Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash
[ "Delete", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L146-L169
36,973
saltstack/salt
salt/modules/pdbedit.py
create
def create(login, password, password_hashed=False, machine_account=False): ''' Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to c...
python
def create(login, password, password_hashed=False, machine_account=False): ''' Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to c...
[ "def", "create", "(", "login", ",", "password", ",", "password_hashed", "=", "False", ",", "machine_account", "=", "False", ")", ":", "ret", "=", "'unchanged'", "# generate nt hash if needed", "if", "password_hashed", ":", "password_hash", "=", "password", ".", ...
Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to create a machine trust account instead CLI Example: .. code-block:: bash ...
[ "Create", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L172-L233
36,974
saltstack/salt
salt/states/supervisord.py
mod_watch
def mod_watch(name, restart=True, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state e...
python
def mod_watch(name, restart=True, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state e...
[ "def", "mod_watch", "(", "name", ",", "restart", "=", "True", ",", "update", "=", "False", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "running", "(", "name", ",...
The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being t...
[ "The", "supervisord", "watcher", "called", "to", "invoke", "the", "watch", "command", ".", "Always", "restart", "on", "watch" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/supervisord.py#L358-L382
36,975
saltstack/salt
salt/modules/nagios_rpc.py
_config
def _config(): ''' Get configuration items for URL, Username and Password ''' status_url = __salt__['config.get']('nagios.status_url') or \ __salt__['config.get']('nagios:status_url') if not status_url: raise CommandExecutionError('Missing Nagios URL in the configuration.') user...
python
def _config(): ''' Get configuration items for URL, Username and Password ''' status_url = __salt__['config.get']('nagios.status_url') or \ __salt__['config.get']('nagios:status_url') if not status_url: raise CommandExecutionError('Missing Nagios URL in the configuration.') user...
[ "def", "_config", "(", ")", ":", "status_url", "=", "__salt__", "[", "'config.get'", "]", "(", "'nagios.status_url'", ")", "or", "__salt__", "[", "'config.get'", "]", "(", "'nagios:status_url'", ")", "if", "not", "status_url", ":", "raise", "CommandExecutionErro...
Get configuration items for URL, Username and Password
[ "Get", "configuration", "items", "for", "URL", "Username", "and", "Password" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L32-L49
36,976
saltstack/salt
salt/modules/nagios_rpc.py
_status_query
def _status_query(query, hostname, enumerate=None, service=None): ''' Send query along to Nagios. ''' config = _config() data = None params = { 'hostname': hostname, 'query': query, } ret = { 'result': False } if enumerate: params['formatoptions...
python
def _status_query(query, hostname, enumerate=None, service=None): ''' Send query along to Nagios. ''' config = _config() data = None params = { 'hostname': hostname, 'query': query, } ret = { 'result': False } if enumerate: params['formatoptions...
[ "def", "_status_query", "(", "query", ",", "hostname", ",", "enumerate", "=", "None", ",", "service", "=", "None", ")", ":", "config", "=", "_config", "(", ")", "data", "=", "None", "params", "=", "{", "'hostname'", ":", "hostname", ",", "'query'", ":"...
Send query along to Nagios.
[ "Send", "query", "along", "to", "Nagios", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L52-L110
36,977
saltstack/salt
salt/modules/nagios_rpc.py
host_status
def host_status(hostname=None, **kwargs): ''' Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ...
python
def host_status(hostname=None, **kwargs): ''' Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ...
[ "def", "host_status", "(", "hostname", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "hostname", ":", "raise", "CommandExecutionError", "(", "'Missing hostname parameter'", ")", "target", "=", "'host'", "numeric", "=", "kwargs", ".", "get", "(...
Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ('OK' instead of 0, 'Warning' instead of 1 etc...
[ "Check", "status", "of", "a", "particular", "host", "By", "default", "statuses", "are", "returned", "in", "a", "numeric", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L113-L150
36,978
saltstack/salt
salt/modules/nagios_rpc.py
service_status
def service_status(hostname=None, service=None, **kwargs): ''' Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The serv...
python
def service_status(hostname=None, service=None, **kwargs): ''' Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The serv...
[ "def", "service_status", "(", "hostname", "=", "None", ",", "service", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "hostname", ":", "raise", "CommandExecutionError", "(", "'Missing hostname parameter'", ")", "if", "not", "service", ":", "rai...
Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The service to check the status of in Nagios. numeric Turn to fals...
[ "Check", "status", "of", "a", "particular", "service", "on", "a", "host", "on", "it", "in", "Nagios", ".", "By", "default", "statuses", "are", "returned", "in", "a", "numeric", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L153-L196
36,979
saltstack/salt
salt/sdb/keyring_db.py
get
def get(key, service=None, profile=None): ''' Get a value from a keyring service ''' service = _get_service(service, profile) return keyring.get_password(service, key)
python
def get(key, service=None, profile=None): ''' Get a value from a keyring service ''' service = _get_service(service, profile) return keyring.get_password(service, key)
[ "def", "get", "(", "key", ",", "service", "=", "None", ",", "profile", "=", "None", ")", ":", "service", "=", "_get_service", "(", "service", ",", "profile", ")", "return", "keyring", ".", "get_password", "(", "service", ",", "key", ")" ]
Get a value from a keyring service
[ "Get", "a", "value", "from", "a", "keyring", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/keyring_db.py#L84-L89
36,980
saltstack/salt
salt/returners/sentry_return.py
returner
def returner(ret): ''' Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience. ''' try: _connect_sentry(_get_message(ret), ret) except Ex...
python
def returner(ret): ''' Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience. ''' try: _connect_sentry(_get_message(ret), ret) except Ex...
[ "def", "returner", "(", "ret", ")", ":", "try", ":", "_connect_sentry", "(", "_get_message", "(", "ret", ")", ",", "ret", ")", "except", "Exception", "as", "err", ":", "log", ".", "error", "(", "'Can\\'t run connect_sentry: %s'", ",", "err", ",", "exc_info...
Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience.
[ "Log", "outcome", "to", "sentry", ".", "The", "returner", "tries", "to", "identify", "errors", "and", "report", "them", "as", "such", ".", "All", "other", "messages", "will", "be", "reported", "at", "info", "level", ".", "Failed", "states", "will", "be", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sentry_return.py#L74-L84
36,981
saltstack/salt
salt/returners/sentry_return.py
_connect_sentry
def _connect_sentry(message, result): ''' Connect to the Sentry server ''' pillar_data = __salt__['pillar.raw']() grains = __salt__['grains.items']() raven_config = pillar_data['raven'] hide_pillar = raven_config.get('hide_pillar') sentry_data = { 'result': result, 'pilla...
python
def _connect_sentry(message, result): ''' Connect to the Sentry server ''' pillar_data = __salt__['pillar.raw']() grains = __salt__['grains.items']() raven_config = pillar_data['raven'] hide_pillar = raven_config.get('hide_pillar') sentry_data = { 'result': result, 'pilla...
[ "def", "_connect_sentry", "(", "message", ",", "result", ")", ":", "pillar_data", "=", "__salt__", "[", "'pillar.raw'", "]", "(", ")", "grains", "=", "__salt__", "[", "'grains.items'", "]", "(", ")", "raven_config", "=", "pillar_data", "[", "'raven'", "]", ...
Connect to the Sentry server
[ "Connect", "to", "the", "Sentry", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sentry_return.py#L120-L180
36,982
saltstack/salt
salt/modules/vboxmanage.py
list_nodes_min
def list_nodes_min(): ''' Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min ''' ret = {} cmd = '{0} list vms'.format(vboxcmd()) for line in salt.modules.cmdmod.run(cmd).splitlines(): if not li...
python
def list_nodes_min(): ''' Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min ''' ret = {} cmd = '{0} list vms'.format(vboxcmd()) for line in salt.modules.cmdmod.run(cmd).splitlines(): if not li...
[ "def", "list_nodes_min", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'{0} list vms'", ".", "format", "(", "vboxcmd", "(", ")", ")", "for", "line", "in", "salt", ".", "modules", ".", "cmdmod", ".", "run", "(", "cmd", ")", ".", "splitlines", "(...
Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min
[ "Return", "a", "list", "of", "registered", "VMs", "with", "minimal", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L77-L95
36,983
saltstack/salt
salt/modules/vboxmanage.py
list_nodes
def list_nodes(): ''' Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = { 'id': nodes[node]['UUID'], 'image': nodes[node]['Guest...
python
def list_nodes(): ''' Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = { 'id': nodes[node]['UUID'], 'image': nodes[node]['Guest...
[ "def", "list_nodes", "(", ")", ":", "ret", "=", "{", "}", "nodes", "=", "list_nodes_full", "(", ")", "for", "node", "in", "nodes", ":", "ret", "[", "node", "]", "=", "{", "'id'", ":", "nodes", "[", "node", "]", "[", "'UUID'", "]", ",", "'image'",...
Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes
[ "Return", "a", "list", "of", "registered", "VMs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L111-L136
36,984
saltstack/salt
salt/modules/vboxmanage.py
register
def register(filename): ''' Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename ''' if not os.path.isfile(filename): raise CommandExecutionError( 'The specified filename ({0}) does not exist.'.format(filename) ) ...
python
def register(filename): ''' Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename ''' if not os.path.isfile(filename): raise CommandExecutionError( 'The specified filename ({0}) does not exist.'.format(filename) ) ...
[ "def", "register", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "raise", "CommandExecutionError", "(", "'The specified filename ({0}) does not exist.'", ".", "format", "(", "filename", ")", ")", "cmd", "=...
Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename
[ "Register", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L170-L189
36,985
saltstack/salt
salt/modules/vboxmanage.py
unregister
def unregister(name, delete=False): ''' Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename ''' nodes = list_nodes_min() if name not in nodes: raise CommandExecutionError( 'The specified VM ({0}) is not registered.'.f...
python
def unregister(name, delete=False): ''' Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename ''' nodes = list_nodes_min() if name not in nodes: raise CommandExecutionError( 'The specified VM ({0}) is not registered.'.f...
[ "def", "unregister", "(", "name", ",", "delete", "=", "False", ")", ":", "nodes", "=", "list_nodes_min", "(", ")", "if", "name", "not", "in", "nodes", ":", "raise", "CommandExecutionError", "(", "'The specified VM ({0}) is not registered.'", ".", "format", "(", ...
Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename
[ "Unregister", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L192-L214
36,986
saltstack/salt
salt/modules/vboxmanage.py
create
def create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs): ''' Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name> ''' nodes = list_node...
python
def create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs): ''' Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name> ''' nodes = list_node...
[ "def", "create", "(", "name", ",", "groups", "=", "None", ",", "ostype", "=", "None", ",", "register", "=", "True", ",", "basefolder", "=", "None", ",", "new_uuid", "=", "None", ",", "*", "*", "kwargs", ")", ":", "nodes", "=", "list_nodes_min", "(", ...
Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name>
[ "Create", "a", "new", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L230-L294
36,987
saltstack/salt
salt/modules/oracle.py
_unicode_output
def _unicode_output(cursor, name, default_type, size, precision, scale): ''' Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html ''' if default_type in (cx_Oracle.STRING, cx_Oracle.LONG_STRING, cx_Oracl...
python
def _unicode_output(cursor, name, default_type, size, precision, scale): ''' Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html ''' if default_type in (cx_Oracle.STRING, cx_Oracle.LONG_STRING, cx_Oracl...
[ "def", "_unicode_output", "(", "cursor", ",", "name", ",", "default_type", ",", "size", ",", "precision", ",", "scale", ")", ":", "if", "default_type", "in", "(", "cx_Oracle", ".", "STRING", ",", "cx_Oracle", ".", "LONG_STRING", ",", "cx_Oracle", ".", "FIX...
Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html
[ "Return", "strings", "values", "as", "python", "unicode", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L80-L88
36,988
saltstack/salt
salt/modules/oracle.py
_parse_oratab
def _parse_oratab(sid): ''' Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions ''' if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD'): ORATAB = '/etc/oratab' elif __grains__.get('kernel') in 'SunOS': ORATAB = '...
python
def _parse_oratab(sid): ''' Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions ''' if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD'): ORATAB = '/etc/oratab' elif __grains__.get('kernel') in 'SunOS': ORATAB = '...
[ "def", "_parse_oratab", "(", "sid", ")", ":", "if", "__grains__", ".", "get", "(", "'kernel'", ")", "in", "(", "'Linux'", ",", "'AIX'", ",", "'FreeBSD'", ",", "'OpenBSD'", ",", "'NetBSD'", ")", ":", "ORATAB", "=", "'/etc/oratab'", "elif", "__grains__", "...
Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions
[ "Return", "ORACLE_HOME", "for", "a", "given", "SID", "found", "in", "oratab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L143-L166
36,989
saltstack/salt
salt/modules/oracle.py
run_query
def run_query(db, query): ''' Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table" ''' if db in [x.keys()[0] for x in show_dbs()]: conn = _connect(show_dbs(db)[db]['uri']) else: log.debug('No uri...
python
def run_query(db, query): ''' Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table" ''' if db in [x.keys()[0] for x in show_dbs()]: conn = _connect(show_dbs(db)[db]['uri']) else: log.debug('No uri...
[ "def", "run_query", "(", "db", ",", "query", ")", ":", "if", "db", "in", "[", "x", ".", "keys", "(", ")", "[", "0", "]", "for", "x", "in", "show_dbs", "(", ")", "]", ":", "conn", "=", "_connect", "(", "show_dbs", "(", "db", ")", "[", "db", ...
Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table"
[ "Run", "SQL", "query", "and", "return", "result" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L170-L187
36,990
saltstack/salt
salt/modules/oracle.py
show_env
def show_env(): ''' Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8' ''' envs = ['PATH', 'ORACLE_HOME', 'TNS_ADMIN', 'NLS_LANG'] result = {} for ...
python
def show_env(): ''' Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8' ''' envs = ['PATH', 'ORACLE_HOME', 'TNS_ADMIN', 'NLS_LANG'] result = {} for ...
[ "def", "show_env", "(", ")", ":", "envs", "=", "[", "'PATH'", ",", "'ORACLE_HOME'", ",", "'TNS_ADMIN'", ",", "'NLS_LANG'", "]", "result", "=", "{", "}", "for", "env", "in", "envs", ":", "if", "env", "in", "os", ".", "environ", ":", "result", "[", "...
Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8'
[ "Show", "Environment", "used", "by", "Oracle", "Client" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L273-L291
36,991
saltstack/salt
salt/modules/solaris_user.py
_build_gecos
def _build_gecos(gecos_dict): ''' Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod. ''' return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''), gecos_dict.get('roomnu...
python
def _build_gecos(gecos_dict): ''' Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod. ''' return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''), gecos_dict.get('roomnu...
[ "def", "_build_gecos", "(", "gecos_dict", ")", ":", "return", "'{0},{1},{2},{3}'", ".", "format", "(", "gecos_dict", ".", "get", "(", "'fullname'", ",", "''", ")", ",", "gecos_dict", ".", "get", "(", "'roomnumber'", ",", "''", ")", ",", "gecos_dict", ".", ...
Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod.
[ "Accepts", "a", "dictionary", "entry", "containing", "GECOS", "field", "names", "and", "their", "values", "and", "returns", "a", "full", "GECOS", "comment", "string", "to", "be", "used", "with", "usermod", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L63-L71
36,992
saltstack/salt
salt/modules/solaris_user.py
chhome
def chhome(name, home, persist=False): ''' Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the fi...
python
def chhome(name, home, persist=False): ''' Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the fi...
[ "def", "chhome", "(", "name", ",", "home", ",", "persist", "=", "False", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "not", "pre_info", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "name", ...
Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the files from the skeleton directory. CLI E...
[ "Set", "a", "new", "home", "directory", "for", "an", "existing", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L270-L303
36,993
saltstack/salt
salt/modules/solaris_user.py
chgroups
def chgroups(name, groups, append=False): ''' Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these group...
python
def chgroups(name, groups, append=False): ''' Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these group...
[ "def", "chgroups", "(", "name", ",", "groups", ",", "append", "=", "False", ")", ":", "if", "isinstance", "(", "groups", ",", "six", ".", "string_types", ")", ":", "groups", "=", "groups", ".", "split", "(", "','", ")", "ugrps", "=", "set", "(", "l...
Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these groups to the user's existing list of groups. Other...
[ "Change", "the", "groups", "to", "which", "a", "user", "belongs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L306-L336
36,994
saltstack/salt
salt/utils/virtualbox.py
vb_get_manager
def vb_get_manager(): ''' Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager ''' global _virtualboxManager if _virtualboxManager is None and HAS_LIBS: salt.utils.compat.reload(vboxapi) _virtualboxManager = vboxa...
python
def vb_get_manager(): ''' Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager ''' global _virtualboxManager if _virtualboxManager is None and HAS_LIBS: salt.utils.compat.reload(vboxapi) _virtualboxManager = vboxa...
[ "def", "vb_get_manager", "(", ")", ":", "global", "_virtualboxManager", "if", "_virtualboxManager", "is", "None", "and", "HAS_LIBS", ":", "salt", ".", "utils", ".", "compat", ".", "reload", "(", "vboxapi", ")", "_virtualboxManager", "=", "vboxapi", ".", "Virtu...
Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager
[ "Creates", "a", "singleton", "manager", "to", "communicate", "with", "a", "local", "virtualbox", "hypervisor", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L133-L144
36,995
saltstack/salt
salt/utils/virtualbox.py
vb_get_max_network_slots
def vb_get_max_network_slots(): ''' Max number of slots any machine can have @return: @rtype: number ''' sysprops = vb_get_box().systemProperties totals = [ sysprops.getMaxNetworkAdapters(adapter_type) for adapter_type in [ 1, # PIIX3 A PIIX3 (PCI IDE ISA Xcelera...
python
def vb_get_max_network_slots(): ''' Max number of slots any machine can have @return: @rtype: number ''' sysprops = vb_get_box().systemProperties totals = [ sysprops.getMaxNetworkAdapters(adapter_type) for adapter_type in [ 1, # PIIX3 A PIIX3 (PCI IDE ISA Xcelera...
[ "def", "vb_get_max_network_slots", "(", ")", ":", "sysprops", "=", "vb_get_box", "(", ")", ".", "systemProperties", "totals", "=", "[", "sysprops", ".", "getMaxNetworkAdapters", "(", "adapter_type", ")", "for", "adapter_type", "in", "[", "1", ",", "# PIIX3 A PII...
Max number of slots any machine can have @return: @rtype: number
[ "Max", "number", "of", "slots", "any", "machine", "can", "have" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L164-L178
36,996
saltstack/salt
salt/utils/virtualbox.py
vb_get_network_adapters
def vb_get_network_adapters(machine_name=None, machine=None): ''' A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict] ''' ...
python
def vb_get_network_adapters(machine_name=None, machine=None): ''' A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict] ''' ...
[ "def", "vb_get_network_adapters", "(", "machine_name", "=", "None", ",", "machine", "=", "None", ")", ":", "if", "machine_name", ":", "machine", "=", "vb_get_box", "(", ")", ".", "findMachine", "(", "machine_name", ")", "network_adapters", "=", "[", "]", "fo...
A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict]
[ "A", "valid", "machine_name", "or", "a", "machine", "is", "needed", "to", "make", "this", "work!" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L181-L208
36,997
saltstack/salt
salt/utils/virtualbox.py
vb_wait_for_network_address
def vb_wait_for_network_address(timeout, step=None, machine_name=None, machine=None, wait_for_pattern=None): ''' Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in sec...
python
def vb_wait_for_network_address(timeout, step=None, machine_name=None, machine=None, wait_for_pattern=None): ''' Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in sec...
[ "def", "vb_wait_for_network_address", "(", "timeout", ",", "step", "=", "None", ",", "machine_name", "=", "None", ",", "machine", "=", "None", ",", "wait_for_pattern", "=", "None", ")", ":", "kwargs", "=", "{", "'machine_name'", ":", "machine_name", ",", "'m...
Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in seconds) @type step: float @param machine_name: @type machine_name: str @param machine: @type machine: I...
[ "Wait", "until", "a", "machine", "has", "a", "network", "address", "to", "return", "or", "quit", "after", "the", "timeout" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L211-L234
36,998
saltstack/salt
salt/utils/virtualbox.py
vb_wait_for_session_state
def vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None): ''' Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs ...
python
def vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None): ''' Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs ...
[ "def", "vb_wait_for_session_state", "(", "xp_session", ",", "state", "=", "'Unlocked'", ",", "timeout", "=", "10", ",", "step", "=", "None", ")", ":", "args", "=", "(", "xp_session", ",", "state", ")", "wait_for", "(", "_check_session_state", ",", "timeout",...
Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs @type state: str @param timeout: in seconds @type timeout: int | float @param step: ...
[ "Waits", "until", "a", "session", "state", "has", "been", "reached", "checking", "at", "regular", "intervals", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L250-L266
36,999
saltstack/salt
salt/utils/virtualbox.py
vb_list_machines
def vb_list_machines(**kwargs): ''' Which machines does the hypervisor have @param kwargs: Passed to vb_xpcom_to_attribute_dict to filter the attributes @type kwargs: dict @return: Untreated dicts of the machines known to the hypervisor @rtype: [{}] ''' manager = vb_get_manager() mac...
python
def vb_list_machines(**kwargs): ''' Which machines does the hypervisor have @param kwargs: Passed to vb_xpcom_to_attribute_dict to filter the attributes @type kwargs: dict @return: Untreated dicts of the machines known to the hypervisor @rtype: [{}] ''' manager = vb_get_manager() mac...
[ "def", "vb_list_machines", "(", "*", "*", "kwargs", ")", ":", "manager", "=", "vb_get_manager", "(", ")", "machines", "=", "manager", ".", "getArray", "(", "vb_get_box", "(", ")", ",", "'machines'", ")", "return", "[", "vb_xpcom_to_attribute_dict", "(", "mac...
Which machines does the hypervisor have @param kwargs: Passed to vb_xpcom_to_attribute_dict to filter the attributes @type kwargs: dict @return: Untreated dicts of the machines known to the hypervisor @rtype: [{}]
[ "Which", "machines", "does", "the", "hypervisor", "have" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L329-L342