partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
authenticate
Returns True if the given username and password authenticate for the given service. Returns False otherwise ``username``: the username to authenticate ``password``: the password in plain text
salt/auth/pam.py
def authenticate(username, password): ''' Returns True if the given username and password authenticate for the given service. Returns False otherwise ``username``: the username to authenticate ``password``: the password in plain text ''' service = __opts__.get('auth.pam.service', 'login')...
def authenticate(username, password): ''' Returns True if the given username and password authenticate for the given service. Returns False otherwise ``username``: the username to authenticate ``password``: the password in plain text ''' service = __opts__.get('auth.pam.service', 'login')...
[ "Returns", "True", "if", "the", "given", "username", "and", "password", "authenticate", "for", "the", "given", "service", ".", "Returns", "False", "otherwise" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/pam.py#L168-L216
[ "def", "authenticate", "(", "username", ",", "password", ")", ":", "service", "=", "__opts__", ".", "get", "(", "'auth.pam.service'", ",", "'login'", ")", "if", "isinstance", "(", "username", ",", "six", ".", "text_type", ")", ":", "username", "=", "userna...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_retrieve_grains_cache
Retrieves the grains from the network device if not cached already.
salt/grains/napalm.py
def _retrieve_grains_cache(proxy=None): ''' Retrieves the grains from the network device if not cached already. ''' global GRAINS_CACHE if not GRAINS_CACHE: if proxy and salt.utils.napalm.is_proxy(__opts__): # if proxy var passed and is NAPALM-type proxy minion GRAINS...
def _retrieve_grains_cache(proxy=None): ''' Retrieves the grains from the network device if not cached already. ''' global GRAINS_CACHE if not GRAINS_CACHE: if proxy and salt.utils.napalm.is_proxy(__opts__): # if proxy var passed and is NAPALM-type proxy minion GRAINS...
[ "Retrieves", "the", "grains", "from", "the", "network", "device", "if", "not", "cached", "already", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L63-L79
[ "def", "_retrieve_grains_cache", "(", "proxy", "=", "None", ")", ":", "global", "GRAINS_CACHE", "if", "not", "GRAINS_CACHE", ":", "if", "proxy", "and", "salt", ".", "utils", ".", "napalm", ".", "is_proxy", "(", "__opts__", ")", ":", "# if proxy var passed and ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_retrieve_device_cache
Loads the network device details if not cached already.
salt/grains/napalm.py
def _retrieve_device_cache(proxy=None): ''' Loads the network device details if not cached already. ''' global DEVICE_CACHE if not DEVICE_CACHE: if proxy and salt.utils.napalm.is_proxy(__opts__): # if proxy var passed and is NAPALM-type proxy minion if 'napalm.get_dev...
def _retrieve_device_cache(proxy=None): ''' Loads the network device details if not cached already. ''' global DEVICE_CACHE if not DEVICE_CACHE: if proxy and salt.utils.napalm.is_proxy(__opts__): # if proxy var passed and is NAPALM-type proxy minion if 'napalm.get_dev...
[ "Loads", "the", "network", "device", "details", "if", "not", "cached", "already", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L82-L95
[ "def", "_retrieve_device_cache", "(", "proxy", "=", "None", ")", ":", "global", "DEVICE_CACHE", "if", "not", "DEVICE_CACHE", ":", "if", "proxy", "and", "salt", ".", "utils", ".", "napalm", ".", "is_proxy", "(", "__opts__", ")", ":", "# if proxy var passed and ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_grain
Retrieves the grain value from the cached dictionary.
salt/grains/napalm.py
def _get_grain(name, proxy=None): ''' Retrieves the grain value from the cached dictionary. ''' grains = _retrieve_grains_cache(proxy=proxy) if grains.get('result', False) and grains.get('out', {}): return grains.get('out').get(name)
def _get_grain(name, proxy=None): ''' Retrieves the grain value from the cached dictionary. ''' grains = _retrieve_grains_cache(proxy=proxy) if grains.get('result', False) and grains.get('out', {}): return grains.get('out').get(name)
[ "Retrieves", "the", "grain", "value", "from", "the", "cached", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L98-L104
[ "def", "_get_grain", "(", "name", ",", "proxy", "=", "None", ")", ":", "grains", "=", "_retrieve_grains_cache", "(", "proxy", "=", "proxy", ")", "if", "grains", ".", "get", "(", "'result'", ",", "False", ")", "and", "grains", ".", "get", "(", "'out'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_device_grain
Retrieves device-specific grains.
salt/grains/napalm.py
def _get_device_grain(name, proxy=None): ''' Retrieves device-specific grains. ''' device = _retrieve_device_cache(proxy=proxy) return device.get(name.upper())
def _get_device_grain(name, proxy=None): ''' Retrieves device-specific grains. ''' device = _retrieve_device_cache(proxy=proxy) return device.get(name.upper())
[ "Retrieves", "device", "-", "specific", "grains", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L107-L112
[ "def", "_get_device_grain", "(", "name", ",", "proxy", "=", "None", ")", ":", "device", "=", "_retrieve_device_cache", "(", "proxy", "=", "proxy", ")", "return", "device", ".", "get", "(", "name", ".", "upper", "(", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
username
Return the username. .. versionadded:: 2017.7.0 CLI Example - select all devices using `foobar` as username for connection: .. code-block:: bash salt -G 'username:foobar' test.ping Output: .. code-block::yaml device1: True device2: True
salt/grains/napalm.py
def username(proxy=None): ''' Return the username. .. versionadded:: 2017.7.0 CLI Example - select all devices using `foobar` as username for connection: .. code-block:: bash salt -G 'username:foobar' test.ping Output: .. code-block::yaml device1: True ...
def username(proxy=None): ''' Return the username. .. versionadded:: 2017.7.0 CLI Example - select all devices using `foobar` as username for connection: .. code-block:: bash salt -G 'username:foobar' test.ping Output: .. code-block::yaml device1: True ...
[ "Return", "the", "username", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L265-L289
[ "def", "username", "(", "proxy", "=", "None", ")", ":", "if", "proxy", "and", "salt", ".", "utils", ".", "napalm", ".", "is_proxy", "(", "__opts__", ")", ":", "# only if proxy will override the username", "# otherwise will use the default Salt grains", "return", "{"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
host
This grain is set by the NAPALM grain module only when running in a proxy minion. When Salt is installed directly on the network device, thus running a regular minion, the ``host`` grain provides the physical hostname of the network device, as it would be on an ordinary minion server. When runni...
salt/grains/napalm.py
def host(proxy=None): ''' This grain is set by the NAPALM grain module only when running in a proxy minion. When Salt is installed directly on the network device, thus running a regular minion, the ``host`` grain provides the physical hostname of the network device, as it would be on an ordi...
def host(proxy=None): ''' This grain is set by the NAPALM grain module only when running in a proxy minion. When Salt is installed directly on the network device, thus running a regular minion, the ``host`` grain provides the physical hostname of the network device, as it would be on an ordi...
[ "This", "grain", "is", "set", "by", "the", "NAPALM", "grain", "module", "only", "when", "running", "in", "a", "proxy", "minion", ".", "When", "Salt", "is", "installed", "directly", "on", "the", "network", "device", "thus", "running", "a", "regular", "minio...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L316-L356
[ "def", "host", "(", "proxy", "=", "None", ")", ":", "if", "proxy", "and", "salt", ".", "utils", ".", "napalm", ".", "is_proxy", "(", "__opts__", ")", ":", "# this grain is set only when running in a proxy minion", "# otherwise will use the default Salt grains", "retur...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
host_dns
Return the DNS information of the host. This grain is a dictionary having two keys: - ``A`` - ``AAAA`` .. note:: This grain is disabled by default, as the proxy startup may be slower when the lookup fails. The user can enable it using the ``napalm_host_dns_grain`` option (in ...
salt/grains/napalm.py
def host_dns(proxy=None): ''' Return the DNS information of the host. This grain is a dictionary having two keys: - ``A`` - ``AAAA`` .. note:: This grain is disabled by default, as the proxy startup may be slower when the lookup fails. The user can enable it using the `...
def host_dns(proxy=None): ''' Return the DNS information of the host. This grain is a dictionary having two keys: - ``A`` - ``AAAA`` .. note:: This grain is disabled by default, as the proxy startup may be slower when the lookup fails. The user can enable it using the `...
[ "Return", "the", "DNS", "information", "of", "the", "host", ".", "This", "grain", "is", "a", "dictionary", "having", "two", "keys", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L359-L422
[ "def", "host_dns", "(", "proxy", "=", "None", ")", ":", "if", "not", "__opts__", ".", "get", "(", "'napalm_host_dns_grain'", ",", "False", ")", ":", "return", "device_host", "=", "host", "(", "proxy", "=", "proxy", ")", "if", "device_host", ":", "device_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
optional_args
Return the connection optional args. .. note:: Sensible data will not be returned. .. versionadded:: 2017.7.0 CLI Example - select all devices connecting via port 1234: .. code-block:: bash salt -G 'optional_args:port:1234' test.ping Output: .. code-block:: yaml ...
salt/grains/napalm.py
def optional_args(proxy=None): ''' Return the connection optional args. .. note:: Sensible data will not be returned. .. versionadded:: 2017.7.0 CLI Example - select all devices connecting via port 1234: .. code-block:: bash salt -G 'optional_args:port:1234' test.ping ...
def optional_args(proxy=None): ''' Return the connection optional args. .. note:: Sensible data will not be returned. .. versionadded:: 2017.7.0 CLI Example - select all devices connecting via port 1234: .. code-block:: bash salt -G 'optional_args:port:1234' test.ping ...
[ "Return", "the", "connection", "optional", "args", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/napalm.py#L425-L454
[ "def", "optional_args", "(", "proxy", "=", "None", ")", ":", "opt_args", "=", "_get_device_grain", "(", "'optional_args'", ",", "proxy", "=", "proxy", ")", "or", "{", "}", "if", "opt_args", "and", "_FORBIDDEN_OPT_ARGS", ":", "for", "arg", "in", "_FORBIDDEN_O...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_missing_results
Return a list of the filenames specified in the ``results`` argument, which are not present in the dest_dir.
salt/states/pkgbuild.py
def _get_missing_results(results, dest_dir): ''' Return a list of the filenames specified in the ``results`` argument, which are not present in the dest_dir. ''' try: present = set(os.listdir(dest_dir)) except OSError as exc: if exc.errno == errno.ENOENT: log.debug('p...
def _get_missing_results(results, dest_dir): ''' Return a list of the filenames specified in the ``results`` argument, which are not present in the dest_dir. ''' try: present = set(os.listdir(dest_dir)) except OSError as exc: if exc.errno == errno.ENOENT: log.debug('p...
[ "Return", "a", "list", "of", "the", "filenames", "specified", "in", "the", "results", "argument", "which", "are", "not", "present", "in", "the", "dest_dir", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkgbuild.py#L57-L70
[ "def", "_get_missing_results", "(", "results", ",", "dest_dir", ")", ":", "try", ":", "present", "=", "set", "(", "os", ".", "listdir", "(", "dest_dir", ")", ")", "except", "OSError", "as", "exc", ":", "if", "exc", ".", "errno", "==", "errno", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
built
Ensure that the named package is built and exists in the named directory name The name to track the build, the name value is otherwise unused runas The user to run the build process as dest_dir The directory on the minion to place the built package(s) spec The locatio...
salt/states/pkgbuild.py
def built(name, runas, dest_dir, spec, sources, tgt, template=None, deps=None, env=None, results=None, force=False, saltenv='base', log_dir='/var/log/salt/pkgbuild'): ''' Ensure that the named...
def built(name, runas, dest_dir, spec, sources, tgt, template=None, deps=None, env=None, results=None, force=False, saltenv='base', log_dir='/var/log/salt/pkgbuild'): ''' Ensure that the named...
[ "Ensure", "that", "the", "named", "package", "is", "built", "and", "exists", "in", "the", "named", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkgbuild.py#L73-L220
[ "def", "built", "(", "name", ",", "runas", ",", "dest_dir", ",", "spec", ",", "sources", ",", "tgt", ",", "template", "=", "None", ",", "deps", "=", "None", ",", "env", "=", "None", ",", "results", "=", "None", ",", "force", "=", "False", ",", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
repo
Make a package repository and optionally sign it and packages present The name is directory to turn into a repo. This state is best used with onchanges linked to your package building states. name The directory to find packages that will be in the repository keyid .. versionchanged:: ...
salt/states/pkgbuild.py
def repo(name, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='builder', timeout=15.0): ''' Make a package repository and optionally sign it and packages present The name is directory to turn into a repo. This state is ...
def repo(name, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='builder', timeout=15.0): ''' Make a package repository and optionally sign it and packages present The name is directory to turn into a repo. This state is ...
[ "Make", "a", "package", "repository", "and", "optionally", "sign", "it", "and", "packages", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkgbuild.py#L223-L380
[ "def", "repo", "(", "name", ",", "keyid", "=", "None", ",", "env", "=", "None", ",", "use_passphrase", "=", "False", ",", "gnupghome", "=", "'/etc/salt/gpgkeys'", ",", "runas", "=", "'builder'", ",", "timeout", "=", "15.0", ")", ":", "ret", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compile_template
Take the path to a template and return the high data structure derived from the template. Helpers: :param mask_value: Mask value for debugging purposes (prevent sensitive information etc) example: "mask_value="pass*". All "passwd", "password", "pass" will be masked (as text).
salt/template.py
def compile_template(template, renderers, default, blacklist, whitelist, saltenv='base', sls='', input_data='', **kwargs): ''' Take the path to ...
def compile_template(template, renderers, default, blacklist, whitelist, saltenv='base', sls='', input_data='', **kwargs): ''' Take the path to ...
[ "Take", "the", "path", "to", "a", "template", "and", "return", "the", "high", "data", "structure", "derived", "from", "the", "template", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/template.py#L35-L139
[ "def", "compile_template", "(", "template", ",", "renderers", ",", "default", ",", "blacklist", ",", "whitelist", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "input_data", "=", "''", ",", "*", "*", "kwargs", ")", ":", "# if any error occurs,...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compile_template_str
Take template as a string and return the high data structure derived from the template.
salt/template.py
def compile_template_str(template, renderers, default, blacklist, whitelist): ''' Take template as a string and return the high data structure derived from the template. ''' fn_ = salt.utils.files.mkstemp() with salt.utils.files.fopen(fn_, 'wb') as ofile: ofile.write(SLS_ENCODER(template...
def compile_template_str(template, renderers, default, blacklist, whitelist): ''' Take template as a string and return the high data structure derived from the template. ''' fn_ = salt.utils.files.mkstemp() with salt.utils.files.fopen(fn_, 'wb') as ofile: ofile.write(SLS_ENCODER(template...
[ "Take", "template", "as", "a", "string", "and", "return", "the", "high", "data", "structure", "derived", "from", "the", "template", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/template.py#L142-L150
[ "def", "compile_template_str", "(", "template", ",", "renderers", ",", "default", ",", "blacklist", ",", "whitelist", ")", ":", "fn_", "=", "salt", ".", "utils", ".", "files", ".", "mkstemp", "(", ")", "with", "salt", ".", "utils", ".", "files", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_shebang
Check the template shebang line and return the list of renderers specified in the pipe. Example shebang lines:: #!yaml_jinja #!yaml_mako #!mako|yaml #!jinja|yaml #!jinja|mako|yaml #!mako|yaml|stateconf #!jinja|yaml|stateconf #!mako|yaml_odict #!mako|yaml_o...
salt/template.py
def template_shebang(template, renderers, default, blacklist, whitelist, input_data): ''' Check the template shebang line and return the list of renderers specified in the pipe. Example shebang lines:: #!yaml_jinja #!yaml_mako #!mako|yaml #!jinja|yaml #!jinja|mako|yaml ...
def template_shebang(template, renderers, default, blacklist, whitelist, input_data): ''' Check the template shebang line and return the list of renderers specified in the pipe. Example shebang lines:: #!yaml_jinja #!yaml_mako #!mako|yaml #!jinja|yaml #!jinja|mako|yaml ...
[ "Check", "the", "template", "shebang", "line", "and", "return", "the", "list", "of", "renderers", "specified", "in", "the", "pipe", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/template.py#L153-L186
[ "def", "template_shebang", "(", "template", ",", "renderers", ",", "default", ",", "blacklist", ",", "whitelist", ",", "input_data", ")", ":", "line", "=", "''", "# Open up the first line of the sls template", "if", "template", "==", "':string:'", ":", "line", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_render_pipe_str
Check that all renderers specified in the pipe string are available. If so, return the list of render functions in the pipe as (render_func, arg_str) tuples; otherwise return [].
salt/template.py
def check_render_pipe_str(pipestr, renderers, blacklist, whitelist): ''' Check that all renderers specified in the pipe string are available. If so, return the list of render functions in the pipe as (render_func, arg_str) tuples; otherwise return []. ''' if pipestr is None: return [] ...
def check_render_pipe_str(pipestr, renderers, blacklist, whitelist): ''' Check that all renderers specified in the pipe string are available. If so, return the list of render functions in the pipe as (render_func, arg_str) tuples; otherwise return []. ''' if pipestr is None: return [] ...
[ "Check", "that", "all", "renderers", "specified", "in", "the", "pipe", "string", "are", "available", ".", "If", "so", "return", "the", "list", "of", "render", "functions", "in", "the", "pipe", "as", "(", "render_func", "arg_str", ")", "tuples", ";", "other...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/template.py#L208-L237
[ "def", "check_render_pipe_str", "(", "pipestr", ",", "renderers", ",", "blacklist", ",", "whitelist", ")", ":", "if", "pipestr", "is", "None", ":", "return", "[", "]", "parts", "=", "[", "r", ".", "strip", "(", ")", "for", "r", "in", "pipestr", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
Change the system runlevel on sysV compatible systems CLI Example: state : string Init state .. code-block:: bash salt '*' system.init 3 .. note: state 0 Stop the operating system. state 1 State 1 is referred to as the administrative state. ...
salt/modules/solaris_system.py
def init(state): ''' Change the system runlevel on sysV compatible systems CLI Example: state : string Init state .. code-block:: bash salt '*' system.init 3 .. note: state 0 Stop the operating system. state 1 State 1 is referred to ...
def init(state): ''' Change the system runlevel on sysV compatible systems CLI Example: state : string Init state .. code-block:: bash salt '*' system.init 3 .. note: state 0 Stop the operating system. state 1 State 1 is referred to ...
[ "Change", "the", "system", "runlevel", "on", "sysV", "compatible", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_system.py#L47-L95
[ "def", "init", "(", "state", ")", ":", "cmd", "=", "[", "'shutdown'", ",", "'-i'", ",", "state", ",", "'-g'", ",", "'0'", ",", "'-y'", "]", "ret", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
Reboot the system delay : int Optional wait time in seconds before the system will be rebooted. message : string Optional message to broadcast before rebooting. CLI Example: .. code-block:: bash salt '*' system.reboot salt '*' system.reboot 60 "=== system upgraded ===...
salt/modules/solaris_system.py
def reboot(delay=0, message=None): ''' Reboot the system delay : int Optional wait time in seconds before the system will be rebooted. message : string Optional message to broadcast before rebooting. CLI Example: .. code-block:: bash salt '*' system.reboot sal...
def reboot(delay=0, message=None): ''' Reboot the system delay : int Optional wait time in seconds before the system will be rebooted. message : string Optional message to broadcast before rebooting. CLI Example: .. code-block:: bash salt '*' system.reboot sal...
[ "Reboot", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_system.py#L111-L131
[ "def", "reboot", "(", "delay", "=", "0", ",", "message", "=", "None", ")", ":", "cmd", "=", "[", "'shutdown'", ",", "'-i'", ",", "'6'", ",", "'-g'", ",", "delay", ",", "'-y'", "]", "if", "message", ":", "cmd", ".", "append", "(", "message", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_twilio
Return the twilio connection
salt/modules/twilio_notify.py
def _get_twilio(profile): ''' Return the twilio connection ''' creds = __salt__['config.option'](profile) client = TwilioRestClient( creds.get('twilio.account_sid'), creds.get('twilio.auth_token'), ) return client
def _get_twilio(profile): ''' Return the twilio connection ''' creds = __salt__['config.option'](profile) client = TwilioRestClient( creds.get('twilio.account_sid'), creds.get('twilio.auth_token'), ) return client
[ "Return", "the", "twilio", "connection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/twilio_notify.py#L57-L67
[ "def", "_get_twilio", "(", "profile", ")", ":", "creds", "=", "__salt__", "[", "'config.option'", "]", "(", "profile", ")", "client", "=", "TwilioRestClient", "(", "creds", ".", "get", "(", "'twilio.account_sid'", ")", ",", "creds", ".", "get", "(", "'twil...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
send_sms
Send an sms CLI Example: twilio.send_sms twilio-account 'Test sms' '+18019999999' '+18011111111'
salt/modules/twilio_notify.py
def send_sms(profile, body, to, from_): ''' Send an sms CLI Example: twilio.send_sms twilio-account 'Test sms' '+18019999999' '+18011111111' ''' ret = {} ret['message'] = {} ret['message']['sid'] = None client = _get_twilio(profile) try: if TWILIO_5: mes...
def send_sms(profile, body, to, from_): ''' Send an sms CLI Example: twilio.send_sms twilio-account 'Test sms' '+18019999999' '+18011111111' ''' ret = {} ret['message'] = {} ret['message']['sid'] = None client = _get_twilio(profile) try: if TWILIO_5: mes...
[ "Send", "an", "sms" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/twilio_notify.py#L70-L104
[ "def", "send_sms", "(", "profile", ",", "body", ",", "to", ",", "from_", ")", ":", "ret", "=", "{", "}", "ret", "[", "'message'", "]", "=", "{", "}", "ret", "[", "'message'", "]", "[", "'sid'", "]", "=", "None", "client", "=", "_get_twilio", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lowstate_file_refs
Create a list of file ref objects to reconcile
salt/client/ssh/state.py
def lowstate_file_refs(chunks, extras=''): ''' Create a list of file ref objects to reconcile ''' refs = {} for chunk in chunks: if not isinstance(chunk, dict): continue saltenv = 'base' crefs = [] for state in chunk: if state == '__env__': ...
def lowstate_file_refs(chunks, extras=''): ''' Create a list of file ref objects to reconcile ''' refs = {} for chunk in chunks: if not isinstance(chunk, dict): continue saltenv = 'base' crefs = [] for state in chunk: if state == '__env__': ...
[ "Create", "a", "list", "of", "file", "ref", "objects", "to", "reconcile" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/state.py#L122-L148
[ "def", "lowstate_file_refs", "(", "chunks", ",", "extras", "=", "''", ")", ":", "refs", "=", "{", "}", "for", "chunk", "in", "chunks", ":", "if", "not", "isinstance", "(", "chunk", ",", "dict", ")", ":", "continue", "saltenv", "=", "'base'", "crefs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
salt_refs
Pull salt file references out of the states
salt/client/ssh/state.py
def salt_refs(data, ret=None): ''' Pull salt file references out of the states ''' proto = 'salt://' if ret is None: ret = [] if isinstance(data, six.string_types): if data.startswith(proto) and data not in ret: ret.append(data) if isinstance(data, list): ...
def salt_refs(data, ret=None): ''' Pull salt file references out of the states ''' proto = 'salt://' if ret is None: ret = [] if isinstance(data, six.string_types): if data.startswith(proto) and data not in ret: ret.append(data) if isinstance(data, list): ...
[ "Pull", "salt", "file", "references", "out", "of", "the", "states" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/state.py#L151-L167
[ "def", "salt_refs", "(", "data", ",", "ret", "=", "None", ")", ":", "proto", "=", "'salt://'", "if", "ret", "is", "None", ":", "ret", "=", "[", "]", "if", "isinstance", "(", "data", ",", "six", ".", "string_types", ")", ":", "if", "data", ".", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
prep_trans_tar
Generate the execution package from the saltenv file refs and a low state data structure
salt/client/ssh/state.py
def prep_trans_tar(file_client, chunks, file_refs, pillar=None, id_=None, roster_grains=None): ''' Generate the execution package from the saltenv file refs and a low state data structure ''' gendir = tempfile.mkdtemp() trans_tar = salt.utils.files.mkstemp() lowfn = os.path.join(gendir, 'low...
def prep_trans_tar(file_client, chunks, file_refs, pillar=None, id_=None, roster_grains=None): ''' Generate the execution package from the saltenv file refs and a low state data structure ''' gendir = tempfile.mkdtemp() trans_tar = salt.utils.files.mkstemp() lowfn = os.path.join(gendir, 'low...
[ "Generate", "the", "execution", "package", "from", "the", "saltenv", "file", "refs", "and", "a", "low", "state", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/state.py#L170-L259
[ "def", "prep_trans_tar", "(", "file_client", ",", "chunks", ",", "file_refs", ",", "pillar", "=", "None", ",", "id_", "=", "None", ",", "roster_grains", "=", "None", ")", ":", "gendir", "=", "tempfile", ".", "mkdtemp", "(", ")", "trans_tar", "=", "salt",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHState.load_modules
Load up the modules for remote compilation via ssh
salt/client/ssh/state.py
def load_modules(self, data=None, proxy=None): ''' Load up the modules for remote compilation via ssh ''' self.functions = self.wrapper self.utils = salt.loader.utils(self.opts) self.serializers = salt.loader.serializers(self.opts) locals_ = salt.loader.minion_mod...
def load_modules(self, data=None, proxy=None): ''' Load up the modules for remote compilation via ssh ''' self.functions = self.wrapper self.utils = salt.loader.utils(self.opts) self.serializers = salt.loader.serializers(self.opts) locals_ = salt.loader.minion_mod...
[ "Load", "up", "the", "modules", "for", "remote", "compilation", "via", "ssh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/state.py#L43-L52
[ "def", "load_modules", "(", "self", ",", "data", "=", "None", ",", "proxy", "=", "None", ")", ":", "self", ".", "functions", "=", "self", ".", "wrapper", "self", ".", "utils", "=", "salt", ".", "loader", ".", "utils", "(", "self", ".", "opts", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHHighState._master_tops
Evaluate master_tops locally
salt/client/ssh/state.py
def _master_tops(self): ''' Evaluate master_tops locally ''' if 'id' not in self.opts: log.error('Received call for external nodes without an id') return {} if not salt.utils.verify.valid_id(self.opts, self.opts['id']): return {} # Eval...
def _master_tops(self): ''' Evaluate master_tops locally ''' if 'id' not in self.opts: log.error('Received call for external nodes without an id') return {} if not salt.utils.verify.valid_id(self.opts, self.opts['id']): return {} # Eval...
[ "Evaluate", "master_tops", "locally" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/state.py#L92-L119
[ "def", "_master_tops", "(", "self", ")", ":", "if", "'id'", "not", "in", "self", ".", "opts", ":", "log", ".", "error", "(", "'Received call for external nodes without an id'", ")", "return", "{", "}", "if", "not", "salt", ".", "utils", ".", "verify", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_api_versions
Get a resource type api versions
salt/cloud/clouds/azurearm.py
def get_api_versions(call=None, kwargs=None): # pylint: disable=unused-argument ''' Get a resource type api versions ''' if kwargs is None: kwargs = {} if 'resource_provider' not in kwargs: raise SaltCloudSystemExit( 'A resource_provider must be specified' ) ...
def get_api_versions(call=None, kwargs=None): # pylint: disable=unused-argument ''' Get a resource type api versions ''' if kwargs is None: kwargs = {} if 'resource_provider' not in kwargs: raise SaltCloudSystemExit( 'A resource_provider must be specified' ) ...
[ "Get", "a", "resource", "type", "api", "versions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L157-L189
[ "def", "get_api_versions", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "'resource_provider'", "not", "in", "kwargs", ":", "raise", "Sal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_resource_by_id
Get an AzureARM resource by id
salt/cloud/clouds/azurearm.py
def get_resource_by_id(resource_id, api_version, extract_value=None): ''' Get an AzureARM resource by id ''' ret = {} try: resconn = get_conn(client_type='resource') resource_query = resconn.resources.get_by_id( resource_id=resource_id, api_version=api_versio...
def get_resource_by_id(resource_id, api_version, extract_value=None): ''' Get an AzureARM resource by id ''' ret = {} try: resconn = get_conn(client_type='resource') resource_query = resconn.resources.get_by_id( resource_id=resource_id, api_version=api_versio...
[ "Get", "an", "AzureARM", "resource", "by", "id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L192-L213
[ "def", "get_resource_by_id", "(", "resource_id", ",", "api_version", ",", "extract_value", "=", "None", ")", ":", "ret", "=", "{", "}", "try", ":", "resconn", "=", "get_conn", "(", "client_type", "=", "'resource'", ")", "resource_query", "=", "resconn", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_configured_provider
Return the first configured provider instance.
salt/cloud/clouds/azurearm.py
def get_configured_provider(): ''' Return the first configured provider instance. ''' def __is_provider_configured(opts, provider, required_keys=()): ''' Check if the provider is configured. ''' if ':' in provider: alias, driver = provider.split(':') ...
def get_configured_provider(): ''' Return the first configured provider instance. ''' def __is_provider_configured(opts, provider, required_keys=()): ''' Check if the provider is configured. ''' if ':' in provider: alias, driver = provider.split(':') ...
[ "Return", "the", "first", "configured", "provider", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L216-L275
[ "def", "get_configured_provider", "(", ")", ":", "def", "__is_provider_configured", "(", "opts", ",", "provider", ",", "required_keys", "=", "(", ")", ")", ":", "'''\n Check if the provider is configured.\n '''", "if", "':'", "in", "provider", ":", "alia...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_conn
Return a connection object for a client type.
salt/cloud/clouds/azurearm.py
def get_conn(client_type): ''' Return a connection object for a client type. ''' conn_kwargs = {} conn_kwargs['subscription_id'] = salt.utils.stringutils.to_str( config.get_cloud_config_value( 'subscription_id', get_configured_provider(), __opts__, search_global=Fals...
def get_conn(client_type): ''' Return a connection object for a client type. ''' conn_kwargs = {} conn_kwargs['subscription_id'] = salt.utils.stringutils.to_str( config.get_cloud_config_value( 'subscription_id', get_configured_provider(), __opts__, search_global=Fals...
[ "Return", "a", "connection", "object", "for", "a", "client", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L288-L342
[ "def", "get_conn", "(", "client_type", ")", ":", "conn_kwargs", "=", "{", "}", "conn_kwargs", "[", "'subscription_id'", "]", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "config", ".", "get_cloud_config_value", "(", "'subscription_id'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_location
Return the location that is configured for this provider
salt/cloud/clouds/azurearm.py
def get_location(call=None, kwargs=None): # pylint: disable=unused-argument ''' Return the location that is configured for this provider ''' if not kwargs: kwargs = {} vm_dict = get_configured_provider() vm_dict.update(kwargs) return config.get_cloud_config_value( 'location'...
def get_location(call=None, kwargs=None): # pylint: disable=unused-argument ''' Return the location that is configured for this provider ''' if not kwargs: kwargs = {} vm_dict = get_configured_provider() vm_dict.update(kwargs) return config.get_cloud_config_value( 'location'...
[ "Return", "the", "location", "that", "is", "configured", "for", "this", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L345-L356
[ "def", "get_location", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "not", "kwargs", ":", "kwargs", "=", "{", "}", "vm_dict", "=", "get_configured_provider", "(", ")", "vm_dict", ".", "update", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
Return a dict of all available regions.
salt/cloud/clouds/azurearm.py
def avail_locations(call=None): ''' Return a dict of all available regions. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} ret['loc...
def avail_locations(call=None): ''' Return a dict of all available regions. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} ret['loc...
[ "Return", "a", "dict", "of", "all", "available", "regions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L359-L389
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'", ")", "ret", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Return a dict of all available images on the provider
salt/cloud/clouds/azurearm.py
def avail_images(call=None): ''' Return a dict of all available images on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) compconn = get_co...
def avail_images(call=None): ''' Return a dict of all available images on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) compconn = get_co...
[ "Return", "a", "dict", "of", "all", "available", "images", "on", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L392-L467
[ "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'", ")", "compconn", "=", "get_conn",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
Return a list of sizes available from the provider
salt/cloud/clouds/azurearm.py
def avail_sizes(call=None): ''' Return a list of sizes available from the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) compconn = get_conn(cl...
def avail_sizes(call=None): ''' Return a list of sizes available from the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) compconn = get_conn(cl...
[ "Return", "a", "list", "of", "sizes", "available", "from", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L470-L496
[ "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'", ")", "compconn", "=", "get_conn", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
List VMs on this Azure account
salt/cloud/clouds/azurearm.py
def list_nodes(call=None): ''' List VMs on this Azure account ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {'name':...
def list_nodes(call=None): ''' List VMs on this Azure account ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {'name':...
[ "List", "VMs", "on", "this", "Azure", "account" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L499-L515
[ "def", "list_nodes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "nodes", "=", "list_nodes_full", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
List all VMs on the subscription with full information
salt/cloud/clouds/azurearm.py
def list_nodes_full(call=None): ''' List all VMs on the subscription with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) netapi_versions = get_api_versions(kwargs={ 'reso...
def list_nodes_full(call=None): ''' List all VMs on the subscription with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) netapi_versions = get_api_versions(kwargs={ 'reso...
[ "List", "all", "VMs", "on", "the", "subscription", "with", "full", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L518-L600
[ "def", "list_nodes_full", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_full function must be called with -f or --function.'", ")", "netapi_versions", "=", "get_api_versions", "(", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_resource_groups
List resource groups associated with the subscription
salt/cloud/clouds/azurearm.py
def list_resource_groups(call=None): ''' List resource groups associated with the subscription ''' if call == 'action': raise SaltCloudSystemExit( 'The list_hosted_services function must be called with ' '-f or --function' ) resconn = get_conn(client_type='re...
def list_resource_groups(call=None): ''' List resource groups associated with the subscription ''' if call == 'action': raise SaltCloudSystemExit( 'The list_hosted_services function must be called with ' '-f or --function' ) resconn = get_conn(client_type='re...
[ "List", "resource", "groups", "associated", "with", "the", "subscription" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L603-L625
[ "def", "list_resource_groups", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_hosted_services function must be called with '", "'-f or --function'", ")", "resconn", "=", "get_conn", "(", "client_t...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details from AzureARM concerning an instance
salt/cloud/clouds/azurearm.py
def show_instance(name, call=None): ''' Show the details from AzureARM concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) try: node = list_nodes_full('function')[name] exc...
def show_instance(name, call=None): ''' Show the details from AzureARM concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) try: node = list_nodes_full('function')[name] exc...
[ "Show", "the", "details", "from", "AzureARM", "concerning", "an", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L628-L644
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "try", ":", "node", "=", "list_nodes_full", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_interface
Delete a network interface.
salt/cloud/clouds/azurearm.py
def delete_interface(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a network interface. ''' if kwargs is None: kwargs = {} netconn = get_conn(client_type='network') if kwargs.get('resource_group') is None: kwargs['resource_group'] = config.get_cloud_con...
def delete_interface(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a network interface. ''' if kwargs is None: kwargs = {} netconn = get_conn(client_type='network') if kwargs.get('resource_group') is None: kwargs['resource_group'] = config.get_cloud_con...
[ "Delete", "a", "network", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L647-L680
[ "def", "delete_interface", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "netconn", "=", "get_conn", "(", "client_type", "=", "'network'", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_public_ip
Get the public ip address details by name.
salt/cloud/clouds/azurearm.py
def _get_public_ip(name, resource_group): ''' Get the public ip address details by name. ''' netconn = get_conn(client_type='network') try: pubip_query = netconn.public_ip_addresses.get( resource_group_name=resource_group, public_ip_address_name=name ) ...
def _get_public_ip(name, resource_group): ''' Get the public ip address details by name. ''' netconn = get_conn(client_type='network') try: pubip_query = netconn.public_ip_addresses.get( resource_group_name=resource_group, public_ip_address_name=name ) ...
[ "Get", "the", "public", "ip", "address", "details", "by", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L683-L698
[ "def", "_get_public_ip", "(", "name", ",", "resource_group", ")", ":", "netconn", "=", "get_conn", "(", "client_type", "=", "'network'", ")", "try", ":", "pubip_query", "=", "netconn", ".", "public_ip_addresses", ".", "get", "(", "resource_group_name", "=", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_network_interface
Get a network interface.
salt/cloud/clouds/azurearm.py
def _get_network_interface(name, resource_group): ''' Get a network interface. ''' public_ips = [] private_ips = [] netapi_versions = get_api_versions(kwargs={ 'resource_provider': 'Microsoft.Network', 'resource_type': 'publicIPAddresses' } ) netapi_version = neta...
def _get_network_interface(name, resource_group): ''' Get a network interface. ''' public_ips = [] private_ips = [] netapi_versions = get_api_versions(kwargs={ 'resource_provider': 'Microsoft.Network', 'resource_type': 'publicIPAddresses' } ) netapi_version = neta...
[ "Get", "a", "network", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L701-L733
[ "def", "_get_network_interface", "(", "name", ",", "resource_group", ")", ":", "public_ips", "=", "[", "]", "private_ips", "=", "[", "]", "netapi_versions", "=", "get_api_versions", "(", "kwargs", "=", "{", "'resource_provider'", ":", "'Microsoft.Network'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_network_interface
Create a network interface.
salt/cloud/clouds/azurearm.py
def create_network_interface(call=None, kwargs=None): ''' Create a network interface. ''' if call != 'action': raise SaltCloudSystemExit( 'The create_network_interface action must be called with -a or --action.' ) # pylint: disable=invalid-name IPAllocationMethod = g...
def create_network_interface(call=None, kwargs=None): ''' Create a network interface. ''' if call != 'action': raise SaltCloudSystemExit( 'The create_network_interface action must be called with -a or --action.' ) # pylint: disable=invalid-name IPAllocationMethod = g...
[ "Create", "a", "network", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L736-L913
[ "def", "create_network_interface", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_network_interface action must be called with -a or --action.'", ")", "# pylint: disabl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request_instance
Request a VM from Azure.
salt/cloud/clouds/azurearm.py
def request_instance(vm_): ''' Request a VM from Azure. ''' compconn = get_conn(client_type='compute') # pylint: disable=invalid-name CachingTypes = getattr( compute_models, 'CachingTypes' ) # pylint: disable=invalid-name DataDisk = getattr( compute_models, 'DataDisk...
def request_instance(vm_): ''' Request a VM from Azure. ''' compconn = get_conn(client_type='compute') # pylint: disable=invalid-name CachingTypes = getattr( compute_models, 'CachingTypes' ) # pylint: disable=invalid-name DataDisk = getattr( compute_models, 'DataDisk...
[ "Request", "a", "VM", "from", "Azure", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L916-L1377
[ "def", "request_instance", "(", "vm_", ")", ":", "compconn", "=", "get_conn", "(", "client_type", "=", "'compute'", ")", "# pylint: disable=invalid-name", "CachingTypes", "=", "getattr", "(", "compute_models", ",", "'CachingTypes'", ")", "# pylint: disable=invalid-name"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict.
salt/cloud/clouds/azurearm.py
def create(vm_): ''' Create a single VM from a data dict. ''' try: if vm_['profile'] and config.is_profile_configured( __opts__, __active_provider_name__ or 'azurearm', vm_['profile'], vm_=vm_ ) is False: return False except...
def create(vm_): ''' Create a single VM from a data dict. ''' try: if vm_['profile'] and config.is_profile_configured( __opts__, __active_provider_name__ or 'azurearm', vm_['profile'], vm_=vm_ ) is False: return False except...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1380-L1492
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'azurearm'", ",", "vm_", "[", "'profile'", "]", ",", "vm_", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy a VM. CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice
salt/cloud/clouds/azurearm.py
def destroy(name, call=None, kwargs=None): # pylint: disable=unused-argument ''' Destroy a VM. CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice ''' if kwargs is None: kwargs = {} if call == 'function'...
def destroy(name, call=None, kwargs=None): # pylint: disable=unused-argument ''' Destroy a VM. CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice ''' if kwargs is None: kwargs = {} if call == 'function'...
[ "Destroy", "a", "VM", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1495-L1651
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystem...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_storage_accounts
List storage accounts within the subscription.
salt/cloud/clouds/azurearm.py
def list_storage_accounts(call=None): ''' List storage accounts within the subscription. ''' if call == 'action': raise SaltCloudSystemExit( 'The list_storage_accounts function must be called with ' '-f or --function' ) storconn = get_conn(client_type='storag...
def list_storage_accounts(call=None): ''' List storage accounts within the subscription. ''' if call == 'action': raise SaltCloudSystemExit( 'The list_storage_accounts function must be called with ' '-f or --function' ) storconn = get_conn(client_type='storag...
[ "List", "storage", "accounts", "within", "the", "subscription", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1654-L1676
[ "def", "list_storage_accounts", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_storage_accounts function must be called with '", "'-f or --function'", ")", "storconn", "=", "get_conn", "(", "clien...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cloud_environment
Get the cloud environment object.
salt/cloud/clouds/azurearm.py
def _get_cloud_environment(): ''' Get the cloud environment object. ''' cloud_environment = config.get_cloud_config_value( 'cloud_environment', get_configured_provider(), __opts__, search_global=False ) try: clou...
def _get_cloud_environment(): ''' Get the cloud environment object. ''' cloud_environment = config.get_cloud_config_value( 'cloud_environment', get_configured_provider(), __opts__, search_global=False ) try: clou...
[ "Get", "the", "cloud", "environment", "object", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1679-L1695
[ "def", "_get_cloud_environment", "(", ")", ":", "cloud_environment", "=", "config", ".", "get_cloud_config_value", "(", "'cloud_environment'", ",", "get_configured_provider", "(", ")", ",", "__opts__", ",", "search_global", "=", "False", ")", "try", ":", "cloud_env_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_block_blob_service
Get the block blob storage service.
salt/cloud/clouds/azurearm.py
def _get_block_blob_service(kwargs=None): ''' Get the block blob storage service. ''' resource_group = kwargs.get('resource_group') or config.get_cloud_config_value( 'resource_group', get_configured_provider(), __opts__, search_global=False ...
def _get_block_blob_service(kwargs=None): ''' Get the block blob storage service. ''' resource_group = kwargs.get('resource_group') or config.get_cloud_config_value( 'resource_group', get_configured_provider(), __opts__, search_global=False ...
[ "Get", "the", "block", "blob", "storage", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1698-L1741
[ "def", "_get_block_blob_service", "(", "kwargs", "=", "None", ")", ":", "resource_group", "=", "kwargs", ".", "get", "(", "'resource_group'", ")", "or", "config", ".", "get_cloud_config_value", "(", "'resource_group'", ",", "get_configured_provider", "(", ")", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_blobs
List blobs.
salt/cloud/clouds/azurearm.py
def list_blobs(call=None, kwargs=None): # pylint: disable=unused-argument ''' List blobs. ''' if kwargs is None: kwargs = {} if 'container' not in kwargs: raise SaltCloudSystemExit( 'A container must be specified' ) storageservice = _get_block_blob_service(...
def list_blobs(call=None, kwargs=None): # pylint: disable=unused-argument ''' List blobs. ''' if kwargs is None: kwargs = {} if 'container' not in kwargs: raise SaltCloudSystemExit( 'A container must be specified' ) storageservice = _get_block_blob_service(...
[ "List", "blobs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1744-L1769
[ "def", "list_blobs", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "'container'", "not", "in", "kwargs", ":", "raise", "SaltCloudSystemEx...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_blob
Delete a blob from a container.
salt/cloud/clouds/azurearm.py
def delete_blob(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a blob from a container. ''' if kwargs is None: kwargs = {} if 'container' not in kwargs: raise SaltCloudSystemExit( 'A container must be specified' ) if 'blob' not in kwa...
def delete_blob(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a blob from a container. ''' if kwargs is None: kwargs = {} if 'container' not in kwargs: raise SaltCloudSystemExit( 'A container must be specified' ) if 'blob' not in kwa...
[ "Delete", "a", "blob", "from", "a", "container", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1772-L1792
[ "def", "delete_blob", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "'container'", "not", "in", "kwargs", ":", "raise", "SaltCloudSystemE...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_managed_disk
Delete a managed disk from a resource group.
salt/cloud/clouds/azurearm.py
def delete_managed_disk(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a managed disk from a resource group. ''' compconn = get_conn(client_type='compute') try: compconn.disks.delete(kwargs['resource_group'], kwargs['blob']) except Exception as exc: log....
def delete_managed_disk(call=None, kwargs=None): # pylint: disable=unused-argument ''' Delete a managed disk from a resource group. ''' compconn = get_conn(client_type='compute') try: compconn.disks.delete(kwargs['resource_group'], kwargs['blob']) except Exception as exc: log....
[ "Delete", "a", "managed", "disk", "from", "a", "resource", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1795-L1808
[ "def", "delete_managed_disk", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "compconn", "=", "get_conn", "(", "client_type", "=", "'compute'", ")", "try", ":", "compconn", ".", "disks", ".", "delete", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_virtual_networks
List virtual networks.
salt/cloud/clouds/azurearm.py
def list_virtual_networks(call=None, kwargs=None): ''' List virtual networks. ''' if kwargs is None: kwargs = {} if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function' ) netconn = get_co...
def list_virtual_networks(call=None, kwargs=None): ''' List virtual networks. ''' if kwargs is None: kwargs = {} if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function' ) netconn = get_co...
[ "List", "virtual", "networks", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1811-L1842
[ "def", "list_virtual_networks", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function m...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_subnets
List subnets in a virtual network.
salt/cloud/clouds/azurearm.py
def list_subnets(call=None, kwargs=None): ''' List subnets in a virtual network. ''' if kwargs is None: kwargs = {} if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function' ) netconn = get...
def list_subnets(call=None, kwargs=None): ''' List subnets in a virtual network. ''' if kwargs is None: kwargs = {} if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function' ) netconn = get...
[ "List", "subnets", "in", "a", "virtual", "network", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1845-L1894
[ "def", "list_subnets", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be ca...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_or_update_vmextension
.. versionadded:: 2019.2.0 Create or update a VM extension object "inside" of a VM object. required kwargs: .. code-block:: yaml extension_name: myvmextension virtual_machine_name: myvm settings: {"commandToExecute": "hostname"} optional kwargs: .. code-block:: yaml ...
salt/cloud/clouds/azurearm.py
def create_or_update_vmextension(call=None, kwargs=None): # pylint: disable=unused-argument ''' .. versionadded:: 2019.2.0 Create or update a VM extension object "inside" of a VM object. required kwargs: .. code-block:: yaml extension_name: myvmextension virtual_machine_name: m...
def create_or_update_vmextension(call=None, kwargs=None): # pylint: disable=unused-argument ''' .. versionadded:: 2019.2.0 Create or update a VM extension object "inside" of a VM object. required kwargs: .. code-block:: yaml extension_name: myvmextension virtual_machine_name: m...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L1897-L2000
[ "def", "create_or_update_vmextension", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "# pylint: disable=unused-argument", "if", "kwargs", "is", "None", ":", "kwargs", "=", "{", "}", "if", "'extension_name'", "not", "in", "kwargs", ":", "raise...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stop
.. versionadded:: 2019.2.0 Stop (deallocate) a VM CLI Examples: .. code-block:: bash salt-cloud -a stop myminion
salt/cloud/clouds/azurearm.py
def stop(name, call=None): ''' .. versionadded:: 2019.2.0 Stop (deallocate) a VM CLI Examples: .. code-block:: bash salt-cloud -a stop myminion ''' if call == 'function': raise SaltCloudSystemExit( 'The stop action must be called with -a or --action.' ...
def stop(name, call=None): ''' .. versionadded:: 2019.2.0 Stop (deallocate) a VM CLI Examples: .. code-block:: bash salt-cloud -a stop myminion ''' if call == 'function': raise SaltCloudSystemExit( 'The stop action must be called with -a or --action.' ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/azurearm.py#L2003-L2061
[ "def", "stop", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The stop action must be called with -a or --action.'", ")", "compconn", "=", "get_conn", "(", "client_type", "=", "'comput...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
license_present
Ensures that the specified PowerPath license key is present on the host. name The license key to ensure is present
salt/states/powerpath.py
def license_present(name): ''' Ensures that the specified PowerPath license key is present on the host. name The license key to ensure is present ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} if not __salt__['powerpath.has_...
def license_present(name): ''' Ensures that the specified PowerPath license key is present on the host. name The license key to ensure is present ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} if not __salt__['powerpath.has_...
[ "Ensures", "that", "the", "specified", "PowerPath", "license", "key", "is", "present", "on", "the", "host", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/powerpath.py#L19-L58
[ "def", "license_present", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "if", "not", "__salt__", "[", "'powerpath.has_powerpath'", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_rpmmacros
Create the .rpmmacros file in user's home directory
salt/modules/rpmbuild_pkgbuild.py
def _create_rpmmacros(runas='root'): ''' Create the .rpmmacros file in user's home directory ''' home = os.path.expanduser('~') rpmbuilddir = os.path.join(home, 'rpmbuild') if not os.path.isdir(rpmbuilddir): __salt__['file.makedirs_perms'](name=rpmbuilddir, user=runas, group='mock') ...
def _create_rpmmacros(runas='root'): ''' Create the .rpmmacros file in user's home directory ''' home = os.path.expanduser('~') rpmbuilddir = os.path.join(home, 'rpmbuild') if not os.path.isdir(rpmbuilddir): __salt__['file.makedirs_perms'](name=rpmbuilddir, user=runas, group='mock') ...
[ "Create", "the", ".", "rpmmacros", "file", "in", "user", "s", "home", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L72-L93
[ "def", "_create_rpmmacros", "(", "runas", "=", "'root'", ")", ":", "home", "=", "os", ".", "path", ".", "expanduser", "(", "'~'", ")", "rpmbuilddir", "=", "os", ".", "path", ".", "join", "(", "home", ",", "'rpmbuild'", ")", "if", "not", "os", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_mk_tree
Create the rpm build tree
salt/modules/rpmbuild_pkgbuild.py
def _mk_tree(runas='root'): ''' Create the rpm build tree ''' basedir = tempfile.mkdtemp() paths = ['BUILD', 'RPMS', 'SOURCES', 'SPECS', 'SRPMS'] for path in paths: full = os.path.join(basedir, path) __salt__['file.makedirs_perms'](name=full, user=runas, group='mock') return ...
def _mk_tree(runas='root'): ''' Create the rpm build tree ''' basedir = tempfile.mkdtemp() paths = ['BUILD', 'RPMS', 'SOURCES', 'SPECS', 'SRPMS'] for path in paths: full = os.path.join(basedir, path) __salt__['file.makedirs_perms'](name=full, user=runas, group='mock') return ...
[ "Create", "the", "rpm", "build", "tree" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L96-L105
[ "def", "_mk_tree", "(", "runas", "=", "'root'", ")", ":", "basedir", "=", "tempfile", ".", "mkdtemp", "(", ")", "paths", "=", "[", "'BUILD'", ",", "'RPMS'", ",", "'SOURCES'", ",", "'SPECS'", ",", "'SRPMS'", "]", "for", "path", "in", "paths", ":", "fu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_spec
Get the spec file and place it in the SPECS dir
salt/modules/rpmbuild_pkgbuild.py
def _get_spec(tree_base, spec, template, saltenv='base'): ''' Get the spec file and place it in the SPECS dir ''' spec_tgt = os.path.basename(spec) dest = os.path.join(tree_base, 'SPECS', spec_tgt) return __salt__['cp.get_url']( spec, dest, saltenv=saltenv)
def _get_spec(tree_base, spec, template, saltenv='base'): ''' Get the spec file and place it in the SPECS dir ''' spec_tgt = os.path.basename(spec) dest = os.path.join(tree_base, 'SPECS', spec_tgt) return __salt__['cp.get_url']( spec, dest, saltenv=saltenv)
[ "Get", "the", "spec", "file", "and", "place", "it", "in", "the", "SPECS", "dir" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L108-L117
[ "def", "_get_spec", "(", "tree_base", ",", "spec", ",", "template", ",", "saltenv", "=", "'base'", ")", ":", "spec_tgt", "=", "os", ".", "path", ".", "basename", "(", "spec", ")", "dest", "=", "os", ".", "path", ".", "join", "(", "tree_base", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_distset
Get the distribution string for use with rpmbuild and mock
salt/modules/rpmbuild_pkgbuild.py
def _get_distset(tgt): ''' Get the distribution string for use with rpmbuild and mock ''' # Centos adds 'centos' string to rpm names, removing that to have # consistent naming on Centos and Redhat, and allow for Amazon naming tgtattrs = tgt.split('-') if tgtattrs[0] == 'amzn': distse...
def _get_distset(tgt): ''' Get the distribution string for use with rpmbuild and mock ''' # Centos adds 'centos' string to rpm names, removing that to have # consistent naming on Centos and Redhat, and allow for Amazon naming tgtattrs = tgt.split('-') if tgtattrs[0] == 'amzn': distse...
[ "Get", "the", "distribution", "string", "for", "use", "with", "rpmbuild", "and", "mock" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L134-L148
[ "def", "_get_distset", "(", "tgt", ")", ":", "# Centos adds 'centos' string to rpm names, removing that to have", "# consistent naming on Centos and Redhat, and allow for Amazon naming", "tgtattrs", "=", "tgt", ".", "split", "(", "'-'", ")", "if", "tgtattrs", "[", "0", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_deps
Get include string for list of dependent rpms to build package
salt/modules/rpmbuild_pkgbuild.py
def _get_deps(deps, tree_base, saltenv='base'): ''' Get include string for list of dependent rpms to build package ''' deps_list = '' if deps is None: return deps_list if not isinstance(deps, list): raise SaltInvocationError( '\'deps\' must be a Python list or comma-s...
def _get_deps(deps, tree_base, saltenv='base'): ''' Get include string for list of dependent rpms to build package ''' deps_list = '' if deps is None: return deps_list if not isinstance(deps, list): raise SaltInvocationError( '\'deps\' must be a Python list or comma-s...
[ "Get", "include", "string", "for", "list", "of", "dependent", "rpms", "to", "build", "package" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L151-L173
[ "def", "_get_deps", "(", "deps", ",", "tree_base", ",", "saltenv", "=", "'base'", ")", ":", "deps_list", "=", "''", "if", "deps", "is", "None", ":", "return", "deps_list", "if", "not", "isinstance", "(", "deps", ",", "list", ")", ":", "raise", "SaltInv...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
make_src_pkg
Create a source rpm from the given spec file and sources CLI Example: .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ https://raw.githubusercontent.com/saltstack/libnacl/master/pkg/rpm/python-libnacl.spec https://pypi.python.org/packages/source/l/lib...
salt/modules/rpmbuild_pkgbuild.py
def make_src_pkg(dest_dir, spec, sources, env=None, template=None, saltenv='base', runas='root'): ''' Create a source rpm from the given spec file and sources CLI Example: .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ https://raw.githubusercontent.com/salt...
def make_src_pkg(dest_dir, spec, sources, env=None, template=None, saltenv='base', runas='root'): ''' Create a source rpm from the given spec file and sources CLI Example: .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ https://raw.githubusercontent.com/salt...
[ "Create", "a", "source", "rpm", "from", "the", "given", "spec", "file", "and", "sources" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L176-L257
[ "def", "make_src_pkg", "(", "dest_dir", ",", "spec", ",", "sources", ",", "env", "=", "None", ",", "template", "=", "None", ",", "saltenv", "=", "'base'", ",", "runas", "=", "'root'", ")", ":", "_create_rpmmacros", "(", "runas", ")", "tree_base", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
build
Given the package destination directory, the spec file source and package sources, use mock to safely build the rpm defined in the spec file CLI Example: .. code-block:: bash salt '*' pkgbuild.build mock epel-7-x86_64 /var/www/html https://raw.githubusercontent.com/saltstack/l...
salt/modules/rpmbuild_pkgbuild.py
def build(runas, tgt, dest_dir, spec, sources, deps, env, template, saltenv='base', log_dir='/var/log/salt/pkgbuild'): ''' Given the package destination directory, the spec file source and package sources, use mock to ...
def build(runas, tgt, dest_dir, spec, sources, deps, env, template, saltenv='base', log_dir='/var/log/salt/pkgbuild'): ''' Given the package destination directory, the spec file source and package sources, use mock to ...
[ "Given", "the", "package", "destination", "directory", "the", "spec", "file", "source", "and", "package", "sources", "use", "mock", "to", "safely", "build", "the", "rpm", "defined", "in", "the", "spec", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L260-L374
[ "def", "build", "(", "runas", ",", "tgt", ",", "dest_dir", ",", "spec", ",", "sources", ",", "deps", ",", "env", ",", "template", ",", "saltenv", "=", "'base'", ",", "log_dir", "=", "'/var/log/salt/pkgbuild'", ")", ":", "ret", "=", "{", "}", "try", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
make_repo
Make a package repository and optionally sign packages present Given the repodir, create a ``yum`` repository out of the rpms therein and optionally sign it and packages present, the name is directory to turn into a repo. This state is best used with onchanges linked to your package building states. ...
salt/modules/rpmbuild_pkgbuild.py
def make_repo(repodir, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='root', timeout=15.0): ''' Make a package repository and optionally sign packages present Given the repodir, create a `...
def make_repo(repodir, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='root', timeout=15.0): ''' Make a package repository and optionally sign packages present Given the repodir, create a `...
[ "Make", "a", "package", "repository", "and", "optionally", "sign", "packages", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpmbuild_pkgbuild.py#L377-L595
[ "def", "make_repo", "(", "repodir", ",", "keyid", "=", "None", ",", "env", "=", "None", ",", "use_passphrase", "=", "False", ",", "gnupghome", "=", "'/etc/salt/gpgkeys'", ",", "runas", "=", "'root'", ",", "timeout", "=", "15.0", ")", ":", "SIGN_PROMPT_RE",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
NestDisplay.display
Recursively iterate down through data structures to determine output
salt/output/no_return.py
def display(self, ret, indent, prefix, out): ''' Recursively iterate down through data structures to determine output ''' if isinstance(ret, six.string_types): lines = ret.split('\n') for line in lines: out += '{0}{1}{2}{3}{4}\n'.format( ...
def display(self, ret, indent, prefix, out): ''' Recursively iterate down through data structures to determine output ''' if isinstance(ret, six.string_types): lines = ret.split('\n') for line in lines: out += '{0}{1}{2}{3}{4}\n'.format( ...
[ "Recursively", "iterate", "down", "through", "data", "structures", "to", "determine", "output" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/no_return.py#L33-L56
[ "def", "display", "(", "self", ",", "ret", ",", "indent", ",", "prefix", ",", "out", ")", ":", "if", "isinstance", "(", "ret", ",", "six", ".", "string_types", ")", ":", "lines", "=", "ret", ".", "split", "(", "'\\n'", ")", "for", "line", "in", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Execute the Thorium runtime
salt/engines/thorium.py
def start(grains=False, grain_keys=None, pillar=False, pillar_keys=None): ''' Execute the Thorium runtime ''' state = salt.thorium.ThorState( __opts__, grains, grain_keys, pillar, pillar_keys) state.start_runtime()
def start(grains=False, grain_keys=None, pillar=False, pillar_keys=None): ''' Execute the Thorium runtime ''' state = salt.thorium.ThorState( __opts__, grains, grain_keys, pillar, pillar_keys) state.start_runtime()
[ "Execute", "the", "Thorium", "runtime" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/thorium.py#L11-L21
[ "def", "start", "(", "grains", "=", "False", ",", "grain_keys", "=", "None", ",", "pillar", "=", "False", ",", "pillar_keys", "=", "None", ")", ":", "state", "=", "salt", ".", "thorium", ".", "ThorState", "(", "__opts__", ",", "grains", ",", "grain_key...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
Open the connection to the Junos device, login, and bind to the Resource class
salt/proxy/junos.py
def init(opts): ''' Open the connection to the Junos device, login, and bind to the Resource class ''' opts['multiprocessing'] = False log.debug('Opening connection to junos') args = {"host": opts['proxy']['host']} optional_args = ['user', 'username', ...
def init(opts): ''' Open the connection to the Junos device, login, and bind to the Resource class ''' opts['multiprocessing'] = False log.debug('Opening connection to junos') args = {"host": opts['proxy']['host']} optional_args = ['user', 'username', ...
[ "Open", "the", "connection", "to", "the", "Junos", "device", "login", "and", "bind", "to", "the", "Resource", "class" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/junos.py#L76-L134
[ "def", "init", "(", "opts", ")", ":", "opts", "[", "'multiprocessing'", "]", "=", "False", "log", ".", "debug", "(", "'Opening connection to junos'", ")", "args", "=", "{", "\"host\"", ":", "opts", "[", "'proxy'", "]", "[", "'host'", "]", "}", "optional_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
alive
Validate and return the connection status with the remote device. .. versionadded:: 2018.3.0
salt/proxy/junos.py
def alive(opts): ''' Validate and return the connection status with the remote device. .. versionadded:: 2018.3.0 ''' dev = conn() thisproxy['conn'].connected = ping() if not dev.connected: __salt__['event.fire_master']({}, 'junos/proxy/{}/stop'.format( opts['proxy'][...
def alive(opts): ''' Validate and return the connection status with the remote device. .. versionadded:: 2018.3.0 ''' dev = conn() thisproxy['conn'].connected = ping() if not dev.connected: __salt__['event.fire_master']({}, 'junos/proxy/{}/stop'.format( opts['proxy'][...
[ "Validate", "and", "return", "the", "connection", "status", "with", "the", "remote", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/junos.py#L145-L159
[ "def", "alive", "(", "opts", ")", ":", "dev", "=", "conn", "(", ")", "thisproxy", "[", "'conn'", "]", ".", "connected", "=", "ping", "(", ")", "if", "not", "dev", ".", "connected", ":", "__salt__", "[", "'event.fire_master'", "]", "(", "{", "}", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ping
Ping? Pong!
salt/proxy/junos.py
def ping(): ''' Ping? Pong! ''' dev = conn() # Check that the underlying netconf connection still exists. if dev._conn is None: return False # call rpc only if ncclient queue is empty. If not empty that means other # rpc call is going on. if hasattr(dev._conn, '_session'):...
def ping(): ''' Ping? Pong! ''' dev = conn() # Check that the underlying netconf connection still exists. if dev._conn is None: return False # call rpc only if ncclient queue is empty. If not empty that means other # rpc call is going on. if hasattr(dev._conn, '_session'):...
[ "Ping?", "Pong!" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/junos.py#L162-L189
[ "def", "ping", "(", ")", ":", "dev", "=", "conn", "(", ")", "# Check that the underlying netconf connection still exists.", "if", "dev", ".", "_conn", "is", "None", ":", "return", "False", "# call rpc only if ncclient queue is empty. If not empty that means other", "# rpc c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_retry_get_url
Retry grabbing a URL. Based heavily on boto.utils.retry_url
salt/utils/iam.py
def _retry_get_url(url, num_retries=10, timeout=5): ''' Retry grabbing a URL. Based heavily on boto.utils.retry_url ''' for i in range(0, num_retries): try: result = requests.get(url, timeout=timeout, proxies={'http': ''}) if hasattr(result, 'text'): r...
def _retry_get_url(url, num_retries=10, timeout=5): ''' Retry grabbing a URL. Based heavily on boto.utils.retry_url ''' for i in range(0, num_retries): try: result = requests.get(url, timeout=timeout, proxies={'http': ''}) if hasattr(result, 'text'): r...
[ "Retry", "grabbing", "a", "URL", ".", "Based", "heavily", "on", "boto", ".", "utils", ".", "retry_url" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/iam.py#L26-L53
[ "def", "_retry_get_url", "(", "url", ",", "num_retries", "=", "10", ",", "timeout", "=", "5", ")", ":", "for", "i", "in", "range", "(", "0", ",", "num_retries", ")", ":", "try", ":", "result", "=", "requests", ".", "get", "(", "url", ",", "timeout"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_convert_key_to_str
Stolen completely from boto.providers
salt/utils/iam.py
def _convert_key_to_str(key): ''' Stolen completely from boto.providers ''' # IMPORTANT: on PY2, the secret key must be str and not unicode to work # properly with hmac.new (see http://bugs.python.org/issue5285) # # pylint: disable=incompatible-py3-code,undefined-variable return salt.uti...
def _convert_key_to_str(key): ''' Stolen completely from boto.providers ''' # IMPORTANT: on PY2, the secret key must be str and not unicode to work # properly with hmac.new (see http://bugs.python.org/issue5285) # # pylint: disable=incompatible-py3-code,undefined-variable return salt.uti...
[ "Stolen", "completely", "from", "boto", ".", "providers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/iam.py#L56-L66
[ "def", "_convert_key_to_str", "(", "key", ")", ":", "# IMPORTANT: on PY2, the secret key must be str and not unicode to work", "# properly with hmac.new (see http://bugs.python.org/issue5285)", "#", "# pylint: disable=incompatible-py3-code,undefined-variable", "return", "salt", ".", "utils...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseCaller.print_docs
Pick up the documentation for all of the modules and print it out.
salt/cli/caller.py
def print_docs(self): ''' Pick up the documentation for all of the modules and print it out. ''' docs = {} for name, func in six.iteritems(self.minion.functions): if name not in docs: if func.__doc__: docs[name] = func.__doc__ ...
def print_docs(self): ''' Pick up the documentation for all of the modules and print it out. ''' docs = {} for name, func in six.iteritems(self.minion.functions): if name not in docs: if func.__doc__: docs[name] = func.__doc__ ...
[ "Pick", "up", "the", "documentation", "for", "all", "of", "the", "modules", "and", "print", "it", "out", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/caller.py#L91-L102
[ "def", "print_docs", "(", "self", ")", ":", "docs", "=", "{", "}", "for", "name", ",", "func", "in", "six", ".", "iteritems", "(", "self", ".", "minion", ".", "functions", ")", ":", "if", "name", "not", "in", "docs", ":", "if", "func", ".", "__do...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseCaller.print_grains
Print out the grains
salt/cli/caller.py
def print_grains(self): ''' Print out the grains ''' grains = self.minion.opts.get('grains') or salt.loader.grains(self.opts) salt.output.display_output({'local': grains}, 'grains', self.opts)
def print_grains(self): ''' Print out the grains ''' grains = self.minion.opts.get('grains') or salt.loader.grains(self.opts) salt.output.display_output({'local': grains}, 'grains', self.opts)
[ "Print", "out", "the", "grains" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/caller.py#L104-L109
[ "def", "print_grains", "(", "self", ")", ":", "grains", "=", "self", ".", "minion", ".", "opts", ".", "get", "(", "'grains'", ")", "or", "salt", ".", "loader", ".", "grains", "(", "self", ".", "opts", ")", "salt", ".", "output", ".", "display_output"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseCaller.run
Execute the salt call logic
salt/cli/caller.py
def run(self): ''' Execute the salt call logic ''' profiling_enabled = self.opts.get('profiling_enabled', False) try: pr = salt.utils.profile.activate_profile(profiling_enabled) try: ret = self.call() finally: sa...
def run(self): ''' Execute the salt call logic ''' profiling_enabled = self.opts.get('profiling_enabled', False) try: pr = salt.utils.profile.activate_profile(profiling_enabled) try: ret = self.call() finally: sa...
[ "Execute", "the", "salt", "call", "logic" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/caller.py#L111-L142
[ "def", "run", "(", "self", ")", ":", "profiling_enabled", "=", "self", ".", "opts", ".", "get", "(", "'profiling_enabled'", ",", "False", ")", "try", ":", "pr", "=", "salt", ".", "utils", ".", "profile", ".", "activate_profile", "(", "profiling_enabled", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseCaller.call
Call the module
salt/cli/caller.py
def call(self): ''' Call the module ''' ret = {} fun = self.opts['fun'] ret['jid'] = salt.utils.jid.gen_jid(self.opts) proc_fn = os.path.join( salt.minion.get_proc_dir(self.opts['cachedir']), ret['jid'] ) if fun not in self....
def call(self): ''' Call the module ''' ret = {} fun = self.opts['fun'] ret['jid'] = salt.utils.jid.gen_jid(self.opts) proc_fn = os.path.join( salt.minion.get_proc_dir(self.opts['cachedir']), ret['jid'] ) if fun not in self....
[ "Call", "the", "module" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/caller.py#L144-L301
[ "def", "call", "(", "self", ")", ":", "ret", "=", "{", "}", "fun", "=", "self", ".", "opts", "[", "'fun'", "]", "ret", "[", "'jid'", "]", "=", "salt", ".", "utils", ".", "jid", ".", "gen_jid", "(", "self", ".", "opts", ")", "proc_fn", "=", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ZeroMQCaller.return_pub
Return the data up to the master
salt/cli/caller.py
def return_pub(self, ret): ''' Return the data up to the master ''' channel = salt.transport.client.ReqChannel.factory(self.opts, usage='salt_call') load = {'cmd': '_return', 'id': self.opts['id']} for key, value in six.iteritems(ret): load[key] = value ...
def return_pub(self, ret): ''' Return the data up to the master ''' channel = salt.transport.client.ReqChannel.factory(self.opts, usage='salt_call') load = {'cmd': '_return', 'id': self.opts['id']} for key, value in six.iteritems(ret): load[key] = value ...
[ "Return", "the", "data", "up", "to", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/caller.py#L308-L319
[ "def", "return_pub", "(", "self", ",", "ret", ")", ":", "channel", "=", "salt", ".", "transport", ".", "client", ".", "ReqChannel", ".", "factory", "(", "self", ".", "opts", ",", "usage", "=", "'salt_call'", ")", "load", "=", "{", "'cmd'", ":", "'_re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cmd
Execute a remote execution command USAGE: .. code-block:: yaml run_remote_ex: local.cmd: - tgt: '*' - func: test.ping run_remote_ex: local.cmd: - tgt: '*' - func: test.sleep - arg: - 30 run...
salt/thorium/local.py
def cmd(name, tgt, func, arg=(), tgt_type='glob', ret='', kwarg=None, **kwargs): ''' Execute a remote execution command USAGE: .. code-block:: yaml run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...
def cmd(name, tgt, func, arg=(), tgt_type='glob', ret='', kwarg=None, **kwargs): ''' Execute a remote execution command USAGE: .. code-block:: yaml run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...
[ "Execute", "a", "remote", "execution", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/local.py#L12-L59
[ "def", "cmd", "(", "name", ",", "tgt", ",", "func", ",", "arg", "=", "(", ")", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "kwarg", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_api_version
Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version.
salt/states/keystone.py
def _api_version(profile=None, **connection_args): ''' Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version. ''' global _TENANT_ID global _OS_IDENTITY_API_VERSION try: if float(__salt__['keystone.api_version'](profile=profile, **connection_args).stri...
def _api_version(profile=None, **connection_args): ''' Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version. ''' global _TENANT_ID global _OS_IDENTITY_API_VERSION try: if float(__salt__['keystone.api_version'](profile=profile, **connection_args).stri...
[ "Sets", "global", "variables", "_OS_IDENTITY_API_VERSION", "and", "_TENANT_ID", "depending", "on", "API", "version", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L83-L95
[ "def", "_api_version", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "global", "_TENANT_ID", "global", "_OS_IDENTITY_API_VERSION", "try", ":", "if", "float", "(", "__salt__", "[", "'keystone.api_version'", "]", "(", "profile", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_present
Ensure that the keystone user is present with the specified properties. name The name of the user to manage password The password to use for this user. .. note:: If the user already exists and a different password was set for the user than the one specified he...
salt/states/keystone.py
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): ''' Ensure ...
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): ''' Ensure ...
[ "Ensure", "that", "the", "keystone", "user", "is", "present", "with", "the", "specified", "properties", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L98-L298
[ "def", "user_present", "(", "name", ",", "password", ",", "email", ",", "tenant", "=", "None", ",", "enabled", "=", "True", ",", "roles", "=", "None", ",", "profile", "=", "None", ",", "password_reset", "=", "True", ",", "project", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_absent
Ensure that the keystone user is absent. name The name of the user that should not exist
salt/states/keystone.py
def user_absent(name, profile=None, **connection_args): ''' Ensure that the keystone user is absent. name The name of the user that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'User "{0}" is already absent'.format(name...
def user_absent(name, profile=None, **connection_args): ''' Ensure that the keystone user is absent. name The name of the user that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'User "{0}" is already absent'.format(name...
[ "Ensure", "that", "the", "keystone", "user", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L301-L327
[ "def", "user_absent", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'User \"{0}\" is ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenant_present
Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for this tenant
salt/states/keystone.py
def tenant_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for...
def tenant_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for...
[ "Ensures", "that", "the", "keystone", "tenant", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L330-L399
[ "def", "tenant_present", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenant_absent
Ensure that the keystone tenant is absent. name The name of the tenant that should not exist
salt/states/keystone.py
def tenant_absent(name, profile=None, **connection_args): ''' Ensure that the keystone tenant is absent. name The name of the tenant that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Tenant / project "{0}" is already a...
def tenant_absent(name, profile=None, **connection_args): ''' Ensure that the keystone tenant is absent. name The name of the tenant that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Tenant / project "{0}" is already a...
[ "Ensure", "that", "the", "keystone", "tenant", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L402-L429
[ "def", "tenant_absent", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Tenant / proje...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
project_present
Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the project to manage description The description to use for this project enabled Availability state for thi...
salt/states/keystone.py
def project_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the projec...
def project_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the projec...
[ "Ensures", "that", "the", "keystone", "project", "exists", "Alias", "for", "tenant_present", "from", "V2", "API", "to", "fulfill", "V3", "API", "naming", "convention", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L432-L460
[ "def", "project_present", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "return", "tenant_present", "(", "name", ",", "description", "=", "description", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_present
Ensures that the keystone role exists name The name of the role that should be present
salt/states/keystone.py
def role_present(name, profile=None, **connection_args): '''' Ensures that the keystone role exists name The name of the role that should be present ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Role "{0}" already exists'.format(name)} ...
def role_present(name, profile=None, **connection_args): '''' Ensures that the keystone role exists name The name of the role that should be present ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Role "{0}" already exists'.format(name)} ...
[ "Ensures", "that", "the", "keystone", "role", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L484-L512
[ "def", "role_present", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Role \"{0}\" al...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_present
Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the service
salt/states/keystone.py
def service_present(name, service_type, description=None, profile=None, **connection_args): ''' Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the ...
def service_present(name, service_type, description=None, profile=None, **connection_args): ''' Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the ...
[ "Ensure", "service", "present", "in", "Keystone", "catalog" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L544-L583
[ "def", "service_present", "(", "name", ",", "service_type", ",", "description", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_present
Ensure the specified endpoints exists for service name The Service name publicurl The public url of service endpoint (for V2 API) internalurl The internal url of service endpoint (for V2 API) adminurl The admin url of the service endpoint (for V2 API) region ...
salt/states/keystone.py
def endpoint_present(name, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Ensure the s...
def endpoint_present(name, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Ensure the s...
[ "Ensure", "the", "specified", "endpoints", "exists", "for", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L617-L771
[ "def", "endpoint_present", "(", "name", ",", "publicurl", "=", "None", ",", "internalurl", "=", "None", ",", "adminurl", "=", "None", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "url", "=", "None", ",", "interface", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_absent
Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to ``RegionOne``. interface The interface type, which describes the visibility of ...
salt/states/keystone.py
def endpoint_absent(name, region=None, profile=None, interface=None, **connection_args): ''' Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to...
def endpoint_absent(name, region=None, profile=None, interface=None, **connection_args): ''' Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to...
[ "Ensure", "that", "the", "endpoint", "for", "a", "service", "doesn", "t", "exist", "in", "Keystone", "catalog" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L774-L814
[ "def", "endpoint_absent", "(", "name", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "interface", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_chkconfig_add
Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels.
salt/modules/rh_service.py
def _chkconfig_add(name): ''' Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels. ''' cmd = '/sbin/chkconfig --add {0}'.format(name) if __salt__['cmd.retcode'](cmd, python_shell=False) == 0: ...
def _chkconfig_add(name): ''' Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels. ''' cmd = '/sbin/chkconfig --add {0}'.format(name) if __salt__['cmd.retcode'](cmd, python_shell=False) == 0: ...
[ "Run", "chkconfig", "--", "add", "for", "a", "service", "whose", "script", "is", "installed", "in", "/", "etc", "/", "init", ".", "d", ".", "The", "service", "is", "initially", "configured", "to", "be", "disabled", "at", "all", "run", "-", "levels", "....
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L126-L138
[ "def", "_chkconfig_add", "(", "name", ")", ":", "cmd", "=", "'/sbin/chkconfig --add {0}'", ".", "format", "(", "name", ")", "if", "__salt__", "[", "'cmd.retcode'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "==", "0", ":", "log", ".", "info...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_service_is_sysv
Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False.
salt/modules/rh_service.py
def _service_is_sysv(name): ''' Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False. ''' try: # Look for user-execute bit in file mode. return bool(os.stat( os.path.join('/etc/init.d', name)).st_mode & stat.S_IXUS...
def _service_is_sysv(name): ''' Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False. ''' try: # Look for user-execute bit in file mode. return bool(os.stat( os.path.join('/etc/init.d', name)).st_mode & stat.S_IXUS...
[ "Return", "True", "if", "the", "service", "is", "a", "System", "V", "service", "(", "includes", "those", "managed", "by", "chkconfig", ")", ";", "otherwise", "return", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L148-L158
[ "def", "_service_is_sysv", "(", "name", ")", ":", "try", ":", "# Look for user-execute bit in file mode.", "return", "bool", "(", "os", ".", "stat", "(", "os", ".", "path", ".", "join", "(", "'/etc/init.d'", ",", "name", ")", ")", ".", "st_mode", "&", "sta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_service_is_chkconfig
Return True if the service is managed by chkconfig.
salt/modules/rh_service.py
def _service_is_chkconfig(name): ''' Return True if the service is managed by chkconfig. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) return __salt__['cmd.retcode'](cmdline, python_shell=False, ignore_retcode=True) == 0
def _service_is_chkconfig(name): ''' Return True if the service is managed by chkconfig. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) return __salt__['cmd.retcode'](cmdline, python_shell=False, ignore_retcode=True) == 0
[ "Return", "True", "if", "the", "service", "is", "managed", "by", "chkconfig", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L161-L166
[ "def", "_service_is_chkconfig", "(", "name", ")", ":", "cmdline", "=", "'/sbin/chkconfig --list {0}'", ".", "format", "(", "name", ")", "return", "__salt__", "[", "'cmd.retcode'", "]", "(", "cmdline", ",", "python_shell", "=", "False", ",", "ignore_retcode", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sysv_is_enabled
Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel.
salt/modules/rh_service.py
def _sysv_is_enabled(name, runlevel=None): ''' Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel. ''' # Try chkconfig first. result = _chkconfig_is_enabled(name, runlevel) if...
def _sysv_is_enabled(name, runlevel=None): ''' Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel. ''' # Try chkconfig first. result = _chkconfig_is_enabled(name, runlevel) if...
[ "Return", "True", "if", "the", "sysv", "(", "or", "chkconfig", ")", "service", "is", "enabled", "for", "the", "specified", "runlevel", ";", "otherwise", "return", "False", ".", "If", "runlevel", "is", "None", "then", "use", "the", "current", "runlevel", "....
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L169-L183
[ "def", "_sysv_is_enabled", "(", "name", ",", "runlevel", "=", "None", ")", ":", "# Try chkconfig first.", "result", "=", "_chkconfig_is_enabled", "(", "name", ",", "runlevel", ")", "if", "result", ":", "return", "True", "if", "runlevel", "is", "None", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_chkconfig_is_enabled
Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel.
salt/modules/rh_service.py
def _chkconfig_is_enabled(name, runlevel=None): ''' Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) result = __salt__['cmd.run_al...
def _chkconfig_is_enabled(name, runlevel=None): ''' Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) result = __salt__['cmd.run_al...
[ "Return", "True", "if", "the", "service", "is", "enabled", "according", "to", "chkconfig", ";", "otherwise", "return", "False", ".", "If", "runlevel", "is", "None", "then", "use", "the", "current", "runlevel", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L186-L204
[ "def", "_chkconfig_is_enabled", "(", "name", ",", "runlevel", "=", "None", ")", ":", "cmdline", "=", "'/sbin/chkconfig --list {0}'", ".", "format", "(", "name", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmdline", ",", "python_shell", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sysv_enable
Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail.
salt/modules/rh_service.py
def _sysv_enable(name): ''' Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail. ''' if not _service_is_chkconfig(name) and not _chkconfig_...
def _sysv_enable(name): ''' Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail. ''' if not _service_is_chkconfig(name) and not _chkconfig_...
[ "Enable", "the", "named", "sysv", "service", "to", "start", "at", "boot", ".", "The", "service", "will", "be", "enabled", "using", "chkconfig", "with", "default", "run", "-", "levels", "if", "the", "service", "is", "chkconfig", "compatible", ".", "If", "ch...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L207-L216
[ "def", "_sysv_enable", "(", "name", ")", ":", "if", "not", "_service_is_chkconfig", "(", "name", ")", "and", "not", "_chkconfig_add", "(", "name", ")", ":", "return", "False", "cmd", "=", "'/sbin/chkconfig {0} on'", ".", "format", "(", "name", ")", "return",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sysv_delete
Delete the named sysv service from the system. The service will be deleted using chkconfig.
salt/modules/rh_service.py
def _sysv_delete(name): ''' Delete the named sysv service from the system. The service will be deleted using chkconfig. ''' if not _service_is_chkconfig(name): return False cmd = '/sbin/chkconfig --del {0}'.format(name) return not __salt__['cmd.retcode'](cmd)
def _sysv_delete(name): ''' Delete the named sysv service from the system. The service will be deleted using chkconfig. ''' if not _service_is_chkconfig(name): return False cmd = '/sbin/chkconfig --del {0}'.format(name) return not __salt__['cmd.retcode'](cmd)
[ "Delete", "the", "named", "sysv", "service", "from", "the", "system", ".", "The", "service", "will", "be", "deleted", "using", "chkconfig", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L232-L240
[ "def", "_sysv_delete", "(", "name", ")", ":", "if", "not", "_service_is_chkconfig", "(", "name", ")", ":", "return", "False", "cmd", "=", "'/sbin/chkconfig --del {0}'", ".", "format", "(", "name", ")", "return", "not", "__salt__", "[", "'cmd.retcode'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_upstart_delete
Delete an upstart service. This will only rename the .conf file
salt/modules/rh_service.py
def _upstart_delete(name): ''' Delete an upstart service. This will only rename the .conf file ''' if HAS_UPSTART: if os.path.exists('/etc/init/{0}.conf'.format(name)): os.rename('/etc/init/{0}.conf'.format(name), '/etc/init/{0}.conf.removed'.format(name)) r...
def _upstart_delete(name): ''' Delete an upstart service. This will only rename the .conf file ''' if HAS_UPSTART: if os.path.exists('/etc/init/{0}.conf'.format(name)): os.rename('/etc/init/{0}.conf'.format(name), '/etc/init/{0}.conf.removed'.format(name)) r...
[ "Delete", "an", "upstart", "service", ".", "This", "will", "only", "rename", "the", ".", "conf", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L243-L251
[ "def", "_upstart_delete", "(", "name", ")", ":", "if", "HAS_UPSTART", ":", "if", "os", ".", "path", ".", "exists", "(", "'/etc/init/{0}.conf'", ".", "format", "(", "name", ")", ")", ":", "os", ".", "rename", "(", "'/etc/init/{0}.conf'", ".", "format", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sysv_services
Return list of sysv services.
salt/modules/rh_service.py
def _sysv_services(): ''' Return list of sysv services. ''' _services = [] output = __salt__['cmd.run'](['chkconfig', '--list'], python_shell=False) for line in output.splitlines(): comps = line.split() try: if comps[1].startswith('0:'): _services.appe...
def _sysv_services(): ''' Return list of sysv services. ''' _services = [] output = __salt__['cmd.run'](['chkconfig', '--list'], python_shell=False) for line in output.splitlines(): comps = line.split() try: if comps[1].startswith('0:'): _services.appe...
[ "Return", "list", "of", "sysv", "services", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L265-L279
[ "def", "_sysv_services", "(", ")", ":", "_services", "=", "[", "]", "output", "=", "__salt__", "[", "'cmd.run'", "]", "(", "[", "'chkconfig'", ",", "'--list'", "]", ",", "python_shell", "=", "False", ")", "for", "line", "in", "output", ".", "splitlines",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_enabled
Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=sysvinit
salt/modules/rh_service.py
def get_enabled(limit=''): ''' Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=s...
def get_enabled(limit=''): ''' Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=s...
[ "Return", "the", "enabled", "services", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L282-L309
[ "def", "get_enabled", "(", "limit", "=", "''", ")", ":", "limit", "=", "limit", ".", "lower", "(", ")", "if", "limit", "==", "'upstart'", ":", "return", "sorted", "(", "name", "for", "name", "in", "_upstart_services", "(", ")", "if", "_upstart_is_enabled...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all
Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit
salt/modules/rh_service.py
def get_all(limit=''): ''' Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit '''...
def get_all(limit=''): ''' Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit '''...
[ "Return", "all", "installed", "services", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L342-L361
[ "def", "get_all", "(", "limit", "=", "''", ")", ":", "limit", "=", "limit", ".", "lower", "(", ")", "if", "limit", "==", "'upstart'", ":", "return", "sorted", "(", "_upstart_services", "(", ")", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
available
Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*' service.available sshd limit=sysvinit
salt/modules/rh_service.py
def available(name, limit=''): ''' Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*...
def available(name, limit=''): ''' Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*...
[ "Return", "True", "if", "the", "named", "service", "is", "available", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L364-L382
[ "def", "available", "(", "name", ",", "limit", "=", "''", ")", ":", "if", "limit", "==", "'upstart'", ":", "return", "_service_is_upstart", "(", "name", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", "_service_is_sysv", "(", "name", ")", "else", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
missing
The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missing sshd limit=upstart salt '*' ser...
salt/modules/rh_service.py
def missing(name, limit=''): ''' The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missin...
def missing(name, limit=''): ''' The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missin...
[ "The", "inverse", "of", "service", ".", "available", ".", "Return", "True", "if", "the", "named", "service", "is", "not", "available", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L385-L407
[ "def", "missing", "(", "name", ",", "limit", "=", "''", ")", ":", "if", "limit", "==", "'upstart'", ":", "return", "not", "_service_is_upstart", "(", "name", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", "not", "_service_is_sysv", "(", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name>
salt/modules/rh_service.py
def start(name): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name> ''' if _service_is_upstart(name): cmd = 'start {0}'.format(name) else: cmd = '/sbin/service {0} start'.format(name) return not __salt__['cmd...
def start(name): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name> ''' if _service_is_upstart(name): cmd = 'start {0}'.format(name) else: cmd = '/sbin/service {0} start'.format(name) return not __salt__['cmd...
[ "Start", "the", "specified", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L410-L424
[ "def", "start", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "cmd", "=", "'start {0}'", ".", "format", "(", "name", ")", "else", ":", "cmd", "=", "'/sbin/service {0} start'", ".", "format", "(", "name", ")", "return", "not",...
e8541fd6e744ab0df786c0f76102e41631f45d46