repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/deb_postgres.py | cluster_remove | def cluster_remove(version,
name='main',
stop=False):
'''
Remove a cluster on a Postgres server. By default it doesn't try
to stop the cluster.
CLI Example:
.. code-block:: bash
salt '*' postgres.cluster_remove '9.3'
salt '*' postgres.cluster... | python | def cluster_remove(version,
name='main',
stop=False):
'''
Remove a cluster on a Postgres server. By default it doesn't try
to stop the cluster.
CLI Example:
.. code-block:: bash
salt '*' postgres.cluster_remove '9.3'
salt '*' postgres.cluster... | [
"def",
"cluster_remove",
"(",
"version",
",",
"name",
"=",
"'main'",
",",
"stop",
"=",
"False",
")",
":",
"cmd",
"=",
"[",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'pg_dropcluster'",
")",
"]",
"if",
"stop",
":",
"cmd",
"+=",
"[",
"'--... | Remove a cluster on a Postgres server. By default it doesn't try
to stop the cluster.
CLI Example:
.. code-block:: bash
salt '*' postgres.cluster_remove '9.3'
salt '*' postgres.cluster_remove '9.3' 'main'
salt '*' postgres.cluster_remove '9.3' 'main' stop=True | [
"Remove",
"a",
"cluster",
"on",
"a",
"Postgres",
"server",
".",
"By",
"default",
"it",
"doesn",
"t",
"try",
"to",
"stop",
"the",
"cluster",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L126-L156 | train |
saltstack/salt | salt/modules/deb_postgres.py | _parse_pg_lscluster | def _parse_pg_lscluster(output):
'''
Helper function to parse the output of pg_lscluster
'''
cluster_dict = {}
for line in output.splitlines():
version, name, port, status, user, datadir, log = (
line.split())
cluster_dict['{0}/{1}'.format(version, name)] = {
... | python | def _parse_pg_lscluster(output):
'''
Helper function to parse the output of pg_lscluster
'''
cluster_dict = {}
for line in output.splitlines():
version, name, port, status, user, datadir, log = (
line.split())
cluster_dict['{0}/{1}'.format(version, name)] = {
... | [
"def",
"_parse_pg_lscluster",
"(",
"output",
")",
":",
"cluster_dict",
"=",
"{",
"}",
"for",
"line",
"in",
"output",
".",
"splitlines",
"(",
")",
":",
"version",
",",
"name",
",",
"port",
",",
"status",
",",
"user",
",",
"datadir",
",",
"log",
"=",
"... | Helper function to parse the output of pg_lscluster | [
"Helper",
"function",
"to",
"parse",
"the",
"output",
"of",
"pg_lscluster"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L159-L173 | train |
saltstack/salt | salt/grains/esxi.py | _find_credentials | def _find_credentials(host):
'''
Cycle through all the possible credentials and return the first one that
works.
'''
user_names = [__pillar__['proxy'].get('username', 'root')]
passwords = __pillar__['proxy']['passwords']
for user in user_names:
for password in passwords:
... | python | def _find_credentials(host):
'''
Cycle through all the possible credentials and return the first one that
works.
'''
user_names = [__pillar__['proxy'].get('username', 'root')]
passwords = __pillar__['proxy']['passwords']
for user in user_names:
for password in passwords:
... | [
"def",
"_find_credentials",
"(",
"host",
")",
":",
"user_names",
"=",
"[",
"__pillar__",
"[",
"'proxy'",
"]",
".",
"get",
"(",
"'username'",
",",
"'root'",
")",
"]",
"passwords",
"=",
"__pillar__",
"[",
"'proxy'",
"]",
"[",
"'passwords'",
"]",
"for",
"us... | Cycle through all the possible credentials and return the first one that
works. | [
"Cycle",
"through",
"all",
"the",
"possible",
"credentials",
"and",
"return",
"the",
"first",
"one",
"that",
"works",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/esxi.py#L59-L80 | train |
saltstack/salt | salt/grains/esxi.py | _grains | def _grains():
'''
Get the grains from the proxied device.
'''
try:
host = __pillar__['proxy']['host']
if host:
username, password = _find_credentials(host)
protocol = __pillar__['proxy'].get('protocol')
port = __pillar__['proxy'].get('port')
... | python | def _grains():
'''
Get the grains from the proxied device.
'''
try:
host = __pillar__['proxy']['host']
if host:
username, password = _find_credentials(host)
protocol = __pillar__['proxy'].get('protocol')
port = __pillar__['proxy'].get('port')
... | [
"def",
"_grains",
"(",
")",
":",
"try",
":",
"host",
"=",
"__pillar__",
"[",
"'proxy'",
"]",
"[",
"'host'",
"]",
"if",
"host",
":",
"username",
",",
"password",
"=",
"_find_credentials",
"(",
"host",
")",
"protocol",
"=",
"__pillar__",
"[",
"'proxy'",
... | Get the grains from the proxied device. | [
"Get",
"the",
"grains",
"from",
"the",
"proxied",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/esxi.py#L83-L102 | train |
saltstack/salt | salt/pillar/etcd_pillar.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
conf):
'''
Check etcd for all data
'''
comps = conf.split()
profile = None
if comps[0]:
profile = comps[0]
client = salt.utils.etcd_util.get_conn(__opts__, profile)
path = '/'
if len(co... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
conf):
'''
Check etcd for all data
'''
comps = conf.split()
profile = None
if comps[0]:
profile = comps[0]
client = salt.utils.etcd_util.get_conn(__opts__, profile)
path = '/'
if len(co... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"conf",
")",
":",
"comps",
"=",
"conf",
".",
"split",
"(",
")",
"profile",
"=",
"None",
"if",
"comps",
"[",
"0",
"]",
":",
"profile",
"=",
"comps",
"[",
"0",
"]",
"... | Check etcd for all data | [
"Check",
"etcd",
"for",
"all",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/etcd_pillar.py#L86-L114 | train |
saltstack/salt | salt/states/csf.py | rule_absent | def rule_absent(name,
method,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='s',
ttl=None,
reload=False):
'''
Ensure iptable is not present.
name
The ... | python | def rule_absent(name,
method,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='s',
ttl=None,
reload=False):
'''
Ensure iptable is not present.
name
The ... | [
"def",
"rule_absent",
"(",
"name",
",",
"method",
",",
"port",
"=",
"None",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'s'",
",",
"ttl",
"=",
"None",
",",
"reload",
"=",
"False",... | Ensure iptable is not present.
name
The ip address or CIDR for the rule.
method
The type of rule. Either 'allow' or 'deny'.
port
Optional port to be open or closed for the
iptables rule.
proto
The protocol. Either 'tcp', 'udp'.
Only applicable if port... | [
"Ensure",
"iptable",
"is",
"not",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L131-L217 | train |
saltstack/salt | salt/states/csf.py | ports_open | def ports_open(name, ports, proto='tcp', direction='in'):
'''
Ensure ports are open for a protocol, in a direction.
e.g. - proto='tcp', direction='in' would set the values
for TCP_IN in the csf.conf file.
ports
A list of ports that should be open.
proto
The protocol. May be one... | python | def ports_open(name, ports, proto='tcp', direction='in'):
'''
Ensure ports are open for a protocol, in a direction.
e.g. - proto='tcp', direction='in' would set the values
for TCP_IN in the csf.conf file.
ports
A list of ports that should be open.
proto
The protocol. May be one... | [
"def",
"ports_open",
"(",
"name",
",",
"ports",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
")",
":",
"ports",
"=",
"list",
"(",
"six",
".",
"moves",
".",
"map",
"(",
"six",
".",
"text_type",
",",
"ports",
")",
")",
"diff",
"=",
"F... | Ensure ports are open for a protocol, in a direction.
e.g. - proto='tcp', direction='in' would set the values
for TCP_IN in the csf.conf file.
ports
A list of ports that should be open.
proto
The protocol. May be one of 'tcp', 'udp',
'tcp6', or 'udp6'.
direction
Ch... | [
"Ensure",
"ports",
"are",
"open",
"for",
"a",
"protocol",
"in",
"a",
"direction",
".",
"e",
".",
"g",
".",
"-",
"proto",
"=",
"tcp",
"direction",
"=",
"in",
"would",
"set",
"the",
"values",
"for",
"TCP_IN",
"in",
"the",
"csf",
".",
"conf",
"file",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L220-L258 | train |
saltstack/salt | salt/states/csf.py | nics_skip | def nics_skip(name, nics, ipv6):
'''
Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>`
'''
return nics_skipped(name, nics=nics, ipv6=ipv6) | python | def nics_skip(name, nics, ipv6):
'''
Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>`
'''
return nics_skipped(name, nics=nics, ipv6=ipv6) | [
"def",
"nics_skip",
"(",
"name",
",",
"nics",
",",
"ipv6",
")",
":",
"return",
"nics_skipped",
"(",
"name",
",",
"nics",
"=",
"nics",
",",
"ipv6",
"=",
"ipv6",
")"
] | Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` | [
"Alias",
"for",
":",
"mod",
":",
"csf",
".",
"nics_skipped",
"<salt",
".",
"states",
".",
"csf",
".",
"nics_skipped",
">"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L261-L265 | train |
saltstack/salt | salt/states/csf.py | nics_skipped | def nics_skipped(name, nics, ipv6=False):
'''
name
Meaningless arg, but required for state.
nics
A list of nics to skip.
ipv6
Boolean. Set to true if you want to skip
the ipv6 interface. Default false (ipv4).
'''
ret = {'name': ','.join(nics),
'change... | python | def nics_skipped(name, nics, ipv6=False):
'''
name
Meaningless arg, but required for state.
nics
A list of nics to skip.
ipv6
Boolean. Set to true if you want to skip
the ipv6 interface. Default false (ipv4).
'''
ret = {'name': ','.join(nics),
'change... | [
"def",
"nics_skipped",
"(",
"name",
",",
"nics",
",",
"ipv6",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"','",
".",
"join",
"(",
"nics",
")",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"'NI... | name
Meaningless arg, but required for state.
nics
A list of nics to skip.
ipv6
Boolean. Set to true if you want to skip
the ipv6 interface. Default false (ipv4). | [
"name",
"Meaningless",
"arg",
"but",
"required",
"for",
"state",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L268-L290 | train |
saltstack/salt | salt/states/csf.py | option_present | def option_present(name, value, reload=False):
'''
Ensure the state of a particular option/setting in csf.
name
The option name in csf.conf
value
The value it should be set to.
reload
Boolean. If set to true, csf will be reloaded after.
'''
ret = {'name': 'testing ... | python | def option_present(name, value, reload=False):
'''
Ensure the state of a particular option/setting in csf.
name
The option name in csf.conf
value
The value it should be set to.
reload
Boolean. If set to true, csf will be reloaded after.
'''
ret = {'name': 'testing ... | [
"def",
"option_present",
"(",
"name",
",",
"value",
",",
"reload",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"'testing mode'",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"'Option already present.'",
... | Ensure the state of a particular option/setting in csf.
name
The option name in csf.conf
value
The value it should be set to.
reload
Boolean. If set to true, csf will be reloaded after. | [
"Ensure",
"the",
"state",
"of",
"a",
"particular",
"option",
"/",
"setting",
"in",
"csf",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L350-L389 | train |
saltstack/salt | salt/pillar/stack.py | _parse_stack_cfg | def _parse_stack_cfg(content):
'''
Allow top level cfg to be YAML
'''
try:
obj = salt.utils.yaml.safe_load(content)
if isinstance(obj, list):
return obj
except Exception as e:
pass
return content.splitlines() | python | def _parse_stack_cfg(content):
'''
Allow top level cfg to be YAML
'''
try:
obj = salt.utils.yaml.safe_load(content)
if isinstance(obj, list):
return obj
except Exception as e:
pass
return content.splitlines() | [
"def",
"_parse_stack_cfg",
"(",
"content",
")",
":",
"try",
":",
"obj",
"=",
"salt",
".",
"utils",
".",
"yaml",
".",
"safe_load",
"(",
"content",
")",
"if",
"isinstance",
"(",
"obj",
",",
"list",
")",
":",
"return",
"obj",
"except",
"Exception",
"as",
... | Allow top level cfg to be YAML | [
"Allow",
"top",
"level",
"cfg",
"to",
"be",
"YAML"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/stack.py#L529-L539 | train |
saltstack/salt | salt/modules/pip.py | _clear_context | def _clear_context(bin_env=None):
'''
Remove the cached pip version
'''
contextkey = 'pip.version'
if bin_env is not None:
contextkey = '{0}.{1}'.format(contextkey, bin_env)
__context__.pop(contextkey, None) | python | def _clear_context(bin_env=None):
'''
Remove the cached pip version
'''
contextkey = 'pip.version'
if bin_env is not None:
contextkey = '{0}.{1}'.format(contextkey, bin_env)
__context__.pop(contextkey, None) | [
"def",
"_clear_context",
"(",
"bin_env",
"=",
"None",
")",
":",
"contextkey",
"=",
"'pip.version'",
"if",
"bin_env",
"is",
"not",
"None",
":",
"contextkey",
"=",
"'{0}.{1}'",
".",
"format",
"(",
"contextkey",
",",
"bin_env",
")",
"__context__",
".",
"pop",
... | Remove the cached pip version | [
"Remove",
"the",
"cached",
"pip",
"version"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L131-L138 | train |
saltstack/salt | salt/modules/pip.py | _get_pip_bin | def _get_pip_bin(bin_env):
'''
Locate the pip binary, either from `bin_env` as a virtualenv, as the
executable itself, or from searching conventional filesystem locations
'''
if not bin_env:
logger.debug('pip: Using pip from currently-running Python')
return [os.path.normpath(sys.exe... | python | def _get_pip_bin(bin_env):
'''
Locate the pip binary, either from `bin_env` as a virtualenv, as the
executable itself, or from searching conventional filesystem locations
'''
if not bin_env:
logger.debug('pip: Using pip from currently-running Python')
return [os.path.normpath(sys.exe... | [
"def",
"_get_pip_bin",
"(",
"bin_env",
")",
":",
"if",
"not",
"bin_env",
":",
"logger",
".",
"debug",
"(",
"'pip: Using pip from currently-running Python'",
")",
"return",
"[",
"os",
".",
"path",
".",
"normpath",
"(",
"sys",
".",
"executable",
")",
",",
"'-m... | Locate the pip binary, either from `bin_env` as a virtualenv, as the
executable itself, or from searching conventional filesystem locations | [
"Locate",
"the",
"pip",
"binary",
"either",
"from",
"bin_env",
"as",
"a",
"virtualenv",
"as",
"the",
"executable",
"itself",
"or",
"from",
"searching",
"conventional",
"filesystem",
"locations"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L141-L193 | train |
saltstack/salt | salt/modules/pip.py | _get_cached_requirements | def _get_cached_requirements(requirements, saltenv):
'''
Get the location of a cached requirements file; caching if necessary.
'''
req_file, senv = salt.utils.url.parse(requirements)
if senv:
saltenv = senv
if req_file not in __salt__['cp.list_master'](saltenv):
# Requirements ... | python | def _get_cached_requirements(requirements, saltenv):
'''
Get the location of a cached requirements file; caching if necessary.
'''
req_file, senv = salt.utils.url.parse(requirements)
if senv:
saltenv = senv
if req_file not in __salt__['cp.list_master'](saltenv):
# Requirements ... | [
"def",
"_get_cached_requirements",
"(",
"requirements",
",",
"saltenv",
")",
":",
"req_file",
",",
"senv",
"=",
"salt",
".",
"utils",
".",
"url",
".",
"parse",
"(",
"requirements",
")",
"if",
"senv",
":",
"saltenv",
"=",
"senv",
"if",
"req_file",
"not",
... | Get the location of a cached requirements file; caching if necessary. | [
"Get",
"the",
"location",
"of",
"a",
"cached",
"requirements",
"file",
";",
"caching",
"if",
"necessary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L196-L224 | train |
saltstack/salt | salt/modules/pip.py | _get_env_activate | def _get_env_activate(bin_env):
'''
Return the path to the activate binary
'''
if not bin_env:
raise CommandNotFoundError('Could not find a `activate` binary')
if os.path.isdir(bin_env):
if salt.utils.platform.is_windows():
activate_bin = os.path.join(bin_env, 'Scripts',... | python | def _get_env_activate(bin_env):
'''
Return the path to the activate binary
'''
if not bin_env:
raise CommandNotFoundError('Could not find a `activate` binary')
if os.path.isdir(bin_env):
if salt.utils.platform.is_windows():
activate_bin = os.path.join(bin_env, 'Scripts',... | [
"def",
"_get_env_activate",
"(",
"bin_env",
")",
":",
"if",
"not",
"bin_env",
":",
"raise",
"CommandNotFoundError",
"(",
"'Could not find a `activate` binary'",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"bin_env",
")",
":",
"if",
"salt",
".",
"utils",
... | Return the path to the activate binary | [
"Return",
"the",
"path",
"to",
"the",
"activate",
"binary"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L227-L241 | train |
saltstack/salt | salt/modules/pip.py | _resolve_requirements_chain | def _resolve_requirements_chain(requirements):
'''
Return an array of requirements file paths that can be used to complete
the no_chown==False && user != None conundrum
'''
chain = []
if isinstance(requirements, six.string_types):
requirements = [requirements]
for req_file in requ... | python | def _resolve_requirements_chain(requirements):
'''
Return an array of requirements file paths that can be used to complete
the no_chown==False && user != None conundrum
'''
chain = []
if isinstance(requirements, six.string_types):
requirements = [requirements]
for req_file in requ... | [
"def",
"_resolve_requirements_chain",
"(",
"requirements",
")",
":",
"chain",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"requirements",
",",
"six",
".",
"string_types",
")",
":",
"requirements",
"=",
"[",
"requirements",
"]",
"for",
"req_file",
"in",
"requiremen... | Return an array of requirements file paths that can be used to complete
the no_chown==False && user != None conundrum | [
"Return",
"an",
"array",
"of",
"requirements",
"file",
"paths",
"that",
"can",
"be",
"used",
"to",
"complete",
"the",
"no_chown",
"==",
"False",
"&&",
"user",
"!",
"=",
"None",
"conundrum"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L259-L274 | train |
saltstack/salt | salt/modules/pip.py | _process_requirements | def _process_requirements(requirements, cmd, cwd, saltenv, user):
'''
Process the requirements argument
'''
cleanup_requirements = []
if requirements is not None:
if isinstance(requirements, six.string_types):
requirements = [r.strip() for r in requirements.split(',')]
e... | python | def _process_requirements(requirements, cmd, cwd, saltenv, user):
'''
Process the requirements argument
'''
cleanup_requirements = []
if requirements is not None:
if isinstance(requirements, six.string_types):
requirements = [r.strip() for r in requirements.split(',')]
e... | [
"def",
"_process_requirements",
"(",
"requirements",
",",
"cmd",
",",
"cwd",
",",
"saltenv",
",",
"user",
")",
":",
"cleanup_requirements",
"=",
"[",
"]",
"if",
"requirements",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"requirements",
",",
"six",
... | Process the requirements argument | [
"Process",
"the",
"requirements",
"argument"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L277-L383 | train |
saltstack/salt | salt/modules/pip.py | install | def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
editable=None,
find_links=None,
in... | python | def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
editable=None,
find_links=None,
in... | [
"def",
"install",
"(",
"pkgs",
"=",
"None",
",",
"# pylint: disable=R0912,R0913,R0914",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"use_wheel",
"=",
"False",
",",
"no_use_wheel",
"=",
"False",
",",
"log",
"=",
"None",
",",
"proxy",
"=",
... | Install packages with pip
Install packages individually or from a pip requirements file. Install
packages globally or to a virtualenv.
pkgs
Comma separated list of packages to install
requirements
Path to requirements
bin_env
Path to pip (or to a virtualenv). This can be ... | [
"Install",
"packages",
"with",
"pip"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L402-L961 | train |
saltstack/salt | salt/modules/pip.py | uninstall | def uninstall(pkgs=None,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
saltenv='base',
use_vt=False):
'''
Uninstall packages individually or f... | python | def uninstall(pkgs=None,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
saltenv='base',
use_vt=False):
'''
Uninstall packages individually or f... | [
"def",
"uninstall",
"(",
"pkgs",
"=",
"None",
",",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"log",
"=",
"None",
",",
"proxy",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
... | Uninstall packages individually or from a pip requirements file
pkgs
comma separated list of packages to install
requirements
Path to requirements file
bin_env
Path to pip (or to a virtualenv). This can be used to specify the path
to the pip to use when more than one Pytho... | [
"Uninstall",
"packages",
"individually",
"or",
"from",
"a",
"pip",
"requirements",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L964-L1086 | train |
saltstack/salt | salt/modules/pip.py | freeze | def freeze(bin_env=None,
user=None,
cwd=None,
use_vt=False,
env_vars=None,
**kwargs):
'''
Return a list of installed packages either globally or in the specified
virtualenv
bin_env
Path to pip (or to a virtualenv). This can be used to speci... | python | def freeze(bin_env=None,
user=None,
cwd=None,
use_vt=False,
env_vars=None,
**kwargs):
'''
Return a list of installed packages either globally or in the specified
virtualenv
bin_env
Path to pip (or to a virtualenv). This can be used to speci... | [
"def",
"freeze",
"(",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
"False",
",",
"env_vars",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"_get_pip_bin",
"(",
"bin_env",
")",
"cmd",
... | Return a list of installed packages either globally or in the specified
virtualenv
bin_env
Path to pip (or to a virtualenv). This can be used to specify the path
to the pip to use when more than one Python release is installed (e.g.
``/usr/bin/pip-2.7`` or ``/usr/bin/pip-2.6``. If a dir... | [
"Return",
"a",
"list",
"of",
"installed",
"packages",
"either",
"globally",
"or",
"in",
"the",
"specified",
"virtualenv"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1089-L1149 | train |
saltstack/salt | salt/modules/pip.py | list_ | def list_(prefix=None,
bin_env=None,
user=None,
cwd=None,
env_vars=None,
**kwargs):
'''
Filter list of installed apps from ``freeze`` and check to see if
``prefix`` exists in the list of packages installed.
.. note::
If the version of pip avail... | python | def list_(prefix=None,
bin_env=None,
user=None,
cwd=None,
env_vars=None,
**kwargs):
'''
Filter list of installed apps from ``freeze`` and check to see if
``prefix`` exists in the list of packages installed.
.. note::
If the version of pip avail... | [
"def",
"list_",
"(",
"prefix",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"env_vars",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"packages",
"=",
"{",
"}",
"if",
"prefix",
"is",
"None",
... | Filter list of installed apps from ``freeze`` and check to see if
``prefix`` exists in the list of packages installed.
.. note::
If the version of pip available is older than 8.0.3, the packages
``wheel``, ``setuptools``, and ``distribute`` will not be reported by
this function even if... | [
"Filter",
"list",
"of",
"installed",
"apps",
"from",
"freeze",
"and",
"check",
"to",
"see",
"if",
"prefix",
"exists",
"in",
"the",
"list",
"of",
"packages",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1152-L1220 | train |
saltstack/salt | salt/modules/pip.py | version | def version(bin_env=None):
'''
.. versionadded:: 0.17.0
Returns the version of pip. Use ``bin_env`` to specify the path to a
virtualenv and get the version of pip in that virtualenv.
If unable to detect the pip version, returns ``None``.
CLI Example:
.. code-block:: bash
salt '*... | python | def version(bin_env=None):
'''
.. versionadded:: 0.17.0
Returns the version of pip. Use ``bin_env`` to specify the path to a
virtualenv and get the version of pip in that virtualenv.
If unable to detect the pip version, returns ``None``.
CLI Example:
.. code-block:: bash
salt '*... | [
"def",
"version",
"(",
"bin_env",
"=",
"None",
")",
":",
"contextkey",
"=",
"'pip.version'",
"if",
"bin_env",
"is",
"not",
"None",
":",
"contextkey",
"=",
"'{0}.{1}'",
".",
"format",
"(",
"contextkey",
",",
"bin_env",
")",
"if",
"contextkey",
"in",
"__cont... | .. versionadded:: 0.17.0
Returns the version of pip. Use ``bin_env`` to specify the path to a
virtualenv and get the version of pip in that virtualenv.
If unable to detect the pip version, returns ``None``.
CLI Example:
.. code-block:: bash
salt '*' pip.version | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1223-L1258 | train |
saltstack/salt | salt/modules/pip.py | list_upgrades | def list_upgrades(bin_env=None,
user=None,
cwd=None):
'''
Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pip.list_upgrades
'''
cmd = _get_pip_bin(bin_env)
cmd.extend(['list', '--outdated'... | python | def list_upgrades(bin_env=None,
user=None,
cwd=None):
'''
Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pip.list_upgrades
'''
cmd = _get_pip_bin(bin_env)
cmd.extend(['list', '--outdated'... | [
"def",
"list_upgrades",
"(",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"cmd",
"=",
"_get_pip_bin",
"(",
"bin_env",
")",
"cmd",
".",
"extend",
"(",
"[",
"'list'",
",",
"'--outdated'",
"]",
")",
"pip_version",
... | Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pip.list_upgrades | [
"Check",
"whether",
"or",
"not",
"an",
"upgrade",
"is",
"available",
"for",
"all",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1261-L1336 | train |
saltstack/salt | salt/modules/pip.py | is_installed | def is_installed(pkgname=None,
bin_env=None,
user=None,
cwd=None):
'''
.. versionadded:: 2018.3.0
Filter list of installed apps from ``freeze`` and return True or False if
``pkgname`` exists in the list of packages installed.
.. note::
If... | python | def is_installed(pkgname=None,
bin_env=None,
user=None,
cwd=None):
'''
.. versionadded:: 2018.3.0
Filter list of installed apps from ``freeze`` and return True or False if
``pkgname`` exists in the list of packages installed.
.. note::
If... | [
"def",
"is_installed",
"(",
"pkgname",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"for",
"line",
"in",
"freeze",
"(",
"bin_env",
"=",
"bin_env",
",",
"user",
"=",
"user",
",",
"cwd",
"=",
... | .. versionadded:: 2018.3.0
Filter list of installed apps from ``freeze`` and return True or False if
``pkgname`` exists in the list of packages installed.
.. note::
If the version of pip available is older than 8.0.3, the packages
wheel, setuptools, and distribute will not be reported by ... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1339-L1387 | train |
saltstack/salt | salt/modules/pip.py | upgrade_available | def upgrade_available(pkg,
bin_env=None,
user=None,
cwd=None):
'''
.. versionadded:: 2015.5.0
Check whether or not an upgrade is available for a given package
CLI Example:
.. code-block:: bash
salt '*' pip.upgrade_availabl... | python | def upgrade_available(pkg,
bin_env=None,
user=None,
cwd=None):
'''
.. versionadded:: 2015.5.0
Check whether or not an upgrade is available for a given package
CLI Example:
.. code-block:: bash
salt '*' pip.upgrade_availabl... | [
"def",
"upgrade_available",
"(",
"pkg",
",",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"return",
"pkg",
"in",
"list_upgrades",
"(",
"bin_env",
"=",
"bin_env",
",",
"user",
"=",
"user",
",",
"cwd",
"=",
"cwd"... | .. versionadded:: 2015.5.0
Check whether or not an upgrade is available for a given package
CLI Example:
.. code-block:: bash
salt '*' pip.upgrade_available <package name> | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1390-L1405 | train |
saltstack/salt | salt/modules/pip.py | upgrade | def upgrade(bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Upgrades outdated pip packages.
.. note::
On Windows you can't update salt from pip using salt, so salt will be
skipped
Returns a dict containing the ch... | python | def upgrade(bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Upgrades outdated pip packages.
.. note::
On Windows you can't update salt from pip using salt, so salt will be
skipped
Returns a dict containing the ch... | [
"def",
"upgrade",
"(",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
... | .. versionadded:: 2015.5.0
Upgrades outdated pip packages.
.. note::
On Windows you can't update salt from pip using salt, so salt will be
skipped
Returns a dict containing the changes.
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1408-L1463 | train |
saltstack/salt | salt/modules/pip.py | list_all_versions | def list_all_versions(pkg,
bin_env=None,
include_alpha=False,
include_beta=False,
include_rc=False,
user=None,
cwd=None,
index_url=None,
extra_i... | python | def list_all_versions(pkg,
bin_env=None,
include_alpha=False,
include_beta=False,
include_rc=False,
user=None,
cwd=None,
index_url=None,
extra_i... | [
"def",
"list_all_versions",
"(",
"pkg",
",",
"bin_env",
"=",
"None",
",",
"include_alpha",
"=",
"False",
",",
"include_beta",
"=",
"False",
",",
"include_rc",
"=",
"False",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"index_url",
"=",
"None",... | .. versionadded:: 2017.7.3
List all available versions of a pip package
pkg
The package to check
bin_env
Path to pip (or to a virtualenv). This can be used to specify the path
to the pip to use when more than one Python release is installed (e.g.
``/usr/bin/pip-2.7`` or ``... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"3"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1466-L1563 | train |
saltstack/salt | salt/netapi/rest_cherrypy/__init__.py | verify_certs | def verify_certs(*args):
'''
Sanity checking for the specified SSL certificates
'''
msg = ("Could not find a certificate: {0}\n"
"If you want to quickly generate a self-signed certificate, "
"use the tls.create_self_signed_cert function in Salt")
for arg in args:
if ... | python | def verify_certs(*args):
'''
Sanity checking for the specified SSL certificates
'''
msg = ("Could not find a certificate: {0}\n"
"If you want to quickly generate a self-signed certificate, "
"use the tls.create_self_signed_cert function in Salt")
for arg in args:
if ... | [
"def",
"verify_certs",
"(",
"*",
"args",
")",
":",
"msg",
"=",
"(",
"\"Could not find a certificate: {0}\\n\"",
"\"If you want to quickly generate a self-signed certificate, \"",
"\"use the tls.create_self_signed_cert function in Salt\"",
")",
"for",
"arg",
"in",
"args",
":",
"... | Sanity checking for the specified SSL certificates | [
"Sanity",
"checking",
"for",
"the",
"specified",
"SSL",
"certificates"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/__init__.py#L62-L72 | train |
saltstack/salt | salt/netapi/rest_cherrypy/__init__.py | start | def start():
'''
Start the server loop
'''
from . import app
root, apiopts, conf = app.get_app(__opts__)
if not apiopts.get('disable_ssl', False):
if 'ssl_crt' not in apiopts or 'ssl_key' not in apiopts:
logger.error("Not starting '%s'. Options 'ssl_crt' and "
... | python | def start():
'''
Start the server loop
'''
from . import app
root, apiopts, conf = app.get_app(__opts__)
if not apiopts.get('disable_ssl', False):
if 'ssl_crt' not in apiopts or 'ssl_key' not in apiopts:
logger.error("Not starting '%s'. Options 'ssl_crt' and "
... | [
"def",
"start",
"(",
")",
":",
"from",
".",
"import",
"app",
"root",
",",
"apiopts",
",",
"conf",
"=",
"app",
".",
"get_app",
"(",
"__opts__",
")",
"if",
"not",
"apiopts",
".",
"get",
"(",
"'disable_ssl'",
",",
"False",
")",
":",
"if",
"'ssl_crt'",
... | Start the server loop | [
"Start",
"the",
"server",
"loop"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/__init__.py#L75-L98 | train |
saltstack/salt | salt/utils/pkg/rpm.py | get_osarch | def get_osarch():
'''
Get the os architecture using rpm --eval
'''
if salt.utils.path.which('rpm'):
ret = subprocess.Popen(
'rpm --eval "%{_host_cpu}"',
shell=True,
close_fds=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communi... | python | def get_osarch():
'''
Get the os architecture using rpm --eval
'''
if salt.utils.path.which('rpm'):
ret = subprocess.Popen(
'rpm --eval "%{_host_cpu}"',
shell=True,
close_fds=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communi... | [
"def",
"get_osarch",
"(",
")",
":",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'rpm'",
")",
":",
"ret",
"=",
"subprocess",
".",
"Popen",
"(",
"'rpm --eval \"%{_host_cpu}\"'",
",",
"shell",
"=",
"True",
",",
"close_fds",
"=",
"True",
"... | Get the os architecture using rpm --eval | [
"Get",
"the",
"os",
"architecture",
"using",
"rpm",
"--",
"eval"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L46-L60 | train |
saltstack/salt | salt/utils/pkg/rpm.py | check_32 | def check_32(arch, osarch=None):
'''
Returns True if both the OS arch and the passed arch are 32-bit
'''
if osarch is None:
osarch = get_osarch()
return all(x in ARCHES_32 for x in (osarch, arch)) | python | def check_32(arch, osarch=None):
'''
Returns True if both the OS arch and the passed arch are 32-bit
'''
if osarch is None:
osarch = get_osarch()
return all(x in ARCHES_32 for x in (osarch, arch)) | [
"def",
"check_32",
"(",
"arch",
",",
"osarch",
"=",
"None",
")",
":",
"if",
"osarch",
"is",
"None",
":",
"osarch",
"=",
"get_osarch",
"(",
")",
"return",
"all",
"(",
"x",
"in",
"ARCHES_32",
"for",
"x",
"in",
"(",
"osarch",
",",
"arch",
")",
")"
] | Returns True if both the OS arch and the passed arch are 32-bit | [
"Returns",
"True",
"if",
"both",
"the",
"OS",
"arch",
"and",
"the",
"passed",
"arch",
"are",
"32",
"-",
"bit"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L63-L69 | train |
saltstack/salt | salt/utils/pkg/rpm.py | pkginfo | def pkginfo(name, version, arch, repoid, install_date=None, install_date_time_t=None):
'''
Build and return a pkginfo namedtuple
'''
pkginfo_tuple = collections.namedtuple(
'PkgInfo',
('name', 'version', 'arch', 'repoid', 'install_date',
'install_date_time_t')
)
return p... | python | def pkginfo(name, version, arch, repoid, install_date=None, install_date_time_t=None):
'''
Build and return a pkginfo namedtuple
'''
pkginfo_tuple = collections.namedtuple(
'PkgInfo',
('name', 'version', 'arch', 'repoid', 'install_date',
'install_date_time_t')
)
return p... | [
"def",
"pkginfo",
"(",
"name",
",",
"version",
",",
"arch",
",",
"repoid",
",",
"install_date",
"=",
"None",
",",
"install_date_time_t",
"=",
"None",
")",
":",
"pkginfo_tuple",
"=",
"collections",
".",
"namedtuple",
"(",
"'PkgInfo'",
",",
"(",
"'name'",
",... | Build and return a pkginfo namedtuple | [
"Build",
"and",
"return",
"a",
"pkginfo",
"namedtuple"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L72-L82 | train |
saltstack/salt | salt/utils/pkg/rpm.py | resolve_name | def resolve_name(name, arch, osarch=None):
'''
Resolve the package name and arch into a unique name referred to by salt.
For example, on a 64-bit OS, a 32-bit package will be pkgname.i386.
'''
if osarch is None:
osarch = get_osarch()
if not check_32(arch, osarch) and arch not in (ARCHMA... | python | def resolve_name(name, arch, osarch=None):
'''
Resolve the package name and arch into a unique name referred to by salt.
For example, on a 64-bit OS, a 32-bit package will be pkgname.i386.
'''
if osarch is None:
osarch = get_osarch()
if not check_32(arch, osarch) and arch not in (ARCHMA... | [
"def",
"resolve_name",
"(",
"name",
",",
"arch",
",",
"osarch",
"=",
"None",
")",
":",
"if",
"osarch",
"is",
"None",
":",
"osarch",
"=",
"get_osarch",
"(",
")",
"if",
"not",
"check_32",
"(",
"arch",
",",
"osarch",
")",
"and",
"arch",
"not",
"in",
"... | Resolve the package name and arch into a unique name referred to by salt.
For example, on a 64-bit OS, a 32-bit package will be pkgname.i386. | [
"Resolve",
"the",
"package",
"name",
"and",
"arch",
"into",
"a",
"unique",
"name",
"referred",
"to",
"by",
"salt",
".",
"For",
"example",
"on",
"a",
"64",
"-",
"bit",
"OS",
"a",
"32",
"-",
"bit",
"package",
"will",
"be",
"pkgname",
".",
"i386",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L85-L95 | train |
saltstack/salt | salt/utils/pkg/rpm.py | parse_pkginfo | def parse_pkginfo(line, osarch=None):
'''
A small helper to parse an rpm/repoquery command's output. Returns a
pkginfo namedtuple.
'''
try:
name, epoch, version, release, arch, repoid, install_time = line.split('_|-')
# Handle unpack errors (should never happen with the queryformat we ar... | python | def parse_pkginfo(line, osarch=None):
'''
A small helper to parse an rpm/repoquery command's output. Returns a
pkginfo namedtuple.
'''
try:
name, epoch, version, release, arch, repoid, install_time = line.split('_|-')
# Handle unpack errors (should never happen with the queryformat we ar... | [
"def",
"parse_pkginfo",
"(",
"line",
",",
"osarch",
"=",
"None",
")",
":",
"try",
":",
"name",
",",
"epoch",
",",
"version",
",",
"release",
",",
"arch",
",",
"repoid",
",",
"install_time",
"=",
"line",
".",
"split",
"(",
"'_|-'",
")",
"# Handle unpack... | A small helper to parse an rpm/repoquery command's output. Returns a
pkginfo namedtuple. | [
"A",
"small",
"helper",
"to",
"parse",
"an",
"rpm",
"/",
"repoquery",
"command",
"s",
"output",
".",
"Returns",
"a",
"pkginfo",
"namedtuple",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L98-L123 | train |
saltstack/salt | salt/utils/pkg/rpm.py | combine_comments | def combine_comments(comments):
'''
Given a list of comments, strings, a single comment or a single string,
return a single string of text containing all of the comments, prepending
the '#' and joining with newlines as necessary.
'''
if not isinstance(comments, list):
comments = [comment... | python | def combine_comments(comments):
'''
Given a list of comments, strings, a single comment or a single string,
return a single string of text containing all of the comments, prepending
the '#' and joining with newlines as necessary.
'''
if not isinstance(comments, list):
comments = [comment... | [
"def",
"combine_comments",
"(",
"comments",
")",
":",
"if",
"not",
"isinstance",
"(",
"comments",
",",
"list",
")",
":",
"comments",
"=",
"[",
"comments",
"]",
"ret",
"=",
"[",
"]",
"for",
"comment",
"in",
"comments",
":",
"if",
"not",
"isinstance",
"(... | Given a list of comments, strings, a single comment or a single string,
return a single string of text containing all of the comments, prepending
the '#' and joining with newlines as necessary. | [
"Given",
"a",
"list",
"of",
"comments",
"strings",
"a",
"single",
"comment",
"or",
"a",
"single",
"string",
"return",
"a",
"single",
"string",
"of",
"text",
"containing",
"all",
"of",
"the",
"comments",
"prepending",
"the",
"#",
"and",
"joining",
"with",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L126-L140 | train |
saltstack/salt | salt/utils/pkg/rpm.py | version_to_evr | def version_to_evr(verstring):
'''
Split the package version string into epoch, version and release.
Return this as tuple.
The epoch is always not empty. The version and the release can be an empty
string if such a component could not be found in the version string.
"2:1.0-1.2" => ('2', '1.0',... | python | def version_to_evr(verstring):
'''
Split the package version string into epoch, version and release.
Return this as tuple.
The epoch is always not empty. The version and the release can be an empty
string if such a component could not be found in the version string.
"2:1.0-1.2" => ('2', '1.0',... | [
"def",
"version_to_evr",
"(",
"verstring",
")",
":",
"if",
"verstring",
"in",
"[",
"None",
",",
"''",
"]",
":",
"return",
"'0'",
",",
"''",
",",
"''",
"idx_e",
"=",
"verstring",
".",
"find",
"(",
"':'",
")",
"if",
"idx_e",
"!=",
"-",
"1",
":",
"t... | Split the package version string into epoch, version and release.
Return this as tuple.
The epoch is always not empty. The version and the release can be an empty
string if such a component could not be found in the version string.
"2:1.0-1.2" => ('2', '1.0', '1.2)
"1.0" => ('0', '1.0', '')
""... | [
"Split",
"the",
"package",
"version",
"string",
"into",
"epoch",
"version",
"and",
"release",
".",
"Return",
"this",
"as",
"tuple",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/rpm.py#L143-L175 | train |
saltstack/salt | salt/states/boto_secgroup.py | present | def present(
name,
description,
vpc_id=None,
vpc_name=None,
rules=None,
rules_egress=None,
delete_ingress_rules=True,
delete_egress_rules=True,
region=None,
key=None,
keyid=None,
profile=None,
tags=None):
'''
... | python | def present(
name,
description,
vpc_id=None,
vpc_name=None,
rules=None,
rules_egress=None,
delete_ingress_rules=True,
delete_egress_rules=True,
region=None,
key=None,
keyid=None,
profile=None,
tags=None):
'''
... | [
"def",
"present",
"(",
"name",
",",
"description",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"rules",
"=",
"None",
",",
"rules_egress",
"=",
"None",
",",
"delete_ingress_rules",
"=",
"True",
",",
"delete_egress_rules",
"=",
"True",
","... | Ensure the security group exists with the specified rules.
name
Name of the security group.
description
A description of this security group.
vpc_id
The ID of the VPC to create the security group in, if any. Exclusive with vpc_name.
vpc_name
The name of the VPC to cre... | [
"Ensure",
"the",
"security",
"group",
"exists",
"with",
"the",
"specified",
"rules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L127-L235 | train |
saltstack/salt | salt/states/boto_secgroup.py | _security_group_present | def _security_group_present(name, description, vpc_id=None, vpc_name=None,
region=None, key=None, keyid=None, profile=None):
'''
given a group name or a group name and vpc id (or vpc name):
1. determine if the group exists
2. if the group does not exist, creates the group
... | python | def _security_group_present(name, description, vpc_id=None, vpc_name=None,
region=None, key=None, keyid=None, profile=None):
'''
given a group name or a group name and vpc id (or vpc name):
1. determine if the group exists
2. if the group does not exist, creates the group
... | [
"def",
"_security_group_present",
"(",
"name",
",",
"description",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
... | given a group name or a group name and vpc id (or vpc name):
1. determine if the group exists
2. if the group does not exist, creates the group
3. return the group's configuration and any changes made | [
"given",
"a",
"group",
"name",
"or",
"a",
"group",
"name",
"and",
"vpc",
"id",
"(",
"or",
"vpc",
"name",
")",
":",
"1",
".",
"determine",
"if",
"the",
"group",
"exists",
"2",
".",
"if",
"the",
"group",
"does",
"not",
"exist",
"creates",
"the",
"gro... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L238-L270 | train |
saltstack/salt | salt/states/boto_secgroup.py | _split_rules | def _split_rules(rules):
'''
Split rules with lists into individual rules.
We accept some attributes as lists or strings. The data we get back from
the execution module lists rules as individual rules. We need to split the
provided rules into individual rules to compare them.
'''
split = []... | python | def _split_rules(rules):
'''
Split rules with lists into individual rules.
We accept some attributes as lists or strings. The data we get back from
the execution module lists rules as individual rules. We need to split the
provided rules into individual rules to compare them.
'''
split = []... | [
"def",
"_split_rules",
"(",
"rules",
")",
":",
"split",
"=",
"[",
"]",
"for",
"rule",
"in",
"rules",
":",
"cidr_ip",
"=",
"rule",
".",
"get",
"(",
"'cidr_ip'",
")",
"group_name",
"=",
"rule",
".",
"get",
"(",
"'source_group_name'",
")",
"group_id",
"="... | Split rules with lists into individual rules.
We accept some attributes as lists or strings. The data we get back from
the execution module lists rules as individual rules. We need to split the
provided rules into individual rules to compare them. | [
"Split",
"rules",
"with",
"lists",
"into",
"individual",
"rules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L273-L303 | train |
saltstack/salt | salt/states/boto_secgroup.py | _check_rule | def _check_rule(rule, _rule):
'''
Check to see if two rules are the same. Needed to compare rules fetched
from boto, since they may not completely match rules defined in sls files
but may be functionally equivalent.
'''
# We need to alter what Boto returns if no ports are specified
# so tha... | python | def _check_rule(rule, _rule):
'''
Check to see if two rules are the same. Needed to compare rules fetched
from boto, since they may not completely match rules defined in sls files
but may be functionally equivalent.
'''
# We need to alter what Boto returns if no ports are specified
# so tha... | [
"def",
"_check_rule",
"(",
"rule",
",",
"_rule",
")",
":",
"# We need to alter what Boto returns if no ports are specified",
"# so that we can compare rules fairly.",
"#",
"# Boto returns None for from_port and to_port where we're required",
"# to pass in \"-1\" instead.",
"if",
"_rule",... | Check to see if two rules are the same. Needed to compare rules fetched
from boto, since they may not completely match rules defined in sls files
but may be functionally equivalent. | [
"Check",
"to",
"see",
"if",
"two",
"rules",
"are",
"the",
"same",
".",
"Needed",
"to",
"compare",
"rules",
"fetched",
"from",
"boto",
"since",
"they",
"may",
"not",
"completely",
"match",
"rules",
"defined",
"in",
"sls",
"files",
"but",
"may",
"be",
"fun... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L306-L338 | train |
saltstack/salt | salt/states/boto_secgroup.py | _get_rule_changes | def _get_rule_changes(rules, _rules):
'''
given a list of desired rules (rules) and existing rules (_rules) return
a list of rules to delete (to_delete) and to create (to_create)
'''
to_delete = []
to_create = []
# for each rule in state file
# 1. validate rule
# 2. determine if rule... | python | def _get_rule_changes(rules, _rules):
'''
given a list of desired rules (rules) and existing rules (_rules) return
a list of rules to delete (to_delete) and to create (to_create)
'''
to_delete = []
to_create = []
# for each rule in state file
# 1. validate rule
# 2. determine if rule... | [
"def",
"_get_rule_changes",
"(",
"rules",
",",
"_rules",
")",
":",
"to_delete",
"=",
"[",
"]",
"to_create",
"=",
"[",
"]",
"# for each rule in state file",
"# 1. validate rule",
"# 2. determine if rule exists in existing security group rules",
"for",
"rule",
"in",
"rules"... | given a list of desired rules (rules) and existing rules (_rules) return
a list of rules to delete (to_delete) and to create (to_create) | [
"given",
"a",
"list",
"of",
"desired",
"rules",
"(",
"rules",
")",
"and",
"existing",
"rules",
"(",
"_rules",
")",
"return",
"a",
"list",
"of",
"rules",
"to",
"delete",
"(",
"to_delete",
")",
"and",
"to",
"create",
"(",
"to_create",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L341-L405 | train |
saltstack/salt | salt/states/boto_secgroup.py | _rules_present | def _rules_present(name, rules, delete_ingress_rules=True, vpc_id=None,
vpc_name=None, region=None, key=None, keyid=None, profile=None):
'''
given a group name or group name and vpc_id (or vpc name):
1. get lists of desired rule changes (using _get_rule_changes)
2. authorize/create ru... | python | def _rules_present(name, rules, delete_ingress_rules=True, vpc_id=None,
vpc_name=None, region=None, key=None, keyid=None, profile=None):
'''
given a group name or group name and vpc_id (or vpc name):
1. get lists of desired rule changes (using _get_rule_changes)
2. authorize/create ru... | [
"def",
"_rules_present",
"(",
"name",
",",
"rules",
",",
"delete_ingress_rules",
"=",
"True",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",... | given a group name or group name and vpc_id (or vpc name):
1. get lists of desired rule changes (using _get_rule_changes)
2. authorize/create rules missing rules
3. if delete_ingress_rules is True, delete/revoke non-requested rules
4. return 'old' and 'new' group rules | [
"given",
"a",
"group",
"name",
"or",
"group",
"name",
"and",
"vpc_id",
"(",
"or",
"vpc",
"name",
")",
":",
"1",
".",
"get",
"lists",
"of",
"desired",
"rule",
"changes",
"(",
"using",
"_get_rule_changes",
")",
"2",
".",
"authorize",
"/",
"create",
"rule... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L408-L499 | train |
saltstack/salt | salt/states/boto_secgroup.py | absent | def absent(
name,
vpc_id=None,
vpc_name=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
Ensure a security group with the specified name does not exist.
name
Name of the security group.
vpc_id
The ID of the VPC to remov... | python | def absent(
name,
vpc_id=None,
vpc_name=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
Ensure a security group with the specified name does not exist.
name
Name of the security group.
vpc_id
The ID of the VPC to remov... | [
"def",
"absent",
"(",
"name",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",... | Ensure a security group with the specified name does not exist.
name
Name of the security group.
vpc_id
The ID of the VPC to remove the security group from, if any. Exclusive with vpc_name.
vpc_name
The name of the VPC to remove the security group from, if any. Exclusive with vpc_... | [
"Ensure",
"a",
"security",
"group",
"with",
"the",
"specified",
"name",
"does",
"not",
"exist",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L603-L663 | train |
saltstack/salt | salt/states/boto_secgroup.py | _tags_present | def _tags_present(name, tags, vpc_id=None, vpc_name=None, region=None,
key=None, keyid=None, profile=None):
'''
helper function to validate tags are correct
'''
ret = {'result': True, 'comment': '', 'changes': {}}
if tags:
sg = __salt__['boto_secgroup.get_config'](name=name... | python | def _tags_present(name, tags, vpc_id=None, vpc_name=None, region=None,
key=None, keyid=None, profile=None):
'''
helper function to validate tags are correct
'''
ret = {'result': True, 'comment': '', 'changes': {}}
if tags:
sg = __salt__['boto_secgroup.get_config'](name=name... | [
"def",
"_tags_present",
"(",
"name",
",",
"tags",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'... | helper function to validate tags are correct | [
"helper",
"function",
"to",
"validate",
"tags",
"are",
"correct"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_secgroup.py#L666-L761 | train |
saltstack/salt | salt/states/ceph.py | _ordereddict2dict | def _ordereddict2dict(input_ordered_dict):
'''
Convert ordered dictionary to a dictionary
'''
return salt.utils.json.loads(salt.utils.json.dumps(input_ordered_dict)) | python | def _ordereddict2dict(input_ordered_dict):
'''
Convert ordered dictionary to a dictionary
'''
return salt.utils.json.loads(salt.utils.json.dumps(input_ordered_dict)) | [
"def",
"_ordereddict2dict",
"(",
"input_ordered_dict",
")",
":",
"return",
"salt",
".",
"utils",
".",
"json",
".",
"loads",
"(",
"salt",
".",
"utils",
".",
"json",
".",
"dumps",
"(",
"input_ordered_dict",
")",
")"
] | Convert ordered dictionary to a dictionary | [
"Convert",
"ordered",
"dictionary",
"to",
"a",
"dictionary"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ceph.py#L47-L51 | train |
saltstack/salt | salt/states/ceph.py | quorum | def quorum(name, **kwargs):
'''
Quorum state
This state checks the mon daemons are in quorum. It does not alter the
cluster but can be used in formula as a dependency for many cluster
operations.
Example usage in sls file:
.. code-block:: yaml
quorum:
sesceph.quorum:
... | python | def quorum(name, **kwargs):
'''
Quorum state
This state checks the mon daemons are in quorum. It does not alter the
cluster but can be used in formula as a dependency for many cluster
operations.
Example usage in sls file:
.. code-block:: yaml
quorum:
sesceph.quorum:
... | [
"def",
"quorum",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"parameters",
"=",
"_ordereddict2dict",
"(",
"kwargs",
")",
"if",
"parameters",
"is",
"None",
":",
"return",
"_error",
"(",
"name",
",",
"\"Invalid parameters:%s\"",
")",
"if",
"__opts__",
"[... | Quorum state
This state checks the mon daemons are in quorum. It does not alter the
cluster but can be used in formula as a dependency for many cluster
operations.
Example usage in sls file:
.. code-block:: yaml
quorum:
sesceph.quorum:
- require:
- ses... | [
"Quorum",
"state"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ceph.py#L54-L83 | train |
saltstack/salt | salt/pillar/consul_pillar.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
conf):
'''
Check consul for all data
'''
opts = {}
temp = conf
target_re = re.compile('target="(.*?)"')
match = target_re.search(temp)
if match:
opts['target'] = match.group(1)
temp =... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
conf):
'''
Check consul for all data
'''
opts = {}
temp = conf
target_re = re.compile('target="(.*?)"')
match = target_re.search(temp)
if match:
opts['target'] = match.group(1)
temp =... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"conf",
")",
":",
"opts",
"=",
"{",
"}",
"temp",
"=",
"conf",
"target_re",
"=",
"re",
".",
"compile",
"(",
"'target=\"(.*?)\"'",
")",
"match",
"=",
"target_re",
".",
"sea... | Check consul for all data | [
"Check",
"consul",
"for",
"all",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L170-L254 | train |
saltstack/salt | salt/pillar/consul_pillar.py | consul_fetch | def consul_fetch(client, path):
'''
Query consul for all keys/values within base path
'''
# Unless the root path is blank, it needs a trailing slash for
# the kv get from Consul to work as expected
return client.kv.get('' if not path else path.rstrip('/') + '/', recurse=True) | python | def consul_fetch(client, path):
'''
Query consul for all keys/values within base path
'''
# Unless the root path is blank, it needs a trailing slash for
# the kv get from Consul to work as expected
return client.kv.get('' if not path else path.rstrip('/') + '/', recurse=True) | [
"def",
"consul_fetch",
"(",
"client",
",",
"path",
")",
":",
"# Unless the root path is blank, it needs a trailing slash for",
"# the kv get from Consul to work as expected",
"return",
"client",
".",
"kv",
".",
"get",
"(",
"''",
"if",
"not",
"path",
"else",
"path",
".",... | Query consul for all keys/values within base path | [
"Query",
"consul",
"for",
"all",
"keys",
"/",
"values",
"within",
"base",
"path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L257-L263 | train |
saltstack/salt | salt/pillar/consul_pillar.py | fetch_tree | def fetch_tree(client, path, expand_keys):
'''
Grab data from consul, trim base path and remove any keys which
are folders. Take the remaining data and send it to be formatted
in such a way as to be used as pillar data.
'''
_, items = consul_fetch(client, path)
ret = {}
has_children = re... | python | def fetch_tree(client, path, expand_keys):
'''
Grab data from consul, trim base path and remove any keys which
are folders. Take the remaining data and send it to be formatted
in such a way as to be used as pillar data.
'''
_, items = consul_fetch(client, path)
ret = {}
has_children = re... | [
"def",
"fetch_tree",
"(",
"client",
",",
"path",
",",
"expand_keys",
")",
":",
"_",
",",
"items",
"=",
"consul_fetch",
"(",
"client",
",",
"path",
")",
"ret",
"=",
"{",
"}",
"has_children",
"=",
"re",
".",
"compile",
"(",
"r'/$'",
")",
"log",
".",
... | Grab data from consul, trim base path and remove any keys which
are folders. Take the remaining data and send it to be formatted
in such a way as to be used as pillar data. | [
"Grab",
"data",
"from",
"consul",
"trim",
"base",
"path",
"and",
"remove",
"any",
"keys",
"which",
"are",
"folders",
".",
"Take",
"the",
"remaining",
"data",
"and",
"send",
"it",
"to",
"be",
"formatted",
"in",
"such",
"a",
"way",
"as",
"to",
"be",
"use... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L266-L289 | train |
saltstack/salt | salt/pillar/consul_pillar.py | pillar_format | def pillar_format(ret, keys, value, expand_keys):
'''
Perform data formatting to be used as pillar data and
merge it with the current pillar data
'''
# if value is empty in Consul then it's None here - skip it
if value is None:
return ret
# If value is not None then it's a string
... | python | def pillar_format(ret, keys, value, expand_keys):
'''
Perform data formatting to be used as pillar data and
merge it with the current pillar data
'''
# if value is empty in Consul then it's None here - skip it
if value is None:
return ret
# If value is not None then it's a string
... | [
"def",
"pillar_format",
"(",
"ret",
",",
"keys",
",",
"value",
",",
"expand_keys",
")",
":",
"# if value is empty in Consul then it's None here - skip it",
"if",
"value",
"is",
"None",
":",
"return",
"ret",
"# If value is not None then it's a string",
"# YAML strips whitesp... | Perform data formatting to be used as pillar data and
merge it with the current pillar data | [
"Perform",
"data",
"formatting",
"to",
"be",
"used",
"as",
"pillar",
"data",
"and",
"merge",
"it",
"with",
"the",
"current",
"pillar",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L292-L315 | train |
saltstack/salt | salt/pillar/consul_pillar.py | get_conn | def get_conn(opts, profile):
'''
Return a client object for accessing consul
'''
opts_pillar = opts.get('pillar', {})
opts_master = opts_pillar.get('master', {})
opts_merged = {}
opts_merged.update(opts_master)
opts_merged.update(opts_pillar)
opts_merged.update(opts)
if profil... | python | def get_conn(opts, profile):
'''
Return a client object for accessing consul
'''
opts_pillar = opts.get('pillar', {})
opts_master = opts_pillar.get('master', {})
opts_merged = {}
opts_merged.update(opts_master)
opts_merged.update(opts_pillar)
opts_merged.update(opts)
if profil... | [
"def",
"get_conn",
"(",
"opts",
",",
"profile",
")",
":",
"opts_pillar",
"=",
"opts",
".",
"get",
"(",
"'pillar'",
",",
"{",
"}",
")",
"opts_master",
"=",
"opts_pillar",
".",
"get",
"(",
"'master'",
",",
"{",
"}",
")",
"opts_merged",
"=",
"{",
"}",
... | Return a client object for accessing consul | [
"Return",
"a",
"client",
"object",
"for",
"accessing",
"consul"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L318-L355 | train |
saltstack/salt | salt/pillar/consul_pillar.py | _resolve_datacenter | def _resolve_datacenter(dc, pillarenv):
'''
If ``dc`` is a string - return it as is.
If it's a dict then sort it in descending order by key length and try
to use keys as RegEx patterns to match against ``pillarenv``.
The value for matched pattern should be a string (that can use
``str.format`` ... | python | def _resolve_datacenter(dc, pillarenv):
'''
If ``dc`` is a string - return it as is.
If it's a dict then sort it in descending order by key length and try
to use keys as RegEx patterns to match against ``pillarenv``.
The value for matched pattern should be a string (that can use
``str.format`` ... | [
"def",
"_resolve_datacenter",
"(",
"dc",
",",
"pillarenv",
")",
":",
"log",
".",
"debug",
"(",
"'Resolving Consul datacenter based on: %s'",
",",
"dc",
")",
"try",
":",
"mappings",
"=",
"dc",
".",
"items",
"(",
")",
"# is it a dict?",
"except",
"AttributeError",... | If ``dc`` is a string - return it as is.
If it's a dict then sort it in descending order by key length and try
to use keys as RegEx patterns to match against ``pillarenv``.
The value for matched pattern should be a string (that can use
``str.format`` syntax togetehr with captured variables from pattern... | [
"If",
"dc",
"is",
"a",
"string",
"-",
"return",
"it",
"as",
"is",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/consul_pillar.py#L358-L397 | train |
saltstack/salt | salt/beacons/btmp.py | _gather_group_members | def _gather_group_members(group, groups, users):
'''
Gather group members
'''
_group = __salt__['group.info'](group)
if not _group:
log.warning('Group %s does not exist, ignoring.', group)
return
for member in _group['members']:
if member not in users:
users... | python | def _gather_group_members(group, groups, users):
'''
Gather group members
'''
_group = __salt__['group.info'](group)
if not _group:
log.warning('Group %s does not exist, ignoring.', group)
return
for member in _group['members']:
if member not in users:
users... | [
"def",
"_gather_group_members",
"(",
"group",
",",
"groups",
",",
"users",
")",
":",
"_group",
"=",
"__salt__",
"[",
"'group.info'",
"]",
"(",
"group",
")",
"if",
"not",
"_group",
":",
"log",
".",
"warning",
"(",
"'Group %s does not exist, ignoring.'",
",",
... | Gather group members | [
"Gather",
"group",
"members"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/btmp.py#L168-L180 | train |
saltstack/salt | salt/beacons/btmp.py | _check_time_range | def _check_time_range(time_range, now):
'''
Check time range
'''
if _TIME_SUPPORTED:
_start = dateutil_parser.parse(time_range['start'])
_end = dateutil_parser.parse(time_range['end'])
return bool(_start <= now <= _end)
else:
log.error('Dateutil is required.')
... | python | def _check_time_range(time_range, now):
'''
Check time range
'''
if _TIME_SUPPORTED:
_start = dateutil_parser.parse(time_range['start'])
_end = dateutil_parser.parse(time_range['end'])
return bool(_start <= now <= _end)
else:
log.error('Dateutil is required.')
... | [
"def",
"_check_time_range",
"(",
"time_range",
",",
"now",
")",
":",
"if",
"_TIME_SUPPORTED",
":",
"_start",
"=",
"dateutil_parser",
".",
"parse",
"(",
"time_range",
"[",
"'start'",
"]",
")",
"_end",
"=",
"dateutil_parser",
".",
"parse",
"(",
"time_range",
"... | Check time range | [
"Check",
"time",
"range"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/btmp.py#L183-L194 | train |
saltstack/salt | salt/beacons/btmp.py | beacon | def beacon(config):
'''
Read the last btmp file and return information on the failed logins
'''
ret = []
users = {}
groups = {}
defaults = None
for config_item in config:
if 'users' in config_item:
users = config_item['users']
if 'groups' in config_item:
... | python | def beacon(config):
'''
Read the last btmp file and return information on the failed logins
'''
ret = []
users = {}
groups = {}
defaults = None
for config_item in config:
if 'users' in config_item:
users = config_item['users']
if 'groups' in config_item:
... | [
"def",
"beacon",
"(",
"config",
")",
":",
"ret",
"=",
"[",
"]",
"users",
"=",
"{",
"}",
"groups",
"=",
"{",
"}",
"defaults",
"=",
"None",
"for",
"config_item",
"in",
"config",
":",
"if",
"'users'",
"in",
"config_item",
":",
"users",
"=",
"config_item... | Read the last btmp file and return information on the failed logins | [
"Read",
"the",
"last",
"btmp",
"file",
"and",
"return",
"information",
"on",
"the",
"failed",
"logins"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/btmp.py#L266-L331 | train |
saltstack/salt | salt/returners/slack_webhook_return.py | _sprinkle | def _sprinkle(config_str):
'''
Sprinkle with grains of salt, that is
convert 'test {id} test {host} ' types of strings
:param config_str: The string to be sprinkled
:return: The string sprinkled
'''
parts = [x for sub in config_str.split('{') for x in sub.split('}')]
for i in range(1, le... | python | def _sprinkle(config_str):
'''
Sprinkle with grains of salt, that is
convert 'test {id} test {host} ' types of strings
:param config_str: The string to be sprinkled
:return: The string sprinkled
'''
parts = [x for sub in config_str.split('{') for x in sub.split('}')]
for i in range(1, le... | [
"def",
"_sprinkle",
"(",
"config_str",
")",
":",
"parts",
"=",
"[",
"x",
"for",
"sub",
"in",
"config_str",
".",
"split",
"(",
"'{'",
")",
"for",
"x",
"in",
"sub",
".",
"split",
"(",
"'}'",
")",
"]",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"le... | Sprinkle with grains of salt, that is
convert 'test {id} test {host} ' types of strings
:param config_str: The string to be sprinkled
:return: The string sprinkled | [
"Sprinkle",
"with",
"grains",
"of",
"salt",
"that",
"is",
"convert",
"test",
"{",
"id",
"}",
"test",
"{",
"host",
"}",
"types",
"of",
"strings",
":",
"param",
"config_str",
":",
"The",
"string",
"to",
"be",
"sprinkled",
":",
"return",
":",
"The",
"stri... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_webhook_return.py#L121-L131 | train |
saltstack/salt | salt/returners/slack_webhook_return.py | _generate_payload | def _generate_payload(author_icon, title, report):
'''
Prepare the payload for Slack
:param author_icon: The url for the thumbnail to be displayed
:param title: The title of the message
:param report: A dictionary with the report of the Salt function
:return: The payload ready for Slack
'''
... | python | def _generate_payload(author_icon, title, report):
'''
Prepare the payload for Slack
:param author_icon: The url for the thumbnail to be displayed
:param title: The title of the message
:param report: A dictionary with the report of the Salt function
:return: The payload ready for Slack
'''
... | [
"def",
"_generate_payload",
"(",
"author_icon",
",",
"title",
",",
"report",
")",
":",
"title",
"=",
"_sprinkle",
"(",
"title",
")",
"unchanged",
"=",
"{",
"'color'",
":",
"'good'",
",",
"'title'",
":",
"'Unchanged: {unchanged}'",
".",
"format",
"(",
"unchan... | Prepare the payload for Slack
:param author_icon: The url for the thumbnail to be displayed
:param title: The title of the message
:param report: A dictionary with the report of the Salt function
:return: The payload ready for Slack | [
"Prepare",
"the",
"payload",
"for",
"Slack",
":",
"param",
"author_icon",
":",
"The",
"url",
"for",
"the",
"thumbnail",
"to",
"be",
"displayed",
":",
"param",
"title",
":",
"The",
"title",
"of",
"the",
"message",
":",
"param",
"report",
":",
"A",
"dictio... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_webhook_return.py#L144-L205 | train |
saltstack/salt | salt/returners/slack_webhook_return.py | _generate_report | def _generate_report(ret, show_tasks):
'''
Generate a report of the Salt function
:param ret: The Salt return
:param show_tasks: Flag to show the name of the changed and failed states
:return: The report
'''
returns = ret.get('return')
sorted_data = sorted(
returns.items(),
... | python | def _generate_report(ret, show_tasks):
'''
Generate a report of the Salt function
:param ret: The Salt return
:param show_tasks: Flag to show the name of the changed and failed states
:return: The report
'''
returns = ret.get('return')
sorted_data = sorted(
returns.items(),
... | [
"def",
"_generate_report",
"(",
"ret",
",",
"show_tasks",
")",
":",
"returns",
"=",
"ret",
".",
"get",
"(",
"'return'",
")",
"sorted_data",
"=",
"sorted",
"(",
"returns",
".",
"items",
"(",
")",
",",
"key",
"=",
"lambda",
"s",
":",
"s",
"[",
"1",
"... | Generate a report of the Salt function
:param ret: The Salt return
:param show_tasks: Flag to show the name of the changed and failed states
:return: The report | [
"Generate",
"a",
"report",
"of",
"the",
"Salt",
"function",
":",
"param",
"ret",
":",
"The",
"Salt",
"return",
":",
"param",
"show_tasks",
":",
"Flag",
"to",
"show",
"the",
"name",
"of",
"the",
"changed",
"and",
"failed",
"states",
":",
"return",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_webhook_return.py#L208-L280 | train |
saltstack/salt | salt/returners/slack_webhook_return.py | _post_message | def _post_message(webhook, author_icon, title, report):
'''
Send a message to a Slack room through a webhook
:param webhook: The url of the incoming webhook
:param author_icon: The thumbnail image to be displayed on the right side of the message
:param title: The title of the message
:... | python | def _post_message(webhook, author_icon, title, report):
'''
Send a message to a Slack room through a webhook
:param webhook: The url of the incoming webhook
:param author_icon: The thumbnail image to be displayed on the right side of the message
:param title: The title of the message
:... | [
"def",
"_post_message",
"(",
"webhook",
",",
"author_icon",
",",
"title",
",",
"report",
")",
":",
"payload",
"=",
"_generate_payload",
"(",
"author_icon",
",",
"title",
",",
"report",
")",
"data",
"=",
"_urlencode",
"(",
"{",
"'payload'",
":",
"json",
"."... | Send a message to a Slack room through a webhook
:param webhook: The url of the incoming webhook
:param author_icon: The thumbnail image to be displayed on the right side of the message
:param title: The title of the message
:param report: The report of the function state
:return: ... | [
"Send",
"a",
"message",
"to",
"a",
"Slack",
"room",
"through",
"a",
"webhook",
":",
"param",
"webhook",
":",
"The",
"url",
"of",
"the",
"incoming",
"webhook",
":",
"param",
"author_icon",
":",
"The",
"thumbnail",
"image",
"to",
"be",
"displayed",
"on",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_webhook_return.py#L283-L309 | train |
saltstack/salt | salt/returners/slack_webhook_return.py | returner | def returner(ret):
'''
Send a slack message with the data through a webhook
:param ret: The Salt return
:return: The result of the post
'''
_options = _get_options(ret)
webhook = _options.get('webhook', None)
show_tasks = _options.get('show_tasks')
author_icon = _options.get('autho... | python | def returner(ret):
'''
Send a slack message with the data through a webhook
:param ret: The Salt return
:return: The result of the post
'''
_options = _get_options(ret)
webhook = _options.get('webhook', None)
show_tasks = _options.get('show_tasks')
author_icon = _options.get('autho... | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"webhook",
"=",
"_options",
".",
"get",
"(",
"'webhook'",
",",
"None",
")",
"show_tasks",
"=",
"_options",
".",
"get",
"(",
"'show_tasks'",
")",
"author_icon",
"="... | Send a slack message with the data through a webhook
:param ret: The Salt return
:return: The result of the post | [
"Send",
"a",
"slack",
"message",
"with",
"the",
"data",
"through",
"a",
"webhook",
":",
"param",
"ret",
":",
"The",
"Salt",
"return",
":",
"return",
":",
"The",
"result",
"of",
"the",
"post"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_webhook_return.py#L312-L338 | train |
saltstack/salt | salt/modules/winrepo.py | update_git_repos | def update_git_repos(clean=False):
'''
Checkout git repos containing :ref:`Windows Software Package Definitions
<windows-package-manager>`.
.. important::
This function requires `Git for Windows`_ to be installed in order to
work. When installing, make sure to select an installation opt... | python | def update_git_repos(clean=False):
'''
Checkout git repos containing :ref:`Windows Software Package Definitions
<windows-package-manager>`.
.. important::
This function requires `Git for Windows`_ to be installed in order to
work. When installing, make sure to select an installation opt... | [
"def",
"update_git_repos",
"(",
"clean",
"=",
"False",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'git'",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'Git for Windows is not installed, or not configured to be '",
"'accessible... | Checkout git repos containing :ref:`Windows Software Package Definitions
<windows-package-manager>`.
.. important::
This function requires `Git for Windows`_ to be installed in order to
work. When installing, make sure to select an installation option which
permits the git executable to... | [
"Checkout",
"git",
"repos",
"containing",
":",
"ref",
":",
"Windows",
"Software",
"Package",
"Definitions",
"<windows",
"-",
"package",
"-",
"manager",
">",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/winrepo.py#L81-L122 | train |
saltstack/salt | salt/modules/winrepo.py | show_sls | def show_sls(name, saltenv='base'):
r'''
.. versionadded:: 2015.8.0
Display the rendered software definition from a specific sls file in the
local winrepo cache. This will parse all Jinja. Run pkg.refresh_db to pull
the latest software definitions from the master.
.. note::
This functi... | python | def show_sls(name, saltenv='base'):
r'''
.. versionadded:: 2015.8.0
Display the rendered software definition from a specific sls file in the
local winrepo cache. This will parse all Jinja. Run pkg.refresh_db to pull
the latest software definitions from the master.
.. note::
This functi... | [
"def",
"show_sls",
"(",
"name",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# Passed a filename",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"name",
")",
":",
"sls_file",
"=",
"name",
"# Use a winrepo path",
"else",
":",
"# Get the location of the local repo",
... | r'''
.. versionadded:: 2015.8.0
Display the rendered software definition from a specific sls file in the
local winrepo cache. This will parse all Jinja. Run pkg.refresh_db to pull
the latest software definitions from the master.
.. note::
This function does not ask a master for an sls file... | [
"r",
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/winrepo.py#L125-L210 | train |
saltstack/salt | salt/modules/lxc.py | version | def version():
'''
Return the actual lxc client version
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.version
'''
k = 'lxc.version'
if not __context__.get(k, None):
cversion = __salt__['cmd.run_all']('lxc-info --version')
if not cv... | python | def version():
'''
Return the actual lxc client version
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.version
'''
k = 'lxc.version'
if not __context__.get(k, None):
cversion = __salt__['cmd.run_all']('lxc-info --version')
if not cv... | [
"def",
"version",
"(",
")",
":",
"k",
"=",
"'lxc.version'",
"if",
"not",
"__context__",
".",
"get",
"(",
"k",
",",
"None",
")",
":",
"cversion",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'lxc-info --version'",
")",
"if",
"not",
"cversion",
"[",
... | Return the actual lxc client version
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.version | [
"Return",
"the",
"actual",
"lxc",
"client",
"version"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L111-L132 | train |
saltstack/salt | salt/modules/lxc.py | _clear_context | def _clear_context():
'''
Clear any lxc variables set in __context__
'''
for var in [x for x in __context__ if x.startswith('lxc.')]:
log.trace('Clearing __context__[\'%s\']', var)
__context__.pop(var, None) | python | def _clear_context():
'''
Clear any lxc variables set in __context__
'''
for var in [x for x in __context__ if x.startswith('lxc.')]:
log.trace('Clearing __context__[\'%s\']', var)
__context__.pop(var, None) | [
"def",
"_clear_context",
"(",
")",
":",
"for",
"var",
"in",
"[",
"x",
"for",
"x",
"in",
"__context__",
"if",
"x",
".",
"startswith",
"(",
"'lxc.'",
")",
"]",
":",
"log",
".",
"trace",
"(",
"'Clearing __context__[\\'%s\\']'",
",",
"var",
")",
"__context__... | Clear any lxc variables set in __context__ | [
"Clear",
"any",
"lxc",
"variables",
"set",
"in",
"__context__"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L135-L141 | train |
saltstack/salt | salt/modules/lxc.py | _ip_sort | def _ip_sort(ip):
'''Ip sorting'''
idx = '001'
if ip == '127.0.0.1':
idx = '200'
if ip == '::1':
idx = '201'
elif '::' in ip:
idx = '100'
return '{0}___{1}'.format(idx, ip) | python | def _ip_sort(ip):
'''Ip sorting'''
idx = '001'
if ip == '127.0.0.1':
idx = '200'
if ip == '::1':
idx = '201'
elif '::' in ip:
idx = '100'
return '{0}___{1}'.format(idx, ip) | [
"def",
"_ip_sort",
"(",
"ip",
")",
":",
"idx",
"=",
"'001'",
"if",
"ip",
"==",
"'127.0.0.1'",
":",
"idx",
"=",
"'200'",
"if",
"ip",
"==",
"'::1'",
":",
"idx",
"=",
"'201'",
"elif",
"'::'",
"in",
"ip",
":",
"idx",
"=",
"'100'",
"return",
"'{0}___{1}... | Ip sorting | [
"Ip",
"sorting"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L144-L153 | train |
saltstack/salt | salt/modules/lxc.py | search_lxc_bridges | def search_lxc_bridges():
'''
Search which bridges are potentially available as LXC bridges
CLI Example:
.. code-block:: bash
salt '*' lxc.search_lxc_bridges
'''
bridges = __context__.get('lxc.bridges', None)
# either match not yet called or no bridges were found
# to handle ... | python | def search_lxc_bridges():
'''
Search which bridges are potentially available as LXC bridges
CLI Example:
.. code-block:: bash
salt '*' lxc.search_lxc_bridges
'''
bridges = __context__.get('lxc.bridges', None)
# either match not yet called or no bridges were found
# to handle ... | [
"def",
"search_lxc_bridges",
"(",
")",
":",
"bridges",
"=",
"__context__",
".",
"get",
"(",
"'lxc.bridges'",
",",
"None",
")",
"# either match not yet called or no bridges were found",
"# to handle the case where lxc was not installed on the first",
"# call",
"if",
"not",
"br... | Search which bridges are potentially available as LXC bridges
CLI Example:
.. code-block:: bash
salt '*' lxc.search_lxc_bridges | [
"Search",
"which",
"bridges",
"are",
"potentially",
"available",
"as",
"LXC",
"bridges"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L156-L205 | train |
saltstack/salt | salt/modules/lxc.py | cloud_init_interface | def cloud_init_interface(name, vm_=None, **kwargs):
'''
Interface between salt.cloud.lxc driver and lxc.init
``vm_`` is a mapping of vm opts in the salt.cloud format
as documented for the lxc driver.
This can be used either:
- from the salt cloud driver
- because you find the argument to g... | python | def cloud_init_interface(name, vm_=None, **kwargs):
'''
Interface between salt.cloud.lxc driver and lxc.init
``vm_`` is a mapping of vm opts in the salt.cloud format
as documented for the lxc driver.
This can be used either:
- from the salt cloud driver
- because you find the argument to g... | [
"def",
"cloud_init_interface",
"(",
"name",
",",
"vm_",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"vm_",
"is",
"None",
":",
"vm_",
"=",
"{",
"}",
"vm_",
"=",
"copy",
".",
"deepcopy",
"(",
"vm_",
")",
"vm_",
"=",
"salt",
".",
"utils",
... | Interface between salt.cloud.lxc driver and lxc.init
``vm_`` is a mapping of vm opts in the salt.cloud format
as documented for the lxc driver.
This can be used either:
- from the salt cloud driver
- because you find the argument to give easier here
than using directly lxc.init
.. warni... | [
"Interface",
"between",
"salt",
".",
"cloud",
".",
"lxc",
"driver",
"and",
"lxc",
".",
"init",
"vm_",
"is",
"a",
"mapping",
"of",
"vm",
"opts",
"in",
"the",
"salt",
".",
"cloud",
"format",
"as",
"documented",
"for",
"the",
"lxc",
"driver",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L242-L551 | train |
saltstack/salt | salt/modules/lxc.py | _rand_cpu_str | def _rand_cpu_str(cpu):
'''
Return a random subset of cpus for the cpuset config
'''
cpu = int(cpu)
avail = __salt__['status.nproc']()
if cpu < avail:
return '0-{0}'.format(avail)
to_set = set()
while len(to_set) < cpu:
choice = random.randint(0, avail - 1)
if cho... | python | def _rand_cpu_str(cpu):
'''
Return a random subset of cpus for the cpuset config
'''
cpu = int(cpu)
avail = __salt__['status.nproc']()
if cpu < avail:
return '0-{0}'.format(avail)
to_set = set()
while len(to_set) < cpu:
choice = random.randint(0, avail - 1)
if cho... | [
"def",
"_rand_cpu_str",
"(",
"cpu",
")",
":",
"cpu",
"=",
"int",
"(",
"cpu",
")",
"avail",
"=",
"__salt__",
"[",
"'status.nproc'",
"]",
"(",
")",
"if",
"cpu",
"<",
"avail",
":",
"return",
"'0-{0}'",
".",
"format",
"(",
"avail",
")",
"to_set",
"=",
... | Return a random subset of cpus for the cpuset config | [
"Return",
"a",
"random",
"subset",
"of",
"cpus",
"for",
"the",
"cpuset",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L686-L699 | train |
saltstack/salt | salt/modules/lxc.py | _network_conf | def _network_conf(conf_tuples=None, **kwargs):
'''
Network configuration defaults
network_profile
as for containers, we can either call this function
either with a network_profile dict or network profile name
in the kwargs
nic_opts
overrides or ex... | python | def _network_conf(conf_tuples=None, **kwargs):
'''
Network configuration defaults
network_profile
as for containers, we can either call this function
either with a network_profile dict or network profile name
in the kwargs
nic_opts
overrides or ex... | [
"def",
"_network_conf",
"(",
"conf_tuples",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"nic",
"=",
"kwargs",
".",
"get",
"(",
"'network_profile'",
",",
"None",
")",
"ret",
"=",
"[",
"]",
"nic_opts",
"=",
"kwargs",
".",
"get",
"(",
"'nic_opts'",
... | Network configuration defaults
network_profile
as for containers, we can either call this function
either with a network_profile dict or network profile name
in the kwargs
nic_opts
overrides or extra nics in the form {nic_name: {set: tings} | [
"Network",
"configuration",
"defaults"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L702-L874 | train |
saltstack/salt | salt/modules/lxc.py | _config_list | def _config_list(conf_tuples=None, only_net=False, **kwargs):
'''
Return a list of dicts from the salt level configurations
conf_tuples
_LXCConfig compatible list of entries which can contain
- string line
- tuple (lxc config param,value)
- dict of one entry: {l... | python | def _config_list(conf_tuples=None, only_net=False, **kwargs):
'''
Return a list of dicts from the salt level configurations
conf_tuples
_LXCConfig compatible list of entries which can contain
- string line
- tuple (lxc config param,value)
- dict of one entry: {l... | [
"def",
"_config_list",
"(",
"conf_tuples",
"=",
"None",
",",
"only_net",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# explicit cast",
"only_net",
"=",
"bool",
"(",
"only_net",
")",
"if",
"not",
"conf_tuples",
":",
"conf_tuples",
"=",
"[",
"]",
"kw... | Return a list of dicts from the salt level configurations
conf_tuples
_LXCConfig compatible list of entries which can contain
- string line
- tuple (lxc config param,value)
- dict of one entry: {lxc config param: value)
only_net
by default we add to the tup... | [
"Return",
"a",
"list",
"of",
"dicts",
"from",
"the",
"salt",
"level",
"configurations"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L915-L951 | train |
saltstack/salt | salt/modules/lxc.py | _get_veths | def _get_veths(net_data):
'''
Parse the nic setup inside lxc conf tuples back to a dictionary indexed by
network interface
'''
if isinstance(net_data, dict):
net_data = list(net_data.items())
nics = salt.utils.odict.OrderedDict()
current_nic = salt.utils.odict.OrderedDict()
no_na... | python | def _get_veths(net_data):
'''
Parse the nic setup inside lxc conf tuples back to a dictionary indexed by
network interface
'''
if isinstance(net_data, dict):
net_data = list(net_data.items())
nics = salt.utils.odict.OrderedDict()
current_nic = salt.utils.odict.OrderedDict()
no_na... | [
"def",
"_get_veths",
"(",
"net_data",
")",
":",
"if",
"isinstance",
"(",
"net_data",
",",
"dict",
")",
":",
"net_data",
"=",
"list",
"(",
"net_data",
".",
"items",
"(",
")",
")",
"nics",
"=",
"salt",
".",
"utils",
".",
"odict",
".",
"OrderedDict",
"(... | Parse the nic setup inside lxc conf tuples back to a dictionary indexed by
network interface | [
"Parse",
"the",
"nic",
"setup",
"inside",
"lxc",
"conf",
"tuples",
"back",
"to",
"a",
"dictionary",
"indexed",
"by",
"network",
"interface"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L954-L985 | train |
saltstack/salt | salt/modules/lxc.py | _get_base | def _get_base(**kwargs):
'''
If the needed base does not exist, then create it, if it does exist
create nothing and return the name of the base lxc container so
it can be cloned.
'''
profile = get_container_profile(copy.deepcopy(kwargs.get('profile')))
kw_overrides = copy.deepcopy(kwargs)
... | python | def _get_base(**kwargs):
'''
If the needed base does not exist, then create it, if it does exist
create nothing and return the name of the base lxc container so
it can be cloned.
'''
profile = get_container_profile(copy.deepcopy(kwargs.get('profile')))
kw_overrides = copy.deepcopy(kwargs)
... | [
"def",
"_get_base",
"(",
"*",
"*",
"kwargs",
")",
":",
"profile",
"=",
"get_container_profile",
"(",
"copy",
".",
"deepcopy",
"(",
"kwargs",
".",
"get",
"(",
"'profile'",
")",
")",
")",
"kw_overrides",
"=",
"copy",
".",
"deepcopy",
"(",
"kwargs",
")",
... | If the needed base does not exist, then create it, if it does exist
create nothing and return the name of the base lxc container so
it can be cloned. | [
"If",
"the",
"needed",
"base",
"does",
"not",
"exist",
"then",
"create",
"it",
"if",
"it",
"does",
"exist",
"create",
"nothing",
"and",
"return",
"the",
"name",
"of",
"the",
"base",
"lxc",
"container",
"so",
"it",
"can",
"be",
"cloned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1070-L1122 | train |
saltstack/salt | salt/modules/lxc.py | init | def init(name,
config=None,
cpuset=None,
cpushare=None,
memory=None,
profile=None,
network_profile=None,
nic_opts=None,
cpu=None,
autostart=True,
password=None,
password_encrypted=None,
users=None,
dnsse... | python | def init(name,
config=None,
cpuset=None,
cpushare=None,
memory=None,
profile=None,
network_profile=None,
nic_opts=None,
cpu=None,
autostart=True,
password=None,
password_encrypted=None,
users=None,
dnsse... | [
"def",
"init",
"(",
"name",
",",
"config",
"=",
"None",
",",
"cpuset",
"=",
"None",
",",
"cpushare",
"=",
"None",
",",
"memory",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"network_profile",
"=",
"None",
",",
"nic_opts",
"=",
"None",
",",
"cpu",
... | Initialize a new container.
This is a partial idempotent function as if it is already provisioned, we
will reset a bit the lxc configuration file but much of the hard work will
be escaped as markers will prevent re-execution of harmful tasks.
name
Name of the container
image
A tar... | [
"Initialize",
"a",
"new",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1125-L1642 | train |
saltstack/salt | salt/modules/lxc.py | cloud_init | def cloud_init(name, vm_=None, **kwargs):
'''
Thin wrapper to lxc.init to be used from the saltcloud lxc driver
name
Name of the container
may be None and then guessed from saltcloud mapping
`vm_`
saltcloud mapping defaults for the vm
CLI Example:
.. code-block:: bash
... | python | def cloud_init(name, vm_=None, **kwargs):
'''
Thin wrapper to lxc.init to be used from the saltcloud lxc driver
name
Name of the container
may be None and then guessed from saltcloud mapping
`vm_`
saltcloud mapping defaults for the vm
CLI Example:
.. code-block:: bash
... | [
"def",
"cloud_init",
"(",
"name",
",",
"vm_",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"init_interface",
"=",
"cloud_init_interface",
"(",
"name",
",",
"vm_",
",",
"*",
"*",
"kwargs",
")",
"name",
"=",
"init_interface",
".",
"pop",
"(",
"'name'"... | Thin wrapper to lxc.init to be used from the saltcloud lxc driver
name
Name of the container
may be None and then guessed from saltcloud mapping
`vm_`
saltcloud mapping defaults for the vm
CLI Example:
.. code-block:: bash
salt '*' lxc.cloud_init foo | [
"Thin",
"wrapper",
"to",
"lxc",
".",
"init",
"to",
"be",
"used",
"from",
"the",
"saltcloud",
"lxc",
"driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1645-L1663 | train |
saltstack/salt | salt/modules/lxc.py | images | def images(dist=None):
'''
.. versionadded:: 2015.5.0
List the available images for LXC's ``download`` template.
dist : None
Filter results to a single Linux distribution
CLI Examples:
.. code-block:: bash
salt myminion lxc.images
salt myminion lxc.images dist=centos... | python | def images(dist=None):
'''
.. versionadded:: 2015.5.0
List the available images for LXC's ``download`` template.
dist : None
Filter results to a single Linux distribution
CLI Examples:
.. code-block:: bash
salt myminion lxc.images
salt myminion lxc.images dist=centos... | [
"def",
"images",
"(",
"dist",
"=",
"None",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"'lxc-create -n __imgcheck -t download -- --list'",
",",
"ignore_retcode",
"=",
"True",
")",
"if",
"'DIST'",
"not",
"in",
"out",
":",
"raise",
"Comm... | .. versionadded:: 2015.5.0
List the available images for LXC's ``download`` template.
dist : None
Filter results to a single Linux distribution
CLI Examples:
.. code-block:: bash
salt myminion lxc.images
salt myminion lxc.images dist=centos | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1666-L1714 | train |
saltstack/salt | salt/modules/lxc.py | templates | def templates():
'''
.. versionadded:: 2015.5.0
List the available LXC template scripts installed on the minion
CLI Examples:
.. code-block:: bash
salt myminion lxc.templates
'''
try:
template_scripts = os.listdir('/usr/share/lxc/templates')
except OSError:
re... | python | def templates():
'''
.. versionadded:: 2015.5.0
List the available LXC template scripts installed on the minion
CLI Examples:
.. code-block:: bash
salt myminion lxc.templates
'''
try:
template_scripts = os.listdir('/usr/share/lxc/templates')
except OSError:
re... | [
"def",
"templates",
"(",
")",
":",
"try",
":",
"template_scripts",
"=",
"os",
".",
"listdir",
"(",
"'/usr/share/lxc/templates'",
")",
"except",
"OSError",
":",
"return",
"[",
"]",
"else",
":",
"return",
"[",
"x",
"[",
"4",
":",
"]",
"for",
"x",
"in",
... | .. versionadded:: 2015.5.0
List the available LXC template scripts installed on the minion
CLI Examples:
.. code-block:: bash
salt myminion lxc.templates | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1717-L1734 | train |
saltstack/salt | salt/modules/lxc.py | create | def create(name,
config=None,
profile=None,
network_profile=None,
nic_opts=None,
**kwargs):
'''
Create a new container.
name
Name of the container
config
The config file to use for the container. Defaults to system-wide
con... | python | def create(name,
config=None,
profile=None,
network_profile=None,
nic_opts=None,
**kwargs):
'''
Create a new container.
name
Name of the container
config
The config file to use for the container. Defaults to system-wide
con... | [
"def",
"create",
"(",
"name",
",",
"config",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"network_profile",
"=",
"None",
",",
"nic_opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Required params for 'download' template",
"download_template_deps",
... | Create a new container.
name
Name of the container
config
The config file to use for the container. Defaults to system-wide
config (usually in /etc/lxc/lxc.conf).
profile
Profile to use in container creation (see
:mod:`lxc.get_container_profile
<salt.module... | [
"Create",
"a",
"new",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1774-L1984 | train |
saltstack/salt | salt/modules/lxc.py | clone | def clone(name,
orig,
profile=None,
network_profile=None,
nic_opts=None,
**kwargs):
'''
Create a new container as a clone of another container
name
Name of the container
orig
Name of the original container to be cloned
profile
... | python | def clone(name,
orig,
profile=None,
network_profile=None,
nic_opts=None,
**kwargs):
'''
Create a new container as a clone of another container
name
Name of the container
orig
Name of the original container to be cloned
profile
... | [
"def",
"clone",
"(",
"name",
",",
"orig",
",",
"profile",
"=",
"None",
",",
"network_profile",
"=",
"None",
",",
"nic_opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"profile",
"=",
"get_container_profile",
"(",
"copy",
".",
"deepcopy",
"(",
"pr... | Create a new container as a clone of another container
name
Name of the container
orig
Name of the original container to be cloned
profile
Profile to use in container cloning (see
:mod:`lxc.get_container_profile
<salt.modules.lxc.get_container_profile>`). Values in... | [
"Create",
"a",
"new",
"container",
"as",
"a",
"clone",
"of",
"another",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L1987-L2106 | train |
saltstack/salt | salt/modules/lxc.py | ls_ | def ls_(active=None, cache=True, path=None):
'''
Return a list of the containers available on the minion
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
active
If ``True``, return only active (i.e. running) containe... | python | def ls_(active=None, cache=True, path=None):
'''
Return a list of the containers available on the minion
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
active
If ``True``, return only active (i.e. running) containe... | [
"def",
"ls_",
"(",
"active",
"=",
"None",
",",
"cache",
"=",
"True",
",",
"path",
"=",
"None",
")",
":",
"contextvar",
"=",
"'lxc.ls{0}'",
".",
"format",
"(",
"path",
")",
"if",
"active",
":",
"contextvar",
"+=",
"'.active'",
"if",
"cache",
"and",
"(... | Return a list of the containers available on the minion
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
active
If ``True``, return only active (i.e. running) containers
.. versionadded:: 2015.5.0
CLI Example:
... | [
"Return",
"a",
"list",
"of",
"the",
"containers",
"available",
"on",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2109-L2147 | train |
saltstack/salt | salt/modules/lxc.py | list_ | def list_(extra=False, limit=None, path=None):
'''
List containers classified by state
extra
Also get per-container specific info. This will change the return data.
Instead of returning a list of containers, a dictionary of containers
and each container's output from :mod:`lxc.info
... | python | def list_(extra=False, limit=None, path=None):
'''
List containers classified by state
extra
Also get per-container specific info. This will change the return data.
Instead of returning a list of containers, a dictionary of containers
and each container's output from :mod:`lxc.info
... | [
"def",
"list_",
"(",
"extra",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"ctnrs",
"=",
"ls_",
"(",
"path",
"=",
"path",
")",
"if",
"extra",
":",
"stopped",
"=",
"{",
"}",
"frozen",
"=",
"{",
"}",
"running",
"="... | List containers classified by state
extra
Also get per-container specific info. This will change the return data.
Instead of returning a list of containers, a dictionary of containers
and each container's output from :mod:`lxc.info
<salt.modules.lxc.info>`.
path
path to... | [
"List",
"containers",
"classified",
"by",
"state"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2150-L2235 | train |
saltstack/salt | salt/modules/lxc.py | _ensure_exists | def _ensure_exists(name, path=None):
'''
Raise an exception if the container does not exist
'''
if not exists(name, path=path):
raise CommandExecutionError(
'Container \'{0}\' does not exist'.format(name)
) | python | def _ensure_exists(name, path=None):
'''
Raise an exception if the container does not exist
'''
if not exists(name, path=path):
raise CommandExecutionError(
'Container \'{0}\' does not exist'.format(name)
) | [
"def",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"if",
"not",
"exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'Container \\'{0}\\' does not exist'",
".",
"format",
"(",
"name",
")",
... | Raise an exception if the container does not exist | [
"Raise",
"an",
"exception",
"if",
"the",
"container",
"does",
"not",
"exist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2302-L2309 | train |
saltstack/salt | salt/modules/lxc.py | _ensure_running | def _ensure_running(name, no_start=False, path=None):
'''
If the container is not currently running, start it. This function returns
the state that the container was in before changing
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: ... | python | def _ensure_running(name, no_start=False, path=None):
'''
If the container is not currently running, start it. This function returns
the state that the container was in before changing
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: ... | [
"def",
"_ensure_running",
"(",
"name",
",",
"no_start",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"pre",
"=",
"state",
"(",
"name",
",",
"path",
"=",
"path",
")",
"if",
"pre",
"=... | If the container is not currently running, start it. This function returns
the state that the container was in before changing
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0 | [
"If",
"the",
"container",
"is",
"not",
"currently",
"running",
"start",
"it",
".",
"This",
"function",
"returns",
"the",
"state",
"that",
"the",
"container",
"was",
"in",
"before",
"changing"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2312-L2340 | train |
saltstack/salt | salt/modules/lxc.py | restart | def restart(name, path=None, lxc_config=None, force=False):
'''
.. versionadded:: 2015.5.0
Restart the named container. If the container was not running, the
container will merely be started.
name
The name of the container
path
path to the container parent directory
de... | python | def restart(name, path=None, lxc_config=None, force=False):
'''
.. versionadded:: 2015.5.0
Restart the named container. If the container was not running, the
container will merely be started.
name
The name of the container
path
path to the container parent directory
de... | [
"def",
"restart",
"(",
"name",
",",
"path",
"=",
"None",
",",
"lxc_config",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"orig_state",
"=",
"state",
"(",
"name",
",",
"path",
"=",
... | .. versionadded:: 2015.5.0
Restart the named container. If the container was not running, the
container will merely be started.
name
The name of the container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
lx... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2343-L2383 | train |
saltstack/salt | salt/modules/lxc.py | start | def start(name, **kwargs):
'''
Start the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
lxc_config
path to a lxc config file
config file will be guessed from container name otherwise
... | python | def start(name, **kwargs):
'''
Start the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
lxc_config
path to a lxc config file
config file will be guessed from container name otherwise
... | [
"def",
"start",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"kwargs",
".",
"get",
"(",
"'path'",
",",
"None",
")",
"cpath",
"=",
"get_root_path",
"(",
"path",
")",
"lxc_config",
"=",
"kwargs",
".",
"get",
"(",
"'lxc_config'",
",",
... | Start the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
lxc_config
path to a lxc config file
config file will be guessed from container name otherwise
.. versionadded:: 2015.8.0
use_v... | [
"Start",
"the",
"named",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2386-L2437 | train |
saltstack/salt | salt/modules/lxc.py | stop | def stop(name, kill=False, path=None, use_vt=None):
'''
Stop the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
kill: False
Do not wait for the container to stop, kill all tasks in the container.
... | python | def stop(name, kill=False, path=None, use_vt=None):
'''
Stop the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
kill: False
Do not wait for the container to stop, kill all tasks in the container.
... | [
"def",
"stop",
"(",
"name",
",",
"kill",
"=",
"False",
",",
"path",
"=",
"None",
",",
"use_vt",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"orig_state",
"=",
"state",
"(",
"name",
",",
"path",
"=",
"path",
... | Stop the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
kill: False
Do not wait for the container to stop, kill all tasks in the container.
Older LXC versions will stop containers like this irrespec... | [
"Stop",
"the",
"named",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2440-L2481 | train |
saltstack/salt | salt/modules/lxc.py | freeze | def freeze(name, **kwargs):
'''
Freeze the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
start : False
If ``True`` and the container is stopped, the container will be started
before attempt... | python | def freeze(name, **kwargs):
'''
Freeze the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
start : False
If ``True`` and the container is stopped, the container will be started
before attempt... | [
"def",
"freeze",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"use_vt",
"=",
"kwargs",
".",
"get",
"(",
"'use_vt'",
",",
"None",
")",
"path",
"=",
"kwargs",
".",
"get",
"(",
"'path'",
",",
"None",
")",
"_ensure_exists",
"(",
"name",
",",
"path",... | Freeze the named container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
start : False
If ``True`` and the container is stopped, the container will be started
before attempting to freeze.
.. versionadded:... | [
"Freeze",
"the",
"named",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2484-L2530 | train |
saltstack/salt | salt/modules/lxc.py | unfreeze | def unfreeze(name, path=None, use_vt=None):
'''
Unfreeze the named container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
use_vt
run the command through VT
.. versionadded:: 2015.8.0
CLI Example:
... | python | def unfreeze(name, path=None, use_vt=None):
'''
Unfreeze the named container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
use_vt
run the command through VT
.. versionadded:: 2015.8.0
CLI Example:
... | [
"def",
"unfreeze",
"(",
"name",
",",
"path",
"=",
"None",
",",
"use_vt",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"if",
"state",
"(",
"name",
",",
"path",
"=",
"path",
")",
"==",
"'stopped'",
":",
"raise"... | Unfreeze the named container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
use_vt
run the command through VT
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.unfreeze ... | [
"Unfreeze",
"the",
"named",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2533-L2562 | train |
saltstack/salt | salt/modules/lxc.py | destroy | def destroy(name, stop=False, path=None):
'''
Destroy the named container.
.. warning::
Destroys all data associated with the container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
stop : False
If ``True``, the c... | python | def destroy(name, stop=False, path=None):
'''
Destroy the named container.
.. warning::
Destroys all data associated with the container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
stop : False
If ``True``, the c... | [
"def",
"destroy",
"(",
"name",
",",
"stop",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"if",
"not",
"stop",
"and",
"state",
"(",
"name",
",",
"path",
"=",
"path",
")",
"!=",
"'s... | Destroy the named container.
.. warning::
Destroys all data associated with the container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
stop : False
If ``True``, the container will be destroyed even if it is
runni... | [
"Destroy",
"the",
"named",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2565-L2600 | train |
saltstack/salt | salt/modules/lxc.py | exists | def exists(name, path=None):
'''
Returns whether the named container exists.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.exists name
'''
_exists = name in ls_(path... | python | def exists(name, path=None):
'''
Returns whether the named container exists.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.exists name
'''
_exists = name in ls_(path... | [
"def",
"exists",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"_exists",
"=",
"name",
"in",
"ls_",
"(",
"path",
"=",
"path",
")",
"# container may be just created but we did cached earlier the",
"# lxc-ls results",
"if",
"not",
"_exists",
":",
"_exists",
"="... | Returns whether the named container exists.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.exists name | [
"Returns",
"whether",
"the",
"named",
"container",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2607-L2629 | train |
saltstack/salt | salt/modules/lxc.py | state | def state(name, path=None):
'''
Returns the state of a container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.state name
'''
# Don't use _ensure_exists() here, it wi... | python | def state(name, path=None):
'''
Returns the state of a container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.state name
'''
# Don't use _ensure_exists() here, it wi... | [
"def",
"state",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"# Don't use _ensure_exists() here, it will mess with _change_state()",
"cachekey",
"=",
"'lxc.state.{0}{1}'",
".",
"format",
"(",
"name",
",",
"path",
")",
"try",
":",
"return",
"__context__",
"[",
... | Returns the state of a container.
path
path to the container parent directory (default: /var/lib/lxc)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.state name | [
"Returns",
"the",
"state",
"of",
"a",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2632-L2674 | train |
saltstack/salt | salt/modules/lxc.py | get_parameter | def get_parameter(name, parameter, path=None):
'''
Returns the value of a cgroup parameter for a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.get_par... | python | def get_parameter(name, parameter, path=None):
'''
Returns the value of a cgroup parameter for a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.get_par... | [
"def",
"get_parameter",
"(",
"name",
",",
"parameter",
",",
"path",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"cmd",
"=",
"'lxc-cgroup'",
"if",
"path",
":",
"cmd",
"+=",
"' -P {0}'",
".",
"format",
"(",
"pipes... | Returns the value of a cgroup parameter for a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.get_parameter container_name memory.limit_in_bytes | [
"Returns",
"the",
"value",
"of",
"a",
"cgroup",
"parameter",
"for",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2677-L2703 | train |
saltstack/salt | salt/modules/lxc.py | set_parameter | def set_parameter(name, parameter, value, path=None):
'''
Set the value of a cgroup parameter for a container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.set... | python | def set_parameter(name, parameter, value, path=None):
'''
Set the value of a cgroup parameter for a container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.set... | [
"def",
"set_parameter",
"(",
"name",
",",
"parameter",
",",
"value",
",",
"path",
"=",
"None",
")",
":",
"if",
"not",
"exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
":",
"return",
"None",
"cmd",
"=",
"'lxc-cgroup'",
"if",
"path",
":",
"cmd",
... | Set the value of a cgroup parameter for a container.
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.set_parameter name parameter value | [
"Set",
"the",
"value",
"of",
"a",
"cgroup",
"parameter",
"for",
"a",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2706-L2733 | train |
saltstack/salt | salt/modules/lxc.py | info | def info(name, path=None):
'''
Returns information about a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.info name
'''
cachekey = 'lxc.info.{0... | python | def info(name, path=None):
'''
Returns information about a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.info name
'''
cachekey = 'lxc.info.{0... | [
"def",
"info",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"cachekey",
"=",
"'lxc.info.{0}{1}'",
".",
"format",
"(",
"name",
",",
"path",
")",
"try",
":",
"return",
"__context__",
"[",
"cachekey",
"]",
"except",
"KeyError",
":",
"_ensure_exists",
"(... | Returns information about a container
path
path to the container parent directory
default: /var/lib/lxc (system)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.info name | [
"Returns",
"information",
"about",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2736-L2879 | train |
saltstack/salt | salt/modules/lxc.py | set_password | def set_password(name, users, password, encrypted=True, path=None):
'''
.. versionchanged:: 2015.5.0
Function renamed from ``set_pass`` to ``set_password``. Additionally,
this function now supports (and defaults to using) a password hash
instead of a plaintext password.
Set the pass... | python | def set_password(name, users, password, encrypted=True, path=None):
'''
.. versionchanged:: 2015.5.0
Function renamed from ``set_pass`` to ``set_password``. Additionally,
this function now supports (and defaults to using) a password hash
instead of a plaintext password.
Set the pass... | [
"def",
"set_password",
"(",
"name",
",",
"users",
",",
"password",
",",
"encrypted",
"=",
"True",
",",
"path",
"=",
"None",
")",
":",
"def",
"_bad_user_input",
"(",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'Invalid input for \\'users\\' parameter'",
")",
... | .. versionchanged:: 2015.5.0
Function renamed from ``set_pass`` to ``set_password``. Additionally,
this function now supports (and defaults to using) a password hash
instead of a plaintext password.
Set the password of one or more system users inside containers
users
Comma-sep... | [
"..",
"versionchanged",
"::",
"2015",
".",
"5",
".",
"0",
"Function",
"renamed",
"from",
"set_pass",
"to",
"set_password",
".",
"Additionally",
"this",
"function",
"now",
"supports",
"(",
"and",
"defaults",
"to",
"using",
")",
"a",
"password",
"hash",
"inste... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2882-L2945 | train |
saltstack/salt | salt/modules/lxc.py | update_lxc_conf | def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None):
'''
Edit LXC configuration options
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.update_lxc_c... | python | def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None):
'''
Edit LXC configuration options
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.update_lxc_c... | [
"def",
"update_lxc_conf",
"(",
"name",
",",
"lxc_conf",
",",
"lxc_conf_unset",
",",
"path",
"=",
"None",
")",
":",
"_ensure_exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
"cpath",
"=",
"get_root_path",
"(",
"path",
")",
"lxc_conf_p",
"=",
"os",
"."... | Edit LXC configuration options
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.update_lxc_conf ubuntu \\
lxc_conf="[{'network.ipv4.ip':'10.0.3.5'}]" \\... | [
"Edit",
"LXC",
"configuration",
"options"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L2951-L3051 | train |
saltstack/salt | salt/modules/lxc.py | set_dns | def set_dns(name, dnsservers=None, searchdomains=None, path=None):
'''
.. versionchanged:: 2015.5.0
The ``dnsservers`` and ``searchdomains`` parameters can now be passed
as a comma-separated list.
Update /etc/resolv.confo
path
path to the container parent
default: /var... | python | def set_dns(name, dnsservers=None, searchdomains=None, path=None):
'''
.. versionchanged:: 2015.5.0
The ``dnsservers`` and ``searchdomains`` parameters can now be passed
as a comma-separated list.
Update /etc/resolv.confo
path
path to the container parent
default: /var... | [
"def",
"set_dns",
"(",
"name",
",",
"dnsservers",
"=",
"None",
",",
"searchdomains",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"if",
"dnsservers",
"is",
"None",
":",
"dnsservers",
"=",
"[",
"'8.8.8.8'",
",",
"'4.4.4.4'",
"]",
"elif",
"not",
"isi... | .. versionchanged:: 2015.5.0
The ``dnsservers`` and ``searchdomains`` parameters can now be passed
as a comma-separated list.
Update /etc/resolv.confo
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:... | [
"..",
"versionchanged",
"::",
"2015",
".",
"5",
".",
"0",
"The",
"dnsservers",
"and",
"searchdomains",
"parameters",
"can",
"now",
"be",
"passed",
"as",
"a",
"comma",
"-",
"separated",
"list",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L3054-L3147 | train |
saltstack/salt | salt/modules/lxc.py | running_systemd | def running_systemd(name, cache=True, path=None):
'''
Determine if systemD is running
path
path to the container parent
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.running_systemd ubuntu
'''
k = 'lxc.systemd.test.{0}{1}'.format(name... | python | def running_systemd(name, cache=True, path=None):
'''
Determine if systemD is running
path
path to the container parent
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.running_systemd ubuntu
'''
k = 'lxc.systemd.test.{0}{1}'.format(name... | [
"def",
"running_systemd",
"(",
"name",
",",
"cache",
"=",
"True",
",",
"path",
"=",
"None",
")",
":",
"k",
"=",
"'lxc.systemd.test.{0}{1}'",
".",
"format",
"(",
"name",
",",
"path",
")",
"ret",
"=",
"__context__",
".",
"get",
"(",
"k",
",",
"None",
"... | Determine if systemD is running
path
path to the container parent
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' lxc.running_systemd ubuntu | [
"Determine",
"if",
"systemD",
"is",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L3150-L3224 | train |
saltstack/salt | salt/modules/lxc.py | systemd_running_state | def systemd_running_state(name, path=None):
'''
Get the operational state of a systemd based container
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.systemd_... | python | def systemd_running_state(name, path=None):
'''
Get the operational state of a systemd based container
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.systemd_... | [
"def",
"systemd_running_state",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"try",
":",
"ret",
"=",
"run_all",
"(",
"name",
",",
"'systemctl is-system-running'",
",",
"path",
"=",
"path",
",",
"ignore_retcode",
"=",
"True",
")",
"[",
"'stdout'",
"]",
... | Get the operational state of a systemd based container
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion lxc.systemd_running_state ubuntu | [
"Get",
"the",
"operational",
"state",
"of",
"a",
"systemd",
"based",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L3227-L3251 | train |
saltstack/salt | salt/modules/lxc.py | wait_started | def wait_started(name, path=None, timeout=300):
'''
Check that the system has fully inited
This is actually very important for systemD based containers
see https://github.com/saltstack/salt/issues/23847
path
path to the container parent
default: /var/lib/lxc (system default)
... | python | def wait_started(name, path=None, timeout=300):
'''
Check that the system has fully inited
This is actually very important for systemD based containers
see https://github.com/saltstack/salt/issues/23847
path
path to the container parent
default: /var/lib/lxc (system default)
... | [
"def",
"wait_started",
"(",
"name",
",",
"path",
"=",
"None",
",",
"timeout",
"=",
"300",
")",
":",
"if",
"not",
"exists",
"(",
"name",
",",
"path",
"=",
"path",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'Container {0} does does exists'",
".",
"for... | Check that the system has fully inited
This is actually very important for systemD based containers
see https://github.com/saltstack/salt/issues/23847
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. cod... | [
"Check",
"that",
"the",
"system",
"has",
"fully",
"inited"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L3311-L3359 | train |
saltstack/salt | salt/modules/lxc.py | attachable | def attachable(name, path=None):
'''
Return True if the named container can be attached to via the lxc-attach
command
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt 'm... | python | def attachable(name, path=None):
'''
Return True if the named container can be attached to via the lxc-attach
command
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt 'm... | [
"def",
"attachable",
"(",
"name",
",",
"path",
"=",
"None",
")",
":",
"cachekey",
"=",
"'lxc.attachable{0}{1}'",
".",
"format",
"(",
"name",
",",
"path",
")",
"try",
":",
"return",
"__context__",
"[",
"cachekey",
"]",
"except",
"KeyError",
":",
"_ensure_ex... | Return True if the named container can be attached to via the lxc-attach
command
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt 'minion' lxc.attachable ubuntu | [
"Return",
"True",
"if",
"the",
"named",
"container",
"can",
"be",
"attached",
"to",
"via",
"the",
"lxc",
"-",
"attach",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxc.py#L3586-L3620 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.