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/utils/jinja.py | SerializerExtension.format_xml | def format_xml(self, value):
"""Render a formatted multi-line XML string from a complex Python
data structure. Supports tag attributes and nested dicts/lists.
:param value: Complex data structure representing XML contents
:returns: Formatted XML string rendered with newlines and indenta... | python | def format_xml(self, value):
"""Render a formatted multi-line XML string from a complex Python
data structure. Supports tag attributes and nested dicts/lists.
:param value: Complex data structure representing XML contents
:returns: Formatted XML string rendered with newlines and indenta... | [
"def",
"format_xml",
"(",
"self",
",",
"value",
")",
":",
"def",
"normalize_iter",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"if",
"isinstance",
"(",
"value",
"[",
"0",
"]",
",",
"str",... | Render a formatted multi-line XML string from a complex Python
data structure. Supports tag attributes and nested dicts/lists.
:param value: Complex data structure representing XML contents
:returns: Formatted XML string rendered with newlines and indentation
:rtype: str | [
"Render",
"a",
"formatted",
"multi",
"-",
"line",
"XML",
"string",
"from",
"a",
"complex",
"Python",
"data",
"structure",
".",
"Supports",
"tag",
"attributes",
"and",
"nested",
"dicts",
"/",
"lists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L871-L915 | train |
saltstack/salt | salt/states/elasticsearch.py | alias_absent | def alias_absent(name, index):
'''
Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
alias = __salt__['elasticsearch.alias_... | python | def alias_absent(name, index):
'''
Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
alias = __salt__['elasticsearch.alias_... | [
"def",
"alias_absent",
"(",
"name",
",",
"index",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"alias",
"=",
"__salt__",
"[",
"'elasti... | Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias | [
"Ensure",
"that",
"the",
"index",
"alias",
"is",
"absent",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L104-L136 | train |
saltstack/salt | salt/states/elasticsearch.py | alias_present | def alias_present(name, index, definition=None):
'''
Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
... | python | def alias_present(name, index, definition=None):
'''
Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
... | [
"def",
"alias_present",
"(",
"name",
",",
"index",
",",
"definition",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"alias... | Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
**Example:**
.. code-block:: yaml
mytestal... | [
"Ensure",
"that",
"the",
"named",
"index",
"alias",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L139-L199 | train |
saltstack/salt | salt/states/elasticsearch.py | index_template_absent | def index_template_absent(name):
'''
Ensure that the named index template is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index_template = __salt__['elasticsearch.index_template_get'](name=name)
if... | python | def index_template_absent(name):
'''
Ensure that the named index template is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index_template = __salt__['elasticsearch.index_template_get'](name=name)
if... | [
"def",
"index_template_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"index_template",
"=",
"__salt__",
"[",
"'elasti... | Ensure that the named index template is absent.
name
Name of the index to remove | [
"Ensure",
"that",
"the",
"named",
"index",
"template",
"is",
"absent",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L202-L232 | train |
saltstack/salt | salt/states/elasticsearch.py | index_template_present | def index_template_present(name, definition, check_definition=False):
'''
Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templa... | python | def index_template_present(name, definition, check_definition=False):
'''
Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templa... | [
"def",
"index_template_present",
"(",
"name",
",",
"definition",
",",
"check_definition",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"... | Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
check_definition
If the template already exists and the defin... | [
"Ensure",
"that",
"the",
"named",
"index",
"template",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L235-L309 | train |
saltstack/salt | salt/states/elasticsearch.py | pipeline_absent | def pipeline_absent(name):
'''
Ensure that the named pipeline is absent
name
Name of the pipeline to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
pipeline = __salt__['elasticsearch.pipeline_get'](id=name)
if pipeline and name in pi... | python | def pipeline_absent(name):
'''
Ensure that the named pipeline is absent
name
Name of the pipeline to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
pipeline = __salt__['elasticsearch.pipeline_get'](id=name)
if pipeline and name in pi... | [
"def",
"pipeline_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"pipeline",
"=",
"__salt__",
"[",
"'elasticsearch.pipe... | Ensure that the named pipeline is absent
name
Name of the pipeline to remove | [
"Ensure",
"that",
"the",
"named",
"pipeline",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L312-L342 | train |
saltstack/salt | salt/states/elasticsearch.py | pipeline_present | def pipeline_present(name, definition):
'''
Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:... | python | def pipeline_present(name, definition):
'''
Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:... | [
"def",
"pipeline_present",
"(",
"name",
",",
"definition",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"pipeline",
"=",
"__salt__",
"["... | Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:: yaml
test_pipeline:
elasticsear... | [
"Ensure",
"that",
"the",
"named",
"pipeline",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L345-L401 | train |
saltstack/salt | salt/states/elasticsearch.py | search_template_absent | def search_template_absent(name):
'''
Ensure that the search template is absent
name
Name of the search template to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
template = __salt__['elasticsearch.search_template_get'](id=name)
if t... | python | def search_template_absent(name):
'''
Ensure that the search template is absent
name
Name of the search template to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
template = __salt__['elasticsearch.search_template_get'](id=name)
if t... | [
"def",
"search_template_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"template",
"=",
"__salt__",
"[",
"'elasticsear... | Ensure that the search template is absent
name
Name of the search template to remove | [
"Ensure",
"that",
"the",
"search",
"template",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L404-L434 | train |
saltstack/salt | salt/states/elasticsearch.py | search_template_present | def search_template_present(name, definition):
'''
Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
*... | python | def search_template_present(name, definition):
'''
Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
*... | [
"def",
"search_template_present",
"(",
"name",
",",
"definition",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"template",
"=",
"__salt__"... | Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
**Example:**
.. code-block:: yaml
test_pipelin... | [
"Ensure",
"that",
"the",
"named",
"search",
"template",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L437-L492 | train |
saltstack/salt | salt/modules/pkgng.py | _pkg | def _pkg(jail=None, chroot=None, root=None):
'''
Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified.
'''
ret = ['pkg']
if jail:
ret.extend(['-j', jail])
elif chroot:
ret.extend(['-c', chroot])
elif root:
ret.extend(... | python | def _pkg(jail=None, chroot=None, root=None):
'''
Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified.
'''
ret = ['pkg']
if jail:
ret.extend(['-j', jail])
elif chroot:
ret.extend(['-c', chroot])
elif root:
ret.extend(... | [
"def",
"_pkg",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"'pkg'",
"]",
"if",
"jail",
":",
"ret",
".",
"extend",
"(",
"[",
"'-j'",
",",
"jail",
"]",
")",
"elif",
"chroot",
":",
"... | Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified. | [
"Returns",
"the",
"prefix",
"for",
"a",
"pkg",
"command",
"using",
"-",
"j",
"if",
"a",
"jail",
"is",
"specified",
"or",
"-",
"c",
"if",
"chroot",
"is",
"specified",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L89-L101 | train |
saltstack/salt | salt/modules/pkgng.py | _get_pkgng_version | def _get_pkgng_version(jail=None, chroot=None, root=None):
'''
return the version of 'pkg'
'''
cmd = _pkg(jail, chroot, root) + ['--version']
return __salt__['cmd.run'](cmd).strip() | python | def _get_pkgng_version(jail=None, chroot=None, root=None):
'''
return the version of 'pkg'
'''
cmd = _pkg(jail, chroot, root) + ['--version']
return __salt__['cmd.run'](cmd).strip() | [
"def",
"_get_pkgng_version",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"cmd",
"=",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'--version'",
"]",
"return",
"__salt__",
"[",
"'cmd.ru... | return the version of 'pkg' | [
"return",
"the",
"version",
"of",
"pkg"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L104-L109 | train |
saltstack/salt | salt/modules/pkgng.py | _get_version | def _get_version(name, results):
'''
``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match.
'''
for line in salt.utils.itertools.split(results, '\n'):
if not line:
continue
try:... | python | def _get_version(name, results):
'''
``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match.
'''
for line in salt.utils.itertools.split(results, '\n'):
if not line:
continue
try:... | [
"def",
"_get_version",
"(",
"name",
",",
"results",
")",
":",
"for",
"line",
"in",
"salt",
".",
"utils",
".",
"itertools",
".",
"split",
"(",
"results",
",",
"'\\n'",
")",
":",
"if",
"not",
"line",
":",
"continue",
"try",
":",
"pkgname",
",",
"pkgver... | ``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match. | [
"pkg",
"search",
"will",
"return",
"all",
"packages",
"for",
"which",
"the",
"pattern",
"is",
"a",
"match",
".",
"Narrow",
"this",
"down",
"and",
"return",
"the",
"package",
"version",
"or",
"None",
"if",
"no",
"exact",
"match",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L112-L126 | train |
saltstack/salt | salt/modules/pkgng.py | _contextkey | def _contextkey(jail=None, chroot=None, root=None, prefix='pkg.list_pkgs'):
'''
As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used.
'''
if jail:
return ... | python | def _contextkey(jail=None, chroot=None, root=None, prefix='pkg.list_pkgs'):
'''
As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used.
'''
if jail:
return ... | [
"def",
"_contextkey",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"prefix",
"=",
"'pkg.list_pkgs'",
")",
":",
"if",
"jail",
":",
"return",
"six",
".",
"text_type",
"(",
"prefix",
")",
"+",
"'.jail_{0}'",
".",
... | As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used. | [
"As",
"this",
"module",
"is",
"designed",
"to",
"manipulate",
"packages",
"in",
"jails",
"and",
"chroots",
"use",
"the",
"passed",
"jail",
"/",
"chroot",
"to",
"ensure",
"that",
"a",
"key",
"in",
"the",
"__context__",
"dict",
"that",
"is",
"unique",
"to",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L129-L141 | train |
saltstack/salt | salt/modules/pkgng.py | parse_config | def parse_config(file_name='/usr/local/etc/pkg.conf'):
'''
Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now
'''
ret = {}
if not os.path.isfile(file_name):
return 'Unable t... | python | def parse_config(file_name='/usr/local/etc/pkg.conf'):
'''
Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now
'''
ret = {}
if not os.path.isfile(file_name):
return 'Unable t... | [
"def",
"parse_config",
"(",
"file_name",
"=",
"'/usr/local/etc/pkg.conf'",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"file_name",
")",
":",
"return",
"'Unable to find {0} on file system'",
".",
"format",
"(",
"file_nam... | Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now | [
"Return",
"dict",
"of",
"uncommented",
"global",
"variables",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L144-L169 | train |
saltstack/salt | salt/modules/pkgng.py | version | def version(*names, **kwargs):
'''
Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``p... | python | def version(*names, **kwargs):
'''
Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``p... | [
"def",
"version",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"with_origin",
"=",
"kwargs",
".",
"pop",
"(",
"'with_origin'",
",",
"False",
")",
"ret",
"=",
"__salt__",
"[",
"'pkg_resource.version'",
"]",
"(",
"*",
"names",
",",
"*",
"*",
"... | Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``pkg.version``, to more closely match the CLI... | [
"Returns",
"a",
"string",
"representing",
"the",
"package",
"version",
"or",
"an",
"empty",
"string",
"if",
"not",
"installed",
".",
"If",
"more",
"than",
"one",
"package",
"name",
"is",
"specified",
"a",
"dict",
"of",
"name",
"/",
"version",
"pairs",
"is"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L172-L220 | train |
saltstack/salt | salt/modules/pkgng.py | refresh_db | def refresh_db(jail=None, chroot=None, root=None, force=False, **kwargs):
'''
Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: ... | python | def refresh_db(jail=None, chroot=None, root=None, force=False, **kwargs):
'''
Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: ... | [
"def",
"refresh_db",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"force",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils"... | Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
jail
Refresh the pkg database withi... | [
"Refresh",
"PACKAGESITE",
"contents"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L227-L269 | train |
saltstack/salt | salt/modules/pkgng.py | list_pkgs | def list_pkgs(versions_as_list=False,
jail=None,
chroot=None,
root=None,
with_origin=False,
**kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the s... | python | def list_pkgs(versions_as_list=False,
jail=None,
chroot=None,
root=None,
with_origin=False,
**kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the s... | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"with_origin",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# not yet implemented or not applicable",
"if",
... | List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the specified jail
chroot
List the packages in the specified chroot (ignored if ``jail`` is
specified)
root
List the packages in the specified root (ignored... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L354-L438 | train |
saltstack/salt | salt/modules/pkgng.py | stats | def stats(local=False, remote=False, jail=None, chroot=None, root=None):
'''
Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*'... | python | def stats(local=False, remote=False, jail=None, chroot=None, root=None):
'''
Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*'... | [
"def",
"stats",
"(",
"local",
"=",
"False",
",",
"remote",
"=",
"False",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"opts",
"=",
"''",
"if",
"local",
":",
"opts",
"+=",
"'l'",
"if",
"remote",
":",
... | Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats local=True
remote
Display stats only for the remote package d... | [
"Return",
"pkgng",
"stats",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L462-L529 | train |
saltstack/salt | salt/modules/pkgng.py | backup | def backup(file_name, jail=None, chroot=None, root=None):
'''
Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, a... | python | def backup(file_name, jail=None, chroot=None, root=None):
'''
Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, a... | [
"def",
"backup",
"(",
"file_name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'bac... | Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, and so the path to the backup file will be
relative to the root... | [
"Export",
"installed",
"packages",
"into",
"yaml",
"+",
"mtree",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L532-L576 | train |
saltstack/salt | salt/modules/pkgng.py | restore | def restore(file_name, jail=None, chroot=None, root=None):
'''
Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
comma... | python | def restore(file_name, jail=None, chroot=None, root=None):
'''
Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
comma... | [
"def",
"restore",
"(",
"file_name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'backup... | Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
command within the jail, and so the path to the file from which the pkg
... | [
"Reads",
"archive",
"created",
"by",
"pkg",
"backup",
"-",
"d",
"and",
"recreates",
"the",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L579-L622 | train |
saltstack/salt | salt/modules/pkgng.py | audit | def audit(jail=None, chroot=None, root=None):
'''
Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' p... | python | def audit(jail=None, chroot=None, root=None):
'''
Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' p... | [
"def",
"audit",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'audit'",
",",
"'-F'",
"]... | Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.audit jail=<jail name or id>
chroot
Audit ... | [
"Audits",
"installed",
"packages",
"against",
"known",
"vulnerabilities"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L625-L662 | train |
saltstack/salt | salt/modules/pkgng.py | install | def install(name=None,
fromrepo=None,
pkgs=None,
sources=None,
jail=None,
chroot=None,
root=None,
orphan=False,
force=False,
glob=False,
local=False,
dryrun=False,
quiet=False,... | python | def install(name=None,
fromrepo=None,
pkgs=None,
sources=None,
jail=None,
chroot=None,
root=None,
orphan=False,
force=False,
glob=False,
local=False,
dryrun=False,
quiet=False,... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"orphan",
"=",
"False",
",",
"fo... | Install package(s) from a repository
name
The name of the package to install
CLI Example:
.. code-block:: bash
salt '*' pkg.install <package name>
jail
Install the package into the specified jail
chroot
Install the package into the specified chroot (... | [
"Install",
"package",
"(",
"s",
")",
"from",
"a",
"repository"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L665-L909 | train |
saltstack/salt | salt/modules/pkgng.py | remove | def remove(name=None,
pkgs=None,
jail=None,
chroot=None,
root=None,
all_installed=False,
force=False,
glob=False,
dryrun=False,
recurse=False,
regex=False,
pcre=False,
**kwargs):
'''
... | python | def remove(name=None,
pkgs=None,
jail=None,
chroot=None,
root=None,
all_installed=False,
force=False,
glob=False,
dryrun=False,
recurse=False,
regex=False,
pcre=False,
**kwargs):
'''
... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"all_installed",
"=",
"False",
",",
"force",
"=",
"False",
",",
"glob",
"=",
"False",
",",
"... | Remove a package from the database and system
.. note::
This function can accessed using ``pkg.delete`` in addition to
``pkg.remove``, to more closely match the CLI usage of ``pkg(8)``.
name
The package to remove
CLI Example:
.. code-block:: bash
salt '*... | [
"Remove",
"a",
"package",
"from",
"the",
"database",
"and",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L912-L1086 | train |
saltstack/salt | salt/modules/pkgng.py | upgrade | def upgrade(*names, **kwargs):
'''
Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
... | python | def upgrade(*names, **kwargs):
'''
Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
... | [
"def",
"upgrade",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
"=",
"kwargs",
".",
"pop",... | Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Ex... | [
"Upgrade",
"named",
"or",
"all",
"packages",
"(",
"run",
"a",
"pkg",
"upgrade",
")",
".",
"If",
"<package",
"name",
">",
"is",
"omitted",
"the",
"operation",
"is",
"executed",
"on",
"all",
"packages",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1095-L1212 | train |
saltstack/salt | salt/modules/pkgng.py | clean | def clean(jail=None,
chroot=None,
root=None,
clean_all=False,
dryrun=False):
'''
Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
... | python | def clean(jail=None,
chroot=None,
root=None,
clean_all=False,
dryrun=False):
'''
Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
... | [
"def",
"clean",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"clean_all",
"=",
"False",
",",
"dryrun",
"=",
"False",
")",
":",
"opts",
"=",
"''",
"if",
"clean_all",
":",
"opts",
"+=",
"'a'",
"if",
"dryrun",
... | Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.clean jail=<jail name or id>
chroot
Cleans... | [
"Cleans",
"the",
"local",
"cache",
"of",
"fetched",
"remote",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1215-L1288 | train |
saltstack/salt | salt/modules/pkgng.py | check | def check(jail=None,
chroot=None,
root=None,
depends=False,
recompute=False,
checksum=False):
'''
Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
s... | python | def check(jail=None,
chroot=None,
root=None,
depends=False,
recompute=False,
checksum=False):
'''
Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
s... | [
"def",
"check",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"depends",
"=",
"False",
",",
"recompute",
"=",
"False",
",",
"checksum",
"=",
"False",
")",
":",
"if",
"not",
"any",
"(",
"(",
"depends",
",",
"... | Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.check jail=<jail name or id>
chroot
Perform the sanity check in the specified chroot (ignored if ``jail``
is specified)
... | [
"Sanity",
"checks",
"installed",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1326-L1407 | train |
saltstack/salt | salt/modules/pkgng.py | which | def which(path, jail=None, chroot=None, root=None, origin=False, quiet=False):
'''
Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code... | python | def which(path, jail=None, chroot=None, root=None, origin=False, quiet=False):
'''
Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code... | [
"def",
"which",
"(",
"path",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"origin",
"=",
"False",
",",
"quiet",
"=",
"False",
")",
":",
"opts",
"=",
"''",
"if",
"quiet",
":",
"opts",
"+=",
"'q'",
"if",
"o... | Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name> jail=<jail name or id>
chroo... | [
"Displays",
"which",
"package",
"installed",
"a",
"specific",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1410-L1477 | train |
saltstack/salt | salt/modules/pkgng.py | search | def search(name,
jail=None,
chroot=None,
root=None,
exact=False,
glob=False,
regex=False,
pcre=False,
comment=False,
desc=False,
full=False,
depends=False,
size=False,
quiet=Fal... | python | def search(name,
jail=None,
chroot=None,
root=None,
exact=False,
glob=False,
regex=False,
pcre=False,
comment=False,
desc=False,
full=False,
depends=False,
size=False,
quiet=Fal... | [
"def",
"search",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"exact",
"=",
"False",
",",
"glob",
"=",
"False",
",",
"regex",
"=",
"False",
",",
"pcre",
"=",
"False",
",",
"comment",
"=",
"Fals... | Searches in remote package repositories
CLI Example:
.. code-block:: bash
salt '*' pkg.search pattern
jail
Perform the search using the ``pkg.conf(5)`` from the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.search pattern jail=<jail name or ... | [
"Searches",
"in",
"remote",
"package",
"repositories"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1480-L1673 | train |
saltstack/salt | salt/modules/pkgng.py | fetch | def fetch(name,
jail=None,
chroot=None,
root=None,
fetch_all=False,
quiet=False,
fromrepo=None,
glob=True,
regex=False,
pcre=False,
local=False,
depends=False):
'''
Fetches remote packages
CLI Exam... | python | def fetch(name,
jail=None,
chroot=None,
root=None,
fetch_all=False,
quiet=False,
fromrepo=None,
glob=True,
regex=False,
pcre=False,
local=False,
depends=False):
'''
Fetches remote packages
CLI Exam... | [
"def",
"fetch",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"fetch_all",
"=",
"False",
",",
"quiet",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"glob",
"=",
"True",
",",
"regex",
"=",
"F... | Fetches remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.fetch <package name>
jail
Fetch package in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.fetch <package name> jail=<jail name or id>
chroot
Fetch package... | [
"Fetches",
"remote",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1676-L1821 | train |
saltstack/salt | salt/modules/pkgng.py | updating | def updating(name,
jail=None,
chroot=None,
root=None,
filedate=None,
filename=None):
''''
Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the a... | python | def updating(name,
jail=None,
chroot=None,
root=None,
filedate=None,
filename=None):
''''
Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the a... | [
"def",
"updating",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"filedate",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"opts",
"=",
"''",
"if",
"filedate",
":",
"opts",
"+=",
"'d {0}'",... | Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the action in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo jail=<jail name or id>
chroot
P... | [
"Displays",
"UPDATING",
"entries",
"of",
"software",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1824-L1896 | train |
saltstack/salt | salt/modules/pkgng.py | hold | def hold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
'''
Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng... | python | def hold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
'''
Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng... | [
"def",
"hold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"targets",
"=",
"[",
"]",
"if",
"pkgs",
":",
"targets",
".",
"extend",
"(",
"pkgs",
")",
"else",
":",
"targets",
".",
"... | Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng.lock>` instead. instead.
name
The name of the package to be held.... | [
"Version",
"-",
"lock",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1899-L1961 | train |
saltstack/salt | salt/modules/pkgng.py | list_locked | def list_locked(**kwargs):
'''
Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List l... | python | def list_locked(**kwargs):
'''
Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List l... | [
"def",
"list_locked",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"[",
"'{0}-{1}'",
".",
"format",
"(",
"pkgname",
",",
"version",
"(",
"pkgname",
",",
"*",
"*",
"kwargs",
")",
")",
"for",
"pkgname",
"in",
"_lockcmd",
"(",
"'lock'",
",",
"name",
"="... | Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List locked packages within the specified jai... | [
"Query",
"the",
"package",
"database",
"those",
"packages",
"which",
"are",
"locked",
"against",
"reinstallation",
"modification",
"or",
"deletion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2029-L2073 | train |
saltstack/salt | salt/modules/pkgng.py | _lockcmd | def _lockcmd(subcmd, pkgname=None, **kwargs):
'''
Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages
'''
jail = kwargs.pop('jail', None)
chroot = kwargs.pop('chroot', None)
root = kwargs.pop('ro... | python | def _lockcmd(subcmd, pkgname=None, **kwargs):
'''
Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages
'''
jail = kwargs.pop('jail', None)
chroot = kwargs.pop('chroot', None)
root = kwargs.pop('ro... | [
"def",
"_lockcmd",
"(",
"subcmd",
",",
"pkgname",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
... | Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages | [
"Helper",
"function",
"for",
"lock",
"and",
"unlock",
"commands",
"because",
"their",
"syntax",
"is",
"identical",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2221-L2261 | train |
saltstack/salt | salt/modules/pkgng.py | list_upgrades | def list_upgrades(refresh=True, **kwargs):
'''
List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
... | python | def list_upgrades(refresh=True, **kwargs):
'''
List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
... | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
"=",
"kwargs... | List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
CLI Example:
.. code-block:: bash
... | [
"List",
"those",
"packages",
"for",
"which",
"an",
"upgrade",
"is",
"available"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2264-L2322 | train |
saltstack/salt | salt/modules/pkgng.py | _parse_upgrade | def _parse_upgrade(stdout):
'''
Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'curren... | python | def _parse_upgrade(stdout):
'''
Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'curren... | [
"def",
"_parse_upgrade",
"(",
"stdout",
")",
":",
"# Match strings like 'python36: 3.6.3 -> 3.6.4 [FreeBSD]'",
"upgrade_regex",
"=",
"re",
".",
"compile",
"(",
"r'^\\s+([^:]+):\\s([0-9a-z_,.]+)\\s+->\\s+([0-9a-z_,.]+)\\s*(\\[([^]]+)\\])?\\s*(\\(([^)]+)\\))?'",
")",
"# Match strings lik... | Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'current': n.n.n
'new': n.n.n
... | [
"Parse",
"the",
"output",
"from",
"the",
"pkg",
"upgrade",
"--",
"dry",
"-",
"run",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2325-L2441 | train |
saltstack/salt | salt/modules/pkgng.py | version_cmp | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version... | python | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version... | [
"def",
"version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"del",
"ignore_epoch",
"# Unused parameter",
"# Don't worry about ignore_epoch since we're shelling out to pkg.",
"sym",
"=",
"{",
"'<'",
":",
"-",
... | Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version_cmp '2.1.11' '2.1.12' | [
"Do",
"a",
"cmp",
"-",
"style",
"comparison",
"on",
"two",
"packages",
".",
"Return",
"-",
"1",
"if",
"pkg1",
"<",
"pkg2",
"0",
"if",
"pkg1",
"==",
"pkg2",
"and",
"1",
"if",
"pkg1",
">",
"pkg2",
".",
"Return",
"None",
"if",
"there",
"was",
"a",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2444-L2476 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | bin_pkg_info | def bin_pkg_info(path, saltenv='base'):
'''
.. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ... | python | def bin_pkg_info(path, saltenv='base'):
'''
.. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ... | [
"def",
"bin_pkg_info",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# If the path is a valid protocol, pull it down using cp.cache_file",
"if",
"__salt__",
"[",
"'config.valid_fileproto'",
"]",
"(",
"path",
")",
":",
"newpath",
"=",
"__salt__",
"[",
"'cp.cac... | .. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ``salt://path/to/file.rpm``).
If a salt file... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L37-L110 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | unpurge | def unpurge(*packages):
'''
Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl
'''
if not packages:
return {}
old = __salt__['pkg.list_pkgs'](purge_desired=True)
ret = {}
__salt__['cmd.run... | python | def unpurge(*packages):
'''
Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl
'''
if not packages:
return {}
old = __salt__['pkg.list_pkgs'](purge_desired=True)
ret = {}
__salt__['cmd.run... | [
"def",
"unpurge",
"(",
"*",
"packages",
")",
":",
"if",
"not",
"packages",
":",
"return",
"{",
"}",
"old",
"=",
"__salt__",
"[",
"'pkg.list_pkgs'",
"]",
"(",
"purge_desired",
"=",
"True",
")",
"ret",
"=",
"{",
"}",
"__salt__",
"[",
"'cmd.run'",
"]",
... | Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl | [
"Change",
"package",
"selection",
"for",
"each",
"package",
"specified",
"to",
"install"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L113-L135 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | list_pkgs | def list_pkgs(*packages, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
... | python | def list_pkgs(*packages, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
... | [
"def",
"list_pkgs",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packages",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"... | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
CLI Example:
.. code-block:: bash
... | [
"List",
"the",
"packages",
"currently",
"installed",
"in",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L138-L169 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | file_list | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt... | python | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt... | [
"def",
"file_list",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"ret",
"=",
"set",
"(",
"[",
"]",
")",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packa... | List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd postfix
salt... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
"generally",
"recommended",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L172-L211 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | file_dict | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_lis... | python | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_lis... | [
"def",
"file_dict",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"ret",
"=",
"{",
"}",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packages",
")",
")",
"... | List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd ... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
"grouped",
"by",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L214-L252 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | _get_pkg_build_time | def _get_pkg_build_time(name):
'''
Get package build time, if possible.
:param name:
:return:
'''
iso_time = iso_time_t = None
changelog_dir = os.path.join('/usr/share/doc', name)
if os.path.exists(changelog_dir):
for fname in os.listdir(changelog_dir):
try:
... | python | def _get_pkg_build_time(name):
'''
Get package build time, if possible.
:param name:
:return:
'''
iso_time = iso_time_t = None
changelog_dir = os.path.join('/usr/share/doc', name)
if os.path.exists(changelog_dir):
for fname in os.listdir(changelog_dir):
try:
... | [
"def",
"_get_pkg_build_time",
"(",
"name",
")",
":",
"iso_time",
"=",
"iso_time_t",
"=",
"None",
"changelog_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'/usr/share/doc'",
",",
"name",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"changelog_dir",
... | Get package build time, if possible.
:param name:
:return: | [
"Get",
"package",
"build",
"time",
"if",
"possible",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L255-L284 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | _get_pkg_info | def _get_pkg_info(*packages, **kwargs):
'''
Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return:
'''
kwargs =... | python | def _get_pkg_info(*packages, **kwargs):
'''
Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return:
'''
kwargs =... | [
"def",
"_get_pkg_info",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"failhard",
"=",
"kwargs",
".",
"pop",
"(",
"'failhard'",
",",
"True... | Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return: | [
"Return",
"list",
"of",
"package",
"information",
".",
"If",
"packages",
"parameter",
"is",
"empty",
"then",
"data",
"about",
"all",
"installed",
"packages",
"will",
"be",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L287-L354 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | _get_pkg_license | def _get_pkg_license(pkg):
'''
Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return:
'''
licenses = set()
cpr = "/usr/share/doc/{0}/copyright".format(pkg)
if os.path.exists(cpr):
with salt.util... | python | def _get_pkg_license(pkg):
'''
Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return:
'''
licenses = set()
cpr = "/usr/share/doc/{0}/copyright".format(pkg)
if os.path.exists(cpr):
with salt.util... | [
"def",
"_get_pkg_license",
"(",
"pkg",
")",
":",
"licenses",
"=",
"set",
"(",
")",
"cpr",
"=",
"\"/usr/share/doc/{0}/copyright\"",
".",
"format",
"(",
"pkg",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"cpr",
")",
":",
"with",
"salt",
".",
"utils... | Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return: | [
"Try",
"to",
"get",
"a",
"license",
"from",
"the",
"package",
".",
"Based",
"on",
"https",
":",
"//",
"www",
".",
"debian",
".",
"org",
"/",
"doc",
"/",
"packaging",
"-",
"manuals",
"/",
"copyright",
"-",
"format",
"/",
"1",
".",
"0",
"/"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L357-L373 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | _get_pkg_install_time | def _get_pkg_install_time(pkg, arch=None):
'''
Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return:
'''
iso_time = iso_time_t = None
loc_root = '/var/lib/dpkg/info'
if pkg is not None:
locations = []
if arch is not None and arch != 'all':
... | python | def _get_pkg_install_time(pkg, arch=None):
'''
Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return:
'''
iso_time = iso_time_t = None
loc_root = '/var/lib/dpkg/info'
if pkg is not None:
locations = []
if arch is not None and arch != 'all':
... | [
"def",
"_get_pkg_install_time",
"(",
"pkg",
",",
"arch",
"=",
"None",
")",
":",
"iso_time",
"=",
"iso_time_t",
"=",
"None",
"loc_root",
"=",
"'/var/lib/dpkg/info'",
"if",
"pkg",
"is",
"not",
"None",
":",
"locations",
"=",
"[",
"]",
"if",
"arch",
"is",
"n... | Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return: | [
"Return",
"package",
"install",
"time",
"based",
"on",
"the",
"/",
"var",
"/",
"lib",
"/",
"dpkg",
"/",
"info",
"/",
"<package",
">",
".",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L376-L401 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | _get_pkg_ds_avail | def _get_pkg_ds_avail():
'''
Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return:
'''
avail = "/var/lib/dpkg/available"
if not salt.utils.path.which('dselect') or not os.path.exists(avail):
... | python | def _get_pkg_ds_avail():
'''
Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return:
'''
avail = "/var/lib/dpkg/available"
if not salt.utils.path.which('dselect') or not os.path.exists(avail):
... | [
"def",
"_get_pkg_ds_avail",
"(",
")",
":",
"avail",
"=",
"\"/var/lib/dpkg/available\"",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'dselect'",
")",
"or",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"avail",
")",
":",
"return",
... | Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return: | [
"Get",
"the",
"package",
"information",
"of",
"the",
"available",
"packages",
"maintained",
"by",
"dselect",
".",
"Note",
"this",
"will",
"be",
"not",
"very",
"useful",
"if",
"dselect",
"isn",
"t",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L404-L432 | train |
saltstack/salt | salt/modules/dpkg_lowpkg.py | info | def info(*packages, **kwargs):
'''
Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
... | python | def info(*packages, **kwargs):
'''
Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
... | [
"def",
"info",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"# Get the missing information from the /var/lib/dpkg/available, if it is there.",
"# However, this file is operated by dselect which has to be installed.",
"dselect_pkg_avail",
"=",
"_get_pkg_ds_avail",
"(",
"... | Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
Whether to throw an exception if none of t... | [
"Returns",
"a",
"detailed",
"summary",
"of",
"package",
"information",
"for",
"provided",
"package",
"names",
".",
"If",
"no",
"packages",
"are",
"specified",
"all",
"packages",
"will",
"be",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L435-L507 | train |
saltstack/salt | salt/utils/context.py | func_globals_inject | def func_globals_inject(func, **overrides):
'''
Override specific variables within a function's global context.
'''
# recognize methods
if hasattr(func, 'im_func'):
func = func.__func__
# Get a reference to the function globals dictionary
func_globals = func.__globals__
# Save t... | python | def func_globals_inject(func, **overrides):
'''
Override specific variables within a function's global context.
'''
# recognize methods
if hasattr(func, 'im_func'):
func = func.__func__
# Get a reference to the function globals dictionary
func_globals = func.__globals__
# Save t... | [
"def",
"func_globals_inject",
"(",
"func",
",",
"*",
"*",
"overrides",
")",
":",
"# recognize methods",
"if",
"hasattr",
"(",
"func",
",",
"'im_func'",
")",
":",
"func",
"=",
"func",
".",
"__func__",
"# Get a reference to the function globals dictionary",
"func_glob... | Override specific variables within a function's global context. | [
"Override",
"specific",
"variables",
"within",
"a",
"function",
"s",
"global",
"context",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/context.py#L28-L61 | train |
saltstack/salt | salt/utils/context.py | ContextDict.clone | def clone(self, **kwargs):
'''
Clone this context, and return the ChildContextDict
'''
child = ChildContextDict(parent=self, threadsafe=self._threadsafe, overrides=kwargs)
return child | python | def clone(self, **kwargs):
'''
Clone this context, and return the ChildContextDict
'''
child = ChildContextDict(parent=self, threadsafe=self._threadsafe, overrides=kwargs)
return child | [
"def",
"clone",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"child",
"=",
"ChildContextDict",
"(",
"parent",
"=",
"self",
",",
"threadsafe",
"=",
"self",
".",
"_threadsafe",
",",
"overrides",
"=",
"kwargs",
")",
"return",
"child"
] | Clone this context, and return the ChildContextDict | [
"Clone",
"this",
"context",
"and",
"return",
"the",
"ChildContextDict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/context.py#L95-L100 | train |
saltstack/salt | salt/cli/cp.py | SaltCPCli.run | def run(self):
'''
Execute salt-cp
'''
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
salt.utils.verify.verify_log(self.config)
cp_ = SaltCP(self.config)
cp_.run() | python | def run(self):
'''
Execute salt-cp
'''
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
salt.utils.verify.verify_log(self.config)
cp_ = SaltCP(self.config)
cp_.run() | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"parse_args",
"(",
")",
"# Setup file logging!",
"self",
".",
"setup_logfile_logger",
"(",
")",
"salt",
".",
"utils",
".",
"verify",
".",
"verify_log",
"(",
"self",
".",
"config",
")",
"cp_",
"=",
"SaltCP... | Execute salt-cp | [
"Execute",
"salt",
"-",
"cp"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L41-L52 | train |
saltstack/salt | salt/cli/cp.py | SaltCP._recurse | def _recurse(self, path):
'''
Get a list of all specified files
'''
files = {}
empty_dirs = []
try:
sub_paths = os.listdir(path)
except OSError as exc:
if exc.errno == errno.ENOENT:
# Path does not exist
sys.... | python | def _recurse(self, path):
'''
Get a list of all specified files
'''
files = {}
empty_dirs = []
try:
sub_paths = os.listdir(path)
except OSError as exc:
if exc.errno == errno.ENOENT:
# Path does not exist
sys.... | [
"def",
"_recurse",
"(",
"self",
",",
"path",
")",
":",
"files",
"=",
"{",
"}",
"empty_dirs",
"=",
"[",
"]",
"try",
":",
"sub_paths",
"=",
"os",
".",
"listdir",
"(",
"path",
")",
"except",
"OSError",
"as",
"exc",
":",
"if",
"exc",
".",
"errno",
"=... | Get a list of all specified files | [
"Get",
"a",
"list",
"of",
"all",
"specified",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L71-L95 | train |
saltstack/salt | salt/cli/cp.py | SaltCP._file_dict | def _file_dict(self, fn_):
'''
Take a path and return the contents of the file as a string
'''
if not os.path.isfile(fn_):
err = 'The referenced file, {0} is not available.'.format(fn_)
sys.stderr.write(err + '\n')
sys.exit(42)
with salt.utils.... | python | def _file_dict(self, fn_):
'''
Take a path and return the contents of the file as a string
'''
if not os.path.isfile(fn_):
err = 'The referenced file, {0} is not available.'.format(fn_)
sys.stderr.write(err + '\n')
sys.exit(42)
with salt.utils.... | [
"def",
"_file_dict",
"(",
"self",
",",
"fn_",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"fn_",
")",
":",
"err",
"=",
"'The referenced file, {0} is not available.'",
".",
"format",
"(",
"fn_",
")",
"sys",
".",
"stderr",
".",
"write",
... | Take a path and return the contents of the file as a string | [
"Take",
"a",
"path",
"and",
"return",
"the",
"contents",
"of",
"the",
"file",
"as",
"a",
"string"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L106-L116 | train |
saltstack/salt | salt/cli/cp.py | SaltCP._load_files | def _load_files(self):
'''
Parse the files indicated in opts['src'] and load them into a python
object for transport
'''
files = {}
for fn_ in self.opts['src']:
if os.path.isfile(fn_):
files.update(self._file_dict(fn_))
elif os.path... | python | def _load_files(self):
'''
Parse the files indicated in opts['src'] and load them into a python
object for transport
'''
files = {}
for fn_ in self.opts['src']:
if os.path.isfile(fn_):
files.update(self._file_dict(fn_))
elif os.path... | [
"def",
"_load_files",
"(",
"self",
")",
":",
"files",
"=",
"{",
"}",
"for",
"fn_",
"in",
"self",
".",
"opts",
"[",
"'src'",
"]",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"fn_",
")",
":",
"files",
".",
"update",
"(",
"self",
".",
"_file... | Parse the files indicated in opts['src'] and load them into a python
object for transport | [
"Parse",
"the",
"files",
"indicated",
"in",
"opts",
"[",
"src",
"]",
"and",
"load",
"them",
"into",
"a",
"python",
"object",
"for",
"transport"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L118-L133 | train |
saltstack/salt | salt/cli/cp.py | SaltCP.run | def run(self):
'''
Make the salt client call
'''
if self.opts['chunked']:
ret = self.run_chunked()
else:
ret = self.run_oldstyle()
salt.output.display_output(
ret,
self.opts.get('output', 'nested'),
... | python | def run(self):
'''
Make the salt client call
'''
if self.opts['chunked']:
ret = self.run_chunked()
else:
ret = self.run_oldstyle()
salt.output.display_output(
ret,
self.opts.get('output', 'nested'),
... | [
"def",
"run",
"(",
"self",
")",
":",
"if",
"self",
".",
"opts",
"[",
"'chunked'",
"]",
":",
"ret",
"=",
"self",
".",
"run_chunked",
"(",
")",
"else",
":",
"ret",
"=",
"self",
".",
"run_oldstyle",
"(",
")",
"salt",
".",
"output",
".",
"display_outpu... | Make the salt client call | [
"Make",
"the",
"salt",
"client",
"call"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L135-L147 | train |
saltstack/salt | salt/cli/cp.py | SaltCP.run_oldstyle | def run_oldstyle(self):
'''
Make the salt client call in old-style all-in-one call method
'''
arg = [self._load_files(), self.opts['dest']]
local = salt.client.get_local_client(self.opts['conf_file'])
args = [self.opts['tgt'],
'cp.recv',
ar... | python | def run_oldstyle(self):
'''
Make the salt client call in old-style all-in-one call method
'''
arg = [self._load_files(), self.opts['dest']]
local = salt.client.get_local_client(self.opts['conf_file'])
args = [self.opts['tgt'],
'cp.recv',
ar... | [
"def",
"run_oldstyle",
"(",
"self",
")",
":",
"arg",
"=",
"[",
"self",
".",
"_load_files",
"(",
")",
",",
"self",
".",
"opts",
"[",
"'dest'",
"]",
"]",
"local",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"self",
".",
"opts",
"[",
"'c... | Make the salt client call in old-style all-in-one call method | [
"Make",
"the",
"salt",
"client",
"call",
"in",
"old",
"-",
"style",
"all",
"-",
"in",
"-",
"one",
"call",
"method"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L149-L165 | train |
saltstack/salt | salt/cli/cp.py | SaltCP.run_chunked | def run_chunked(self):
'''
Make the salt client call in the new fasion chunked multi-call way
'''
files, empty_dirs = self._list_files()
dest = self.opts['dest']
gzip = self.opts['gzip']
tgt = self.opts['tgt']
timeout = self.opts['timeout']
selecte... | python | def run_chunked(self):
'''
Make the salt client call in the new fasion chunked multi-call way
'''
files, empty_dirs = self._list_files()
dest = self.opts['dest']
gzip = self.opts['gzip']
tgt = self.opts['tgt']
timeout = self.opts['timeout']
selecte... | [
"def",
"run_chunked",
"(",
"self",
")",
":",
"files",
",",
"empty_dirs",
"=",
"self",
".",
"_list_files",
"(",
")",
"dest",
"=",
"self",
".",
"opts",
"[",
"'dest'",
"]",
"gzip",
"=",
"self",
".",
"opts",
"[",
"'gzip'",
"]",
"tgt",
"=",
"self",
".",... | Make the salt client call in the new fasion chunked multi-call way | [
"Make",
"the",
"salt",
"client",
"call",
"in",
"the",
"new",
"fasion",
"chunked",
"multi",
"-",
"call",
"way"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L167-L286 | train |
saltstack/salt | salt/modules/mdadm_raid.py | list_ | def list_():
'''
List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list
'''
ret = {}
for line in (__salt__['cmd.run_stdout']
(['mdadm', '--detail', '--scan'],
python_shell=False).splitlines()):
if ' ' not in lin... | python | def list_():
'''
List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list
'''
ret = {}
for line in (__salt__['cmd.run_stdout']
(['mdadm', '--detail', '--scan'],
python_shell=False).splitlines()):
if ' ' not in lin... | [
"def",
"list_",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"(",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"[",
"'mdadm'",
",",
"'--detail'",
",",
"'--scan'",
"]",
",",
"python_shell",
"=",
"False",
")",
".",
"splitlines",
"(",
")"... | List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list | [
"List",
"the",
"RAID",
"devices",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L43-L66 | train |
saltstack/salt | salt/modules/mdadm_raid.py | detail | def detail(device='/dev/md0'):
'''
Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0'
'''
ret = {}
ret['members'] = {}
# Lets make sure the device exists before running mdadm
if not os.path.exists(device):
msg... | python | def detail(device='/dev/md0'):
'''
Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0'
'''
ret = {}
ret['members'] = {}
# Lets make sure the device exists before running mdadm
if not os.path.exists(device):
msg... | [
"def",
"detail",
"(",
"device",
"=",
"'/dev/md0'",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'members'",
"]",
"=",
"{",
"}",
"# Lets make sure the device exists before running mdadm",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"device",
")",
":... | Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0' | [
"Show",
"detail",
"for",
"a",
"specified",
"RAID",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L69-L111 | train |
saltstack/salt | salt/modules/mdadm_raid.py | destroy | def destroy(device):
'''
Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0
'''
try:
details = detail(device)
except CommandExecutionError:
return Fal... | python | def destroy(device):
'''
Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0
'''
try:
details = detail(device)
except CommandExecutionError:
return Fal... | [
"def",
"destroy",
"(",
"device",
")",
":",
"try",
":",
"details",
"=",
"detail",
"(",
"device",
")",
"except",
"CommandExecutionError",
":",
"return",
"False",
"stop_cmd",
"=",
"[",
"'mdadm'",
",",
"'--stop'",
",",
"device",
"]",
"zero_cmd",
"=",
"[",
"'... | Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0 | [
"Destroy",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L114-L153 | train |
saltstack/salt | salt/modules/mdadm_raid.py | create | def create(name,
level,
devices,
metadata='default',
test_mode=False,
**kwargs):
'''
Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
... | python | def create(name,
level,
devices,
metadata='default',
test_mode=False,
**kwargs):
'''
Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
... | [
"def",
"create",
"(",
"name",
",",
"level",
",",
"devices",
",",
"metadata",
"=",
"'default'",
",",
"test_mode",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"[",
"]",
"raid_devices",
"=",
"len",
"(",
"devices",
")",
"for",
"key",
... | Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
CLI Examples:
.. code-block:: bash
salt '*' raid.create /dev/md0 level=1 chunk=256 devices="['/dev/xvdd', '/dev/xvde']" test_mode=... | [
"Create",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L174-L259 | train |
saltstack/salt | salt/modules/mdadm_raid.py | save_config | def save_config():
'''
Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. co... | python | def save_config():
'''
Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. co... | [
"def",
"save_config",
"(",
")",
":",
"scan",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'mdadm --detail --scan'",
",",
"python_shell",
"=",
"False",
")",
".",
"splitlines",
"(",
")",
"# Issue with mdadm and ubuntu",
"# REF: http://askubuntu.com/questions/209702/why-i... | Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. code-block:: bash
salt '... | [
"Save",
"RAID",
"configuration",
"to",
"config",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L262-L306 | train |
saltstack/salt | salt/modules/mdadm_raid.py | assemble | def assemble(name,
devices,
test_mode=False,
**kwargs):
'''
Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print ... | python | def assemble(name,
devices,
test_mode=False,
**kwargs):
'''
Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print ... | [
"def",
"assemble",
"(",
"name",
",",
"devices",
",",
"test_mode",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"[",
"]",
"for",
"key",
"in",
"kwargs",
":",
"if",
"not",
"key",
".",
"startswith",
"(",
"'__'",
")",
":",
"opts",
"."... | Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print out the mdadm
command that would have been run.
name
The name of the array to assemble... | [
"Assemble",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L309-L360 | train |
saltstack/salt | salt/modules/mdadm_raid.py | examine | def examine(device, quiet=False):
'''
Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev... | python | def examine(device, quiet=False):
'''
Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev... | [
"def",
"examine",
"(",
"device",
",",
"quiet",
"=",
"False",
")",
":",
"res",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"'mdadm -Y -E {0}'",
".",
"format",
"(",
"device",
")",
",",
"python_shell",
"=",
"False",
",",
"ignore_retcode",
"=",
"quiet"... | Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev/sda1' | [
"Show",
"detail",
"for",
"a",
"specified",
"RAID",
"component",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L363-L387 | train |
saltstack/salt | salt/modules/mdadm_raid.py | add | def add(name, device):
'''
Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1
'''
cmd = 'mdadm --manage {0} --add {1}'.format(name, device)
if __salt__['cmd.retcode'](cmd) == 0:
return True
return False | python | def add(name, device):
'''
Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1
'''
cmd = 'mdadm --manage {0} --add {1}'.format(name, device)
if __salt__['cmd.retcode'](cmd) == 0:
return True
return False | [
"def",
"add",
"(",
"name",
",",
"device",
")",
":",
"cmd",
"=",
"'mdadm --manage {0} --add {1}'",
".",
"format",
"(",
"name",
",",
"device",
")",
"if",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"(",
"cmd",
")",
"==",
"0",
":",
"return",
"True",
"return",
... | Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1 | [
"Add",
"new",
"device",
"to",
"RAID",
"array",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L390-L405 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | exists | def exists(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt... | python | def exists(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt... | [
"def",
"exists",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.exists mydomain | [
"Given",
"a",
"domain",
"name",
"check",
"to",
"see",
"if",
"the",
"given",
"domain",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L127-L150 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | status | def status(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain
'''
conn ... | python | def status(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain
'''
conn ... | [
"def",
"status",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain | [
"Given",
"a",
"domain",
"name",
"describe",
"its",
"status",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L153-L181 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | describe | def describe(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.describe mydomain
'''
... | python | def describe(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.describe mydomain
'''
... | [
"def",
"describe",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | Given a domain name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.describe mydomain | [
"Given",
"a",
"domain",
"name",
"describe",
"its",
"properties",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L184-L210 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | create | def create(DomainName, ElasticsearchClusterConfig=None, EBSOptions=None,
AccessPolicies=None, SnapshotOptions=None, AdvancedOptions=None,
region=None, key=None, keyid=None, profile=None,
ElasticsearchVersion=None):
'''
Given a valid config, create a domain.
Returns {created... | python | def create(DomainName, ElasticsearchClusterConfig=None, EBSOptions=None,
AccessPolicies=None, SnapshotOptions=None, AdvancedOptions=None,
region=None, key=None, keyid=None, profile=None,
ElasticsearchVersion=None):
'''
Given a valid config, create a domain.
Returns {created... | [
"def",
"create",
"(",
"DomainName",
",",
"ElasticsearchClusterConfig",
"=",
"None",
",",
"EBSOptions",
"=",
"None",
",",
"AccessPolicies",
"=",
"None",
",",
"SnapshotOptions",
"=",
"None",
",",
"AdvancedOptions",
"=",
"None",
",",
"region",
"=",
"None",
",",
... | Given a valid config, create a domain.
Returns {created: true} if the domain was created and returns
{created: False} if the domain was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.create mydomain \\
{'InstanceType': 't2.micro.elasticse... | [
"Given",
"a",
"valid",
"config",
"create",
"a",
"domain",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L213-L264 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | delete | def delete(DomainName, region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, delete it.
Returns {deleted: true} if the domain was deleted and returns
{deleted: false} if the domain was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearc... | python | def delete(DomainName, region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, delete it.
Returns {deleted: true} if the domain was deleted and returns
{deleted: false} if the domain was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearc... | [
"def",
"delete",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
... | Given a domain name, delete it.
Returns {deleted: true} if the domain was deleted and returns
{deleted: false} if the domain was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.delete mydomain | [
"Given",
"a",
"domain",
"name",
"delete",
"it",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L267-L287 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | add_tags | def add_tags(DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a domain
Returns {tagged: true} if the domain was tagged and returns
{tagged: False} if the domain was not tagged.
CLI Example:
.. code-block:: bash
salt mym... | python | def add_tags(DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a domain
Returns {tagged: true} if the domain was tagged and returns
{tagged: False} if the domain was not tagged.
CLI Example:
.. code-block:: bash
salt mym... | [
"def",
"add_tags",
"(",
"DomainName",
"=",
"None",
",",
"ARN",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"conn",
"=",
... | Add tags to a domain
Returns {tagged: true} if the domain was tagged and returns
{tagged: False} if the domain was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.add_tags mydomain tag_a=tag_value tag_b=tag_value | [
"Add",
"tags",
"to",
"a",
"domain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L340-L380 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | remove_tags | def remove_tags(TagKeys, DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None):
'''
Remove tags from a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt... | python | def remove_tags(TagKeys, DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None):
'''
Remove tags from a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt... | [
"def",
"remove_tags",
"(",
"TagKeys",
",",
"DomainName",
"=",
"None",
",",
"ARN",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_con... | Remove tags from a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.remove_tags my_trail tag_a=tag_value tag_b=tag_value | [
"Remove",
"tags",
"from",
"a",
"trail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L383-L419 | train |
saltstack/salt | salt/modules/boto_elasticsearch_domain.py | list_tags | def list_tags(DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None):
'''
List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail
'''
try:
... | python | def list_tags(DomainName=None, ARN=None,
region=None, key=None, keyid=None, profile=None):
'''
List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail
'''
try:
... | [
"def",
"list_tags",
"(",
"DomainName",
"=",
"None",
",",
"ARN",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",... | List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail | [
"List",
"tags",
"of",
"a",
"trail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L422-L464 | train |
saltstack/salt | salt/states/neutron_secgroup.py | present | def present(name, auth=None, **kwargs):
'''
Ensure a security group exists.
You can supply either project_name or project_id.
Creating a default security group will not show up as a change;
it gets created through the lookup process.
name
Name of the security group
description
... | python | def present(name, auth=None, **kwargs):
'''
Ensure a security group exists.
You can supply either project_name or project_id.
Creating a default security group will not show up as a change;
it gets created through the lookup process.
name
Name of the security group
description
... | [
"def",
"present",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
... | Ensure a security group exists.
You can supply either project_name or project_id.
Creating a default security group will not show up as a change;
it gets created through the lookup process.
name
Name of the security group
description
Description of the security group
project... | [
"Ensure",
"a",
"security",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_secgroup.py#L50-L120 | train |
saltstack/salt | salt/states/neutron_secgroup.py | absent | def absent(name, auth=None, **kwargs):
'''
Ensure a security group does not exist
name
Name of the security group
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs'](**kwargs)
__salt__['ne... | python | def absent(name, auth=None, **kwargs):
'''
Ensure a security group does not exist
name
Name of the security group
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs'](**kwargs)
__salt__['ne... | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
"... | Ensure a security group does not exist
name
Name of the security group | [
"Ensure",
"a",
"security",
"group",
"does",
"not",
"exist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_secgroup.py#L123-L159 | train |
saltstack/salt | salt/modules/logrotate.py | _parse_conf | def _parse_conf(conf_file=_DEFAULT_CONF):
'''
Parse a logrotate configuration file.
Includes will also be parsed, and their configuration will be stored in the
return dict, as if they were part of the main config file. A dict of which
configs came from which includes will be stored in the 'include ... | python | def _parse_conf(conf_file=_DEFAULT_CONF):
'''
Parse a logrotate configuration file.
Includes will also be parsed, and their configuration will be stored in the
return dict, as if they were part of the main config file. A dict of which
configs came from which includes will be stored in the 'include ... | [
"def",
"_parse_conf",
"(",
"conf_file",
"=",
"_DEFAULT_CONF",
")",
":",
"ret",
"=",
"{",
"}",
"mode",
"=",
"'single'",
"multi_names",
"=",
"[",
"]",
"multi",
"=",
"{",
"}",
"prev_comps",
"=",
"None",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"... | Parse a logrotate configuration file.
Includes will also be parsed, and their configuration will be stored in the
return dict, as if they were part of the main config file. A dict of which
configs came from which includes will be stored in the 'include files' dict
inside the return dict, for later refe... | [
"Parse",
"a",
"logrotate",
"configuration",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/logrotate.py#L57-L123 | train |
saltstack/salt | salt/modules/logrotate.py | get | def get(key, value=None, conf_file=_DEFAULT_CONF):
'''
Get the value for a specific configuration line.
:param str key: The command or stanza block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str conf_file: The logrotate configura... | python | def get(key, value=None, conf_file=_DEFAULT_CONF):
'''
Get the value for a specific configuration line.
:param str key: The command or stanza block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str conf_file: The logrotate configura... | [
"def",
"get",
"(",
"key",
",",
"value",
"=",
"None",
",",
"conf_file",
"=",
"_DEFAULT_CONF",
")",
":",
"current_conf",
"=",
"_parse_conf",
"(",
"conf_file",
")",
"stanza",
"=",
"current_conf",
".",
"get",
"(",
"key",
",",
"False",
")",
"if",
"value",
"... | Get the value for a specific configuration line.
:param str key: The command or stanza block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str conf_file: The logrotate configuration file.
:return: The value for a specific configuration... | [
"Get",
"the",
"value",
"for",
"a",
"specific",
"configuration",
"line",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/logrotate.py#L144-L170 | train |
saltstack/salt | salt/modules/logrotate.py | set_ | def set_(key, value, setting=None, conf_file=_DEFAULT_CONF):
'''
Set a new value for a specific configuration line.
:param str key: The command or block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str setting: The command value fo... | python | def set_(key, value, setting=None, conf_file=_DEFAULT_CONF):
'''
Set a new value for a specific configuration line.
:param str key: The command or block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str setting: The command value fo... | [
"def",
"set_",
"(",
"key",
",",
"value",
",",
"setting",
"=",
"None",
",",
"conf_file",
"=",
"_DEFAULT_CONF",
")",
":",
"conf",
"=",
"_parse_conf",
"(",
"conf_file",
")",
"for",
"include",
"in",
"conf",
"[",
"'include files'",
"]",
":",
"if",
"key",
"i... | Set a new value for a specific configuration line.
:param str key: The command or block to configure.
:param str value: The command value or command of the block specified by the key parameter.
:param str setting: The command value for the command specified by the value parameter.
:param str conf_file:... | [
"Set",
"a",
"new",
"value",
"for",
"a",
"specific",
"configuration",
"line",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/logrotate.py#L173-L273 | train |
saltstack/salt | salt/modules/logrotate.py | _dict_to_stanza | def _dict_to_stanza(key, stanza):
'''
Convert a dict to a multi-line stanza
'''
ret = ''
for skey in stanza:
if stanza[skey] is True:
stanza[skey] = ''
ret += ' {0} {1}\n'.format(skey, stanza[skey])
return '{0} {{\n{1}}}'.format(key, ret) | python | def _dict_to_stanza(key, stanza):
'''
Convert a dict to a multi-line stanza
'''
ret = ''
for skey in stanza:
if stanza[skey] is True:
stanza[skey] = ''
ret += ' {0} {1}\n'.format(skey, stanza[skey])
return '{0} {{\n{1}}}'.format(key, ret) | [
"def",
"_dict_to_stanza",
"(",
"key",
",",
"stanza",
")",
":",
"ret",
"=",
"''",
"for",
"skey",
"in",
"stanza",
":",
"if",
"stanza",
"[",
"skey",
"]",
"is",
"True",
":",
"stanza",
"[",
"skey",
"]",
"=",
"''",
"ret",
"+=",
"' {0} {1}\\n'",
".",
"... | Convert a dict to a multi-line stanza | [
"Convert",
"a",
"dict",
"to",
"a",
"multi",
"-",
"line",
"stanza"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/logrotate.py#L276-L285 | train |
saltstack/salt | salt/states/zk_concurrency.py | lock | def lock(name,
zk_hosts=None,
identifier=None,
max_concurrency=1,
timeout=None,
ephemeral_lease=False,
profile=None,
scheme=None,
username=None,
password=None,
default_acl=None):
'''
Block state execution until you are abl... | python | def lock(name,
zk_hosts=None,
identifier=None,
max_concurrency=1,
timeout=None,
ephemeral_lease=False,
profile=None,
scheme=None,
username=None,
password=None,
default_acl=None):
'''
Block state execution until you are abl... | [
"def",
"lock",
"(",
"name",
",",
"zk_hosts",
"=",
"None",
",",
"identifier",
"=",
"None",
",",
"max_concurrency",
"=",
"1",
",",
"timeout",
"=",
"None",
",",
"ephemeral_lease",
"=",
"False",
",",
"profile",
"=",
"None",
",",
"scheme",
"=",
"None",
",",... | Block state execution until you are able to get the lock (or hit the timeout) | [
"Block",
"state",
"execution",
"until",
"you",
"are",
"able",
"to",
"get",
"the",
"lock",
"(",
"or",
"hit",
"the",
"timeout",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zk_concurrency.py#L69-L112 | train |
saltstack/salt | salt/states/zk_concurrency.py | unlock | def unlock(name,
zk_hosts=None, # in case you need to unlock without having run lock (failed execution for example)
identifier=None,
max_concurrency=1,
ephemeral_lease=False,
profile=None,
scheme=None,
username=None,
password=None,... | python | def unlock(name,
zk_hosts=None, # in case you need to unlock without having run lock (failed execution for example)
identifier=None,
max_concurrency=1,
ephemeral_lease=False,
profile=None,
scheme=None,
username=None,
password=None,... | [
"def",
"unlock",
"(",
"name",
",",
"zk_hosts",
"=",
"None",
",",
"# in case you need to unlock without having run lock (failed execution for example)",
"identifier",
"=",
"None",
",",
"max_concurrency",
"=",
"1",
",",
"ephemeral_lease",
"=",
"False",
",",
"profile",
"="... | Remove lease from semaphore. | [
"Remove",
"lease",
"from",
"semaphore",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zk_concurrency.py#L115-L155 | train |
saltstack/salt | salt/states/zk_concurrency.py | min_party | def min_party(name,
zk_hosts,
min_nodes,
blocking=False,
profile=None,
scheme=None,
username=None,
password=None,
default_acl=None):
'''
Ensure that there are `min_nodes` in the party at `name`, optio... | python | def min_party(name,
zk_hosts,
min_nodes,
blocking=False,
profile=None,
scheme=None,
username=None,
password=None,
default_acl=None):
'''
Ensure that there are `min_nodes` in the party at `name`, optio... | [
"def",
"min_party",
"(",
"name",
",",
"zk_hosts",
",",
"min_nodes",
",",
"blocking",
"=",
"False",
",",
"profile",
"=",
"None",
",",
"scheme",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"default_acl",
"=",
"None",
")"... | Ensure that there are `min_nodes` in the party at `name`, optionally blocking if not available. | [
"Ensure",
"that",
"there",
"are",
"min_nodes",
"in",
"the",
"party",
"at",
"name",
"optionally",
"blocking",
"if",
"not",
"available",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zk_concurrency.py#L158-L198 | train |
saltstack/salt | salt/modules/nxos_api.py | _cli_command | def _cli_command(commands,
method='cli',
**kwargs):
'''
Execute a list of CLI commands.
'''
if not isinstance(commands, (list, tuple)):
commands = [commands]
rpc_responses = rpc(commands,
method=method,
**kwarg... | python | def _cli_command(commands,
method='cli',
**kwargs):
'''
Execute a list of CLI commands.
'''
if not isinstance(commands, (list, tuple)):
commands = [commands]
rpc_responses = rpc(commands,
method=method,
**kwarg... | [
"def",
"_cli_command",
"(",
"commands",
",",
"method",
"=",
"'cli'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"commands",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"commands",
"=",
"[",
"commands",
"]",
"rpc_responses",
... | Execute a list of CLI commands. | [
"Execute",
"a",
"list",
"of",
"CLI",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos_api.py#L171-L194 | train |
saltstack/salt | salt/modules/nxos_api.py | rpc | def rpc(commands,
method='cli',
**kwargs):
'''
Execute an arbitrary RPC request via the Nexus API.
commands
The commands to be executed.
method: ``cli``
The type of the response, i.e., raw text (``cli_ascii``) or structured
document (``cli``). Defaults to ``cli`... | python | def rpc(commands,
method='cli',
**kwargs):
'''
Execute an arbitrary RPC request via the Nexus API.
commands
The commands to be executed.
method: ``cli``
The type of the response, i.e., raw text (``cli_ascii``) or structured
document (``cli``). Defaults to ``cli`... | [
"def",
"rpc",
"(",
"commands",
",",
"method",
"=",
"'cli'",
",",
"*",
"*",
"kwargs",
")",
":",
"nxos_api_kwargs",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'nxos_api'",
",",
"{",
"}",
")",
"nxos_api_kwargs",
".",
"update",
"(",
"*",
"*",
"kwargs... | Execute an arbitrary RPC request via the Nexus API.
commands
The commands to be executed.
method: ``cli``
The type of the response, i.e., raw text (``cli_ascii``) or structured
document (``cli``). Defaults to ``cli`` (structured data).
transport: ``https``
Specifies the ty... | [
"Execute",
"an",
"arbitrary",
"RPC",
"request",
"via",
"the",
"Nexus",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos_api.py#L201-L254 | train |
saltstack/salt | salt/modules/nxos_api.py | show | def show(commands,
raw_text=True,
**kwargs):
'''
Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
transport: ``https``
Specifies the type of conn... | python | def show(commands,
raw_text=True,
**kwargs):
'''
Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
transport: ``https``
Specifies the type of conn... | [
"def",
"show",
"(",
"commands",
",",
"raw_text",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"[",
"]",
"if",
"raw_text",
":",
"method",
"=",
"'cli_ascii'",
"key",
"=",
"'msg'",
"else",
":",
"method",
"=",
"'cli'",
"key",
"=",
"'body... | Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
transport: ``https``
Specifies the type of connection transport to use. Valid values for the
connection are ``http... | [
"Execute",
"one",
"or",
"more",
"show",
"(",
"non",
"-",
"configuration",
")",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos_api.py#L257-L314 | train |
saltstack/salt | salt/modules/nxos_api.py | config | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to t... | python | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to t... | [
"def",
"config",
"(",
"commands",
"=",
"None",
",",
"config_file",
"=",
"None",
",",
"template_engine",
"=",
"'jinja'",
",",
"context",
"=",
"None",
",",
"defaults",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"initia... | Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to the switch. It
will take either a string or a list and prepend the necessary commands
to put the session into config mode.
.. warning::
All the commands will be applied directly int... | [
"Configures",
"the",
"Nexus",
"switch",
"with",
"the",
"specified",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos_api.py#L317-L427 | train |
saltstack/salt | salt/utils/aggregation.py | levelise | def levelise(level):
'''
Describe which levels are allowed to do deep merging.
level can be:
True
all levels are True
False
all levels are False
an int
only the first levels are True, the others are False
a sequence
it describes which levels are True, it ... | python | def levelise(level):
'''
Describe which levels are allowed to do deep merging.
level can be:
True
all levels are True
False
all levels are False
an int
only the first levels are True, the others are False
a sequence
it describes which levels are True, it ... | [
"def",
"levelise",
"(",
"level",
")",
":",
"if",
"not",
"level",
":",
"# False, 0, [] ...",
"return",
"False",
",",
"False",
"if",
"level",
"is",
"True",
":",
"return",
"True",
",",
"True",
"if",
"isinstance",
"(",
"level",
",",
"int",
")",
":",
"retur... | Describe which levels are allowed to do deep merging.
level can be:
True
all levels are True
False
all levels are False
an int
only the first levels are True, the others are False
a sequence
it describes which levels are True, it can be:
* a list of bool... | [
"Describe",
"which",
"levels",
"are",
"allowed",
"to",
"do",
"deep",
"merging",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aggregation.py#L151-L185 | train |
saltstack/salt | salt/utils/aggregation.py | mark | def mark(obj, map_class=Map, sequence_class=Sequence):
'''
Convert obj into an Aggregate instance
'''
if isinstance(obj, Aggregate):
return obj
if isinstance(obj, dict):
return map_class(obj)
if isinstance(obj, (list, tuple, set)):
return sequence_class(obj)
else:
... | python | def mark(obj, map_class=Map, sequence_class=Sequence):
'''
Convert obj into an Aggregate instance
'''
if isinstance(obj, Aggregate):
return obj
if isinstance(obj, dict):
return map_class(obj)
if isinstance(obj, (list, tuple, set)):
return sequence_class(obj)
else:
... | [
"def",
"mark",
"(",
"obj",
",",
"map_class",
"=",
"Map",
",",
"sequence_class",
"=",
"Sequence",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"Aggregate",
")",
":",
"return",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
":",
"return",
"... | Convert obj into an Aggregate instance | [
"Convert",
"obj",
"into",
"an",
"Aggregate",
"instance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aggregation.py#L188-L199 | train |
saltstack/salt | salt/utils/aggregation.py | aggregate | def aggregate(obj_a, obj_b, level=False, map_class=Map, sequence_class=Sequence):
'''
Merge obj_b into obj_a.
>>> aggregate('first', 'second', True) == ['first', 'second']
True
'''
deep, subdeep = levelise(level)
if deep:
obj_a = mark(obj_a, map_class=map_class, sequence_class=sequ... | python | def aggregate(obj_a, obj_b, level=False, map_class=Map, sequence_class=Sequence):
'''
Merge obj_b into obj_a.
>>> aggregate('first', 'second', True) == ['first', 'second']
True
'''
deep, subdeep = levelise(level)
if deep:
obj_a = mark(obj_a, map_class=map_class, sequence_class=sequ... | [
"def",
"aggregate",
"(",
"obj_a",
",",
"obj_b",
",",
"level",
"=",
"False",
",",
"map_class",
"=",
"Map",
",",
"sequence_class",
"=",
"Sequence",
")",
":",
"deep",
",",
"subdeep",
"=",
"levelise",
"(",
"level",
")",
"if",
"deep",
":",
"obj_a",
"=",
"... | Merge obj_b into obj_a.
>>> aggregate('first', 'second', True) == ['first', 'second']
True | [
"Merge",
"obj_b",
"into",
"obj_a",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aggregation.py#L202-L244 | train |
saltstack/salt | salt/utils/migrations.py | migrate_paths | def migrate_paths(opts):
'''
Migrate old minion and master pki file paths to new ones.
'''
oldpki_dir = os.path.join(syspaths.CONFIG_DIR, 'pki')
if not os.path.exists(oldpki_dir):
# There's not even a pki directory, don't bother migrating
return
newpki_dir = opts['pki_dir']
... | python | def migrate_paths(opts):
'''
Migrate old minion and master pki file paths to new ones.
'''
oldpki_dir = os.path.join(syspaths.CONFIG_DIR, 'pki')
if not os.path.exists(oldpki_dir):
# There's not even a pki directory, don't bother migrating
return
newpki_dir = opts['pki_dir']
... | [
"def",
"migrate_paths",
"(",
"opts",
")",
":",
"oldpki_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"syspaths",
".",
"CONFIG_DIR",
",",
"'pki'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"oldpki_dir",
")",
":",
"# There's not even a pki... | Migrate old minion and master pki file paths to new ones. | [
"Migrate",
"old",
"minion",
"and",
"master",
"pki",
"file",
"paths",
"to",
"new",
"ones",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/migrations.py#L15-L54 | train |
saltstack/salt | salt/utils/zfs.py | _check_retcode | def _check_retcode(cmd):
'''
Simple internal wrapper for cmdmod.retcode
'''
return salt.modules.cmdmod.retcode(cmd, output_loglevel='quiet', ignore_retcode=True) == 0 | python | def _check_retcode(cmd):
'''
Simple internal wrapper for cmdmod.retcode
'''
return salt.modules.cmdmod.retcode(cmd, output_loglevel='quiet', ignore_retcode=True) == 0 | [
"def",
"_check_retcode",
"(",
"cmd",
")",
":",
"return",
"salt",
".",
"modules",
".",
"cmdmod",
".",
"retcode",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'quiet'",
",",
"ignore_retcode",
"=",
"True",
")",
"==",
"0"
] | Simple internal wrapper for cmdmod.retcode | [
"Simple",
"internal",
"wrapper",
"for",
"cmdmod",
".",
"retcode"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L40-L44 | train |
saltstack/salt | salt/utils/zfs.py | _exec | def _exec(**kwargs):
'''
Simple internal wrapper for cmdmod.run
'''
if 'ignore_retcode' not in kwargs:
kwargs['ignore_retcode'] = True
if 'output_loglevel' not in kwargs:
kwargs['output_loglevel'] = 'quiet'
return salt.modules.cmdmod.run_all(**kwargs) | python | def _exec(**kwargs):
'''
Simple internal wrapper for cmdmod.run
'''
if 'ignore_retcode' not in kwargs:
kwargs['ignore_retcode'] = True
if 'output_loglevel' not in kwargs:
kwargs['output_loglevel'] = 'quiet'
return salt.modules.cmdmod.run_all(**kwargs) | [
"def",
"_exec",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"'ignore_retcode'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'ignore_retcode'",
"]",
"=",
"True",
"if",
"'output_loglevel'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'output_loglevel'",
"]",
"=... | Simple internal wrapper for cmdmod.run | [
"Simple",
"internal",
"wrapper",
"for",
"cmdmod",
".",
"run"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L47-L55 | train |
saltstack/salt | salt/utils/zfs.py | _merge_last | def _merge_last(values, merge_after, merge_with=' '):
'''
Merge values all values after X into the last value
'''
if len(values) > merge_after:
values = values[0:(merge_after-1)] + [merge_with.join(values[(merge_after-1):])]
return values | python | def _merge_last(values, merge_after, merge_with=' '):
'''
Merge values all values after X into the last value
'''
if len(values) > merge_after:
values = values[0:(merge_after-1)] + [merge_with.join(values[(merge_after-1):])]
return values | [
"def",
"_merge_last",
"(",
"values",
",",
"merge_after",
",",
"merge_with",
"=",
"' '",
")",
":",
"if",
"len",
"(",
"values",
")",
">",
"merge_after",
":",
"values",
"=",
"values",
"[",
"0",
":",
"(",
"merge_after",
"-",
"1",
")",
"]",
"+",
"[",
"m... | Merge values all values after X into the last value | [
"Merge",
"values",
"all",
"values",
"after",
"X",
"into",
"the",
"last",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L58-L65 | train |
saltstack/salt | salt/utils/zfs.py | _property_detect_type | def _property_detect_type(name, values):
'''
Detect the datatype of a property
'''
value_type = 'str'
if values.startswith('on | off'):
value_type = 'bool'
elif values.startswith('yes | no'):
value_type = 'bool_alt'
elif values in ['<size>', '<size> | none']:
value_ty... | python | def _property_detect_type(name, values):
'''
Detect the datatype of a property
'''
value_type = 'str'
if values.startswith('on | off'):
value_type = 'bool'
elif values.startswith('yes | no'):
value_type = 'bool_alt'
elif values in ['<size>', '<size> | none']:
value_ty... | [
"def",
"_property_detect_type",
"(",
"name",
",",
"values",
")",
":",
"value_type",
"=",
"'str'",
"if",
"values",
".",
"startswith",
"(",
"'on | off'",
")",
":",
"value_type",
"=",
"'bool'",
"elif",
"values",
".",
"startswith",
"(",
"'yes | no'",
")",
":",
... | Detect the datatype of a property | [
"Detect",
"the",
"datatype",
"of",
"a",
"property"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L77-L94 | train |
saltstack/salt | salt/utils/zfs.py | _property_create_dict | def _property_create_dict(header, data):
'''
Create a property dict
'''
prop = dict(zip(header, _merge_last(data, len(header))))
prop['name'] = _property_normalize_name(prop['property'])
prop['type'] = _property_detect_type(prop['name'], prop['values'])
prop['edit'] = from_bool(prop['edit'])... | python | def _property_create_dict(header, data):
'''
Create a property dict
'''
prop = dict(zip(header, _merge_last(data, len(header))))
prop['name'] = _property_normalize_name(prop['property'])
prop['type'] = _property_detect_type(prop['name'], prop['values'])
prop['edit'] = from_bool(prop['edit'])... | [
"def",
"_property_create_dict",
"(",
"header",
",",
"data",
")",
":",
"prop",
"=",
"dict",
"(",
"zip",
"(",
"header",
",",
"_merge_last",
"(",
"data",
",",
"len",
"(",
"header",
")",
")",
")",
")",
"prop",
"[",
"'name'",
"]",
"=",
"_property_normalize_... | Create a property dict | [
"Create",
"a",
"property",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L97-L108 | train |
saltstack/salt | salt/utils/zfs.py | _property_parse_cmd | def _property_parse_cmd(cmd, alias=None):
'''
Parse output of zpool/zfs get command
'''
if not alias:
alias = {}
properties = {}
# NOTE: append get to command
if cmd[-3:] != 'get':
cmd += ' get'
# NOTE: parse output
prop_hdr = []
for prop_data in _exec(cmd=cmd)[... | python | def _property_parse_cmd(cmd, alias=None):
'''
Parse output of zpool/zfs get command
'''
if not alias:
alias = {}
properties = {}
# NOTE: append get to command
if cmd[-3:] != 'get':
cmd += ' get'
# NOTE: parse output
prop_hdr = []
for prop_data in _exec(cmd=cmd)[... | [
"def",
"_property_parse_cmd",
"(",
"cmd",
",",
"alias",
"=",
"None",
")",
":",
"if",
"not",
"alias",
":",
"alias",
"=",
"{",
"}",
"properties",
"=",
"{",
"}",
"# NOTE: append get to command",
"if",
"cmd",
"[",
"-",
"3",
":",
"]",
"!=",
"'get'",
":",
... | Parse output of zpool/zfs get command | [
"Parse",
"output",
"of",
"zpool",
"/",
"zfs",
"get",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L111-L150 | train |
saltstack/salt | salt/utils/zfs.py | _auto | def _auto(direction, name, value, source='auto', convert_to_human=True):
'''
Internal magic for from_auto and to_auto
'''
# NOTE: check direction
if direction not in ['to', 'from']:
return value
# NOTE: collect property data
props = property_data_zpool()
if source == 'zfs':
... | python | def _auto(direction, name, value, source='auto', convert_to_human=True):
'''
Internal magic for from_auto and to_auto
'''
# NOTE: check direction
if direction not in ['to', 'from']:
return value
# NOTE: collect property data
props = property_data_zpool()
if source == 'zfs':
... | [
"def",
"_auto",
"(",
"direction",
",",
"name",
",",
"value",
",",
"source",
"=",
"'auto'",
",",
"convert_to_human",
"=",
"True",
")",
":",
"# NOTE: check direction",
"if",
"direction",
"not",
"in",
"[",
"'to'",
",",
"'from'",
"]",
":",
"return",
"value",
... | Internal magic for from_auto and to_auto | [
"Internal",
"magic",
"for",
"from_auto",
"and",
"to_auto"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L153-L175 | train |
saltstack/salt | salt/utils/zfs.py | _command | def _command(source, command, flags=None, opts=None,
property_name=None, property_value=None,
filesystem_properties=None, pool_properties=None,
target=None):
'''
Build and properly escape a zfs command
.. note::
Input is not considered safe and will be passed... | python | def _command(source, command, flags=None, opts=None,
property_name=None, property_value=None,
filesystem_properties=None, pool_properties=None,
target=None):
'''
Build and properly escape a zfs command
.. note::
Input is not considered safe and will be passed... | [
"def",
"_command",
"(",
"source",
",",
"command",
",",
"flags",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"property_name",
"=",
"None",
",",
"property_value",
"=",
"None",
",",
"filesystem_properties",
"=",
"None",
",",
"pool_properties",
"=",
"None",
",... | Build and properly escape a zfs command
.. note::
Input is not considered safe and will be passed through
to_auto(from_auto('input_here')), you do not need to do so
your self first. | [
"Build",
"and",
"properly",
"escape",
"a",
"zfs",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L196-L279 | train |
saltstack/salt | salt/utils/zfs.py | is_supported | def is_supported():
'''
Check the system for ZFS support
'''
# Check for supported platforms
# NOTE: ZFS on Windows is in development
# NOTE: ZFS on NetBSD is in development
on_supported_platform = False
if salt.utils.platform.is_sunos():
on_supported_platform = True
elif sal... | python | def is_supported():
'''
Check the system for ZFS support
'''
# Check for supported platforms
# NOTE: ZFS on Windows is in development
# NOTE: ZFS on NetBSD is in development
on_supported_platform = False
if salt.utils.platform.is_sunos():
on_supported_platform = True
elif sal... | [
"def",
"is_supported",
"(",
")",
":",
"# Check for supported platforms",
"# NOTE: ZFS on Windows is in development",
"# NOTE: ZFS on NetBSD is in development",
"on_supported_platform",
"=",
"False",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_sunos",
"(",
")",
":"... | Check the system for ZFS support | [
"Check",
"the",
"system",
"for",
"ZFS",
"support"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L282-L304 | train |
saltstack/salt | salt/utils/zfs.py | has_feature_flags | def has_feature_flags():
'''
Check if zpool-features is available
'''
# get man location
man = salt.utils.path.which('man')
return _check_retcode('{man} zpool-features'.format(
man=man
)) if man else False | python | def has_feature_flags():
'''
Check if zpool-features is available
'''
# get man location
man = salt.utils.path.which('man')
return _check_retcode('{man} zpool-features'.format(
man=man
)) if man else False | [
"def",
"has_feature_flags",
"(",
")",
":",
"# get man location",
"man",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'man'",
")",
"return",
"_check_retcode",
"(",
"'{man} zpool-features'",
".",
"format",
"(",
"man",
"=",
"man",
")",
")",
"if... | Check if zpool-features is available | [
"Check",
"if",
"zpool",
"-",
"features",
"is",
"available"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L308-L316 | train |
saltstack/salt | salt/utils/zfs.py | property_data_zpool | def property_data_zpool():
'''
Return a dict of zpool properties
.. note::
Each property will have an entry with the following info:
- edit : boolean - is this property editable after pool creation
- type : str - either bool, bool_alt, size, numeric, or string
-... | python | def property_data_zpool():
'''
Return a dict of zpool properties
.. note::
Each property will have an entry with the following info:
- edit : boolean - is this property editable after pool creation
- type : str - either bool, bool_alt, size, numeric, or string
-... | [
"def",
"property_data_zpool",
"(",
")",
":",
"# NOTE: man page also mentions a few short forms",
"property_data",
"=",
"_property_parse_cmd",
"(",
"_zpool_cmd",
"(",
")",
",",
"{",
"'allocated'",
":",
"'alloc'",
",",
"'autoexpand'",
":",
"'expand'",
",",
"'autoreplace'"... | Return a dict of zpool properties
.. note::
Each property will have an entry with the following info:
- edit : boolean - is this property editable after pool creation
- type : str - either bool, bool_alt, size, numeric, or string
- values : str - list of possible values... | [
"Return",
"a",
"dict",
"of",
"zpool",
"properties"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/zfs.py#L320-L372 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.