repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/bcache.py | _sizes | def _sizes(dev):
'''
Return neigh useless sizing info about a blockdev
:return: (total size in blocks, blocksize, maximum discard size in bytes)
'''
dev = _devbase(dev)
# standarization yay
block_sizes = ('hw_sector_size', 'minimum_io_size', 'physical_block_size', 'logical_block_size')
... | python | def _sizes(dev):
'''
Return neigh useless sizing info about a blockdev
:return: (total size in blocks, blocksize, maximum discard size in bytes)
'''
dev = _devbase(dev)
# standarization yay
block_sizes = ('hw_sector_size', 'minimum_io_size', 'physical_block_size', 'logical_block_size')
... | [
"def",
"_sizes",
"(",
"dev",
")",
":",
"dev",
"=",
"_devbase",
"(",
"dev",
")",
"# standarization yay",
"block_sizes",
"=",
"(",
"'hw_sector_size'",
",",
"'minimum_io_size'",
",",
"'physical_block_size'",
",",
"'logical_block_size'",
")",
"discard_sizes",
"=",
"("... | Return neigh useless sizing info about a blockdev
:return: (total size in blocks, blocksize, maximum discard size in bytes) | [
"Return",
"neigh",
"useless",
"sizing",
"info",
"about",
"a",
"blockdev",
":",
"return",
":",
"(",
"total",
"size",
"in",
"blocks",
"blocksize",
"maximum",
"discard",
"size",
"in",
"bytes",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L847-L878 | train | Return neigh useless sizing info about a blockdev
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/bcache.py | _wipe | def _wipe(dev):
'''
REALLY DESTRUCTIVE STUFF RIGHT AHEAD
'''
endres = 0
dev = _devbase(dev)
size, block, discard = _sizes(dev)
if discard is None:
log.error('Unable to read SysFS props for %s', dev)
return None
elif not discard:
log.warning('%s seems unable to d... | python | def _wipe(dev):
'''
REALLY DESTRUCTIVE STUFF RIGHT AHEAD
'''
endres = 0
dev = _devbase(dev)
size, block, discard = _sizes(dev)
if discard is None:
log.error('Unable to read SysFS props for %s', dev)
return None
elif not discard:
log.warning('%s seems unable to d... | [
"def",
"_wipe",
"(",
"dev",
")",
":",
"endres",
"=",
"0",
"dev",
"=",
"_devbase",
"(",
"dev",
")",
"size",
",",
"block",
",",
"discard",
"=",
"_sizes",
"(",
"dev",
")",
"if",
"discard",
"is",
"None",
":",
"log",
".",
"error",
"(",
"'Unable to read ... | REALLY DESTRUCTIVE STUFF RIGHT AHEAD | [
"REALLY",
"DESTRUCTIVE",
"STUFF",
"RIGHT",
"AHEAD"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L881-L918 | train | Wipe the node from SysFS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/bcache.py | _wait | def _wait(lfunc, log_lvl=None, log_msg=None, tries=10):
'''
Wait for lfunc to be True
:return: True if lfunc succeeded within tries, False if it didn't
'''
i = 0
while i < tries:
time.sleep(1)
if lfunc():
return True
else:
i += 1
if log_lvl is... | python | def _wait(lfunc, log_lvl=None, log_msg=None, tries=10):
'''
Wait for lfunc to be True
:return: True if lfunc succeeded within tries, False if it didn't
'''
i = 0
while i < tries:
time.sleep(1)
if lfunc():
return True
else:
i += 1
if log_lvl is... | [
"def",
"_wait",
"(",
"lfunc",
",",
"log_lvl",
"=",
"None",
",",
"log_msg",
"=",
"None",
",",
"tries",
"=",
"10",
")",
":",
"i",
"=",
"0",
"while",
"i",
"<",
"tries",
":",
"time",
".",
"sleep",
"(",
"1",
")",
"if",
"lfunc",
"(",
")",
":",
"ret... | Wait for lfunc to be True
:return: True if lfunc succeeded within tries, False if it didn't | [
"Wait",
"for",
"lfunc",
"to",
"be",
"True",
":",
"return",
":",
"True",
"if",
"lfunc",
"succeeded",
"within",
"tries",
"False",
"if",
"it",
"didn",
"t"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L921-L936 | train | Wait for a function to be True and return False if it didn t. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/bcache.py | _run_all | def _run_all(cmd, log_lvl=None, log_msg=None, exitcode=0):
'''
Simple wrapper around cmd.run_all
log_msg can contain {0} for stderr
:return: True or stdout, False if retcode wasn't exitcode
'''
res = __salt__['cmd.run_all'](cmd)
if res['retcode'] == exitcode:
if res['stdout']:
... | python | def _run_all(cmd, log_lvl=None, log_msg=None, exitcode=0):
'''
Simple wrapper around cmd.run_all
log_msg can contain {0} for stderr
:return: True or stdout, False if retcode wasn't exitcode
'''
res = __salt__['cmd.run_all'](cmd)
if res['retcode'] == exitcode:
if res['stdout']:
... | [
"def",
"_run_all",
"(",
"cmd",
",",
"log_lvl",
"=",
"None",
",",
"log_msg",
"=",
"None",
",",
"exitcode",
"=",
"0",
")",
":",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"if",
"res",
"[",
"'retcode'",
"]",
"==",
"exitcode",
... | Simple wrapper around cmd.run_all
log_msg can contain {0} for stderr
:return: True or stdout, False if retcode wasn't exitcode | [
"Simple",
"wrapper",
"around",
"cmd",
".",
"run_all",
"log_msg",
"can",
"contain",
"{",
"0",
"}",
"for",
"stderr",
":",
"return",
":",
"True",
"or",
"stdout",
"False",
"if",
"retcode",
"wasn",
"t",
"exitcode"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L939-L954 | train | Wrapper around cmd. run_all returning True or stdout False if retcode was not exitcode | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/salt_version.py | get_release_number | def get_release_number(name):
'''
Returns the release number of a given release code name in a
``<year>.<month>`` context.
If the release name has not been given an assigned release number, the
function returns a string. If the release cannot be found, it returns
``None``.
name
The... | python | def get_release_number(name):
'''
Returns the release number of a given release code name in a
``<year>.<month>`` context.
If the release name has not been given an assigned release number, the
function returns a string. If the release cannot be found, it returns
``None``.
name
The... | [
"def",
"get_release_number",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"lower",
"(",
")",
"version_map",
"=",
"salt",
".",
"version",
".",
"SaltStackVersion",
".",
"LNAMES",
"version",
"=",
"version_map",
".",
"get",
"(",
"name",
")",
"if",
"versi... | Returns the release number of a given release code name in a
``<year>.<month>`` context.
If the release name has not been given an assigned release number, the
function returns a string. If the release cannot be found, it returns
``None``.
name
The release codename for which to find a rele... | [
"Returns",
"the",
"release",
"number",
"of",
"a",
"given",
"release",
"code",
"name",
"in",
"a",
"<year",
">",
".",
"<month",
">",
"context",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_version.py#L56-L85 | train | Returns the release number of a given release code name in a base context. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/salt_version.py | _check_release_cmp | def _check_release_cmp(name):
'''
Helper function to compare release codename versions to the minion's current
Salt version.
If release codename isn't found, the function returns None. Otherwise, it
returns the results of the version comparison as documented by the
``versions_cmp`` function in ... | python | def _check_release_cmp(name):
'''
Helper function to compare release codename versions to the minion's current
Salt version.
If release codename isn't found, the function returns None. Otherwise, it
returns the results of the version comparison as documented by the
``versions_cmp`` function in ... | [
"def",
"_check_release_cmp",
"(",
"name",
")",
":",
"map_version",
"=",
"get_release_number",
"(",
"name",
")",
"if",
"map_version",
"is",
"None",
":",
"log",
".",
"info",
"(",
"'Release codename %s was not found.'",
",",
"name",
")",
"return",
"None",
"current_... | Helper function to compare release codename versions to the minion's current
Salt version.
If release codename isn't found, the function returns None. Otherwise, it
returns the results of the version comparison as documented by the
``versions_cmp`` function in ``salt.utils.versions.py``. | [
"Helper",
"function",
"to",
"compare",
"release",
"codename",
"versions",
"to",
"the",
"minion",
"s",
"current",
"Salt",
"version",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_version.py#L151-L170 | train | Helper function to compare release codename versions to the current salt s current
Salt version. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | install | def install(runas=None, path=None):
'''
Install rbenv systemwide
CLI Example:
.. code-block:: bash
salt '*' rbenv.install
'''
path = path or _rbenv_path(runas)
path = os.path.expanduser(path)
return _install_rbenv(path, runas) and _install_ruby_build(path, runas) | python | def install(runas=None, path=None):
'''
Install rbenv systemwide
CLI Example:
.. code-block:: bash
salt '*' rbenv.install
'''
path = path or _rbenv_path(runas)
path = os.path.expanduser(path)
return _install_rbenv(path, runas) and _install_ruby_build(path, runas) | [
"def",
"install",
"(",
"runas",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"path",
"=",
"path",
"or",
"_rbenv_path",
"(",
"runas",
")",
"path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"path",
")",
"return",
"_install_rbenv",
"(",
"path"... | Install rbenv systemwide
CLI Example:
.. code-block:: bash
salt '*' rbenv.install | [
"Install",
"rbenv",
"systemwide"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L159-L171 | train | Install rbenv systemwide
CLI Example | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | update | def update(runas=None, path=None):
'''
Updates the current versions of rbenv and ruby-build
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.update
... | python | def update(runas=None, path=None):
'''
Updates the current versions of rbenv and ruby-build
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.update
... | [
"def",
"update",
"(",
"runas",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"path",
"=",
"path",
"or",
"_rbenv_path",
"(",
"runas",
")",
"path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"path",
")",
"return",
"_update_rbenv",
"(",
"path",
... | Updates the current versions of rbenv and ruby-build
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.update | [
"Updates",
"the",
"current",
"versions",
"of",
"rbenv",
"and",
"ruby",
"-",
"build"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L174-L191 | train | Updates the current versions of rbenv and ruby - build with the current version of ruby - build. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | install_ruby | def install_ruby(ruby, runas=None):
'''
Install a ruby implementation.
ruby
The version of Ruby to install, should match one of the
versions listed by :py:func:`rbenv.list <salt.modules.rbenv.list>`
runas
The user under which to run rbenv. If not specified, then rbenv will be
... | python | def install_ruby(ruby, runas=None):
'''
Install a ruby implementation.
ruby
The version of Ruby to install, should match one of the
versions listed by :py:func:`rbenv.list <salt.modules.rbenv.list>`
runas
The user under which to run rbenv. If not specified, then rbenv will be
... | [
"def",
"install_ruby",
"(",
"ruby",
",",
"runas",
"=",
"None",
")",
":",
"ruby",
"=",
"re",
".",
"sub",
"(",
"r'^ruby-'",
",",
"''",
",",
"ruby",
")",
"env",
"=",
"None",
"env_list",
"=",
"[",
"]",
"if",
"__grains__",
"[",
"'os'",
"]",
"in",
"(",... | Install a ruby implementation.
ruby
The version of Ruby to install, should match one of the
versions listed by :py:func:`rbenv.list <salt.modules.rbenv.list>`
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is runni... | [
"Install",
"a",
"ruby",
"implementation",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L207-L257 | train | Install a ruby implementation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | uninstall_ruby | def uninstall_ruby(ruby, runas=None):
'''
Uninstall a ruby implementation.
ruby
The version of ruby to uninstall. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
runas
The user under which to run rbenv. If not specified, then ... | python | def uninstall_ruby(ruby, runas=None):
'''
Uninstall a ruby implementation.
ruby
The version of ruby to uninstall. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
runas
The user under which to run rbenv. If not specified, then ... | [
"def",
"uninstall_ruby",
"(",
"ruby",
",",
"runas",
"=",
"None",
")",
":",
"ruby",
"=",
"re",
".",
"sub",
"(",
"r'^ruby-'",
",",
"''",
",",
"ruby",
")",
"_rbenv_exec",
"(",
"[",
"'uninstall'",
",",
"'--force'",
",",
"ruby",
"]",
",",
"runas",
"=",
... | Uninstall a ruby implementation.
ruby
The version of ruby to uninstall. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which ... | [
"Uninstall",
"a",
"ruby",
"implementation",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L260-L280 | train | Uninstall a ruby implementation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | versions | def versions(runas=None):
'''
List the installed versions of ruby
CLI Example:
.. code-block:: bash
salt '*' rbenv.versions
'''
ret = _rbenv_exec(['versions', '--bare'], runas=runas)
return [] if ret is False else ret.splitlines() | python | def versions(runas=None):
'''
List the installed versions of ruby
CLI Example:
.. code-block:: bash
salt '*' rbenv.versions
'''
ret = _rbenv_exec(['versions', '--bare'], runas=runas)
return [] if ret is False else ret.splitlines() | [
"def",
"versions",
"(",
"runas",
"=",
"None",
")",
":",
"ret",
"=",
"_rbenv_exec",
"(",
"[",
"'versions'",
",",
"'--bare'",
"]",
",",
"runas",
"=",
"runas",
")",
"return",
"[",
"]",
"if",
"ret",
"is",
"False",
"else",
"ret",
".",
"splitlines",
"(",
... | List the installed versions of ruby
CLI Example:
.. code-block:: bash
salt '*' rbenv.versions | [
"List",
"the",
"installed",
"versions",
"of",
"ruby"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L283-L294 | train | List installed versions of ruby
CLI Example : rabian - set version list | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | default | def default(ruby=None, runas=None):
'''
Returns or sets the currently defined default ruby
ruby
The version to set as the default. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
Leave blank to return the current default.
CLI ... | python | def default(ruby=None, runas=None):
'''
Returns or sets the currently defined default ruby
ruby
The version to set as the default. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
Leave blank to return the current default.
CLI ... | [
"def",
"default",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
")",
":",
"if",
"ruby",
":",
"_rbenv_exec",
"(",
"[",
"'global'",
",",
"ruby",
"]",
",",
"runas",
"=",
"runas",
")",
"return",
"True",
"else",
":",
"ret",
"=",
"_rbenv_exec",
"(... | Returns or sets the currently defined default ruby
ruby
The version to set as the default. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
Leave blank to return the current default.
CLI Example:
.. code-block:: bash
salt... | [
"Returns",
"or",
"sets",
"the",
"currently",
"defined",
"default",
"ruby"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L297-L318 | train | Returns or sets the currently defined default for the current version of the current version. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | list_ | def list_(runas=None):
'''
List the installable versions of ruby
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.list
'''
ret = []
outpu... | python | def list_(runas=None):
'''
List the installable versions of ruby
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.list
'''
ret = []
outpu... | [
"def",
"list_",
"(",
"runas",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"output",
"=",
"_rbenv_exec",
"(",
"[",
"'install'",
",",
"'--list'",
"]",
",",
"runas",
"=",
"runas",
")",
"if",
"output",
":",
"for",
"line",
"in",
"output",
".",
"splitli... | List the installable versions of ruby
runas
The user under which to run rbenv. If not specified, then rbenv will be
run as the user under which Salt is running.
CLI Example:
.. code-block:: bash
salt '*' rbenv.list | [
"List",
"the",
"installable",
"versions",
"of",
"ruby"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L321-L342 | train | Return a list of installable versions of ruby
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | do | def do(cmdline, runas=None, env=None):
'''
Execute a ruby command with rbenv's shims from the user or the system
CLI Example:
.. code-block:: bash
salt '*' rbenv.do 'gem list bundler'
salt '*' rbenv.do 'gem list bundler' deploy
'''
if not cmdline:
# This is a positiona... | python | def do(cmdline, runas=None, env=None):
'''
Execute a ruby command with rbenv's shims from the user or the system
CLI Example:
.. code-block:: bash
salt '*' rbenv.do 'gem list bundler'
salt '*' rbenv.do 'gem list bundler' deploy
'''
if not cmdline:
# This is a positiona... | [
"def",
"do",
"(",
"cmdline",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"if",
"not",
"cmdline",
":",
"# This is a positional argument so this should never happen, but this",
"# will handle cases where someone explicitly passes a false value for",
"# cmdline... | Execute a ruby command with rbenv's shims from the user or the system
CLI Example:
.. code-block:: bash
salt '*' rbenv.do 'gem list bundler'
salt '*' rbenv.do 'gem list bundler' deploy | [
"Execute",
"a",
"ruby",
"command",
"with",
"rbenv",
"s",
"shims",
"from",
"the",
"user",
"or",
"the",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L363-L410 | train | Execute a ruby command with rbenv s shims from the user or system | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/rbenv.py | do_with_ruby | def do_with_ruby(ruby, cmdline, runas=None):
'''
Execute a ruby command with rbenv's shims using a specific ruby version
CLI Example:
.. code-block:: bash
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler'
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy
'... | python | def do_with_ruby(ruby, cmdline, runas=None):
'''
Execute a ruby command with rbenv's shims using a specific ruby version
CLI Example:
.. code-block:: bash
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler'
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy
'... | [
"def",
"do_with_ruby",
"(",
"ruby",
",",
"cmdline",
",",
"runas",
"=",
"None",
")",
":",
"if",
"not",
"cmdline",
":",
"# This is a positional argument so this should never happen, but this",
"# will handle cases where someone explicitly passes a false value for",
"# cmdline.",
... | Execute a ruby command with rbenv's shims using a specific ruby version
CLI Example:
.. code-block:: bash
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler'
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy | [
"Execute",
"a",
"ruby",
"command",
"with",
"rbenv",
"s",
"shims",
"using",
"a",
"specific",
"ruby",
"version"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L413-L442 | train | Execute a bash command with rbenv s shims using a specific ruby version | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/mac_assistive.py | installed | def installed(name, enabled=True):
'''
Make sure that we have the given bundle ID or path to command
installed in the assistive access panel.
name
The bundle ID or path to command
enable
Should assistive access be enabled on this application?
'''
ret = {'name': name,
... | python | def installed(name, enabled=True):
'''
Make sure that we have the given bundle ID or path to command
installed in the assistive access panel.
name
The bundle ID or path to command
enable
Should assistive access be enabled on this application?
'''
ret = {'name': name,
... | [
"def",
"installed",
"(",
"name",
",",
"enabled",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_installed",
"=",
"__salt__",
"[",
"... | Make sure that we have the given bundle ID or path to command
installed in the assistive access panel.
name
The bundle ID or path to command
enable
Should assistive access be enabled on this application? | [
"Make",
"sure",
"that",
"we",
"have",
"the",
"given",
"bundle",
"ID",
"or",
"path",
"to",
"command",
"installed",
"in",
"the",
"assistive",
"access",
"panel",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mac_assistive.py#L38-L70 | train | Ensure that the given bundle ID or path to command
is installed in the assistive access panel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | _enable | def _enable(name, started, result=True, skip_verify=False, **kwargs):
'''
Enable the service
'''
ret = {}
if not skip_verify:
# is service available?
try:
if not _available(name, ret):
return ret
except CommandExecutionError as exc:
re... | python | def _enable(name, started, result=True, skip_verify=False, **kwargs):
'''
Enable the service
'''
ret = {}
if not skip_verify:
# is service available?
try:
if not _available(name, ret):
return ret
except CommandExecutionError as exc:
re... | [
"def",
"_enable",
"(",
"name",
",",
"started",
",",
"result",
"=",
"True",
",",
"skip_verify",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"skip_verify",
":",
"# is service available?",
"try",
":",
"if",
"not",
... | Enable the service | [
"Enable",
"the",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L123-L223 | train | Enable the service in the available state | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | _disable | def _disable(name, started, result=True, skip_verify=False, **kwargs):
'''
Disable the service
'''
ret = {}
if not skip_verify:
# is service available?
try:
if not _available(name, ret):
ret['result'] = True
return ret
except Comma... | python | def _disable(name, started, result=True, skip_verify=False, **kwargs):
'''
Disable the service
'''
ret = {}
if not skip_verify:
# is service available?
try:
if not _available(name, ret):
ret['result'] = True
return ret
except Comma... | [
"def",
"_disable",
"(",
"name",
",",
"started",
",",
"result",
"=",
"True",
",",
"skip_verify",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"skip_verify",
":",
"# is service available?",
"try",
":",
"if",
"not",
... | Disable the service | [
"Disable",
"the",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L226-L320 | train | Disable the service with the specified name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | _available | def _available(name, ret):
'''
Check if the service is available
'''
avail = False
if 'service.available' in __salt__:
avail = __salt__['service.available'](name)
elif 'service.get_all' in __salt__:
avail = name in __salt__['service.get_all']()
if not avail:
ret['resu... | python | def _available(name, ret):
'''
Check if the service is available
'''
avail = False
if 'service.available' in __salt__:
avail = __salt__['service.available'](name)
elif 'service.get_all' in __salt__:
avail = name in __salt__['service.get_all']()
if not avail:
ret['resu... | [
"def",
"_available",
"(",
"name",
",",
"ret",
")",
":",
"avail",
"=",
"False",
"if",
"'service.available'",
"in",
"__salt__",
":",
"avail",
"=",
"__salt__",
"[",
"'service.available'",
"]",
"(",
"name",
")",
"elif",
"'service.get_all'",
"in",
"__salt__",
":"... | Check if the service is available | [
"Check",
"if",
"the",
"service",
"is",
"available"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L323-L335 | train | Check if the named service is available | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | running | def running(name,
enable=None,
sig=None,
init_delay=None,
no_block=False,
unmask=False,
unmask_runtime=False,
**kwargs):
'''
Ensure that the service is running
name
The name of the init or rc script used to manage t... | python | def running(name,
enable=None,
sig=None,
init_delay=None,
no_block=False,
unmask=False,
unmask_runtime=False,
**kwargs):
'''
Ensure that the service is running
name
The name of the init or rc script used to manage t... | [
"def",
"running",
"(",
"name",
",",
"enable",
"=",
"None",
",",
"sig",
"=",
"None",
",",
"init_delay",
"=",
"None",
",",
"no_block",
"=",
"False",
",",
"unmask",
"=",
"False",
",",
"unmask_runtime",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
... | Ensure that the service is running
name
The name of the init or rc script used to manage the service
enable
Set the service to be enabled at boot time, ``True`` sets the service
to be enabled, ``False`` sets the named service to be disabled. The
default is ``None``, which does ... | [
"Ensure",
"that",
"the",
"service",
"is",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L338-L514 | train | Ensure that the service is running. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | dead | def dead(name,
enable=None,
sig=None,
init_delay=None,
**kwargs):
'''
Ensure that the named service is dead by stopping the service if it is running
name
The name of the init or rc script used to manage the service
enable
Set the service to be enable... | python | def dead(name,
enable=None,
sig=None,
init_delay=None,
**kwargs):
'''
Ensure that the named service is dead by stopping the service if it is running
name
The name of the init or rc script used to manage the service
enable
Set the service to be enable... | [
"def",
"dead",
"(",
"name",
",",
"enable",
"=",
"None",
",",
"sig",
"=",
"None",
",",
"init_delay",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"... | Ensure that the named service is dead by stopping the service if it is running
name
The name of the init or rc script used to manage the service
enable
Set the service to be enabled at boot time, ``True`` sets the service
to be enabled, ``False`` sets the named service to be disabled. ... | [
"Ensure",
"that",
"the",
"named",
"service",
"is",
"dead",
"by",
"stopping",
"the",
"service",
"if",
"it",
"is",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L517-L651 | train | Ensure that the named service is dead by stopping it if it is running. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | enabled | def enabled(name,
skip_verify=False,
**kwargs):
'''
Ensure that the service is enabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
enable a running service to use the enable: True option for the running
or dead fu... | python | def enabled(name,
skip_verify=False,
**kwargs):
'''
Ensure that the service is enabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
enable a running service to use the enable: True option for the running
or dead fu... | [
"def",
"enabled",
"(",
"name",
",",
"skip_verify",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
".... | Ensure that the service is enabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
enable a running service to use the enable: True option for the running
or dead function.
name
The name of the init or rc script used to manage the servi... | [
"Ensure",
"that",
"the",
"service",
"is",
"enabled",
"on",
"boot",
"only",
"use",
"this",
"state",
"if",
"you",
"don",
"t",
"want",
"to",
"manage",
"the",
"running",
"process",
"remember",
"that",
"if",
"you",
"want",
"to",
"enable",
"a",
"running",
"ser... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L654-L677 | train | Ensure that the service is enabled on boot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | disabled | def disabled(name,
skip_verify=False,
**kwargs):
'''
Ensure that the service is disabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
disable a service to use the enable: False option for the running or dead
funct... | python | def disabled(name,
skip_verify=False,
**kwargs):
'''
Ensure that the service is disabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
disable a service to use the enable: False option for the running or dead
funct... | [
"def",
"disabled",
"(",
"name",
",",
"skip_verify",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"... | Ensure that the service is disabled on boot, only use this state if you
don't want to manage the running process, remember that if you want to
disable a service to use the enable: False option for the running or dead
function.
name
The name of the init or rc script used to manage the service
... | [
"Ensure",
"that",
"the",
"service",
"is",
"disabled",
"on",
"boot",
"only",
"use",
"this",
"state",
"if",
"you",
"don",
"t",
"want",
"to",
"manage",
"the",
"running",
"process",
"remember",
"that",
"if",
"you",
"want",
"to",
"disable",
"a",
"service",
"t... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L680-L703 | train | Ensure that the service is disabled on boot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | masked | def masked(name, runtime=False):
'''
.. versionadded:: 2017.7.0
.. note::
This state is only available on minions which use systemd_.
Ensures that the named service is masked (i.e. prevented from being
started).
name
Name of the service to mask
runtime : False
By ... | python | def masked(name, runtime=False):
'''
.. versionadded:: 2017.7.0
.. note::
This state is only available on minions which use systemd_.
Ensures that the named service is masked (i.e. prevented from being
started).
name
Name of the service to mask
runtime : False
By ... | [
"def",
"masked",
"(",
"name",
",",
"runtime",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"if",
"'service.masked'",
"not",
"in",
"_... | .. versionadded:: 2017.7.0
.. note::
This state is only available on minions which use systemd_.
Ensures that the named service is masked (i.e. prevented from being
started).
name
Name of the service to mask
runtime : False
By default, this state will manage an indefinite... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L706-L788 | train | A state machine to mask a named service. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/service.py | mod_watch | def mod_watch(name,
sfun=None,
sig=None,
full_restart=False,
init_delay=None,
force=False,
**kwargs):
'''
The service watcher, called to invoke the watch command.
When called, it will restart or reload the named service.
... | python | def mod_watch(name,
sfun=None,
sig=None,
full_restart=False,
init_delay=None,
force=False,
**kwargs):
'''
The service watcher, called to invoke the watch command.
When called, it will restart or reload the named service.
... | [
"def",
"mod_watch",
"(",
"name",
",",
"sfun",
"=",
"None",
",",
"sig",
"=",
"None",
",",
"full_restart",
"=",
"False",
",",
"init_delay",
"=",
"None",
",",
"force",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"reload_",
"=",
"kwargs",
".",
"po... | The service watcher, called to invoke the watch command.
When called, it will restart or reload the named service.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function shou... | [
"The",
"service",
"watcher",
"called",
"to",
"invoke",
"the",
"watch",
"command",
".",
"When",
"called",
"it",
"will",
"restart",
"or",
"reload",
"the",
"named",
"service",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L858-L1002 | train | The function to watch a service and return a new version of the service. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | recv | def recv(files, dest):
'''
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI.
'''
ret = {}
for path, data in six.iteritems(files):
if os.path.basename(path) == os.path.b... | python | def recv(files, dest):
'''
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI.
'''
ret = {}
for path, data in six.iteritems(files):
if os.path.basename(path) == os.path.b... | [
"def",
"recv",
"(",
"files",
",",
"dest",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"path",
",",
"data",
"in",
"six",
".",
"iteritems",
"(",
"files",
")",
":",
"if",
"os",
".",
"path",
".",
"basename",
"(",
"path",
")",
"==",
"os",
".",
"path",
... | Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI. | [
"Used",
"with",
"salt",
"-",
"cp",
"pass",
"the",
"files",
"dict",
"and",
"the",
"destination",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L63-L89 | train | This function takes a dict of files and dest and returns a dict of the result | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | recv_chunked | def recv_chunked(dest, chunk, append=False, compressed=True, mode=None):
'''
This function receives files copied to the minion using ``salt-cp`` and is
not intended to be used directly on the CLI.
'''
if 'retcode' not in __context__:
__context__['retcode'] = 0
def _error(msg):
_... | python | def recv_chunked(dest, chunk, append=False, compressed=True, mode=None):
'''
This function receives files copied to the minion using ``salt-cp`` and is
not intended to be used directly on the CLI.
'''
if 'retcode' not in __context__:
__context__['retcode'] = 0
def _error(msg):
_... | [
"def",
"recv_chunked",
"(",
"dest",
",",
"chunk",
",",
"append",
"=",
"False",
",",
"compressed",
"=",
"True",
",",
"mode",
"=",
"None",
")",
":",
"if",
"'retcode'",
"not",
"in",
"__context__",
":",
"__context__",
"[",
"'retcode'",
"]",
"=",
"0",
"def"... | This function receives files copied to the minion using ``salt-cp`` and is
not intended to be used directly on the CLI. | [
"This",
"function",
"receives",
"files",
"copied",
"to",
"the",
"minion",
"using",
"salt",
"-",
"cp",
"and",
"is",
"not",
"intended",
"to",
"be",
"used",
"directly",
"on",
"the",
"CLI",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L92-L154 | train | This function receives a single chunk of base64 encoded files and writes them to the specified destination directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | _mk_client | def _mk_client():
'''
Create a file client and add it to the context.
Each file client needs to correspond to a unique copy
of the opts dictionary, therefore it's hashed by the
id of the __opts__ dict
'''
if 'cp.fileclient_{0}'.format(id(__opts__)) not in __context__:
__context__['c... | python | def _mk_client():
'''
Create a file client and add it to the context.
Each file client needs to correspond to a unique copy
of the opts dictionary, therefore it's hashed by the
id of the __opts__ dict
'''
if 'cp.fileclient_{0}'.format(id(__opts__)) not in __context__:
__context__['c... | [
"def",
"_mk_client",
"(",
")",
":",
"if",
"'cp.fileclient_{0}'",
".",
"format",
"(",
"id",
"(",
"__opts__",
")",
")",
"not",
"in",
"__context__",
":",
"__context__",
"[",
"'cp.fileclient_{0}'",
".",
"format",
"(",
"id",
"(",
"__opts__",
")",
")",
"]",
"=... | Create a file client and add it to the context.
Each file client needs to correspond to a unique copy
of the opts dictionary, therefore it's hashed by the
id of the __opts__ dict | [
"Create",
"a",
"file",
"client",
"and",
"add",
"it",
"to",
"the",
"context",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L157-L167 | train | Create a file client and add it to the context. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | get_file | def get_file(path,
dest,
saltenv='base',
makedirs=False,
template=None,
gzip=None,
**kwargs):
'''
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from the salt master
CLI Exampl... | python | def get_file(path,
dest,
saltenv='base',
makedirs=False,
template=None,
gzip=None,
**kwargs):
'''
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from the salt master
CLI Exampl... | [
"def",
"get_file",
"(",
"path",
",",
"dest",
",",
"saltenv",
"=",
"'base'",
",",
"makedirs",
"=",
"False",
",",
"template",
"=",
"None",
",",
"gzip",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"(",
"path",
",",
"dest",
")",
"=",
"_render_filen... | .. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from the salt master
CLI Example:
.. code-block:: bash
salt '*' cp.get_file salt://path/to/file /minion/dest
Template rendering can be enabled on both the source and destination file
names lik... | [
"..",
"versionchanged",
"::",
"2018",
".",
"3",
".",
"0",
"dest",
"can",
"now",
"be",
"a",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L235-L301 | train | Get a single file from the master and minion | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | get_template | def get_template(path,
dest,
template='jinja',
saltenv='base',
makedirs=False,
**kwargs):
'''
Render a file as a template before setting it down.
Warning, order is not the same as in fileclient.cp for
non breaking old A... | python | def get_template(path,
dest,
template='jinja',
saltenv='base',
makedirs=False,
**kwargs):
'''
Render a file as a template before setting it down.
Warning, order is not the same as in fileclient.cp for
non breaking old A... | [
"def",
"get_template",
"(",
"path",
",",
"dest",
",",
"template",
"=",
"'jinja'",
",",
"saltenv",
"=",
"'base'",
",",
"makedirs",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'salt'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'salt'",
"]... | Render a file as a template before setting it down.
Warning, order is not the same as in fileclient.cp for
non breaking old API.
CLI Example:
.. code-block:: bash
salt '*' cp.get_template salt://path/to/template /minion/dest | [
"Render",
"a",
"file",
"as",
"a",
"template",
"before",
"setting",
"it",
"down",
".",
"Warning",
"order",
"is",
"not",
"the",
"same",
"as",
"in",
"fileclient",
".",
"cp",
"for",
"non",
"breaking",
"old",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L317-L348 | train | Get a template from a file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | get_dir | def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
'''
Used to recursively copy a directory from the salt master
CLI Example:
.. code-block:: bash
salt '*' cp.get_dir salt://path/to/dir/ /minion/dest
get_dir supports the same template and gzip arguments as get_f... | python | def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
'''
Used to recursively copy a directory from the salt master
CLI Example:
.. code-block:: bash
salt '*' cp.get_dir salt://path/to/dir/ /minion/dest
get_dir supports the same template and gzip arguments as get_f... | [
"def",
"get_dir",
"(",
"path",
",",
"dest",
",",
"saltenv",
"=",
"'base'",
",",
"template",
"=",
"None",
",",
"gzip",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"(",
"path",
",",
"dest",
")",
"=",
"_render_filenames",
"(",
"path",
",",
"dest",... | Used to recursively copy a directory from the salt master
CLI Example:
.. code-block:: bash
salt '*' cp.get_dir salt://path/to/dir/ /minion/dest
get_dir supports the same template and gzip arguments as get_file. | [
"Used",
"to",
"recursively",
"copy",
"a",
"directory",
"from",
"the",
"salt",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L351-L365 | train | This function is used to recursively copy a directory from the master master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | get_url | def get_url(path, dest='', saltenv='base', makedirs=False, source_hash=None):
'''
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from a URL.
path
A URL to download a file from. Supported URL schemes are: ``salt://``,
``http://``, ``https:... | python | def get_url(path, dest='', saltenv='base', makedirs=False, source_hash=None):
'''
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from a URL.
path
A URL to download a file from. Supported URL schemes are: ``salt://``,
``http://``, ``https:... | [
"def",
"get_url",
"(",
"path",
",",
"dest",
"=",
"''",
",",
"saltenv",
"=",
"'base'",
",",
"makedirs",
"=",
"False",
",",
"source_hash",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"dest",
",",
"six",
".",
"string_types",
")",
":",
"result",
"=",... | .. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from a URL.
path
A URL to download a file from. Supported URL schemes are: ``salt://``,
``http://``, ``https://``, ``ftp://``, ``s3://``, ``swift://`` and
``file://`` (local filesystem). If n... | [
"..",
"versionchanged",
"::",
"2018",
".",
"3",
".",
"0",
"dest",
"can",
"now",
"be",
"a",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L368-L426 | train | Return a file from a URL. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | get_file_str | def get_file_str(path, saltenv='base'):
'''
Download a file from a URL to the Minion cache directory and return the
contents of that file
Returns ``False`` if Salt was unable to cache a file from a URL.
CLI Example:
.. code-block:: bash
salt '*' cp.get_file_str salt://my/file
'''... | python | def get_file_str(path, saltenv='base'):
'''
Download a file from a URL to the Minion cache directory and return the
contents of that file
Returns ``False`` if Salt was unable to cache a file from a URL.
CLI Example:
.. code-block:: bash
salt '*' cp.get_file_str salt://my/file
'''... | [
"def",
"get_file_str",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"fn_",
"=",
"cache_file",
"(",
"path",
",",
"saltenv",
")",
"if",
"isinstance",
"(",
"fn_",
",",
"six",
".",
"string_types",
")",
":",
"try",
":",
"with",
"salt",
".",
"util... | Download a file from a URL to the Minion cache directory and return the
contents of that file
Returns ``False`` if Salt was unable to cache a file from a URL.
CLI Example:
.. code-block:: bash
salt '*' cp.get_file_str salt://my/file | [
"Download",
"a",
"file",
"from",
"a",
"URL",
"to",
"the",
"Minion",
"cache",
"directory",
"and",
"return",
"the",
"contents",
"of",
"that",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L429-L449 | train | Download a file from a URL to the Minion cache directory and return the contents of that file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | cache_file | def cache_file(path, saltenv='base', source_hash=None):
'''
Used to cache a single file on the Minion
Returns the location of the new cached file on the Minion
source_hash
If ``name`` is an http(s) or ftp URL and the file exists in the
minion's file cache, this option can be passed to ... | python | def cache_file(path, saltenv='base', source_hash=None):
'''
Used to cache a single file on the Minion
Returns the location of the new cached file on the Minion
source_hash
If ``name`` is an http(s) or ftp URL and the file exists in the
minion's file cache, this option can be passed to ... | [
"def",
"cache_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"source_hash",
"=",
"None",
")",
":",
"path",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"path",
")",
"saltenv",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"de... | Used to cache a single file on the Minion
Returns the location of the new cached file on the Minion
source_hash
If ``name`` is an http(s) or ftp URL and the file exists in the
minion's file cache, this option can be passed to keep the minion from
re-downloading the file if the cached c... | [
"Used",
"to",
"cache",
"a",
"single",
"file",
"on",
"the",
"Minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L452-L525 | train | Return the location of the new cached file on the Minion
Taxonomy | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | cache_dir | def cache_dir(path, saltenv='base', include_empty=False, include_pat=None,
exclude_pat=None):
'''
Download and cache everything under a directory from the master
include_pat : None
Glob or regex to narrow down the files cached from the given path. If
matching with a regex, th... | python | def cache_dir(path, saltenv='base', include_empty=False, include_pat=None,
exclude_pat=None):
'''
Download and cache everything under a directory from the master
include_pat : None
Glob or regex to narrow down the files cached from the given path. If
matching with a regex, th... | [
"def",
"cache_dir",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"include_empty",
"=",
"False",
",",
"include_pat",
"=",
"None",
",",
"exclude_pat",
"=",
"None",
")",
":",
"return",
"_client",
"(",
")",
".",
"cache_dir",
"(",
"path",
",",
"saltenv",
... | Download and cache everything under a directory from the master
include_pat : None
Glob or regex to narrow down the files cached from the given path. If
matching with a regex, the regex must be prefixed with ``E@``,
otherwise the expression will be interpreted as a glob.
.. versio... | [
"Download",
"and",
"cache",
"everything",
"under",
"a",
"directory",
"from",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L590-L625 | train | Download and cache all files under a directory from the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | cache_local_file | def cache_local_file(path):
'''
Cache a local file on the minion in the localfiles cache
CLI Example:
.. code-block:: bash
salt '*' cp.cache_local_file /etc/hosts
'''
if not os.path.exists(path):
return ''
path_cached = is_cached(path)
# If the file has already been ... | python | def cache_local_file(path):
'''
Cache a local file on the minion in the localfiles cache
CLI Example:
.. code-block:: bash
salt '*' cp.cache_local_file /etc/hosts
'''
if not os.path.exists(path):
return ''
path_cached = is_cached(path)
# If the file has already been ... | [
"def",
"cache_local_file",
"(",
"path",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"return",
"''",
"path_cached",
"=",
"is_cached",
"(",
"path",
")",
"# If the file has already been cached, return the path",
"if",
"path_cache... | Cache a local file on the minion in the localfiles cache
CLI Example:
.. code-block:: bash
salt '*' cp.cache_local_file /etc/hosts | [
"Cache",
"a",
"local",
"file",
"on",
"the",
"minion",
"in",
"the",
"localfiles",
"cache"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L641-L665 | train | Cache a local file on the minion in the localfiles cache
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | hash_file | def hash_file(path, saltenv='base'):
'''
Return the hash of a file, to get the hash of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
salt '*' cp.hash_file salt:... | python | def hash_file(path, saltenv='base'):
'''
Return the hash of a file, to get the hash of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
salt '*' cp.hash_file salt:... | [
"def",
"hash_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"path",
",",
"senv",
"=",
"salt",
".",
"utils",
".",
"url",
".",
"split_env",
"(",
"path",
")",
"if",
"senv",
":",
"saltenv",
"=",
"senv",
"return",
"_client",
"(",
")",
".",... | Return the hash of a file, to get the hash of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
salt '*' cp.hash_file salt://path/to/file | [
"Return",
"the",
"hash",
"of",
"a",
"file",
"to",
"get",
"the",
"hash",
"of",
"a",
"file",
"on",
"the",
"salt",
"master",
"file",
"server",
"prepend",
"the",
"path",
"with",
"salt",
":",
"//",
"<file",
"on",
"server",
">",
"otherwise",
"prepend",
"the"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L747-L763 | train | Return the hash of a file on the
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | stat_file | def stat_file(path, saltenv='base', octal=True):
'''
Return the permissions of a file, to get the permissions of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
s... | python | def stat_file(path, saltenv='base', octal=True):
'''
Return the permissions of a file, to get the permissions of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
s... | [
"def",
"stat_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"octal",
"=",
"True",
")",
":",
"path",
",",
"senv",
"=",
"salt",
".",
"utils",
".",
"url",
".",
"split_env",
"(",
"path",
")",
"if",
"senv",
":",
"saltenv",
"=",
"senv",
"stat",
... | Return the permissions of a file, to get the permissions of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
salt '*' cp.stat_file salt://path/to/file | [
"Return",
"the",
"permissions",
"of",
"a",
"file",
"to",
"get",
"the",
"permissions",
"of",
"a",
"file",
"on",
"the",
"salt",
"master",
"file",
"server",
"prepend",
"the",
"path",
"with",
"salt",
":",
"//",
"<file",
"on",
"server",
">",
"otherwise",
"pre... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L766-L785 | train | Return the permissions of a file on the
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | push | def push(path, keep_symlinks=False, upload_path=None, remove_source=False):
'''
WARNING Files pushed to the master will have global read permissions..
Push a file from the minion up to the master, the file will be saved to
the salt master in the master's minion files cachedir
(defaults to ``/var/ca... | python | def push(path, keep_symlinks=False, upload_path=None, remove_source=False):
'''
WARNING Files pushed to the master will have global read permissions..
Push a file from the minion up to the master, the file will be saved to
the salt master in the master's minion files cachedir
(defaults to ``/var/ca... | [
"def",
"push",
"(",
"path",
",",
"keep_symlinks",
"=",
"False",
",",
"upload_path",
"=",
"None",
",",
"remove_source",
"=",
"False",
")",
":",
"log",
".",
"debug",
"(",
"'Trying to copy \\'%s\\' to master'",
",",
"path",
")",
"if",
"'../'",
"in",
"path",
"... | WARNING Files pushed to the master will have global read permissions..
Push a file from the minion up to the master, the file will be saved to
the salt master in the master's minion files cachedir
(defaults to ``/var/cache/salt/master/minions/minion-id/files``)
Since this feature allows a minion to pu... | [
"WARNING",
"Files",
"pushed",
"to",
"the",
"master",
"will",
"have",
"global",
"read",
"permissions",
".."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L788-L880 | train | Push a file up to the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/cp.py | push_dir | def push_dir(path, glob=None, upload_path=None):
'''
Push a directory from the minion up to the master, the files will be saved
to the salt master in the master's minion files cachedir (defaults to
``/var/cache/salt/master/minions/minion-id/files``). It also has a glob
for matching specific files u... | python | def push_dir(path, glob=None, upload_path=None):
'''
Push a directory from the minion up to the master, the files will be saved
to the salt master in the master's minion files cachedir (defaults to
``/var/cache/salt/master/minions/minion-id/files``). It also has a glob
for matching specific files u... | [
"def",
"push_dir",
"(",
"path",
",",
"glob",
"=",
"None",
",",
"upload_path",
"=",
"None",
")",
":",
"if",
"'../'",
"in",
"path",
"or",
"not",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
":",
"return",
"False",
"tmpupload_path",
"=",
"upload_p... | Push a directory from the minion up to the master, the files will be saved
to the salt master in the master's minion files cachedir (defaults to
``/var/cache/salt/master/minions/minion-id/files``). It also has a glob
for matching specific files using globbing.
.. versionadded:: 2014.7.0
Since thi... | [
"Push",
"a",
"directory",
"from",
"the",
"minion",
"up",
"to",
"the",
"master",
"the",
"files",
"will",
"be",
"saved",
"to",
"the",
"salt",
"master",
"in",
"the",
"master",
"s",
"minion",
"files",
"cachedir",
"(",
"defaults",
"to",
"/",
"var",
"/",
"ca... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cp.py#L883-L931 | train | Push a directory up to the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/glance_image.py | present | def present(name, auth=None, **kwargs):
'''
Ensure image exists and is up-to-date
name
Name of the image
enabled
Boolean to control if image is enabled
description
An arbitrary description of the image
'''
ret = {'name': name,
'changes': {},
'... | python | def present(name, auth=None, **kwargs):
'''
Ensure image exists and is up-to-date
name
Name of the image
enabled
Boolean to control if image is enabled
description
An arbitrary description of the image
'''
ret = {'name': name,
'changes': {},
'... | [
"def",
"present",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
... | Ensure image exists and is up-to-date
name
Name of the image
enabled
Boolean to control if image is enabled
description
An arbitrary description of the image | [
"Ensure",
"image",
"exists",
"and",
"is",
"up",
"-",
"to",
"-",
"date"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glance_image.py#L37-L75 | train | Ensure an image exists and is up - to - date and is up - to - date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | _merge_keys | def _merge_keys(kwargs):
'''
The log_config is a mixture of the CLI options --log-driver and --log-opt
(which we support in Salt as log_driver and log_opt, respectively), but it
must be submitted to the host config in the format {'Type': log_driver,
'Config': log_opt}. So, we need to construct this ... | python | def _merge_keys(kwargs):
'''
The log_config is a mixture of the CLI options --log-driver and --log-opt
(which we support in Salt as log_driver and log_opt, respectively), but it
must be submitted to the host config in the format {'Type': log_driver,
'Config': log_opt}. So, we need to construct this ... | [
"def",
"_merge_keys",
"(",
"kwargs",
")",
":",
"log_driver",
"=",
"kwargs",
".",
"pop",
"(",
"'log_driver'",
",",
"helpers",
".",
"NOTSET",
")",
"log_opt",
"=",
"kwargs",
".",
"pop",
"(",
"'log_opt'",
",",
"helpers",
".",
"NOTSET",
")",
"if",
"'log_confi... | The log_config is a mixture of the CLI options --log-driver and --log-opt
(which we support in Salt as log_driver and log_opt, respectively), but it
must be submitted to the host config in the format {'Type': log_driver,
'Config': log_opt}. So, we need to construct this argument to be passed to
the API ... | [
"The",
"log_config",
"is",
"a",
"mixture",
"of",
"the",
"CLI",
"options",
"--",
"log",
"-",
"driver",
"and",
"--",
"log",
"-",
"opt",
"(",
"which",
"we",
"support",
"in",
"Salt",
"as",
"log_driver",
"and",
"log_opt",
"respectively",
")",
"but",
"it",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L44-L64 | train | Merge log_config and log_driver keys into the kwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | _post_processing | def _post_processing(kwargs, skip_translate, invalid):
'''
Additional container-specific post-translation processing
'''
# Don't allow conflicting options to be set
if kwargs.get('port_bindings') is not None \
and kwargs.get('publish_all_ports'):
kwargs.pop('port_bindings')
... | python | def _post_processing(kwargs, skip_translate, invalid):
'''
Additional container-specific post-translation processing
'''
# Don't allow conflicting options to be set
if kwargs.get('port_bindings') is not None \
and kwargs.get('publish_all_ports'):
kwargs.pop('port_bindings')
... | [
"def",
"_post_processing",
"(",
"kwargs",
",",
"skip_translate",
",",
"invalid",
")",
":",
"# Don't allow conflicting options to be set",
"if",
"kwargs",
".",
"get",
"(",
"'port_bindings'",
")",
"is",
"not",
"None",
"and",
"kwargs",
".",
"get",
"(",
"'publish_all_... | Additional container-specific post-translation processing | [
"Additional",
"container",
"-",
"specific",
"post",
"-",
"translation",
"processing"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L67-L137 | train | This function is called after the container is parsed and the process_container_specific_options method is called. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | binds | def binds(val, **kwargs): # pylint: disable=unused-argument
'''
On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python list.
'''
if not isinstance(val, dict):
if not isinstance(val, list):... | python | def binds(val, **kwargs): # pylint: disable=unused-argument
'''
On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python list.
'''
if not isinstance(val, dict):
if not isinstance(val, list):... | [
"def",
"binds",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"not",
"isinstance",
"(",
"val",
",",
"dict",
")",
":",
"if",
"not",
"isinstance",
"(",
"val",
",",
"list",
")",
":",
"try",
":",
"val",
"=",
"h... | On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python list. | [
"On",
"the",
"CLI",
"these",
"are",
"passed",
"as",
"multiple",
"instances",
"of",
"a",
"given",
"CLI",
"option",
".",
"In",
"Salt",
"we",
"accept",
"these",
"as",
"a",
"comma",
"-",
"delimited",
"list",
"but",
"the",
"API",
"expects",
"a",
"Python",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L145-L160 | train | Validate that the value is a list of parameters for the a
parameter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | blkio_weight_device | def blkio_weight_device(val, **kwargs): # pylint: disable=unused-argument
'''
CLI input is a list of PATH:WEIGHT pairs, but the API expects a list of
dictionaries in the format [{'Path': path, 'Weight': weight}]
'''
val = helpers.map_vals(val, 'Path', 'Weight')
for idx in range(len(val)):
... | python | def blkio_weight_device(val, **kwargs): # pylint: disable=unused-argument
'''
CLI input is a list of PATH:WEIGHT pairs, but the API expects a list of
dictionaries in the format [{'Path': path, 'Weight': weight}]
'''
val = helpers.map_vals(val, 'Path', 'Weight')
for idx in range(len(val)):
... | [
"def",
"blkio_weight_device",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"val",
"=",
"helpers",
".",
"map_vals",
"(",
"val",
",",
"'Path'",
",",
"'Weight'",
")",
"for",
"idx",
"in",
"range",
"(",
"len",
"(",
"val",
... | CLI input is a list of PATH:WEIGHT pairs, but the API expects a list of
dictionaries in the format [{'Path': path, 'Weight': weight}] | [
"CLI",
"input",
"is",
"a",
"list",
"of",
"PATH",
":",
"WEIGHT",
"pairs",
"but",
"the",
"API",
"expects",
"a",
"list",
"of",
"dictionaries",
"in",
"the",
"format",
"[",
"{",
"Path",
":",
"path",
"Weight",
":",
"weight",
"}",
"]"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L167-L181 | train | Helper function to convert a list of PATH :WEIGHT pairs into a list of tuples. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | port_bindings | def port_bindings(val, **kwargs):
'''
On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python dictionary mapping ports to their bindings. The format the API
expects is complicated depending on whether o... | python | def port_bindings(val, **kwargs):
'''
On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python dictionary mapping ports to their bindings. The format the API
expects is complicated depending on whether o... | [
"def",
"port_bindings",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"validate_ip_addrs",
"=",
"kwargs",
".",
"get",
"(",
"'validate_ip_addrs'",
",",
"True",
")",
"if",
"not",
"isinstance",
"(",
"val",
",",
"dict",
")",
":",
"if",
"not",
"isinstance",
... | On the CLI, these are passed as multiple instances of a given CLI option.
In Salt, we accept these as a comma-delimited list but the API expects a
Python dictionary mapping ports to their bindings. The format the API
expects is complicated depending on whether or not the external port maps
to a differen... | [
"On",
"the",
"CLI",
"these",
"are",
"passed",
"as",
"multiple",
"instances",
"of",
"a",
"given",
"CLI",
"option",
".",
"In",
"Salt",
"we",
"accept",
"these",
"as",
"a",
"comma",
"-",
"delimited",
"list",
"but",
"the",
"API",
"expects",
"a",
"Python",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L360-L514 | train | Return a list of port bindings for the external port. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | ports | def ports(val, **kwargs): # pylint: disable=unused-argument
'''
Like cap_add, cap_drop, etc., this option can be specified multiple times,
and each time can be a port number or port range. Ultimately, the API
expects a list, but elements in the list are ints when the port is TCP, and
a tuple (port_... | python | def ports(val, **kwargs): # pylint: disable=unused-argument
'''
Like cap_add, cap_drop, etc., this option can be specified multiple times,
and each time can be a port number or port range. Ultimately, the API
expects a list, but elements in the list are ints when the port is TCP, and
a tuple (port_... | [
"def",
"ports",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"not",
"isinstance",
"(",
"val",
",",
"list",
")",
":",
"try",
":",
"val",
"=",
"helpers",
".",
"split",
"(",
"val",
")",
"except",
"AttributeError"... | Like cap_add, cap_drop, etc., this option can be specified multiple times,
and each time can be a port number or port range. Ultimately, the API
expects a list, but elements in the list are ints when the port is TCP, and
a tuple (port_num, 'udp') when the port is UDP. | [
"Like",
"cap_add",
"cap_drop",
"etc",
".",
"this",
"option",
"can",
"be",
"specified",
"multiple",
"times",
"and",
"each",
"time",
"can",
"be",
"a",
"port",
"number",
"or",
"port",
"range",
".",
"Ultimately",
"the",
"API",
"expects",
"a",
"list",
"but",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L517-L554 | train | Return a list of ports in the API
Insights. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | restart_policy | def restart_policy(val, **kwargs): # pylint: disable=unused-argument
'''
CLI input is in the format NAME[:RETRY_COUNT] but the API expects {'Name':
name, 'MaximumRetryCount': retry_count}. We will use the 'fill' kwarg here
to make sure the mapped result uses '0' for the count if this optional
value... | python | def restart_policy(val, **kwargs): # pylint: disable=unused-argument
'''
CLI input is in the format NAME[:RETRY_COUNT] but the API expects {'Name':
name, 'MaximumRetryCount': retry_count}. We will use the 'fill' kwarg here
to make sure the mapped result uses '0' for the count if this optional
value... | [
"def",
"restart_policy",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"val",
"=",
"helpers",
".",
"map_vals",
"(",
"val",
",",
"'Name'",
",",
"'MaximumRetryCount'",
",",
"fill",
"=",
"'0'",
")",
"# map_vals() converts the i... | CLI input is in the format NAME[:RETRY_COUNT] but the API expects {'Name':
name, 'MaximumRetryCount': retry_count}. We will use the 'fill' kwarg here
to make sure the mapped result uses '0' for the count if this optional
value was omitted. | [
"CLI",
"input",
"is",
"in",
"the",
"format",
"NAME",
"[",
":",
"RETRY_COUNT",
"]",
"but",
"the",
"API",
"expects",
"{",
"Name",
":",
"name",
"MaximumRetryCount",
":",
"retry_count",
"}",
".",
"We",
"will",
"use",
"the",
"fill",
"kwarg",
"here",
"to",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L569-L597 | train | Restart the specified resource policy. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | user | def user(val, **kwargs): # pylint: disable=unused-argument
'''
This can be either a string or a numeric uid
'''
if not isinstance(val, six.integer_types):
# Try to convert to integer. This will fail if the value is a
# username. This is OK, as we check below to make sure that the
... | python | def user(val, **kwargs): # pylint: disable=unused-argument
'''
This can be either a string or a numeric uid
'''
if not isinstance(val, six.integer_types):
# Try to convert to integer. This will fail if the value is a
# username. This is OK, as we check below to make sure that the
... | [
"def",
"user",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"not",
"isinstance",
"(",
"val",
",",
"six",
".",
"integer_types",
")",
":",
"# Try to convert to integer. This will fail if the value is a",
"# username. This is OK... | This can be either a string or a numeric uid | [
"This",
"can",
"be",
"either",
"a",
"string",
"or",
"a",
"numeric",
"uid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L665-L683 | train | Validate the uid of the current user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | volumes | def volumes(val, **kwargs): # pylint: disable=unused-argument
'''
Should be a list of absolute paths
'''
val = helpers.translate_stringlist(val)
for item in val:
if not os.path.isabs(item):
raise SaltInvocationError(
'\'{0}\' is not an absolute path'.format(item)... | python | def volumes(val, **kwargs): # pylint: disable=unused-argument
'''
Should be a list of absolute paths
'''
val = helpers.translate_stringlist(val)
for item in val:
if not os.path.isabs(item):
raise SaltInvocationError(
'\'{0}\' is not an absolute path'.format(item)... | [
"def",
"volumes",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"val",
"=",
"helpers",
".",
"translate_stringlist",
"(",
"val",
")",
"for",
"item",
"in",
"val",
":",
"if",
"not",
"os",
".",
"path",
".",
"isabs",
"(",... | Should be a list of absolute paths | [
"Should",
"be",
"a",
"list",
"of",
"absolute",
"paths"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L694-L704 | train | Validate that the input is a list of absolute paths. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/docker/translate/container.py | working_dir | def working_dir(val, **kwargs): # pylint: disable=unused-argument
'''
Must be an absolute path
'''
try:
is_abs = os.path.isabs(val)
except AttributeError:
is_abs = False
if not is_abs:
raise SaltInvocationError('\'{0}\' is not an absolute path'.format(val))
return va... | python | def working_dir(val, **kwargs): # pylint: disable=unused-argument
'''
Must be an absolute path
'''
try:
is_abs = os.path.isabs(val)
except AttributeError:
is_abs = False
if not is_abs:
raise SaltInvocationError('\'{0}\' is not an absolute path'.format(val))
return va... | [
"def",
"working_dir",
"(",
"val",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"try",
":",
"is_abs",
"=",
"os",
".",
"path",
".",
"isabs",
"(",
"val",
")",
"except",
"AttributeError",
":",
"is_abs",
"=",
"False",
"if",
"not",
"... | Must be an absolute path | [
"Must",
"be",
"an",
"absolute",
"path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/translate/container.py#L711-L721 | train | Validate that the value is a valid path to the working directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _guess_apiserver | def _guess_apiserver(apiserver_url=None):
'''Try to guees the kubemaster url from environ,
then from `/etc/kubernetes/config` file
'''
default_config = "/etc/kubernetes/config"
if apiserver_url is not None:
return apiserver_url
if "KUBERNETES_MASTER" in os.environ:
apiserver_url ... | python | def _guess_apiserver(apiserver_url=None):
'''Try to guees the kubemaster url from environ,
then from `/etc/kubernetes/config` file
'''
default_config = "/etc/kubernetes/config"
if apiserver_url is not None:
return apiserver_url
if "KUBERNETES_MASTER" in os.environ:
apiserver_url ... | [
"def",
"_guess_apiserver",
"(",
"apiserver_url",
"=",
"None",
")",
":",
"default_config",
"=",
"\"/etc/kubernetes/config\"",
"if",
"apiserver_url",
"is",
"not",
"None",
":",
"return",
"apiserver_url",
"if",
"\"KUBERNETES_MASTER\"",
"in",
"os",
".",
"environ",
":",
... | Try to guees the kubemaster url from environ,
then from `/etc/kubernetes/config` file | [
"Try",
"to",
"guees",
"the",
"kubemaster",
"url",
"from",
"environ",
"then",
"from",
"/",
"etc",
"/",
"kubernetes",
"/",
"config",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L43-L67 | train | Try to guess the apiserver url from the config file and the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _kpost | def _kpost(url, data):
''' create any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json"}
# Make request
log.trace("url is: %s, data is: %s", url, data)
ret = http.query(url,
method='POST',
header_dict=... | python | def _kpost(url, data):
''' create any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json"}
# Make request
log.trace("url is: %s, data is: %s", url, data)
ret = http.query(url,
method='POST',
header_dict=... | [
"def",
"_kpost",
"(",
"url",
",",
"data",
")",
":",
"# Prepare headers",
"headers",
"=",
"{",
"\"Content-Type\"",
":",
"\"application/json\"",
"}",
"# Make request",
"log",
".",
"trace",
"(",
"\"url is: %s, data is: %s\"",
",",
"url",
",",
"data",
")",
"ret",
... | create any object in kubernetes based on URL | [
"create",
"any",
"object",
"in",
"kubernetes",
"based",
"on",
"URL"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L70-L85 | train | create any object in kubernetes based on URL | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _kput | def _kput(url, data):
''' put any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json"}
# Make request
ret = http.query(url,
method='PUT',
header_dict=headers,
data=salt.utils.json.dumps(... | python | def _kput(url, data):
''' put any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json"}
# Make request
ret = http.query(url,
method='PUT',
header_dict=headers,
data=salt.utils.json.dumps(... | [
"def",
"_kput",
"(",
"url",
",",
"data",
")",
":",
"# Prepare headers",
"headers",
"=",
"{",
"\"Content-Type\"",
":",
"\"application/json\"",
"}",
"# Make request",
"ret",
"=",
"http",
".",
"query",
"(",
"url",
",",
"method",
"=",
"'PUT'",
",",
"header_dict"... | put any object in kubernetes based on URL | [
"put",
"any",
"object",
"in",
"kubernetes",
"based",
"on",
"URL"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L88-L102 | train | Put any object in kubernetes based on URL | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _kpatch | def _kpatch(url, data):
''' patch any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json-patch+json"}
# Make request
ret = http.query(url, method='PATCH', header_dict=headers,
data=salt.utils.json.dumps(data))
# Check reques... | python | def _kpatch(url, data):
''' patch any object in kubernetes based on URL '''
# Prepare headers
headers = {"Content-Type": "application/json-patch+json"}
# Make request
ret = http.query(url, method='PATCH', header_dict=headers,
data=salt.utils.json.dumps(data))
# Check reques... | [
"def",
"_kpatch",
"(",
"url",
",",
"data",
")",
":",
"# Prepare headers",
"headers",
"=",
"{",
"\"Content-Type\"",
":",
"\"application/json-patch+json\"",
"}",
"# Make request",
"ret",
"=",
"http",
".",
"query",
"(",
"url",
",",
"method",
"=",
"'PATCH'",
",",
... | patch any object in kubernetes based on URL | [
"patch",
"any",
"object",
"in",
"kubernetes",
"based",
"on",
"URL"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L105-L118 | train | patch any object in kubernetes based on URL | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _kname | def _kname(obj):
'''Get name or names out of json result from API server'''
if isinstance(obj, dict):
return [obj.get("metadata", {}).get("name", "")]
elif isinstance(obj, (list, tuple)):
names = []
for i in obj:
names.append(i.get("metadata", {}).get("name", ""))
... | python | def _kname(obj):
'''Get name or names out of json result from API server'''
if isinstance(obj, dict):
return [obj.get("metadata", {}).get("name", "")]
elif isinstance(obj, (list, tuple)):
names = []
for i in obj:
names.append(i.get("metadata", {}).get("name", ""))
... | [
"def",
"_kname",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
":",
"return",
"[",
"obj",
".",
"get",
"(",
"\"metadata\"",
",",
"{",
"}",
")",
".",
"get",
"(",
"\"name\"",
",",
"\"\"",
")",
"]",
"elif",
"isinstance",
"("... | Get name or names out of json result from API server | [
"Get",
"name",
"or",
"names",
"out",
"of",
"json",
"result",
"from",
"API",
"server"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L121-L131 | train | Get name or names out of json result from API server | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _is_dns_subdomain | def _is_dns_subdomain(name):
''' Check that name is DNS subdomain: One or more lowercase rfc1035/rfc1123
labels separated by '.' with a maximum length of 253 characters '''
dns_subdomain = re.compile(r"""^[a-z0-9\.-]{1,253}$""")
if dns_subdomain.match(name):
log.debug("Name: %s is valid DNS sub... | python | def _is_dns_subdomain(name):
''' Check that name is DNS subdomain: One or more lowercase rfc1035/rfc1123
labels separated by '.' with a maximum length of 253 characters '''
dns_subdomain = re.compile(r"""^[a-z0-9\.-]{1,253}$""")
if dns_subdomain.match(name):
log.debug("Name: %s is valid DNS sub... | [
"def",
"_is_dns_subdomain",
"(",
"name",
")",
":",
"dns_subdomain",
"=",
"re",
".",
"compile",
"(",
"r\"\"\"^[a-z0-9\\.-]{1,253}$\"\"\"",
")",
"if",
"dns_subdomain",
".",
"match",
"(",
"name",
")",
":",
"log",
".",
"debug",
"(",
"\"Name: %s is valid DNS subdomain\... | Check that name is DNS subdomain: One or more lowercase rfc1035/rfc1123
labels separated by '.' with a maximum length of 253 characters | [
"Check",
"that",
"name",
"is",
"DNS",
"subdomain",
":",
"One",
"or",
"more",
"lowercase",
"rfc1035",
"/",
"rfc1123",
"labels",
"separated",
"by",
".",
"with",
"a",
"maximum",
"length",
"of",
"253",
"characters"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L134-L144 | train | Check that the name is a DNS subdomain | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _is_port_name | def _is_port_name(name):
''' Check that name is IANA service: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 15 characters, with the '-' character allowed
anywhere except the first or the last character or adjacent to another '-'
character, it must contain at least a (a-z) character '''... | python | def _is_port_name(name):
''' Check that name is IANA service: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 15 characters, with the '-' character allowed
anywhere except the first or the last character or adjacent to another '-'
character, it must contain at least a (a-z) character '''... | [
"def",
"_is_port_name",
"(",
"name",
")",
":",
"port_name",
"=",
"re",
".",
"compile",
"(",
"\"\"\"^[a-z0-9]{1,15}$\"\"\"",
")",
"if",
"port_name",
".",
"match",
"(",
"name",
")",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | Check that name is IANA service: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 15 characters, with the '-' character allowed
anywhere except the first or the last character or adjacent to another '-'
character, it must contain at least a (a-z) character | [
"Check",
"that",
"name",
"is",
"IANA",
"service",
":",
"An",
"alphanumeric",
"(",
"a",
"-",
"z",
"and",
"0",
"-",
"9",
")",
"string",
"with",
"a",
"maximum",
"length",
"of",
"15",
"characters",
"with",
"the",
"-",
"character",
"allowed",
"anywhere",
"e... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L147-L157 | train | Check that the given name is IANA service name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _is_dns_label | def _is_dns_label(name):
''' Check that name is DNS label: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 63 characters, with the '-' character allowed
anywhere except the first or last character, suitable for use as a hostname
or segment in a domain name '''
dns_label = re.compile... | python | def _is_dns_label(name):
''' Check that name is DNS label: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 63 characters, with the '-' character allowed
anywhere except the first or last character, suitable for use as a hostname
or segment in a domain name '''
dns_label = re.compile... | [
"def",
"_is_dns_label",
"(",
"name",
")",
":",
"dns_label",
"=",
"re",
".",
"compile",
"(",
"r\"\"\"^[a-z0-9][a-z0-9\\.-]{1,62}$\"\"\"",
")",
"if",
"dns_label",
".",
"match",
"(",
"name",
")",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | Check that name is DNS label: An alphanumeric (a-z, and 0-9) string,
with a maximum length of 63 characters, with the '-' character allowed
anywhere except the first or last character, suitable for use as a hostname
or segment in a domain name | [
"Check",
"that",
"name",
"is",
"DNS",
"label",
":",
"An",
"alphanumeric",
"(",
"a",
"-",
"z",
"and",
"0",
"-",
"9",
")",
"string",
"with",
"a",
"maximum",
"length",
"of",
"63",
"characters",
"with",
"the",
"-",
"character",
"allowed",
"anywhere",
"exce... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L160-L170 | train | Check that the name is a DNS label | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _get_labels | def _get_labels(node, apiserver_url):
'''Get all labels from a kube node.'''
# Prepare URL
url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
# Make request
ret = http.query(url)
# Check requests status
if 'body' in ret:
ret = salt.utils.json.loads(ret.get('body'))
elif ret... | python | def _get_labels(node, apiserver_url):
'''Get all labels from a kube node.'''
# Prepare URL
url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
# Make request
ret = http.query(url)
# Check requests status
if 'body' in ret:
ret = salt.utils.json.loads(ret.get('body'))
elif ret... | [
"def",
"_get_labels",
"(",
"node",
",",
"apiserver_url",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/nodes/{1}\"",
".",
"format",
"(",
"apiserver_url",
",",
"node",
")",
"# Make request",
"ret",
"=",
"http",
".",
"query",
"(",
"url",
")",
"# Check req... | Get all labels from a kube node. | [
"Get",
"all",
"labels",
"from",
"a",
"kube",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L180-L194 | train | Get all labels from a kube node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _set_labels | def _set_labels(node, apiserver_url, labels):
'''Replace labels dict by a new one'''
# Prepare URL
url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
# Prepare data
data = [{"op": "replace", "path": "/metadata/labels", "value": labels}]
# Make request
ret = _kpatch(url, data)
if re... | python | def _set_labels(node, apiserver_url, labels):
'''Replace labels dict by a new one'''
# Prepare URL
url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
# Prepare data
data = [{"op": "replace", "path": "/metadata/labels", "value": labels}]
# Make request
ret = _kpatch(url, data)
if re... | [
"def",
"_set_labels",
"(",
"node",
",",
"apiserver_url",
",",
"labels",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/nodes/{1}\"",
".",
"format",
"(",
"apiserver_url",
",",
"node",
")",
"# Prepare data",
"data",
"=",
"[",
"{",
"\"op\"",
":",
"\"replace... | Replace labels dict by a new one | [
"Replace",
"labels",
"dict",
"by",
"a",
"new",
"one"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L197-L207 | train | Replace labels dict by a new one | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | get_labels | def get_labels(node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Get labels from the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.get_labels
salt '*' k8s.get_labels kube-node.cluster.local http://kube-master.cluster.local
'''
# Get salt minion... | python | def get_labels(node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Get labels from the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.get_labels
salt '*' k8s.get_labels kube-node.cluster.local http://kube-master.cluster.local
'''
# Get salt minion... | [
"def",
"get_labels",
"(",
"node",
"=",
"None",
",",
"apiserver_url",
"=",
"None",
")",
":",
"# Get salt minion ID",
"node",
"=",
"_guess_node_id",
"(",
"node",
")",
"# Try to get kubernetes master",
"apiserver_url",
"=",
"_guess_apiserver",
"(",
"apiserver_url",
")"... | .. versionadded:: 2016.3.0
Get labels from the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.get_labels
salt '*' k8s.get_labels kube-node.cluster.local http://kube-master.cluster.local | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L210-L234 | train | Get labels from the current node | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | label_present | def label_present(name, value, node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Set label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_present hw/disktype ssd
salt '*' k8s.label_present hw/disktype ssd kube-node.cluster.local http://kube... | python | def label_present(name, value, node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Set label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_present hw/disktype ssd
salt '*' k8s.label_present hw/disktype ssd kube-node.cluster.local http://kube... | [
"def",
"label_present",
"(",
"name",
",",
"value",
",",
"node",
"=",
"None",
",",
"apiserver_url",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
... | .. versionadded:: 2016.3.0
Set label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_present hw/disktype ssd
salt '*' k8s.label_present hw/disktype ssd kube-node.cluster.local http://kube-master.cluster.local | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L237-L292 | train | Ensure that the named label is present in the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | label_absent | def label_absent(name, node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Delete label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_absent hw/disktype
salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.... | python | def label_absent(name, node=None, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Delete label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_absent hw/disktype
salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.... | [
"def",
"label_absent",
"(",
"name",
",",
"node",
"=",
"None",
",",
"apiserver_url",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"# G... | .. versionadded:: 2016.3.0
Delete label to the current node
CLI Example:
.. code-block:: bash
salt '*' k8s.label_absent hw/disktype
salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.local | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L295-L339 | train | Ensure that the named label is absent in the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _get_namespaces | def _get_namespaces(apiserver_url, name=""):
'''Get namespace is namespace is defined otherwise return all namespaces'''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}".format(apiserver_url, name)
# Make request
ret = http.query(url)
if ret.get("body"):
return salt.utils.json.loads(ret.g... | python | def _get_namespaces(apiserver_url, name=""):
'''Get namespace is namespace is defined otherwise return all namespaces'''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}".format(apiserver_url, name)
# Make request
ret = http.query(url)
if ret.get("body"):
return salt.utils.json.loads(ret.g... | [
"def",
"_get_namespaces",
"(",
"apiserver_url",
",",
"name",
"=",
"\"\"",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/namespaces/{1}\"",
".",
"format",
"(",
"apiserver_url",
",",
"name",
")",
"# Make request",
"ret",
"=",
"http",
".",
"query",
"(",
"u... | Get namespace is namespace is defined otherwise return all namespaces | [
"Get",
"namespace",
"is",
"namespace",
"is",
"defined",
"otherwise",
"return",
"all",
"namespaces"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L390-L399 | train | Get namespace is namespace is defined otherwise return all namespaces | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _create_namespace | def _create_namespace(namespace, apiserver_url):
''' create namespace on the defined k8s cluster '''
# Prepare URL
url = "{0}/api/v1/namespaces".format(apiserver_url)
# Prepare data
data = {
"kind": "Namespace",
"apiVersion": "v1",
"metadata": {
"name": namespace,... | python | def _create_namespace(namespace, apiserver_url):
''' create namespace on the defined k8s cluster '''
# Prepare URL
url = "{0}/api/v1/namespaces".format(apiserver_url)
# Prepare data
data = {
"kind": "Namespace",
"apiVersion": "v1",
"metadata": {
"name": namespace,... | [
"def",
"_create_namespace",
"(",
"namespace",
",",
"apiserver_url",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/namespaces\"",
".",
"format",
"(",
"apiserver_url",
")",
"# Prepare data",
"data",
"=",
"{",
"\"kind\"",
":",
"\"Namespace\"",
",",
"\"apiVersion... | create namespace on the defined k8s cluster | [
"create",
"namespace",
"on",
"the",
"defined",
"k8s",
"cluster"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L402-L419 | train | create a namespace on the defined k8s cluster | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | create_namespace | def create_namespace(name, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Create kubernetes namespace from the name, similar to the functionality added to kubectl since v.1.2.0:
.. code-block:: bash
kubectl create namespaces namespace-name
CLI Example:
.. code-block:: bash
... | python | def create_namespace(name, apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Create kubernetes namespace from the name, similar to the functionality added to kubectl since v.1.2.0:
.. code-block:: bash
kubectl create namespaces namespace-name
CLI Example:
.. code-block:: bash
... | [
"def",
"create_namespace",
"(",
"name",
",",
"apiserver_url",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"# Try to get kubernetes master",
... | .. versionadded:: 2016.3.0
Create kubernetes namespace from the name, similar to the functionality added to kubectl since v.1.2.0:
.. code-block:: bash
kubectl create namespaces namespace-name
CLI Example:
.. code-block:: bash
salt '*' k8s.create_namespace namespace_name
sa... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L422-L454 | train | Create kubernetes namespace from the name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | get_namespaces | def get_namespaces(namespace="", apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Get one or all kubernetes namespaces.
If namespace parameter is omitted, all namespaces will be returned back to user, similar to following kubectl example:
.. code-block:: bash
kubectl get namespaces -o... | python | def get_namespaces(namespace="", apiserver_url=None):
'''
.. versionadded:: 2016.3.0
Get one or all kubernetes namespaces.
If namespace parameter is omitted, all namespaces will be returned back to user, similar to following kubectl example:
.. code-block:: bash
kubectl get namespaces -o... | [
"def",
"get_namespaces",
"(",
"namespace",
"=",
"\"\"",
",",
"apiserver_url",
"=",
"None",
")",
":",
"# Try to get kubernetes master",
"apiserver_url",
"=",
"_guess_apiserver",
"(",
"apiserver_url",
")",
"if",
"apiserver_url",
"is",
"None",
":",
"return",
"False",
... | .. versionadded:: 2016.3.0
Get one or all kubernetes namespaces.
If namespace parameter is omitted, all namespaces will be returned back to user, similar to following kubectl example:
.. code-block:: bash
kubectl get namespaces -o json
In case namespace is set by user, the output will be si... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L457-L491 | train | Get one or all kubernetes namespaces. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _update_secret | def _update_secret(namespace, name, data, apiserver_url):
'''Replace secrets data by a new one'''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}/secrets/{2}".format(apiserver_url,
namespace, name)
# Prepare data
data = [{"op": "replace", "path... | python | def _update_secret(namespace, name, data, apiserver_url):
'''Replace secrets data by a new one'''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}/secrets/{2}".format(apiserver_url,
namespace, name)
# Prepare data
data = [{"op": "replace", "path... | [
"def",
"_update_secret",
"(",
"namespace",
",",
"name",
",",
"data",
",",
"apiserver_url",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/namespaces/{1}/secrets/{2}\"",
".",
"format",
"(",
"apiserver_url",
",",
"namespace",
",",
"name",
")",
"# Prepare data",
... | Replace secrets data by a new one | [
"Replace",
"secrets",
"data",
"by",
"a",
"new",
"one"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L508-L519 | train | Replace secrets data by a new one | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | _create_secret | def _create_secret(namespace, name, data, apiserver_url):
''' create namespace on the defined k8s cluster '''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}/secrets".format(apiserver_url, namespace)
# Prepare data
request = {
"apiVersion": "v1",
"kind": "Secret",
"metadata": ... | python | def _create_secret(namespace, name, data, apiserver_url):
''' create namespace on the defined k8s cluster '''
# Prepare URL
url = "{0}/api/v1/namespaces/{1}/secrets".format(apiserver_url, namespace)
# Prepare data
request = {
"apiVersion": "v1",
"kind": "Secret",
"metadata": ... | [
"def",
"_create_secret",
"(",
"namespace",
",",
"name",
",",
"data",
",",
"apiserver_url",
")",
":",
"# Prepare URL",
"url",
"=",
"\"{0}/api/v1/namespaces/{1}/secrets\"",
".",
"format",
"(",
"apiserver_url",
",",
"namespace",
")",
"# Prepare data",
"request",
"=",
... | create namespace on the defined k8s cluster | [
"create",
"namespace",
"on",
"the",
"defined",
"k8s",
"cluster"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L522-L538 | train | create a secret on the defined k8s cluster | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | get_secrets | def get_secrets(namespace, name="", apiserver_url=None, decode=False, brief=False):
'''
Get k8s namespaces
CLI Example:
.. code-block:: bash
salt '*' k8s.get_secrets namespace_name
salt '*' k8s.get_secrets namespace_name secret_name http://kube-master.cluster.local
'''
# Try ... | python | def get_secrets(namespace, name="", apiserver_url=None, decode=False, brief=False):
'''
Get k8s namespaces
CLI Example:
.. code-block:: bash
salt '*' k8s.get_secrets namespace_name
salt '*' k8s.get_secrets namespace_name secret_name http://kube-master.cluster.local
'''
# Try ... | [
"def",
"get_secrets",
"(",
"namespace",
",",
"name",
"=",
"\"\"",
",",
"apiserver_url",
"=",
"None",
",",
"decode",
"=",
"False",
",",
"brief",
"=",
"False",
")",
":",
"# Try to get kubernetes master",
"apiserver_url",
"=",
"_guess_apiserver",
"(",
"apiserver_ur... | Get k8s namespaces
CLI Example:
.. code-block:: bash
salt '*' k8s.get_secrets namespace_name
salt '*' k8s.get_secrets namespace_name secret_name http://kube-master.cluster.local | [
"Get",
"k8s",
"namespaces"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L571-L593 | train | Get secrets from kubernetes | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | update_secret | def update_secret(namespace, name, sources, apiserver_url=None, force=True, saltenv='base'):
'''
.. versionadded:: 2016.3.0
alias to k8s.create_secret with update=true
CLI Example:
.. code-block:: bash
salt '*' k8s.update_secret namespace_name secret_name sources [apiserver_url] [force=t... | python | def update_secret(namespace, name, sources, apiserver_url=None, force=True, saltenv='base'):
'''
.. versionadded:: 2016.3.0
alias to k8s.create_secret with update=true
CLI Example:
.. code-block:: bash
salt '*' k8s.update_secret namespace_name secret_name sources [apiserver_url] [force=t... | [
"def",
"update_secret",
"(",
"namespace",
",",
"name",
",",
"sources",
",",
"apiserver_url",
"=",
"None",
",",
"force",
"=",
"True",
",",
"saltenv",
"=",
"'base'",
")",
":",
"apiserver_url",
"=",
"_guess_apiserver",
"(",
"apiserver_url",
")",
"ret",
"=",
"... | .. versionadded:: 2016.3.0
alias to k8s.create_secret with update=true
CLI Example:
.. code-block:: bash
salt '*' k8s.update_secret namespace_name secret_name sources [apiserver_url] [force=true] [update=false] [saltenv='base']
sources are either dictionary of {name: path, name1: path} pair... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L623-L664 | train | Create a new kubernetes secret | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | create_secret | def create_secret(namespace, name, sources, apiserver_url=None, force=False, update=False, saltenv='base'):
'''
.. versionadded:: 2016.3.0
Create k8s secrets in the defined namespace from the list of files
CLI Example:
.. code-block:: bash
salt '*' k8s.create_secret namespace_name secret... | python | def create_secret(namespace, name, sources, apiserver_url=None, force=False, update=False, saltenv='base'):
'''
.. versionadded:: 2016.3.0
Create k8s secrets in the defined namespace from the list of files
CLI Example:
.. code-block:: bash
salt '*' k8s.create_secret namespace_name secret... | [
"def",
"create_secret",
"(",
"namespace",
",",
"name",
",",
"sources",
",",
"apiserver_url",
"=",
"None",
",",
"force",
"=",
"False",
",",
"update",
"=",
"False",
",",
"saltenv",
"=",
"'base'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"... | .. versionadded:: 2016.3.0
Create k8s secrets in the defined namespace from the list of files
CLI Example:
.. code-block:: bash
salt '*' k8s.create_secret namespace_name secret_name sources
salt '*' k8s.create_secret namespace_name secret_name sources
http://kube-master.cluster.... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L667-L774 | train | Create a kubernetes secret in the specified namespace | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/k8s.py | delete_secret | def delete_secret(namespace, name, apiserver_url=None, force=True):
'''
.. versionadded:: 2016.3.0
Delete kubernetes secret in the defined namespace. Namespace is the mandatory parameter as well as name.
CLI Example:
.. code-block:: bash
salt '*' k8s.delete_secret namespace_name secret_n... | python | def delete_secret(namespace, name, apiserver_url=None, force=True):
'''
.. versionadded:: 2016.3.0
Delete kubernetes secret in the defined namespace. Namespace is the mandatory parameter as well as name.
CLI Example:
.. code-block:: bash
salt '*' k8s.delete_secret namespace_name secret_n... | [
"def",
"delete_secret",
"(",
"namespace",
",",
"name",
",",
"apiserver_url",
"=",
"None",
",",
"force",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"... | .. versionadded:: 2016.3.0
Delete kubernetes secret in the defined namespace. Namespace is the mandatory parameter as well as name.
CLI Example:
.. code-block:: bash
salt '*' k8s.delete_secret namespace_name secret_name
salt '*' k8s.delete_secret namespace_name secret_name http://kube-m... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/k8s.py#L777-L811 | train | Delete kubernetes secret in the specified namespace | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | get_pillar | def get_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None,
pillar_override=None, pillarenv=None, extra_minion_data=None):
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opts.get('master_type') == 'disable'... | python | def get_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None,
pillar_override=None, pillarenv=None, extra_minion_data=None):
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opts.get('master_type') == 'disable'... | [
"def",
"get_pillar",
"(",
"opts",
",",
"grains",
",",
"minion_id",
",",
"saltenv",
"=",
"None",
",",
"ext",
"=",
"None",
",",
"funcs",
"=",
"None",
",",
"pillar_override",
"=",
"None",
",",
"pillarenv",
"=",
"None",
",",
"extra_minion_data",
"=",
"None",... | Return the correct pillar driver based on the file_client option | [
"Return",
"the",
"correct",
"pillar",
"driver",
"based",
"on",
"the",
"file_client",
"option"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L45-L66 | train | Return the correct pillar driver based on the master type option | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | get_async_pillar | def get_async_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None,
pillar_override=None, pillarenv=None,
extra_minion_data=None):
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opt... | python | def get_async_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None,
pillar_override=None, pillarenv=None,
extra_minion_data=None):
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opt... | [
"def",
"get_async_pillar",
"(",
"opts",
",",
"grains",
",",
"minion_id",
",",
"saltenv",
"=",
"None",
",",
"ext",
"=",
"None",
",",
"funcs",
"=",
"None",
",",
"pillar_override",
"=",
"None",
",",
"pillarenv",
"=",
"None",
",",
"extra_minion_data",
"=",
"... | Return the correct pillar driver based on the file_client option | [
"Return",
"the",
"correct",
"pillar",
"driver",
"based",
"on",
"the",
"file_client",
"option"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L70-L85 | train | Return the correct pillar driver based on the file_client option | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | RemotePillarMixin.get_ext_pillar_extra_minion_data | def get_ext_pillar_extra_minion_data(self, opts):
'''
Returns the extra data from the minion's opts dict (the config file).
This data will be passed to external pillar functions.
'''
def get_subconfig(opts_key):
'''
Returns a dict containing the opts key ... | python | def get_ext_pillar_extra_minion_data(self, opts):
'''
Returns the extra data from the minion's opts dict (the config file).
This data will be passed to external pillar functions.
'''
def get_subconfig(opts_key):
'''
Returns a dict containing the opts key ... | [
"def",
"get_ext_pillar_extra_minion_data",
"(",
"self",
",",
"opts",
")",
":",
"def",
"get_subconfig",
"(",
"opts_key",
")",
":",
"'''\n Returns a dict containing the opts key subtree, while maintaining\n the opts structure\n '''",
"ret_dict",
"=",
... | Returns the extra data from the minion's opts dict (the config file).
This data will be passed to external pillar functions. | [
"Returns",
"the",
"extra",
"data",
"from",
"the",
"minion",
"s",
"opts",
"dict",
"(",
"the",
"config",
"file",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L92-L131 | train | Returns the extra data from the minion s opts dict. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | AsyncRemotePillar.compile_pillar | def compile_pillar(self):
'''
Return a future which will contain the pillar data from the master
'''
load = {'id': self.minion_id,
'grains': self.grains,
'saltenv': self.opts['saltenv'],
'pillarenv': self.opts['pillarenv'],
... | python | def compile_pillar(self):
'''
Return a future which will contain the pillar data from the master
'''
load = {'id': self.minion_id,
'grains': self.grains,
'saltenv': self.opts['saltenv'],
'pillarenv': self.opts['pillarenv'],
... | [
"def",
"compile_pillar",
"(",
"self",
")",
":",
"load",
"=",
"{",
"'id'",
":",
"self",
".",
"minion_id",
",",
"'grains'",
":",
"self",
".",
"grains",
",",
"'saltenv'",
":",
"self",
".",
"opts",
"[",
"'saltenv'",
"]",
",",
"'pillarenv'",
":",
"self",
... | Return a future which will contain the pillar data from the master | [
"Return",
"a",
"future",
"which",
"will",
"contain",
"the",
"pillar",
"data",
"from",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L163-L192 | train | Return a future which will contain the pillar data from the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | RemotePillar.compile_pillar | def compile_pillar(self):
'''
Return the pillar data from the master
'''
load = {'id': self.minion_id,
'grains': self.grains,
'saltenv': self.opts['saltenv'],
'pillarenv': self.opts['pillarenv'],
'pillar_override': self.pill... | python | def compile_pillar(self):
'''
Return the pillar data from the master
'''
load = {'id': self.minion_id,
'grains': self.grains,
'saltenv': self.opts['saltenv'],
'pillarenv': self.opts['pillarenv'],
'pillar_override': self.pill... | [
"def",
"compile_pillar",
"(",
"self",
")",
":",
"load",
"=",
"{",
"'id'",
":",
"self",
".",
"minion_id",
",",
"'grains'",
":",
"self",
".",
"grains",
",",
"'saltenv'",
":",
"self",
".",
"opts",
"[",
"'saltenv'",
"]",
",",
"'pillarenv'",
":",
"self",
... | Return the pillar data from the master | [
"Return",
"the",
"pillar",
"data",
"from",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L233-L257 | train | Return the pillar data from the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | PillarCache.fetch_pillar | def fetch_pillar(self):
'''
In the event of a cache miss, we need to incur the overhead of caching
a new pillar.
'''
log.debug('Pillar cache getting external pillar with ext: %s', self.ext)
fresh_pillar = Pillar(self.opts,
self.grains,
... | python | def fetch_pillar(self):
'''
In the event of a cache miss, we need to incur the overhead of caching
a new pillar.
'''
log.debug('Pillar cache getting external pillar with ext: %s', self.ext)
fresh_pillar = Pillar(self.opts,
self.grains,
... | [
"def",
"fetch_pillar",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'Pillar cache getting external pillar with ext: %s'",
",",
"self",
".",
"ext",
")",
"fresh_pillar",
"=",
"Pillar",
"(",
"self",
".",
"opts",
",",
"self",
".",
"grains",
",",
"self",
"."... | In the event of a cache miss, we need to incur the overhead of caching
a new pillar. | [
"In",
"the",
"event",
"of",
"a",
"cache",
"miss",
"we",
"need",
"to",
"incur",
"the",
"overhead",
"of",
"caching",
"a",
"new",
"pillar",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L318-L331 | train | Fetch the external pillar from the cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | PillarCache.compile_pillar | def compile_pillar(self, *args, **kwargs): # Will likely just be pillar_dirs
'''
Compile pillar and set it to the cache, if not found.
:param args:
:param kwargs:
:return:
'''
log.debug('Scanning pillar cache for information about minion %s and pillarenv %s', se... | python | def compile_pillar(self, *args, **kwargs): # Will likely just be pillar_dirs
'''
Compile pillar and set it to the cache, if not found.
:param args:
:param kwargs:
:return:
'''
log.debug('Scanning pillar cache for information about minion %s and pillarenv %s', se... | [
"def",
"compile_pillar",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Will likely just be pillar_dirs",
"log",
".",
"debug",
"(",
"'Scanning pillar cache for information about minion %s and pillarenv %s'",
",",
"self",
".",
"minion_id",
",",
"s... | Compile pillar and set it to the cache, if not found.
:param args:
:param kwargs:
:return: | [
"Compile",
"pillar",
"and",
"set",
"it",
"to",
"the",
"cache",
"if",
"not",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L333-L374 | train | Compile pillar and set it to the cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.__valid_on_demand_ext_pillar | def __valid_on_demand_ext_pillar(self, opts):
'''
Check to see if the on demand external pillar is allowed
'''
if not isinstance(self.ext, dict):
log.error(
'On-demand pillar %s is not formatted as a dictionary',
self.ext
)
... | python | def __valid_on_demand_ext_pillar(self, opts):
'''
Check to see if the on demand external pillar is allowed
'''
if not isinstance(self.ext, dict):
log.error(
'On-demand pillar %s is not formatted as a dictionary',
self.ext
)
... | [
"def",
"__valid_on_demand_ext_pillar",
"(",
"self",
",",
"opts",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"ext",
",",
"dict",
")",
":",
"log",
".",
"error",
"(",
"'On-demand pillar %s is not formatted as a dictionary'",
",",
"self",
".",
"ext",
"... | Check to see if the on demand external pillar is allowed | [
"Check",
"to",
"see",
"if",
"the",
"on",
"demand",
"external",
"pillar",
"is",
"allowed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L429-L461 | train | Check to see if the on demand external pillar data is allowed for the master and if so check if the on demand external pillar data is valid for the master and if so check if the on demand external pillar data is valid for the master and if so check if the on demand external pillar data is valid for the master and if so... | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.__gather_avail | def __gather_avail(self):
'''
Gather the lists of available sls data from the master
'''
avail = {}
for saltenv in self._get_envs():
avail[saltenv] = self.client.list_states(saltenv)
return avail | python | def __gather_avail(self):
'''
Gather the lists of available sls data from the master
'''
avail = {}
for saltenv in self._get_envs():
avail[saltenv] = self.client.list_states(saltenv)
return avail | [
"def",
"__gather_avail",
"(",
"self",
")",
":",
"avail",
"=",
"{",
"}",
"for",
"saltenv",
"in",
"self",
".",
"_get_envs",
"(",
")",
":",
"avail",
"[",
"saltenv",
"]",
"=",
"self",
".",
"client",
".",
"list_states",
"(",
"saltenv",
")",
"return",
"ava... | Gather the lists of available sls data from the master | [
"Gather",
"the",
"lists",
"of",
"available",
"sls",
"data",
"from",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L463-L470 | train | Gather the lists of available sls data from the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.__gen_opts | def __gen_opts(self, opts_in, grains, saltenv=None, ext=None, pillarenv=None):
'''
The options need to be altered to conform to the file client
'''
opts = copy.deepcopy(opts_in)
opts['file_client'] = 'local'
if not grains:
opts['grains'] = {}
else:
... | python | def __gen_opts(self, opts_in, grains, saltenv=None, ext=None, pillarenv=None):
'''
The options need to be altered to conform to the file client
'''
opts = copy.deepcopy(opts_in)
opts['file_client'] = 'local'
if not grains:
opts['grains'] = {}
else:
... | [
"def",
"__gen_opts",
"(",
"self",
",",
"opts_in",
",",
"grains",
",",
"saltenv",
"=",
"None",
",",
"ext",
"=",
"None",
",",
"pillarenv",
"=",
"None",
")",
":",
"opts",
"=",
"copy",
".",
"deepcopy",
"(",
"opts_in",
")",
"opts",
"[",
"'file_client'",
"... | The options need to be altered to conform to the file client | [
"The",
"options",
"need",
"to",
"be",
"altered",
"to",
"conform",
"to",
"the",
"file",
"client"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L472-L510 | train | Generate the options for the file client | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar._get_envs | def _get_envs(self):
'''
Pull the file server environments out of the master options
'''
envs = set(['base'])
if 'pillar_roots' in self.opts:
envs.update(list(self.opts['pillar_roots']))
return envs | python | def _get_envs(self):
'''
Pull the file server environments out of the master options
'''
envs = set(['base'])
if 'pillar_roots' in self.opts:
envs.update(list(self.opts['pillar_roots']))
return envs | [
"def",
"_get_envs",
"(",
"self",
")",
":",
"envs",
"=",
"set",
"(",
"[",
"'base'",
"]",
")",
"if",
"'pillar_roots'",
"in",
"self",
".",
"opts",
":",
"envs",
".",
"update",
"(",
"list",
"(",
"self",
".",
"opts",
"[",
"'pillar_roots'",
"]",
")",
")",... | Pull the file server environments out of the master options | [
"Pull",
"the",
"file",
"server",
"environments",
"out",
"of",
"the",
"master",
"options"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L512-L519 | train | Get the set of file server environments from master options | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.get_tops | def get_tops(self):
'''
Gather the top files
'''
tops = collections.defaultdict(list)
include = collections.defaultdict(list)
done = collections.defaultdict(list)
errors = []
# Gather initial top files
try:
saltenvs = set()
... | python | def get_tops(self):
'''
Gather the top files
'''
tops = collections.defaultdict(list)
include = collections.defaultdict(list)
done = collections.defaultdict(list)
errors = []
# Gather initial top files
try:
saltenvs = set()
... | [
"def",
"get_tops",
"(",
"self",
")",
":",
"tops",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"include",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"done",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"errors",
"... | Gather the top files | [
"Gather",
"the",
"top",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L521-L608 | train | Gather the top files and include files for the specified environment and return a list of dictionaries containing the top files and their contents. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.merge_tops | def merge_tops(self, tops):
'''
Cleanly merge the top files
'''
top = collections.defaultdict(OrderedDict)
orders = collections.defaultdict(OrderedDict)
for ctops in six.itervalues(tops):
for ctop in ctops:
for saltenv, targets in six.iteritems... | python | def merge_tops(self, tops):
'''
Cleanly merge the top files
'''
top = collections.defaultdict(OrderedDict)
orders = collections.defaultdict(OrderedDict)
for ctops in six.itervalues(tops):
for ctop in ctops:
for saltenv, targets in six.iteritems... | [
"def",
"merge_tops",
"(",
"self",
",",
"tops",
")",
":",
"top",
"=",
"collections",
".",
"defaultdict",
"(",
"OrderedDict",
")",
"orders",
"=",
"collections",
".",
"defaultdict",
"(",
"OrderedDict",
")",
"for",
"ctops",
"in",
"six",
".",
"itervalues",
"(",... | Cleanly merge the top files | [
"Cleanly",
"merge",
"the",
"top",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L610-L651 | train | Cleanly merge the top files | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.sort_top_targets | def sort_top_targets(self, top, orders):
'''
Returns the sorted high data from the merged top files
'''
sorted_top = collections.defaultdict(OrderedDict)
# pylint: disable=cell-var-from-loop
for saltenv, targets in six.iteritems(top):
sorted_targets = sorted(t... | python | def sort_top_targets(self, top, orders):
'''
Returns the sorted high data from the merged top files
'''
sorted_top = collections.defaultdict(OrderedDict)
# pylint: disable=cell-var-from-loop
for saltenv, targets in six.iteritems(top):
sorted_targets = sorted(t... | [
"def",
"sort_top_targets",
"(",
"self",
",",
"top",
",",
"orders",
")",
":",
"sorted_top",
"=",
"collections",
".",
"defaultdict",
"(",
"OrderedDict",
")",
"# pylint: disable=cell-var-from-loop",
"for",
"saltenv",
",",
"targets",
"in",
"six",
".",
"iteritems",
"... | Returns the sorted high data from the merged top files | [
"Returns",
"the",
"sorted",
"high",
"data",
"from",
"the",
"merged",
"top",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L653-L665 | train | Returns the sorted high data from the merged top files
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.get_top | def get_top(self):
'''
Returns the high data derived from the top file
'''
tops, errors = self.get_tops()
try:
merged_tops = self.merge_tops(tops)
except TypeError as err:
merged_tops = OrderedDict()
errors.append('Error encountered whi... | python | def get_top(self):
'''
Returns the high data derived from the top file
'''
tops, errors = self.get_tops()
try:
merged_tops = self.merge_tops(tops)
except TypeError as err:
merged_tops = OrderedDict()
errors.append('Error encountered whi... | [
"def",
"get_top",
"(",
"self",
")",
":",
"tops",
",",
"errors",
"=",
"self",
".",
"get_tops",
"(",
")",
"try",
":",
"merged_tops",
"=",
"self",
".",
"merge_tops",
"(",
"tops",
")",
"except",
"TypeError",
"as",
"err",
":",
"merged_tops",
"=",
"OrderedDi... | Returns the high data derived from the top file | [
"Returns",
"the",
"high",
"data",
"derived",
"from",
"the",
"top",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L667-L677 | train | Returns the high data derived from the top file and the errors encountered. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.top_matches | def top_matches(self, top):
'''
Search through the top high data for matches and return the states
that this minion needs to execute.
Returns:
{'saltenv': ['state1', 'state2', ...]}
'''
matches = {}
for saltenv, body in six.iteritems(top):
if ... | python | def top_matches(self, top):
'''
Search through the top high data for matches and return the states
that this minion needs to execute.
Returns:
{'saltenv': ['state1', 'state2', ...]}
'''
matches = {}
for saltenv, body in six.iteritems(top):
if ... | [
"def",
"top_matches",
"(",
"self",
",",
"top",
")",
":",
"matches",
"=",
"{",
"}",
"for",
"saltenv",
",",
"body",
"in",
"six",
".",
"iteritems",
"(",
"top",
")",
":",
"if",
"self",
".",
"opts",
"[",
"'pillarenv'",
"]",
":",
"if",
"saltenv",
"!=",
... | Search through the top high data for matches and return the states
that this minion needs to execute.
Returns:
{'saltenv': ['state1', 'state2', ...]} | [
"Search",
"through",
"the",
"top",
"high",
"data",
"for",
"matches",
"and",
"return",
"the",
"states",
"that",
"this",
"minion",
"needs",
"to",
"execute",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L679-L705 | train | Search through the top high data for matches and return the states
that this minion needs to execute. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.render_pstate | def render_pstate(self, sls, saltenv, mods, defaults=None):
'''
Collect a single pillar sls file and render it
'''
if defaults is None:
defaults = {}
err = ''
errors = []
state_data = self.client.get_state(sls, saltenv)
fn_ = state_data.get('de... | python | def render_pstate(self, sls, saltenv, mods, defaults=None):
'''
Collect a single pillar sls file and render it
'''
if defaults is None:
defaults = {}
err = ''
errors = []
state_data = self.client.get_state(sls, saltenv)
fn_ = state_data.get('de... | [
"def",
"render_pstate",
"(",
"self",
",",
"sls",
",",
"saltenv",
",",
"mods",
",",
"defaults",
"=",
"None",
")",
":",
"if",
"defaults",
"is",
"None",
":",
"defaults",
"=",
"{",
"}",
"err",
"=",
"''",
"errors",
"=",
"[",
"]",
"state_data",
"=",
"sel... | Collect a single pillar sls file and render it | [
"Collect",
"a",
"single",
"pillar",
"sls",
"file",
"and",
"render",
"it"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L707-L859 | train | Render a single pillar sls file and return the state and mods. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.render_pillar | def render_pillar(self, matches, errors=None):
'''
Extract the sls pillar files from the matches and render them into the
pillar
'''
pillar = copy.copy(self.pillar_override)
if errors is None:
errors = []
for saltenv, pstates in six.iteritems(matches):... | python | def render_pillar(self, matches, errors=None):
'''
Extract the sls pillar files from the matches and render them into the
pillar
'''
pillar = copy.copy(self.pillar_override)
if errors is None:
errors = []
for saltenv, pstates in six.iteritems(matches):... | [
"def",
"render_pillar",
"(",
"self",
",",
"matches",
",",
"errors",
"=",
"None",
")",
":",
"pillar",
"=",
"copy",
".",
"copy",
"(",
"self",
".",
"pillar_override",
")",
"if",
"errors",
"is",
"None",
":",
"errors",
"=",
"[",
"]",
"for",
"saltenv",
","... | Extract the sls pillar files from the matches and render them into the
pillar | [
"Extract",
"the",
"sls",
"pillar",
"files",
"from",
"the",
"matches",
"and",
"render",
"them",
"into",
"the",
"pillar"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L861-L910 | train | Extract the sls pillar files from the matches and render them into pillar | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar._external_pillar_data | def _external_pillar_data(self, pillar, val, key):
'''
Builds actual pillar data structure and updates the ``pillar`` variable
'''
ext = None
args = salt.utils.args.get_function_argspec(self.ext_pillars[key]).args
if isinstance(val, dict):
if ('extra_minion_d... | python | def _external_pillar_data(self, pillar, val, key):
'''
Builds actual pillar data structure and updates the ``pillar`` variable
'''
ext = None
args = salt.utils.args.get_function_argspec(self.ext_pillars[key]).args
if isinstance(val, dict):
if ('extra_minion_d... | [
"def",
"_external_pillar_data",
"(",
"self",
",",
"pillar",
",",
"val",
",",
"key",
")",
":",
"ext",
"=",
"None",
"args",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"get_function_argspec",
"(",
"self",
".",
"ext_pillars",
"[",
"key",
"]",
")",
".",
... | Builds actual pillar data structure and updates the ``pillar`` variable | [
"Builds",
"actual",
"pillar",
"data",
"structure",
"and",
"updates",
"the",
"pillar",
"variable"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L912-L946 | train | Builds actual pillar data structure and updates the pillar variable | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.ext_pillar | def ext_pillar(self, pillar, errors=None):
'''
Render the external pillar data
'''
if errors is None:
errors = []
try:
# Make sure that on-demand git_pillar is fetched before we try to
# compile the pillar data. git_pillar will fetch a remote w... | python | def ext_pillar(self, pillar, errors=None):
'''
Render the external pillar data
'''
if errors is None:
errors = []
try:
# Make sure that on-demand git_pillar is fetched before we try to
# compile the pillar data. git_pillar will fetch a remote w... | [
"def",
"ext_pillar",
"(",
"self",
",",
"pillar",
",",
"errors",
"=",
"None",
")",
":",
"if",
"errors",
"is",
"None",
":",
"errors",
"=",
"[",
"]",
"try",
":",
"# Make sure that on-demand git_pillar is fetched before we try to",
"# compile the pillar data. git_pillar w... | Render the external pillar data | [
"Render",
"the",
"external",
"pillar",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L948-L1026 | train | Render the external pillar data | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.compile_pillar | def compile_pillar(self, ext=True):
'''
Render the pillar data and return
'''
top, top_errors = self.get_top()
if ext:
if self.opts.get('ext_pillar_first', False):
self.opts['pillar'], errors = self.ext_pillar(self.pillar_override)
self... | python | def compile_pillar(self, ext=True):
'''
Render the pillar data and return
'''
top, top_errors = self.get_top()
if ext:
if self.opts.get('ext_pillar_first', False):
self.opts['pillar'], errors = self.ext_pillar(self.pillar_override)
self... | [
"def",
"compile_pillar",
"(",
"self",
",",
"ext",
"=",
"True",
")",
":",
"top",
",",
"top_errors",
"=",
"self",
".",
"get_top",
"(",
")",
"if",
"ext",
":",
"if",
"self",
".",
"opts",
".",
"get",
"(",
"'ext_pillar_first'",
",",
"False",
")",
":",
"s... | Render the pillar data and return | [
"Render",
"the",
"pillar",
"data",
"and",
"return"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L1028-L1083 | train | Render the pillar data and return the new master pillar data | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/__init__.py | Pillar.decrypt_pillar | def decrypt_pillar(self, pillar):
'''
Decrypt the specified pillar dictionary items, if configured to do so
'''
errors = []
if self.opts.get('decrypt_pillar'):
decrypt_pillar = self.opts['decrypt_pillar']
if not isinstance(decrypt_pillar, dict):
... | python | def decrypt_pillar(self, pillar):
'''
Decrypt the specified pillar dictionary items, if configured to do so
'''
errors = []
if self.opts.get('decrypt_pillar'):
decrypt_pillar = self.opts['decrypt_pillar']
if not isinstance(decrypt_pillar, dict):
... | [
"def",
"decrypt_pillar",
"(",
"self",
",",
"pillar",
")",
":",
"errors",
"=",
"[",
"]",
"if",
"self",
".",
"opts",
".",
"get",
"(",
"'decrypt_pillar'",
")",
":",
"decrypt_pillar",
"=",
"self",
".",
"opts",
"[",
"'decrypt_pillar'",
"]",
"if",
"not",
"is... | Decrypt the specified pillar dictionary items, if configured to do so | [
"Decrypt",
"the",
"specified",
"pillar",
"dictionary",
"items",
"if",
"configured",
"to",
"do",
"so"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/__init__.py#L1085-L1143 | train | Decrypt the specified pillar dictionary items if configured to do so. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_pki.py | _cmd_run | def _cmd_run(cmd, as_json=False):
'''
Ensure that the Pki module is loaded, and convert to and extract data from
Json as needed.
'''
cmd_full = ['Import-Module -Name PKI; ']
if as_json:
cmd_full.append(r'ConvertTo-Json -Compress -Depth 4 -InputObject '
r'@({0})'.... | python | def _cmd_run(cmd, as_json=False):
'''
Ensure that the Pki module is loaded, and convert to and extract data from
Json as needed.
'''
cmd_full = ['Import-Module -Name PKI; ']
if as_json:
cmd_full.append(r'ConvertTo-Json -Compress -Depth 4 -InputObject '
r'@({0})'.... | [
"def",
"_cmd_run",
"(",
"cmd",
",",
"as_json",
"=",
"False",
")",
":",
"cmd_full",
"=",
"[",
"'Import-Module -Name PKI; '",
"]",
"if",
"as_json",
":",
"cmd_full",
".",
"append",
"(",
"r'ConvertTo-Json -Compress -Depth 4 -InputObject '",
"r'@({0})'",
".",
"format",
... | Ensure that the Pki module is loaded, and convert to and extract data from
Json as needed. | [
"Ensure",
"that",
"the",
"Pki",
"module",
"is",
"loaded",
"and",
"convert",
"to",
"and",
"extract",
"data",
"from",
"Json",
"as",
"needed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pki.py#L65-L91 | train | Execute a command and return the data from the PKI module as needed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_pki.py | _validate_cert_path | def _validate_cert_path(name):
'''
Ensure that the certificate path, as determind from user input, is valid.
'''
cmd = r"Test-Path -Path '{0}'".format(name)
if not ast.literal_eval(_cmd_run(cmd=cmd)):
raise SaltInvocationError(r"Invalid path specified: {0}".format(name)) | python | def _validate_cert_path(name):
'''
Ensure that the certificate path, as determind from user input, is valid.
'''
cmd = r"Test-Path -Path '{0}'".format(name)
if not ast.literal_eval(_cmd_run(cmd=cmd)):
raise SaltInvocationError(r"Invalid path specified: {0}".format(name)) | [
"def",
"_validate_cert_path",
"(",
"name",
")",
":",
"cmd",
"=",
"r\"Test-Path -Path '{0}'\"",
".",
"format",
"(",
"name",
")",
"if",
"not",
"ast",
".",
"literal_eval",
"(",
"_cmd_run",
"(",
"cmd",
"=",
"cmd",
")",
")",
":",
"raise",
"SaltInvocationError",
... | Ensure that the certificate path, as determind from user input, is valid. | [
"Ensure",
"that",
"the",
"certificate",
"path",
"as",
"determind",
"from",
"user",
"input",
"is",
"valid",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pki.py#L94-L101 | train | Ensure that the certificate path is valid. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_pki.py | _validate_cert_format | def _validate_cert_format(name):
'''
Ensure that the certificate format, as determind from user input, is valid.
'''
cert_formats = ['cer', 'pfx']
if name not in cert_formats:
message = ("Invalid certificate format '{0}' specified. Valid formats:"
' {1}').format(name, cer... | python | def _validate_cert_format(name):
'''
Ensure that the certificate format, as determind from user input, is valid.
'''
cert_formats = ['cer', 'pfx']
if name not in cert_formats:
message = ("Invalid certificate format '{0}' specified. Valid formats:"
' {1}').format(name, cer... | [
"def",
"_validate_cert_format",
"(",
"name",
")",
":",
"cert_formats",
"=",
"[",
"'cer'",
",",
"'pfx'",
"]",
"if",
"name",
"not",
"in",
"cert_formats",
":",
"message",
"=",
"(",
"\"Invalid certificate format '{0}' specified. Valid formats:\"",
"' {1}'",
")",
".",
... | Ensure that the certificate format, as determind from user input, is valid. | [
"Ensure",
"that",
"the",
"certificate",
"format",
"as",
"determind",
"from",
"user",
"input",
"is",
"valid",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pki.py#L104-L113 | train | Validate certificate format | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_pki.py | get_stores | def get_stores():
'''
Get the certificate location contexts and their corresponding stores.
:return: A dictionary of the certificate location contexts and stores.
:rtype: dict
CLI Example:
.. code-block:: bash
salt '*' win_pki.get_stores
'''
ret = dict()
cmd = r"Get-Child... | python | def get_stores():
'''
Get the certificate location contexts and their corresponding stores.
:return: A dictionary of the certificate location contexts and stores.
:rtype: dict
CLI Example:
.. code-block:: bash
salt '*' win_pki.get_stores
'''
ret = dict()
cmd = r"Get-Child... | [
"def",
"get_stores",
"(",
")",
":",
"ret",
"=",
"dict",
"(",
")",
"cmd",
"=",
"r\"Get-ChildItem -Path 'Cert:\\' | \"",
"r\"Select-Object LocationName, StoreNames\"",
"items",
"=",
"_cmd_run",
"(",
"cmd",
"=",
"cmd",
",",
"as_json",
"=",
"True",
")",
"for",
"item... | Get the certificate location contexts and their corresponding stores.
:return: A dictionary of the certificate location contexts and stores.
:rtype: dict
CLI Example:
.. code-block:: bash
salt '*' win_pki.get_stores | [
"Get",
"the",
"certificate",
"location",
"contexts",
"and",
"their",
"corresponding",
"stores",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_pki.py#L116-L140 | train | Get the certificate location contexts and their corresponding stores. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.