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/states/rvm.py | _check_and_install_ruby | def _check_and_install_ruby(ret, ruby, default=False, user=None, opts=None, env=None):
'''
Verify that ruby is installed, install if unavailable
'''
ret = _check_ruby(ret, ruby, user=user)
if not ret['result']:
if __salt__['rvm.install_ruby'](ruby, runas=user, opts=opts, env=env):
... | python | def _check_and_install_ruby(ret, ruby, default=False, user=None, opts=None, env=None):
'''
Verify that ruby is installed, install if unavailable
'''
ret = _check_ruby(ret, ruby, user=user)
if not ret['result']:
if __salt__['rvm.install_ruby'](ruby, runas=user, opts=opts, env=env):
... | [
"def",
"_check_and_install_ruby",
"(",
"ret",
",",
"ruby",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"ret",
"=",
"_check_ruby",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"u... | Verify that ruby is installed, install if unavailable | [
"Verify",
"that",
"ruby",
"is",
"installed",
"install",
"if",
"unavailable"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L119-L138 | train | Verify that ruby is installed install if unavailable | 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/rvm.py | _check_ruby | def _check_ruby(ret, ruby, user=None):
'''
Check that ruby is installed
'''
match_version = True
match_micro_version = False
micro_version_regex = re.compile(r'-([0-9]{4}\.[0-9]{2}|p[0-9]+)$')
if micro_version_regex.search(ruby):
match_micro_version = True
if re.search('^[a-z]+$'... | python | def _check_ruby(ret, ruby, user=None):
'''
Check that ruby is installed
'''
match_version = True
match_micro_version = False
micro_version_regex = re.compile(r'-([0-9]{4}\.[0-9]{2}|p[0-9]+)$')
if micro_version_regex.search(ruby):
match_micro_version = True
if re.search('^[a-z]+$'... | [
"def",
"_check_ruby",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"None",
")",
":",
"match_version",
"=",
"True",
"match_micro_version",
"=",
"False",
"micro_version_regex",
"=",
"re",
".",
"compile",
"(",
"r'-([0-9]{4}\\.[0-9]{2}|p[0-9]+)$'",
")",
"if",
"micro_v... | Check that ruby is installed | [
"Check",
"that",
"ruby",
"is",
"installed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L141-L166 | train | Check that ruby is installed and if not return the default | 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/rvm.py | installed | def installed(name, default=False, user=None, opts=None, env=None):
'''
Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user... | python | def installed(name, default=False, user=None, opts=None, env=None):
'''
Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user... | [
"def",
"installed",
"(",
"name",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''... | Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user to run rvm as.
env: None
A list of environment variables to set (i... | [
"Verify",
"that",
"the",
"specified",
"ruby",
"is",
"installed",
"with",
"RVM",
".",
"RVM",
"is",
"installed",
"when",
"necessary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L169-L205 | train | Verify that the specified ruby is installed with RVM. | 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/rvm.py | gemset_present | def gemset_present(name, ruby='default', user=None):
'''
Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0
'''
ret = {'name': n... | python | def gemset_present(name, ruby='default', user=None):
'''
Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0
'''
ret = {'name': n... | [
"def",
"gemset_present",
"(",
"name",
",",
"ruby",
"=",
"'default'",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"ret",... | Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0 | [
"Verify",
"that",
"the",
"gemset",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L208-L253 | train | Verify that the gemset is present. | 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/postgres_tablespace.py | present | def present(name,
directory,
options=None,
owner=None,
user=None,
maintenance_db=None,
db_password=None,
db_host=None,
db_port=None,
db_user=None):
'''
Ensure that the named tablespace is present with the... | python | def present(name,
directory,
options=None,
owner=None,
user=None,
maintenance_db=None,
db_password=None,
db_host=None,
db_port=None,
db_user=None):
'''
Ensure that the named tablespace is present with the... | [
"def",
"present",
"(",
"name",
",",
"directory",
",",
"options",
"=",
"None",
",",
"owner",
"=",
"None",
",",
"user",
"=",
"None",
",",
"maintenance_db",
"=",
"None",
",",
"db_password",
"=",
"None",
",",
"db_host",
"=",
"None",
",",
"db_port",
"=",
... | Ensure that the named tablespace is present with the specified properties.
For more information about all of these options run ``man 7
create_tablespace``.
name
The name of the tablespace to create/manage.
directory
The directory where the tablespace will be located, must already exist... | [
"Ensure",
"that",
"the",
"named",
"tablespace",
"is",
"present",
"with",
"the",
"specified",
"properties",
".",
"For",
"more",
"information",
"about",
"all",
"of",
"these",
"options",
"run",
"man",
"7",
"create_tablespace",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_tablespace.py#L38-L158 | train | Ensure that the named tablespace is present with the specified properties. | 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/sqlcipher.py | ext_pillar | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLCipher, merge and return as a dict
'''
return SQLCipherExtPillar().fetch(minion_id, pillar, *args, **kwargs) | python | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLCipher, merge and return as a dict
'''
return SQLCipherExtPillar().fetch(minion_id, pillar, *args, **kwargs) | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"SQLCipherExtPillar",
"(",
")",
".",
"fetch",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | Execute queries against SQLCipher, merge and return as a dict | [
"Execute",
"queries",
"against",
"SQLCipher",
"merge",
"and",
"return",
"as",
"a",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlcipher.py#L130-L137 | train | Execute queries against SQLCipher merge and return as a 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/sqlcipher.py | SQLCipherExtPillar._get_cursor | def _get_cursor(self):
'''
Yield a SQLCipher cursor
'''
_options = self._get_options()
conn = sqlcipher.connect(_options.get('database'),
timeout=float(_options.get('timeout')))
conn.execute('pragma key="{0}"'.format(_options.get('pass')))... | python | def _get_cursor(self):
'''
Yield a SQLCipher cursor
'''
_options = self._get_options()
conn = sqlcipher.connect(_options.get('database'),
timeout=float(_options.get('timeout')))
conn.execute('pragma key="{0}"'.format(_options.get('pass')))... | [
"def",
"_get_cursor",
"(",
"self",
")",
":",
"_options",
"=",
"self",
".",
"_get_options",
"(",
")",
"conn",
"=",
"sqlcipher",
".",
"connect",
"(",
"_options",
".",
"get",
"(",
"'database'",
")",
",",
"timeout",
"=",
"float",
"(",
"_options",
".",
"get... | Yield a SQLCipher cursor | [
"Yield",
"a",
"SQLCipher",
"cursor"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlcipher.py#L113-L127 | train | Yield a SQLCipher cursor | 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/ldap3.py | _convert_exception | def _convert_exception(e):
'''Convert an ldap backend exception to an LDAPError and raise it.'''
args = ('exception in ldap backend: {0}'.format(repr(e)), e)
if six.PY2:
six.reraise(LDAPError, args, sys.exc_info()[2])
else:
six.raise_from(LDAPError(*args), e) | python | def _convert_exception(e):
'''Convert an ldap backend exception to an LDAPError and raise it.'''
args = ('exception in ldap backend: {0}'.format(repr(e)), e)
if six.PY2:
six.reraise(LDAPError, args, sys.exc_info()[2])
else:
six.raise_from(LDAPError(*args), e) | [
"def",
"_convert_exception",
"(",
"e",
")",
":",
"args",
"=",
"(",
"'exception in ldap backend: {0}'",
".",
"format",
"(",
"repr",
"(",
"e",
")",
")",
",",
"e",
")",
"if",
"six",
".",
"PY2",
":",
"six",
".",
"reraise",
"(",
"LDAPError",
",",
"args",
... | Convert an ldap backend exception to an LDAPError and raise it. | [
"Convert",
"an",
"ldap",
"backend",
"exception",
"to",
"an",
"LDAPError",
"and",
"raise",
"it",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L53-L59 | train | Convert an ldap backend exception to an LDAPError and raise it. | 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/ldap3.py | _bind | def _bind(l, bind=None):
'''Bind helper.'''
if bind is None:
return
method = bind.get('method', 'simple')
if method is None:
return
elif method == 'simple':
l.simple_bind_s(bind.get('dn', ''), bind.get('password', ''))
elif method == 'sasl':
sasl_class = getattr(l... | python | def _bind(l, bind=None):
'''Bind helper.'''
if bind is None:
return
method = bind.get('method', 'simple')
if method is None:
return
elif method == 'simple':
l.simple_bind_s(bind.get('dn', ''), bind.get('password', ''))
elif method == 'sasl':
sasl_class = getattr(l... | [
"def",
"_bind",
"(",
"l",
",",
"bind",
"=",
"None",
")",
":",
"if",
"bind",
"is",
"None",
":",
"return",
"method",
"=",
"bind",
".",
"get",
"(",
"'method'",
",",
"'simple'",
")",
"if",
"method",
"is",
"None",
":",
"return",
"elif",
"method",
"==",
... | Bind helper. | [
"Bind",
"helper",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L62-L81 | train | Bind helper. | 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/ldap3.py | connect | def connect(connect_spec=None):
'''Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
... | python | def connect(connect_spec=None):
'''Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
... | [
"def",
"connect",
"(",
"connect_spec",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"connect_spec",
",",
"_connect_ctx",
")",
":",
"return",
"connect_spec",
"if",
"connect_spec",
"is",
"None",
":",
"connect_spec",
"=",
"{",
"}",
"backend_name",
"=",
"conn... | Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
used), or a dict with the following k... | [
"Connect",
"and",
"optionally",
"bind",
"to",
"an",
"LDAP",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L109-L306 | train | Connect and optionally bind to an LDAP 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/ldap3.py | search | def search(connect_spec, base, scope='subtree', filterstr='(objectClass=*)',
attrlist=None, attrsonly=0):
'''Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of ... | python | def search(connect_spec, base, scope='subtree', filterstr='(objectClass=*)',
attrlist=None, attrsonly=0):
'''Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of ... | [
"def",
"search",
"(",
"connect_spec",
",",
"base",
",",
"scope",
"=",
"'subtree'",
",",
"filterstr",
"=",
"'(objectClass=*)'",
",",
"attrlist",
"=",
"None",
",",
"attrsonly",
"=",
"0",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"scope",
"="... | Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of the entry at which to start the search.
:param scope:
One of the following:
* ``'subtree'``
... | [
"Search",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L309-L369 | train | Search an LDAP database for a set of attributes. | 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/ldap3.py | add | def add(connect_spec, dn, attributes):
'''Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each ... | python | def add(connect_spec, dn, attributes):
'''Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each ... | [
"def",
"add",
"(",
"connect_spec",
",",
"dn",
",",
"attributes",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"# convert the \"iterable of values\" to lists in case that's what",
"# addModlist() expects (also to ensure that the caller's objects",
"# are not modified)"... | Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each of the new entry's attributes to a
non... | [
"Add",
"an",
"entry",
"to",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L372-L417 | train | Add an entry to an LDAP database. | 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/ldap3.py | delete | def delete(connect_spec, dn):
'''Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an excepti... | python | def delete(connect_spec, dn):
'''Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an excepti... | [
"def",
"delete",
"(",
"connect_spec",
",",
"dn",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"log",
".",
"info",
"(",
"'deleting entry: dn: %s'",
",",
"repr",
"(",
"dn",
")",
")",
"try",
":",
"l",
".",
"c",
".",
"delete_s",
"(",
"dn",
... | Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an exception otherwise.
CLI example:
... | [
"Delete",
"an",
"entry",
"from",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L420-L450 | train | Delete an entry from an LDAP database. | 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/ldap3.py | modify | def modify(connect_spec, dn, directives):
'''Modify an entry in an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param directives:
Iterable of directives... | python | def modify(connect_spec, dn, directives):
'''Modify an entry in an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param directives:
Iterable of directives... | [
"def",
"modify",
"(",
"connect_spec",
",",
"dn",
",",
"directives",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"# convert the \"iterable of values\" to lists in case that's what",
"# modify_s() expects (also to ensure that the caller's objects are",
"# not modified)... | Modify an entry in an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param directives:
Iterable of directives that indicate how to modify the entry.
E... | [
"Modify",
"an",
"entry",
"in",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L453-L517 | train | Modify an entry in an LDAP database. | 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/ldap3.py | change | def change(connect_spec, dn, before, after):
'''Modify an entry in an LDAP database.
This does the same thing as :py:func:`modify`, but with a simpler
interface. Instead of taking a list of directives, it takes a
before and after view of an entry, determines the differences
between the two, comput... | python | def change(connect_spec, dn, before, after):
'''Modify an entry in an LDAP database.
This does the same thing as :py:func:`modify`, but with a simpler
interface. Instead of taking a list of directives, it takes a
before and after view of an entry, determines the differences
between the two, comput... | [
"def",
"change",
"(",
"connect_spec",
",",
"dn",
",",
"before",
",",
"after",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"# convert the \"iterable of values\" to lists in case that's what",
"# modifyModlist() expects (also to ensure that the caller's dicts",
"# ... | Modify an entry in an LDAP database.
This does the same thing as :py:func:`modify`, but with a simpler
interface. Instead of taking a list of directives, it takes a
before and after view of an entry, determines the differences
between the two, computes the directives, and executes them.
Any attri... | [
"Modify",
"an",
"entry",
"in",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L520-L585 | train | Modify an entry in an LDAP database. | 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/grafana.py | _parse_profile | def _parse_profile(profile):
'''
From a pillar key, or a dictionary, return index and host keys.
'''
if isinstance(profile, string_types):
_profile = __salt__['config.option'](profile)
if not _profile:
msg = 'Pillar key for profile {0} not found.'.format(profile)
... | python | def _parse_profile(profile):
'''
From a pillar key, or a dictionary, return index and host keys.
'''
if isinstance(profile, string_types):
_profile = __salt__['config.option'](profile)
if not _profile:
msg = 'Pillar key for profile {0} not found.'.format(profile)
... | [
"def",
"_parse_profile",
"(",
"profile",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"_profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"if",
"not",
"_profile",
":",
"msg",
"=",
"'Pillar key for pr... | From a pillar key, or a dictionary, return index and host keys. | [
"From",
"a",
"pillar",
"key",
"or",
"a",
"dictionary",
"return",
"index",
"and",
"host",
"keys",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L189-L202 | train | Parse pillar key or dictionary return index and host keys. | 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/grafana.py | _rows_differ | def _rows_differ(row, _row):
'''
Check if grafana dashboard row and _row differ
'''
row_copy = copy.deepcopy(row)
_row_copy = copy.deepcopy(_row)
# Strip id from all panels in both rows, since they are always generated.
for panel in row_copy['panels']:
if 'id' in panel:
d... | python | def _rows_differ(row, _row):
'''
Check if grafana dashboard row and _row differ
'''
row_copy = copy.deepcopy(row)
_row_copy = copy.deepcopy(_row)
# Strip id from all panels in both rows, since they are always generated.
for panel in row_copy['panels']:
if 'id' in panel:
d... | [
"def",
"_rows_differ",
"(",
"row",
",",
"_row",
")",
":",
"row_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"row",
")",
"_row_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"_row",
")",
"# Strip id from all panels in both rows, since they are always generated.",
"for",
"p... | Check if grafana dashboard row and _row differ | [
"Check",
"if",
"grafana",
"dashboard",
"row",
"and",
"_row",
"differ"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L205-L219 | train | Check if grafana dashboard row and _row differ
| 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/grafana.py | dashboard_present | def dashboard_present(
name,
dashboard=None,
dashboard_from_pillar=None,
rows=None,
rows_from_pillar=None,
profile='grafana'):
'''
Ensure the grafana dashboard exists and is managed.
name
Name of the grafana dashboard.
dashboard
A dict th... | python | def dashboard_present(
name,
dashboard=None,
dashboard_from_pillar=None,
rows=None,
rows_from_pillar=None,
profile='grafana'):
'''
Ensure the grafana dashboard exists and is managed.
name
Name of the grafana dashboard.
dashboard
A dict th... | [
"def",
"dashboard_present",
"(",
"name",
",",
"dashboard",
"=",
"None",
",",
"dashboard_from_pillar",
"=",
"None",
",",
"rows",
"=",
"None",
",",
"rows_from_pillar",
"=",
"None",
",",
"profile",
"=",
"'grafana'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
... | Ensure the grafana dashboard exists and is managed.
name
Name of the grafana dashboard.
dashboard
A dict that defines a dashboard that should be managed.
dashboard_from_pillar
A pillar key that contains a grafana dashboard dict. Mutually exclusive
with dashboard.
rows... | [
"Ensure",
"the",
"grafana",
"dashboard",
"exists",
"and",
"is",
"managed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L222-L369 | train | Ensure the grafana dashboard exists and is present in elasticsearch. | 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/grafana.py | dashboard_absent | def dashboard_absent(
name,
hosts=None,
profile='grafana'):
'''
Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use.
'''
r... | python | def dashboard_absent(
name,
hosts=None,
profile='grafana'):
'''
Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use.
'''
r... | [
"def",
"dashboard_absent",
"(",
"name",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"'grafana'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use. | [
"Ensure",
"the",
"named",
"grafana",
"dashboard",
"is",
"deleted",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L372-L416 | train | Ensure the named grafana dashboard is absent. | 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/jinja.py | ensure_sequence_filter | def ensure_sequence_filter(data):
'''
Ensure sequenced data.
**sequence**
ensure that parsed data is a sequence
.. code-block:: jinja
{% set my_string = "foo" %}
{% set my_list = ["bar", ] %}
{% set my_dict = {"baz": "qux"} %}
{{ my_string|sequence|first }}
... | python | def ensure_sequence_filter(data):
'''
Ensure sequenced data.
**sequence**
ensure that parsed data is a sequence
.. code-block:: jinja
{% set my_string = "foo" %}
{% set my_list = ["bar", ] %}
{% set my_dict = {"baz": "qux"} %}
{{ my_string|sequence|first }}
... | [
"def",
"ensure_sequence_filter",
"(",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"(",
"list",
",",
"tuple",
",",
"set",
",",
"dict",
")",
")",
":",
"return",
"[",
"data",
"]",
"return",
"data"
] | Ensure sequenced data.
**sequence**
ensure that parsed data is a sequence
.. code-block:: jinja
{% set my_string = "foo" %}
{% set my_list = ["bar", ] %}
{% set my_dict = {"baz": "qux"} %}
{{ my_string|sequence|first }}
{{ my_list|sequence|first }}
{{... | [
"Ensure",
"sequenced",
"data",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L252-L281 | train | Ensure that the data is a sequenced 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/utils/jinja.py | to_bool | def to_bool(val):
'''
Returns the logical value.
.. code-block:: jinja
{{ 'yes' | to_bool }}
will be rendered as:
.. code-block:: text
True
'''
if val is None:
return False
if isinstance(val, bool):
return val
if isinstance(val, (six.text_type, si... | python | def to_bool(val):
'''
Returns the logical value.
.. code-block:: jinja
{{ 'yes' | to_bool }}
will be rendered as:
.. code-block:: text
True
'''
if val is None:
return False
if isinstance(val, bool):
return val
if isinstance(val, (six.text_type, si... | [
"def",
"to_bool",
"(",
"val",
")",
":",
"if",
"val",
"is",
"None",
":",
"return",
"False",
"if",
"isinstance",
"(",
"val",
",",
"bool",
")",
":",
"return",
"val",
"if",
"isinstance",
"(",
"val",
",",
"(",
"six",
".",
"text_type",
",",
"six",
".",
... | Returns the logical value.
.. code-block:: jinja
{{ 'yes' | to_bool }}
will be rendered as:
.. code-block:: text
True | [
"Returns",
"the",
"logical",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L285-L309 | train | Converts a value to a boolean. | 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/jinja.py | tojson | def tojson(val, indent=None):
'''
Implementation of tojson filter (only present in Jinja 2.9 and later). If
Jinja 2.9 or later is installed, then the upstream version of this filter
will be used.
'''
options = {'ensure_ascii': True}
if indent is not None:
options['indent'] = indent
... | python | def tojson(val, indent=None):
'''
Implementation of tojson filter (only present in Jinja 2.9 and later). If
Jinja 2.9 or later is installed, then the upstream version of this filter
will be used.
'''
options = {'ensure_ascii': True}
if indent is not None:
options['indent'] = indent
... | [
"def",
"tojson",
"(",
"val",
",",
"indent",
"=",
"None",
")",
":",
"options",
"=",
"{",
"'ensure_ascii'",
":",
"True",
"}",
"if",
"indent",
"is",
"not",
"None",
":",
"options",
"[",
"'indent'",
"]",
"=",
"indent",
"return",
"(",
"salt",
".",
"utils",... | Implementation of tojson filter (only present in Jinja 2.9 and later). If
Jinja 2.9 or later is installed, then the upstream version of this filter
will be used. | [
"Implementation",
"of",
"tojson",
"filter",
"(",
"only",
"present",
"in",
"Jinja",
"2",
".",
"9",
"and",
"later",
")",
".",
"If",
"Jinja",
"2",
".",
"9",
"or",
"later",
"is",
"installed",
"then",
"the",
"upstream",
"version",
"of",
"this",
"filter",
"w... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L313-L329 | train | Implementation of tojson filter for the filter
| 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/jinja.py | regex_search | def regex_search(txt, rgx, ignorecase=False, multiline=False):
'''
Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_search('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd')
... | python | def regex_search(txt, rgx, ignorecase=False, multiline=False):
'''
Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_search('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd')
... | [
"def",
"regex_search",
"(",
"txt",
",",
"rgx",
",",
"ignorecase",
"=",
"False",
",",
"multiline",
"=",
"False",
")",
":",
"flag",
"=",
"0",
"if",
"ignorecase",
":",
"flag",
"|=",
"re",
".",
"I",
"if",
"multiline",
":",
"flag",
"|=",
"re",
".",
"M",... | Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_search('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd') | [
"Searches",
"for",
"a",
"pattern",
"in",
"the",
"text",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L357-L380 | train | Search for a pattern in the text. | 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/jinja.py | regex_match | def regex_match(txt, rgx, ignorecase=False, multiline=False):
'''
Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_match('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd')
''... | python | def regex_match(txt, rgx, ignorecase=False, multiline=False):
'''
Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_match('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd')
''... | [
"def",
"regex_match",
"(",
"txt",
",",
"rgx",
",",
"ignorecase",
"=",
"False",
",",
"multiline",
"=",
"False",
")",
":",
"flag",
"=",
"0",
"if",
"ignorecase",
":",
"flag",
"|=",
"re",
".",
"I",
"if",
"multiline",
":",
"flag",
"|=",
"re",
".",
"M",
... | Searches for a pattern in the text.
.. code-block:: jinja
{% set my_text = 'abcd' %}
{{ my_text | regex_match('^(.*)BC(.*)$', ignorecase=True) }}
will be rendered as:
.. code-block:: text
('a', 'd') | [
"Searches",
"for",
"a",
"pattern",
"in",
"the",
"text",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L384-L407 | train | Returns a list of the names of the words that match the regex rgx. | 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/jinja.py | regex_replace | def regex_replace(txt, rgx, val, ignorecase=False, multiline=False):
r'''
Searches for a pattern and replaces with a sequence of characters.
.. code-block:: jinja
{% set my_text = 'lets replace spaces' %}
{{ my_text | regex_replace('\s+', '__') }}
will be rendered as:
.. code-blo... | python | def regex_replace(txt, rgx, val, ignorecase=False, multiline=False):
r'''
Searches for a pattern and replaces with a sequence of characters.
.. code-block:: jinja
{% set my_text = 'lets replace spaces' %}
{{ my_text | regex_replace('\s+', '__') }}
will be rendered as:
.. code-blo... | [
"def",
"regex_replace",
"(",
"txt",
",",
"rgx",
",",
"val",
",",
"ignorecase",
"=",
"False",
",",
"multiline",
"=",
"False",
")",
":",
"flag",
"=",
"0",
"if",
"ignorecase",
":",
"flag",
"|=",
"re",
".",
"I",
"if",
"multiline",
":",
"flag",
"|=",
"r... | r'''
Searches for a pattern and replaces with a sequence of characters.
.. code-block:: jinja
{% set my_text = 'lets replace spaces' %}
{{ my_text | regex_replace('\s+', '__') }}
will be rendered as:
.. code-block:: text
lets__replace__spaces | [
"r",
"Searches",
"for",
"a",
"pattern",
"and",
"replaces",
"with",
"a",
"sequence",
"of",
"characters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L411-L432 | train | r Replaces a pattern with a sequence of characters. | 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/jinja.py | uuid_ | def uuid_(val):
'''
Returns a UUID corresponding to the value passed as argument.
.. code-block:: jinja
{{ 'example' | uuid }}
will be rendered as:
.. code-block:: text
f4efeff8-c219-578a-bad7-3dc280612ec8
'''
return six.text_type(
uuid.uuid5(
GLOBAL_... | python | def uuid_(val):
'''
Returns a UUID corresponding to the value passed as argument.
.. code-block:: jinja
{{ 'example' | uuid }}
will be rendered as:
.. code-block:: text
f4efeff8-c219-578a-bad7-3dc280612ec8
'''
return six.text_type(
uuid.uuid5(
GLOBAL_... | [
"def",
"uuid_",
"(",
"val",
")",
":",
"return",
"six",
".",
"text_type",
"(",
"uuid",
".",
"uuid5",
"(",
"GLOBAL_UUID",
",",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_str",
"(",
"val",
")",
")",
")"
] | Returns a UUID corresponding to the value passed as argument.
.. code-block:: jinja
{{ 'example' | uuid }}
will be rendered as:
.. code-block:: text
f4efeff8-c219-578a-bad7-3dc280612ec8 | [
"Returns",
"a",
"UUID",
"corresponding",
"to",
"the",
"value",
"passed",
"as",
"argument",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L436-L455 | train | Returns a UUID corresponding to the value passed as argument. | 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/jinja.py | unique | def unique(values):
'''
Removes duplicates from a list.
.. code-block:: jinja
{% set my_list = ['a', 'b', 'c', 'a', 'b'] -%}
{{ my_list | unique }}
will be rendered as:
.. code-block:: text
['a', 'b', 'c']
'''
ret = None
if isinstance(values, collections.Hash... | python | def unique(values):
'''
Removes duplicates from a list.
.. code-block:: jinja
{% set my_list = ['a', 'b', 'c', 'a', 'b'] -%}
{{ my_list | unique }}
will be rendered as:
.. code-block:: text
['a', 'b', 'c']
'''
ret = None
if isinstance(values, collections.Hash... | [
"def",
"unique",
"(",
"values",
")",
":",
"ret",
"=",
"None",
"if",
"isinstance",
"(",
"values",
",",
"collections",
".",
"Hashable",
")",
":",
"ret",
"=",
"set",
"(",
"values",
")",
"else",
":",
"ret",
"=",
"[",
"]",
"for",
"value",
"in",
"values"... | Removes duplicates from a list.
.. code-block:: jinja
{% set my_list = ['a', 'b', 'c', 'a', 'b'] -%}
{{ my_list | unique }}
will be rendered as:
.. code-block:: text
['a', 'b', 'c'] | [
"Removes",
"duplicates",
"from",
"a",
"list",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L462-L485 | train | Returns a list of unique items in the specified 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/utils/jinja.py | lst_avg | def lst_avg(lst):
'''
Returns the average value of a list.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | avg }}
will be rendered as:
.. code-block:: yaml
2.5
'''
salt.utils.versions.warn_until(
'Neon',
'This results of this fun... | python | def lst_avg(lst):
'''
Returns the average value of a list.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | avg }}
will be rendered as:
.. code-block:: yaml
2.5
'''
salt.utils.versions.warn_until(
'Neon',
'This results of this fun... | [
"def",
"lst_avg",
"(",
"lst",
")",
":",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Neon'",
",",
"'This results of this function are currently being rounded.'",
"'Beginning in the Salt Neon release, results will no longer be '",
"'rounded and this warning wil... | Returns the average value of a list.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | avg }}
will be rendered as:
.. code-block:: yaml
2.5 | [
"Returns",
"the",
"average",
"value",
"of",
"a",
"list",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L527-L552 | train | Returns the average value of a 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/utils/jinja.py | union | def union(lst1, lst2):
'''
Returns the union of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | union([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[1, 2, 3, 4, 6]
'''
if isinstance(lst1, collections.Hashable) and isinstance... | python | def union(lst1, lst2):
'''
Returns the union of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | union([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[1, 2, 3, 4, 6]
'''
if isinstance(lst1, collections.Hashable) and isinstance... | [
"def",
"union",
"(",
"lst1",
",",
"lst2",
")",
":",
"if",
"isinstance",
"(",
"lst1",
",",
"collections",
".",
"Hashable",
")",
"and",
"isinstance",
"(",
"lst2",
",",
"collections",
".",
"Hashable",
")",
":",
"return",
"set",
"(",
"lst1",
")",
"|",
"s... | Returns the union of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | union([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[1, 2, 3, 4, 6] | [
"Returns",
"the",
"union",
"of",
"two",
"lists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L556-L573 | train | Returns the union of two lists. | 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/jinja.py | intersect | def intersect(lst1, lst2):
'''
Returns the intersection of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | intersect([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[2, 4]
'''
if isinstance(lst1, collections.Hashable) and isin... | python | def intersect(lst1, lst2):
'''
Returns the intersection of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | intersect([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[2, 4]
'''
if isinstance(lst1, collections.Hashable) and isin... | [
"def",
"intersect",
"(",
"lst1",
",",
"lst2",
")",
":",
"if",
"isinstance",
"(",
"lst1",
",",
"collections",
".",
"Hashable",
")",
"and",
"isinstance",
"(",
"lst2",
",",
"collections",
".",
"Hashable",
")",
":",
"return",
"set",
"(",
"lst1",
")",
"&",
... | Returns the intersection of two lists.
.. code-block:: jinja
{% my_list = [1,2,3,4] -%}
{{ set my_list | intersect([2, 4, 6]) }}
will be rendered as:
.. code-block:: text
[2, 4] | [
"Returns",
"the",
"intersection",
"of",
"two",
"lists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L577-L594 | train | Returns the intersection of two lists. | 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/jinja.py | SaltCacheLoader.file_client | def file_client(self):
'''
Return a file client. Instantiates on first call.
'''
if not self._file_client:
self._file_client = salt.fileclient.get_file_client(
self.opts, self.pillar_rend)
return self._file_client | python | def file_client(self):
'''
Return a file client. Instantiates on first call.
'''
if not self._file_client:
self._file_client = salt.fileclient.get_file_client(
self.opts, self.pillar_rend)
return self._file_client | [
"def",
"file_client",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_file_client",
":",
"self",
".",
"_file_client",
"=",
"salt",
".",
"fileclient",
".",
"get_file_client",
"(",
"self",
".",
"opts",
",",
"self",
".",
"pillar_rend",
")",
"return",
"se... | Return a file client. Instantiates on first call. | [
"Return",
"a",
"file",
"client",
".",
"Instantiates",
"on",
"first",
"call",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L76-L83 | train | Return a file client. Instantiates on first call. | 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/jinja.py | SaltCacheLoader.cache_file | def cache_file(self, template):
'''
Cache a file from the salt master
'''
saltpath = salt.utils.url.create(template)
self.file_client().get_file(saltpath, '', True, self.saltenv) | python | def cache_file(self, template):
'''
Cache a file from the salt master
'''
saltpath = salt.utils.url.create(template)
self.file_client().get_file(saltpath, '', True, self.saltenv) | [
"def",
"cache_file",
"(",
"self",
",",
"template",
")",
":",
"saltpath",
"=",
"salt",
".",
"utils",
".",
"url",
".",
"create",
"(",
"template",
")",
"self",
".",
"file_client",
"(",
")",
".",
"get_file",
"(",
"saltpath",
",",
"''",
",",
"True",
",",
... | Cache a file from the salt master | [
"Cache",
"a",
"file",
"from",
"the",
"salt",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L85-L90 | train | Cache a file 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/utils/jinja.py | SaltCacheLoader.check_cache | def check_cache(self, template):
'''
Cache a file only once
'''
if template not in self.cached:
self.cache_file(template)
self.cached.append(template) | python | def check_cache(self, template):
'''
Cache a file only once
'''
if template not in self.cached:
self.cache_file(template)
self.cached.append(template) | [
"def",
"check_cache",
"(",
"self",
",",
"template",
")",
":",
"if",
"template",
"not",
"in",
"self",
".",
"cached",
":",
"self",
".",
"cache_file",
"(",
"template",
")",
"self",
".",
"cached",
".",
"append",
"(",
"template",
")"
] | Cache a file only once | [
"Cache",
"a",
"file",
"only",
"once"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L92-L98 | train | Cache a file only once | 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/jinja.py | SaltCacheLoader.get_source | def get_source(self, environment, template):
'''
Salt-specific loader to find imported jinja files.
Jinja imports will be interpreted as originating from the top
of each of the directories in the searchpath when the template
name does not begin with './' or '../'. When a templa... | python | def get_source(self, environment, template):
'''
Salt-specific loader to find imported jinja files.
Jinja imports will be interpreted as originating from the top
of each of the directories in the searchpath when the template
name does not begin with './' or '../'. When a templa... | [
"def",
"get_source",
"(",
"self",
",",
"environment",
",",
"template",
")",
":",
"# FIXME: somewhere do seprataor replacement: '\\\\' => '/'",
"_template",
"=",
"template",
"if",
"template",
".",
"split",
"(",
"'/'",
",",
"1",
")",
"[",
"0",
"]",
"in",
"(",
"'... | Salt-specific loader to find imported jinja files.
Jinja imports will be interpreted as originating from the top
of each of the directories in the searchpath when the template
name does not begin with './' or '../'. When a template name
begins with './' or '../' then the import will be... | [
"Salt",
"-",
"specific",
"loader",
"to",
"find",
"imported",
"jinja",
"files",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L100-L171 | train | This method is used by the loader to find imported jinja 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/utils/jinja.py | SerializerExtension.finalizer | def finalizer(self, data):
'''
Ensure that printed mappings are YAML friendly.
'''
def explore(data):
if isinstance(data, (dict, OrderedDict)):
return PrintableDict(
[(key, explore(value)) for key, value in six.iteritems(data)]
... | python | def finalizer(self, data):
'''
Ensure that printed mappings are YAML friendly.
'''
def explore(data):
if isinstance(data, (dict, OrderedDict)):
return PrintableDict(
[(key, explore(value)) for key, value in six.iteritems(data)]
... | [
"def",
"finalizer",
"(",
"self",
",",
"data",
")",
":",
"def",
"explore",
"(",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"(",
"dict",
",",
"OrderedDict",
")",
")",
":",
"return",
"PrintableDict",
"(",
"[",
"(",
"key",
",",
"explore",
... | Ensure that printed mappings are YAML friendly. | [
"Ensure",
"that",
"printed",
"mappings",
"are",
"YAML",
"friendly",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jinja.py#L840-L852 | train | This function is called when the data is loaded and the finalizer is called when the data is loaded. | 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/elasticsearch.py | alias_absent | def alias_absent(name, index):
'''
Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
alias = __salt__['elasticsearch.alias_... | python | def alias_absent(name, index):
'''
Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
alias = __salt__['elasticsearch.alias_... | [
"def",
"alias_absent",
"(",
"name",
",",
"index",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"alias",
"=",
"__salt__",
"[",
"'elasti... | Ensure that the index alias is absent.
name
Name of the index alias to remove
index
Name of the index for the alias | [
"Ensure",
"that",
"the",
"index",
"alias",
"is",
"absent",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L104-L136 | train | Ensure that the index alias is absent. | 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/elasticsearch.py | alias_present | def alias_present(name, index, definition=None):
'''
Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
... | python | def alias_present(name, index, definition=None):
'''
Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
... | [
"def",
"alias_present",
"(",
"name",
",",
"index",
",",
"definition",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"alias... | Ensure that the named index alias is present.
name
Name of the alias
index
Name of the index
definition
Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
**Example:**
.. code-block:: yaml
mytestal... | [
"Ensure",
"that",
"the",
"named",
"index",
"alias",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L139-L199 | train | Ensure that the named index alias is present. | 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/elasticsearch.py | index_template_absent | def index_template_absent(name):
'''
Ensure that the named index template is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index_template = __salt__['elasticsearch.index_template_get'](name=name)
if... | python | def index_template_absent(name):
'''
Ensure that the named index template is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index_template = __salt__['elasticsearch.index_template_get'](name=name)
if... | [
"def",
"index_template_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"index_template",
"=",
"__salt__",
"[",
"'elasti... | Ensure that the named index template is absent.
name
Name of the index to remove | [
"Ensure",
"that",
"the",
"named",
"index",
"template",
"is",
"absent",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L202-L232 | train | Ensure that the named index template is absent. | 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/elasticsearch.py | index_template_present | def index_template_present(name, definition, check_definition=False):
'''
Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templa... | python | def index_template_present(name, definition, check_definition=False):
'''
Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templa... | [
"def",
"index_template_present",
"(",
"name",
",",
"definition",
",",
"check_definition",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"... | Ensure that the named index template is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
check_definition
If the template already exists and the defin... | [
"Ensure",
"that",
"the",
"named",
"index",
"template",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L235-L309 | train | Ensure that the named index template is present. | 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/elasticsearch.py | pipeline_absent | def pipeline_absent(name):
'''
Ensure that the named pipeline is absent
name
Name of the pipeline to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
pipeline = __salt__['elasticsearch.pipeline_get'](id=name)
if pipeline and name in pi... | python | def pipeline_absent(name):
'''
Ensure that the named pipeline is absent
name
Name of the pipeline to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
pipeline = __salt__['elasticsearch.pipeline_get'](id=name)
if pipeline and name in pi... | [
"def",
"pipeline_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"pipeline",
"=",
"__salt__",
"[",
"'elasticsearch.pipe... | Ensure that the named pipeline is absent
name
Name of the pipeline to remove | [
"Ensure",
"that",
"the",
"named",
"pipeline",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L312-L342 | train | Ensure that the named pipeline is absent. | 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/elasticsearch.py | pipeline_present | def pipeline_present(name, definition):
'''
Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:... | python | def pipeline_present(name, definition):
'''
Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:... | [
"def",
"pipeline_present",
"(",
"name",
",",
"definition",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"pipeline",
"=",
"__salt__",
"["... | Ensure that the named pipeline is present.
name
Name of the index to add
definition
Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
**Example:**
.. code-block:: yaml
test_pipeline:
elasticsear... | [
"Ensure",
"that",
"the",
"named",
"pipeline",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L345-L401 | train | Ensure that the named pipeline is present. | 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/elasticsearch.py | search_template_absent | def search_template_absent(name):
'''
Ensure that the search template is absent
name
Name of the search template to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
template = __salt__['elasticsearch.search_template_get'](id=name)
if t... | python | def search_template_absent(name):
'''
Ensure that the search template is absent
name
Name of the search template to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
template = __salt__['elasticsearch.search_template_get'](id=name)
if t... | [
"def",
"search_template_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"template",
"=",
"__salt__",
"[",
"'elasticsear... | Ensure that the search template is absent
name
Name of the search template to remove | [
"Ensure",
"that",
"the",
"search",
"template",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L404-L434 | train | Ensure that the search template is absent | 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/elasticsearch.py | search_template_present | def search_template_present(name, definition):
'''
Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
*... | python | def search_template_present(name, definition):
'''
Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
*... | [
"def",
"search_template_present",
"(",
"name",
",",
"definition",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"template",
"=",
"__salt__"... | Ensure that the named search template is present.
name
Name of the search template to add
definition
Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
**Example:**
.. code-block:: yaml
test_pipelin... | [
"Ensure",
"that",
"the",
"named",
"search",
"template",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch.py#L437-L492 | train | Ensure that the named search template is present. | 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/pkgng.py | _pkg | def _pkg(jail=None, chroot=None, root=None):
'''
Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified.
'''
ret = ['pkg']
if jail:
ret.extend(['-j', jail])
elif chroot:
ret.extend(['-c', chroot])
elif root:
ret.extend(... | python | def _pkg(jail=None, chroot=None, root=None):
'''
Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified.
'''
ret = ['pkg']
if jail:
ret.extend(['-j', jail])
elif chroot:
ret.extend(['-c', chroot])
elif root:
ret.extend(... | [
"def",
"_pkg",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"'pkg'",
"]",
"if",
"jail",
":",
"ret",
".",
"extend",
"(",
"[",
"'-j'",
",",
"jail",
"]",
")",
"elif",
"chroot",
":",
"... | Returns the prefix for a pkg command, using -j if a jail is specified, or
-c if chroot is specified. | [
"Returns",
"the",
"prefix",
"for",
"a",
"pkg",
"command",
"using",
"-",
"j",
"if",
"a",
"jail",
"is",
"specified",
"or",
"-",
"c",
"if",
"chroot",
"is",
"specified",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L89-L101 | train | Returns the prefix for a pkg command. | 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/pkgng.py | _get_pkgng_version | def _get_pkgng_version(jail=None, chroot=None, root=None):
'''
return the version of 'pkg'
'''
cmd = _pkg(jail, chroot, root) + ['--version']
return __salt__['cmd.run'](cmd).strip() | python | def _get_pkgng_version(jail=None, chroot=None, root=None):
'''
return the version of 'pkg'
'''
cmd = _pkg(jail, chroot, root) + ['--version']
return __salt__['cmd.run'](cmd).strip() | [
"def",
"_get_pkgng_version",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"cmd",
"=",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'--version'",
"]",
"return",
"__salt__",
"[",
"'cmd.ru... | return the version of 'pkg' | [
"return",
"the",
"version",
"of",
"pkg"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L104-L109 | train | Return the version of pkgng | 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/pkgng.py | _get_version | def _get_version(name, results):
'''
``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match.
'''
for line in salt.utils.itertools.split(results, '\n'):
if not line:
continue
try:... | python | def _get_version(name, results):
'''
``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match.
'''
for line in salt.utils.itertools.split(results, '\n'):
if not line:
continue
try:... | [
"def",
"_get_version",
"(",
"name",
",",
"results",
")",
":",
"for",
"line",
"in",
"salt",
".",
"utils",
".",
"itertools",
".",
"split",
"(",
"results",
",",
"'\\n'",
")",
":",
"if",
"not",
"line",
":",
"continue",
"try",
":",
"pkgname",
",",
"pkgver... | ``pkg search`` will return all packages for which the pattern is a match.
Narrow this down and return the package version, or None if no exact match. | [
"pkg",
"search",
"will",
"return",
"all",
"packages",
"for",
"which",
"the",
"pattern",
"is",
"a",
"match",
".",
"Narrow",
"this",
"down",
"and",
"return",
"the",
"package",
"version",
"or",
"None",
"if",
"no",
"exact",
"match",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L112-L126 | train | Search for the version of a package in 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/modules/pkgng.py | _contextkey | def _contextkey(jail=None, chroot=None, root=None, prefix='pkg.list_pkgs'):
'''
As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used.
'''
if jail:
return ... | python | def _contextkey(jail=None, chroot=None, root=None, prefix='pkg.list_pkgs'):
'''
As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used.
'''
if jail:
return ... | [
"def",
"_contextkey",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"prefix",
"=",
"'pkg.list_pkgs'",
")",
":",
"if",
"jail",
":",
"return",
"six",
".",
"text_type",
"(",
"prefix",
")",
"+",
"'.jail_{0}'",
".",
... | As this module is designed to manipulate packages in jails and chroots, use
the passed jail/chroot to ensure that a key in the __context__ dict that is
unique to that jail/chroot is used. | [
"As",
"this",
"module",
"is",
"designed",
"to",
"manipulate",
"packages",
"in",
"jails",
"and",
"chroots",
"use",
"the",
"passed",
"jail",
"/",
"chroot",
"to",
"ensure",
"that",
"a",
"key",
"in",
"the",
"__context__",
"dict",
"that",
"is",
"unique",
"to",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L129-L141 | train | Return the key for the context of a package. | 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/pkgng.py | parse_config | def parse_config(file_name='/usr/local/etc/pkg.conf'):
'''
Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now
'''
ret = {}
if not os.path.isfile(file_name):
return 'Unable t... | python | def parse_config(file_name='/usr/local/etc/pkg.conf'):
'''
Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now
'''
ret = {}
if not os.path.isfile(file_name):
return 'Unable t... | [
"def",
"parse_config",
"(",
"file_name",
"=",
"'/usr/local/etc/pkg.conf'",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"file_name",
")",
":",
"return",
"'Unable to find {0} on file system'",
".",
"format",
"(",
"file_nam... | Return dict of uncommented global variables.
CLI Example:
.. code-block:: bash
salt '*' pkg.parse_config
``NOTE:`` not working properly right now | [
"Return",
"dict",
"of",
"uncommented",
"global",
"variables",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L144-L169 | train | Parse the config file and return a dict of uncommented global variables. | 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/pkgng.py | version | def version(*names, **kwargs):
'''
Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``p... | python | def version(*names, **kwargs):
'''
Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``p... | [
"def",
"version",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"with_origin",
"=",
"kwargs",
".",
"pop",
"(",
"'with_origin'",
",",
"False",
")",
"ret",
"=",
"__salt__",
"[",
"'pkg_resource.version'",
"]",
"(",
"*",
"names",
",",
"*",
"*",
"... | Returns a string representing the package version or an empty string if not
installed. If more than one package name is specified, a dict of
name/version pairs is returned.
.. note::
This function can accessed using ``pkg.info`` in addition to
``pkg.version``, to more closely match the CLI... | [
"Returns",
"a",
"string",
"representing",
"the",
"package",
"version",
"or",
"an",
"empty",
"string",
"if",
"not",
"installed",
".",
"If",
"more",
"than",
"one",
"package",
"name",
"is",
"specified",
"a",
"dict",
"of",
"name",
"/",
"version",
"pairs",
"is"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L172-L220 | train | Return a string representing the version of the specified packages. | 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/pkgng.py | refresh_db | def refresh_db(jail=None, chroot=None, root=None, force=False, **kwargs):
'''
Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: ... | python | def refresh_db(jail=None, chroot=None, root=None, force=False, **kwargs):
'''
Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: ... | [
"def",
"refresh_db",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"force",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils"... | Refresh PACKAGESITE contents
.. note::
This function can accessed using ``pkg.update`` in addition to
``pkg.refresh_db``, to more closely match the CLI usage of ``pkg(8)``.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
jail
Refresh the pkg database withi... | [
"Refresh",
"PACKAGESITE",
"contents"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L227-L269 | train | Refresh the pkg database within the specified chroot and root | 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/pkgng.py | list_pkgs | def list_pkgs(versions_as_list=False,
jail=None,
chroot=None,
root=None,
with_origin=False,
**kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the s... | python | def list_pkgs(versions_as_list=False,
jail=None,
chroot=None,
root=None,
with_origin=False,
**kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the s... | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"with_origin",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# not yet implemented or not applicable",
"if",
... | List the packages currently installed as a dict::
{'<package_name>': '<version>'}
jail
List the packages in the specified jail
chroot
List the packages in the specified chroot (ignored if ``jail`` is
specified)
root
List the packages in the specified root (ignored... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L354-L438 | train | List the packages currently installed as a 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/modules/pkgng.py | stats | def stats(local=False, remote=False, jail=None, chroot=None, root=None):
'''
Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*'... | python | def stats(local=False, remote=False, jail=None, chroot=None, root=None):
'''
Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*'... | [
"def",
"stats",
"(",
"local",
"=",
"False",
",",
"remote",
"=",
"False",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"opts",
"=",
"''",
"if",
"local",
":",
"opts",
"+=",
"'l'",
"if",
"remote",
":",
... | Return pkgng stats.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats
local
Display stats only for the local package database.
CLI Example:
.. code-block:: bash
salt '*' pkg.stats local=True
remote
Display stats only for the remote package d... | [
"Return",
"pkgng",
"stats",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L462-L529 | train | Return pkgng stats for the specified chroot and chail. | 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/pkgng.py | backup | def backup(file_name, jail=None, chroot=None, root=None):
'''
Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, a... | python | def backup(file_name, jail=None, chroot=None, root=None):
'''
Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, a... | [
"def",
"backup",
"(",
"file_name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'bac... | Export installed packages into yaml+mtree file
CLI Example:
.. code-block:: bash
salt '*' pkg.backup /tmp/pkg
jail
Backup packages from the specified jail. Note that this will run the
command within the jail, and so the path to the backup file will be
relative to the root... | [
"Export",
"installed",
"packages",
"into",
"yaml",
"+",
"mtree",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L532-L576 | train | Exports installed packages into yaml +mtree 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/pkgng.py | restore | def restore(file_name, jail=None, chroot=None, root=None):
'''
Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
comma... | python | def restore(file_name, jail=None, chroot=None, root=None):
'''
Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
comma... | [
"def",
"restore",
"(",
"file_name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'backup... | Reads archive created by pkg backup -d and recreates the database.
CLI Example:
.. code-block:: bash
salt '*' pkg.restore /tmp/pkg
jail
Restore database to the specified jail. Note that this will run the
command within the jail, and so the path to the file from which the pkg
... | [
"Reads",
"archive",
"created",
"by",
"pkg",
"backup",
"-",
"d",
"and",
"recreates",
"the",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L579-L622 | train | Reads the backup file and recreates the database. | 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/pkgng.py | audit | def audit(jail=None, chroot=None, root=None):
'''
Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' p... | python | def audit(jail=None, chroot=None, root=None):
'''
Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' p... | [
"def",
"audit",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"_pkg",
"(",
"jail",
",",
"chroot",
",",
"root",
")",
"+",
"[",
"'audit'",
",",
"'-F'",
"]... | Audits installed packages against known vulnerabilities
CLI Example:
.. code-block:: bash
salt '*' pkg.audit
jail
Audit packages within the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.audit jail=<jail name or id>
chroot
Audit ... | [
"Audits",
"installed",
"packages",
"against",
"known",
"vulnerabilities"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L625-L662 | train | Audits installed packages against known vulnerabilities | 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/pkgng.py | install | def install(name=None,
fromrepo=None,
pkgs=None,
sources=None,
jail=None,
chroot=None,
root=None,
orphan=False,
force=False,
glob=False,
local=False,
dryrun=False,
quiet=False,... | python | def install(name=None,
fromrepo=None,
pkgs=None,
sources=None,
jail=None,
chroot=None,
root=None,
orphan=False,
force=False,
glob=False,
local=False,
dryrun=False,
quiet=False,... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"orphan",
"=",
"False",
",",
"fo... | Install package(s) from a repository
name
The name of the package to install
CLI Example:
.. code-block:: bash
salt '*' pkg.install <package name>
jail
Install the package into the specified jail
chroot
Install the package into the specified chroot (... | [
"Install",
"package",
"(",
"s",
")",
"from",
"a",
"repository"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L665-L909 | train | Installs a package from a repository and returns the full path to the installed package. | 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/pkgng.py | remove | def remove(name=None,
pkgs=None,
jail=None,
chroot=None,
root=None,
all_installed=False,
force=False,
glob=False,
dryrun=False,
recurse=False,
regex=False,
pcre=False,
**kwargs):
'''
... | python | def remove(name=None,
pkgs=None,
jail=None,
chroot=None,
root=None,
all_installed=False,
force=False,
glob=False,
dryrun=False,
recurse=False,
regex=False,
pcre=False,
**kwargs):
'''
... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"all_installed",
"=",
"False",
",",
"force",
"=",
"False",
",",
"glob",
"=",
"False",
",",
"... | Remove a package from the database and system
.. note::
This function can accessed using ``pkg.delete`` in addition to
``pkg.remove``, to more closely match the CLI usage of ``pkg(8)``.
name
The package to remove
CLI Example:
.. code-block:: bash
salt '*... | [
"Remove",
"a",
"package",
"from",
"the",
"database",
"and",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L912-L1086 | train | Removes a package from the database and 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/pkgng.py | upgrade | def upgrade(*names, **kwargs):
'''
Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
... | python | def upgrade(*names, **kwargs):
'''
Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
... | [
"def",
"upgrade",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
"=",
"kwargs",
".",
"pop",... | Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
omitted, the operation is executed on all packages.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Ex... | [
"Upgrade",
"named",
"or",
"all",
"packages",
"(",
"run",
"a",
"pkg",
"upgrade",
")",
".",
"If",
"<package",
"name",
">",
"is",
"omitted",
"the",
"operation",
"is",
"executed",
"on",
"all",
"packages",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1095-L1212 | train | Execute a single upgrade of the specified packages. | 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/pkgng.py | clean | def clean(jail=None,
chroot=None,
root=None,
clean_all=False,
dryrun=False):
'''
Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
... | python | def clean(jail=None,
chroot=None,
root=None,
clean_all=False,
dryrun=False):
'''
Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
... | [
"def",
"clean",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"clean_all",
"=",
"False",
",",
"dryrun",
"=",
"False",
")",
":",
"opts",
"=",
"''",
"if",
"clean_all",
":",
"opts",
"+=",
"'a'",
"if",
"dryrun",
... | Cleans the local cache of fetched remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.clean
jail
Cleans the package cache in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.clean jail=<jail name or id>
chroot
Cleans... | [
"Cleans",
"the",
"local",
"cache",
"of",
"fetched",
"remote",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1215-L1288 | train | Clean the local cache of fetched remote packages. | 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/pkgng.py | check | def check(jail=None,
chroot=None,
root=None,
depends=False,
recompute=False,
checksum=False):
'''
Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
s... | python | def check(jail=None,
chroot=None,
root=None,
depends=False,
recompute=False,
checksum=False):
'''
Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
s... | [
"def",
"check",
"(",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"depends",
"=",
"False",
",",
"recompute",
"=",
"False",
",",
"checksum",
"=",
"False",
")",
":",
"if",
"not",
"any",
"(",
"(",
"depends",
",",
"... | Sanity checks installed packages
jail
Perform the sanity check in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.check jail=<jail name or id>
chroot
Perform the sanity check in the specified chroot (ignored if ``jail``
is specified)
... | [
"Sanity",
"checks",
"installed",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1326-L1407 | train | Check the contents of a set of packages and return a string containing the contents of the installed packages. | 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/pkgng.py | which | def which(path, jail=None, chroot=None, root=None, origin=False, quiet=False):
'''
Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code... | python | def which(path, jail=None, chroot=None, root=None, origin=False, quiet=False):
'''
Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code... | [
"def",
"which",
"(",
"path",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"origin",
"=",
"False",
",",
"quiet",
"=",
"False",
")",
":",
"opts",
"=",
"''",
"if",
"quiet",
":",
"opts",
"+=",
"'q'",
"if",
"o... | Displays which package installed a specific file
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name>
jail
Perform the check in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.which <file name> jail=<jail name or id>
chroo... | [
"Displays",
"which",
"package",
"installed",
"a",
"specific",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1410-L1477 | train | Shows which package installed a specific 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/pkgng.py | search | def search(name,
jail=None,
chroot=None,
root=None,
exact=False,
glob=False,
regex=False,
pcre=False,
comment=False,
desc=False,
full=False,
depends=False,
size=False,
quiet=Fal... | python | def search(name,
jail=None,
chroot=None,
root=None,
exact=False,
glob=False,
regex=False,
pcre=False,
comment=False,
desc=False,
full=False,
depends=False,
size=False,
quiet=Fal... | [
"def",
"search",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"exact",
"=",
"False",
",",
"glob",
"=",
"False",
",",
"regex",
"=",
"False",
",",
"pcre",
"=",
"False",
",",
"comment",
"=",
"Fals... | Searches in remote package repositories
CLI Example:
.. code-block:: bash
salt '*' pkg.search pattern
jail
Perform the search using the ``pkg.conf(5)`` from the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.search pattern jail=<jail name or ... | [
"Searches",
"in",
"remote",
"package",
"repositories"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1480-L1673 | train | Search for a set of items in the specified set of items in the remote package repositories. | 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/pkgng.py | fetch | def fetch(name,
jail=None,
chroot=None,
root=None,
fetch_all=False,
quiet=False,
fromrepo=None,
glob=True,
regex=False,
pcre=False,
local=False,
depends=False):
'''
Fetches remote packages
CLI Exam... | python | def fetch(name,
jail=None,
chroot=None,
root=None,
fetch_all=False,
quiet=False,
fromrepo=None,
glob=True,
regex=False,
pcre=False,
local=False,
depends=False):
'''
Fetches remote packages
CLI Exam... | [
"def",
"fetch",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"fetch_all",
"=",
"False",
",",
"quiet",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"glob",
"=",
"True",
",",
"regex",
"=",
"F... | Fetches remote packages
CLI Example:
.. code-block:: bash
salt '*' pkg.fetch <package name>
jail
Fetch package in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.fetch <package name> jail=<jail name or id>
chroot
Fetch package... | [
"Fetches",
"remote",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1676-L1821 | train | Fetch the specified set of packages from the specified repository and return the set of packages that were found. | 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/pkgng.py | updating | def updating(name,
jail=None,
chroot=None,
root=None,
filedate=None,
filename=None):
''''
Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the a... | python | def updating(name,
jail=None,
chroot=None,
root=None,
filedate=None,
filename=None):
''''
Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the a... | [
"def",
"updating",
"(",
"name",
",",
"jail",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"root",
"=",
"None",
",",
"filedate",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"opts",
"=",
"''",
"if",
"filedate",
":",
"opts",
"+=",
"'d {0}'",... | Displays UPDATING entries of software packages
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo
jail
Perform the action in the specified jail
CLI Example:
.. code-block:: bash
salt '*' pkg.updating foo jail=<jail name or id>
chroot
P... | [
"Displays",
"UPDATING",
"entries",
"of",
"software",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1824-L1896 | train | Update the entry in the specified software packages. | 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/pkgng.py | hold | def hold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
'''
Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng... | python | def hold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
'''
Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng... | [
"def",
"hold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"targets",
"=",
"[",
"]",
"if",
"pkgs",
":",
"targets",
".",
"extend",
"(",
"pkgs",
")",
"else",
":",
"targets",
".",
"... | Version-lock packages
.. note::
This function is provided primarily for compatibilty with some
parts of :py:mod:`states.pkg <salt.states.pkg>`.
Consider using Consider using :py:func:`pkg.lock <salt.modules.pkgng.lock>` instead. instead.
name
The name of the package to be held.... | [
"Version",
"-",
"lock",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L1899-L1961 | train | Holds the named package. | 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/pkgng.py | list_locked | def list_locked(**kwargs):
'''
Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List l... | python | def list_locked(**kwargs):
'''
Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List l... | [
"def",
"list_locked",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"[",
"'{0}-{1}'",
".",
"format",
"(",
"pkgname",
",",
"version",
"(",
"pkgname",
",",
"*",
"*",
"kwargs",
")",
")",
"for",
"pkgname",
"in",
"_lockcmd",
"(",
"'lock'",
",",
"name",
"="... | Query the package database those packages which are
locked against reinstallation, modification or deletion.
Returns returns a list of package names with version strings
CLI Example:
.. code-block:: bash
salt '*' pkg.list_locked
jail
List locked packages within the specified jai... | [
"Query",
"the",
"package",
"database",
"those",
"packages",
"which",
"are",
"locked",
"against",
"reinstallation",
"modification",
"or",
"deletion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2029-L2073 | train | Query the package database those packages which are locked against reinstallation modification or deletion. | 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/pkgng.py | _lockcmd | def _lockcmd(subcmd, pkgname=None, **kwargs):
'''
Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages
'''
jail = kwargs.pop('jail', None)
chroot = kwargs.pop('chroot', None)
root = kwargs.pop('ro... | python | def _lockcmd(subcmd, pkgname=None, **kwargs):
'''
Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages
'''
jail = kwargs.pop('jail', None)
chroot = kwargs.pop('chroot', None)
root = kwargs.pop('ro... | [
"def",
"_lockcmd",
"(",
"subcmd",
",",
"pkgname",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
... | Helper function for lock and unlock commands, because their syntax is identical.
Run the lock/unlock command, and return a list of locked packages | [
"Helper",
"function",
"for",
"lock",
"and",
"unlock",
"commands",
"because",
"their",
"syntax",
"is",
"identical",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2221-L2261 | train | Helper function for lock and unlock commands. | 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/pkgng.py | list_upgrades | def list_upgrades(refresh=True, **kwargs):
'''
List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
... | python | def list_upgrades(refresh=True, **kwargs):
'''
List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
... | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"pop",
"(",
"'jail'",
",",
"None",
")",
"chroot",
"=",
"kwargs",
".",
"pop",
"(",
"'chroot'",
",",
"None",
")",
"root",
"=",
"kwargs... | List those packages for which an upgrade is available
The ``fromrepo`` argument is also supported, as used in pkg states.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
jail
List upgrades within the specified jail
CLI Example:
.. code-block:: bash
... | [
"List",
"those",
"packages",
"for",
"which",
"an",
"upgrade",
"is",
"available"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2264-L2322 | train | List the packages that have an upgrade 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/modules/pkgng.py | _parse_upgrade | def _parse_upgrade(stdout):
'''
Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'curren... | python | def _parse_upgrade(stdout):
'''
Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'curren... | [
"def",
"_parse_upgrade",
"(",
"stdout",
")",
":",
"# Match strings like 'python36: 3.6.3 -> 3.6.4 [FreeBSD]'",
"upgrade_regex",
"=",
"re",
".",
"compile",
"(",
"r'^\\s+([^:]+):\\s([0-9a-z_,.]+)\\s+->\\s+([0-9a-z_,.]+)\\s*(\\[([^]]+)\\])?\\s*(\\(([^)]+)\\))?'",
")",
"# Match strings lik... | Parse the output from the ``pkg upgrade --dry-run`` command
Returns a dictionary of the expected actions:
.. code-block:: yaml
'upgrade':
pkgname:
'repo': repository
'reason': reason
'version':
'current': n.n.n
'new': n.n.n
... | [
"Parse",
"the",
"output",
"from",
"the",
"pkg",
"upgrade",
"--",
"dry",
"-",
"run",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2325-L2441 | train | Parse the output from the pkg upgrade command and return a dictionary of the expected actions. | 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/pkgng.py | version_cmp | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version... | python | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version... | [
"def",
"version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"del",
"ignore_epoch",
"# Unused parameter",
"# Don't worry about ignore_epoch since we're shelling out to pkg.",
"sym",
"=",
"{",
"'<'",
":",
"-",
... | Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version_cmp '2.1.11' '2.1.12' | [
"Do",
"a",
"cmp",
"-",
"style",
"comparison",
"on",
"two",
"packages",
".",
"Return",
"-",
"1",
"if",
"pkg1",
"<",
"pkg2",
"0",
"if",
"pkg1",
"==",
"pkg2",
"and",
"1",
"if",
"pkg1",
">",
"pkg2",
".",
"Return",
"None",
"if",
"there",
"was",
"a",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkgng.py#L2444-L2476 | train | Compare two packages and return the version of the first 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/dpkg_lowpkg.py | bin_pkg_info | def bin_pkg_info(path, saltenv='base'):
'''
.. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ... | python | def bin_pkg_info(path, saltenv='base'):
'''
.. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ... | [
"def",
"bin_pkg_info",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# If the path is a valid protocol, pull it down using cp.cache_file",
"if",
"__salt__",
"[",
"'config.valid_fileproto'",
"]",
"(",
"path",
")",
":",
"newpath",
"=",
"__salt__",
"[",
"'cp.cac... | .. versionadded:: 2015.8.0
Parses RPM metadata and returns a dictionary of information about the
package (name, version, etc.).
path
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. ``salt://path/to/file.rpm``).
If a salt file... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L37-L110 | train | Return a dictionary of information about the specified RPM package. | 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/dpkg_lowpkg.py | unpurge | def unpurge(*packages):
'''
Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl
'''
if not packages:
return {}
old = __salt__['pkg.list_pkgs'](purge_desired=True)
ret = {}
__salt__['cmd.run... | python | def unpurge(*packages):
'''
Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl
'''
if not packages:
return {}
old = __salt__['pkg.list_pkgs'](purge_desired=True)
ret = {}
__salt__['cmd.run... | [
"def",
"unpurge",
"(",
"*",
"packages",
")",
":",
"if",
"not",
"packages",
":",
"return",
"{",
"}",
"old",
"=",
"__salt__",
"[",
"'pkg.list_pkgs'",
"]",
"(",
"purge_desired",
"=",
"True",
")",
"ret",
"=",
"{",
"}",
"__salt__",
"[",
"'cmd.run'",
"]",
... | Change package selection for each package specified to 'install'
CLI Example:
.. code-block:: bash
salt '*' lowpkg.unpurge curl | [
"Change",
"package",
"selection",
"for",
"each",
"package",
"specified",
"to",
"install"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L113-L135 | train | Unpurge packages specified by the user CLI Example :
Change package selection for each package specified to install | 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/dpkg_lowpkg.py | list_pkgs | def list_pkgs(*packages, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
... | python | def list_pkgs(*packages, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
... | [
"def",
"list_pkgs",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packages",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"... | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
External dependencies::
Virtual package resolution requires aptitude. Because this function
uses dpkg, virtual packages will be reported as not installed.
CLI Example:
.. code-block:: bash
... | [
"List",
"the",
"packages",
"currently",
"installed",
"in",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L138-L169 | train | List the packages currently installed in a 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/modules/dpkg_lowpkg.py | file_list | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt... | python | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt... | [
"def",
"file_list",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"ret",
"=",
"set",
"(",
"[",
"]",
")",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packa... | List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd postfix
salt... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
"generally",
"recommended",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L172-L211 | train | List the files that belong to a package on the 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/dpkg_lowpkg.py | file_dict | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_lis... | python | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_lis... | [
"def",
"file_dict",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"ret",
"=",
"{",
"}",
"pkgs",
"=",
"{",
"}",
"cmd",
"=",
"'dpkg -l {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"packages",
")",
")",
"... | List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd ... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
"grouped",
"by",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L214-L252 | train | Return a dict of all files in a package. | 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/dpkg_lowpkg.py | _get_pkg_build_time | def _get_pkg_build_time(name):
'''
Get package build time, if possible.
:param name:
:return:
'''
iso_time = iso_time_t = None
changelog_dir = os.path.join('/usr/share/doc', name)
if os.path.exists(changelog_dir):
for fname in os.listdir(changelog_dir):
try:
... | python | def _get_pkg_build_time(name):
'''
Get package build time, if possible.
:param name:
:return:
'''
iso_time = iso_time_t = None
changelog_dir = os.path.join('/usr/share/doc', name)
if os.path.exists(changelog_dir):
for fname in os.listdir(changelog_dir):
try:
... | [
"def",
"_get_pkg_build_time",
"(",
"name",
")",
":",
"iso_time",
"=",
"iso_time_t",
"=",
"None",
"changelog_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'/usr/share/doc'",
",",
"name",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"changelog_dir",
... | Get package build time, if possible.
:param name:
:return: | [
"Get",
"package",
"build",
"time",
"if",
"possible",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L255-L284 | train | Get package build time if possible. | 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/dpkg_lowpkg.py | _get_pkg_info | def _get_pkg_info(*packages, **kwargs):
'''
Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return:
'''
kwargs =... | python | def _get_pkg_info(*packages, **kwargs):
'''
Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return:
'''
kwargs =... | [
"def",
"_get_pkg_info",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"failhard",
"=",
"kwargs",
".",
"pop",
"(",
"'failhard'",
",",
"True... | Return list of package information. If 'packages' parameter is empty,
then data about all installed packages will be returned.
:param packages: Specified packages.
:param failhard: Throw an exception if no packages found.
:return: | [
"Return",
"list",
"of",
"package",
"information",
".",
"If",
"packages",
"parameter",
"is",
"empty",
"then",
"data",
"about",
"all",
"installed",
"packages",
"will",
"be",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L287-L354 | train | Return list of package information. | 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/dpkg_lowpkg.py | _get_pkg_license | def _get_pkg_license(pkg):
'''
Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return:
'''
licenses = set()
cpr = "/usr/share/doc/{0}/copyright".format(pkg)
if os.path.exists(cpr):
with salt.util... | python | def _get_pkg_license(pkg):
'''
Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return:
'''
licenses = set()
cpr = "/usr/share/doc/{0}/copyright".format(pkg)
if os.path.exists(cpr):
with salt.util... | [
"def",
"_get_pkg_license",
"(",
"pkg",
")",
":",
"licenses",
"=",
"set",
"(",
")",
"cpr",
"=",
"\"/usr/share/doc/{0}/copyright\"",
".",
"format",
"(",
"pkg",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"cpr",
")",
":",
"with",
"salt",
".",
"utils... | Try to get a license from the package.
Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
:param pkg:
:return: | [
"Try",
"to",
"get",
"a",
"license",
"from",
"the",
"package",
".",
"Based",
"on",
"https",
":",
"//",
"www",
".",
"debian",
".",
"org",
"/",
"doc",
"/",
"packaging",
"-",
"manuals",
"/",
"copyright",
"-",
"format",
"/",
"1",
".",
"0",
"/"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L357-L373 | train | Try to get a license from the package.
Based on https://www. debian. org / doc / packaging - manuals / copyright - format 1. 0. | 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/dpkg_lowpkg.py | _get_pkg_install_time | def _get_pkg_install_time(pkg, arch=None):
'''
Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return:
'''
iso_time = iso_time_t = None
loc_root = '/var/lib/dpkg/info'
if pkg is not None:
locations = []
if arch is not None and arch != 'all':
... | python | def _get_pkg_install_time(pkg, arch=None):
'''
Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return:
'''
iso_time = iso_time_t = None
loc_root = '/var/lib/dpkg/info'
if pkg is not None:
locations = []
if arch is not None and arch != 'all':
... | [
"def",
"_get_pkg_install_time",
"(",
"pkg",
",",
"arch",
"=",
"None",
")",
":",
"iso_time",
"=",
"iso_time_t",
"=",
"None",
"loc_root",
"=",
"'/var/lib/dpkg/info'",
"if",
"pkg",
"is",
"not",
"None",
":",
"locations",
"=",
"[",
"]",
"if",
"arch",
"is",
"n... | Return package install time, based on the /var/lib/dpkg/info/<package>.list
:return: | [
"Return",
"package",
"install",
"time",
"based",
"on",
"the",
"/",
"var",
"/",
"lib",
"/",
"dpkg",
"/",
"info",
"/",
"<package",
">",
".",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L376-L401 | train | Get the package install time based on the package 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/dpkg_lowpkg.py | _get_pkg_ds_avail | def _get_pkg_ds_avail():
'''
Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return:
'''
avail = "/var/lib/dpkg/available"
if not salt.utils.path.which('dselect') or not os.path.exists(avail):
... | python | def _get_pkg_ds_avail():
'''
Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return:
'''
avail = "/var/lib/dpkg/available"
if not salt.utils.path.which('dselect') or not os.path.exists(avail):
... | [
"def",
"_get_pkg_ds_avail",
"(",
")",
":",
"avail",
"=",
"\"/var/lib/dpkg/available\"",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'dselect'",
")",
"or",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"avail",
")",
":",
"return",
... | Get the package information of the available packages, maintained by dselect.
Note, this will be not very useful, if dselect isn't installed.
:return: | [
"Get",
"the",
"package",
"information",
"of",
"the",
"available",
"packages",
"maintained",
"by",
"dselect",
".",
"Note",
"this",
"will",
"be",
"not",
"very",
"useful",
"if",
"dselect",
"isn",
"t",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L404-L432 | train | Get the package information of the available packages maintained by dselect. | 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/dpkg_lowpkg.py | info | def info(*packages, **kwargs):
'''
Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
... | python | def info(*packages, **kwargs):
'''
Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
... | [
"def",
"info",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"# Get the missing information from the /var/lib/dpkg/available, if it is there.",
"# However, this file is operated by dselect which has to be installed.",
"dselect_pkg_avail",
"=",
"_get_pkg_ds_avail",
"(",
"... | Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
Whether to throw an exception if none of t... | [
"Returns",
"a",
"detailed",
"summary",
"of",
"package",
"information",
"for",
"provided",
"package",
"names",
".",
"If",
"no",
"packages",
"are",
"specified",
"all",
"packages",
"will",
"be",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dpkg_lowpkg.py#L435-L507 | train | Return a detailed summary of package information for the given packages. | 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/context.py | func_globals_inject | def func_globals_inject(func, **overrides):
'''
Override specific variables within a function's global context.
'''
# recognize methods
if hasattr(func, 'im_func'):
func = func.__func__
# Get a reference to the function globals dictionary
func_globals = func.__globals__
# Save t... | python | def func_globals_inject(func, **overrides):
'''
Override specific variables within a function's global context.
'''
# recognize methods
if hasattr(func, 'im_func'):
func = func.__func__
# Get a reference to the function globals dictionary
func_globals = func.__globals__
# Save t... | [
"def",
"func_globals_inject",
"(",
"func",
",",
"*",
"*",
"overrides",
")",
":",
"# recognize methods",
"if",
"hasattr",
"(",
"func",
",",
"'im_func'",
")",
":",
"func",
"=",
"func",
".",
"__func__",
"# Get a reference to the function globals dictionary",
"func_glob... | Override specific variables within a function's global context. | [
"Override",
"specific",
"variables",
"within",
"a",
"function",
"s",
"global",
"context",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/context.py#L28-L61 | train | Injects specific variables within a function s global 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/utils/context.py | ContextDict.clone | def clone(self, **kwargs):
'''
Clone this context, and return the ChildContextDict
'''
child = ChildContextDict(parent=self, threadsafe=self._threadsafe, overrides=kwargs)
return child | python | def clone(self, **kwargs):
'''
Clone this context, and return the ChildContextDict
'''
child = ChildContextDict(parent=self, threadsafe=self._threadsafe, overrides=kwargs)
return child | [
"def",
"clone",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"child",
"=",
"ChildContextDict",
"(",
"parent",
"=",
"self",
",",
"threadsafe",
"=",
"self",
".",
"_threadsafe",
",",
"overrides",
"=",
"kwargs",
")",
"return",
"child"
] | Clone this context, and return the ChildContextDict | [
"Clone",
"this",
"context",
"and",
"return",
"the",
"ChildContextDict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/context.py#L95-L100 | train | Clone this context and return the ChildContextDict | 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/cli/cp.py | SaltCPCli.run | def run(self):
'''
Execute salt-cp
'''
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
salt.utils.verify.verify_log(self.config)
cp_ = SaltCP(self.config)
cp_.run() | python | def run(self):
'''
Execute salt-cp
'''
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
salt.utils.verify.verify_log(self.config)
cp_ = SaltCP(self.config)
cp_.run() | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"parse_args",
"(",
")",
"# Setup file logging!",
"self",
".",
"setup_logfile_logger",
"(",
")",
"salt",
".",
"utils",
".",
"verify",
".",
"verify_log",
"(",
"self",
".",
"config",
")",
"cp_",
"=",
"SaltCP... | Execute salt-cp | [
"Execute",
"salt",
"-",
"cp"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L41-L52 | train | Execute salt - cp
| 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/cli/cp.py | SaltCP._recurse | def _recurse(self, path):
'''
Get a list of all specified files
'''
files = {}
empty_dirs = []
try:
sub_paths = os.listdir(path)
except OSError as exc:
if exc.errno == errno.ENOENT:
# Path does not exist
sys.... | python | def _recurse(self, path):
'''
Get a list of all specified files
'''
files = {}
empty_dirs = []
try:
sub_paths = os.listdir(path)
except OSError as exc:
if exc.errno == errno.ENOENT:
# Path does not exist
sys.... | [
"def",
"_recurse",
"(",
"self",
",",
"path",
")",
":",
"files",
"=",
"{",
"}",
"empty_dirs",
"=",
"[",
"]",
"try",
":",
"sub_paths",
"=",
"os",
".",
"listdir",
"(",
"path",
")",
"except",
"OSError",
"as",
"exc",
":",
"if",
"exc",
".",
"errno",
"=... | Get a list of all specified files | [
"Get",
"a",
"list",
"of",
"all",
"specified",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L71-L95 | train | Get a list of all specified files
and all empty directories. | 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/cli/cp.py | SaltCP._file_dict | def _file_dict(self, fn_):
'''
Take a path and return the contents of the file as a string
'''
if not os.path.isfile(fn_):
err = 'The referenced file, {0} is not available.'.format(fn_)
sys.stderr.write(err + '\n')
sys.exit(42)
with salt.utils.... | python | def _file_dict(self, fn_):
'''
Take a path and return the contents of the file as a string
'''
if not os.path.isfile(fn_):
err = 'The referenced file, {0} is not available.'.format(fn_)
sys.stderr.write(err + '\n')
sys.exit(42)
with salt.utils.... | [
"def",
"_file_dict",
"(",
"self",
",",
"fn_",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"fn_",
")",
":",
"err",
"=",
"'The referenced file, {0} is not available.'",
".",
"format",
"(",
"fn_",
")",
"sys",
".",
"stderr",
".",
"write",
... | Take a path and return the contents of the file as a string | [
"Take",
"a",
"path",
"and",
"return",
"the",
"contents",
"of",
"the",
"file",
"as",
"a",
"string"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L106-L116 | train | Take a path and return the contents of the file as a string
| 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/cli/cp.py | SaltCP._load_files | def _load_files(self):
'''
Parse the files indicated in opts['src'] and load them into a python
object for transport
'''
files = {}
for fn_ in self.opts['src']:
if os.path.isfile(fn_):
files.update(self._file_dict(fn_))
elif os.path... | python | def _load_files(self):
'''
Parse the files indicated in opts['src'] and load them into a python
object for transport
'''
files = {}
for fn_ in self.opts['src']:
if os.path.isfile(fn_):
files.update(self._file_dict(fn_))
elif os.path... | [
"def",
"_load_files",
"(",
"self",
")",
":",
"files",
"=",
"{",
"}",
"for",
"fn_",
"in",
"self",
".",
"opts",
"[",
"'src'",
"]",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"fn_",
")",
":",
"files",
".",
"update",
"(",
"self",
".",
"_file... | Parse the files indicated in opts['src'] and load them into a python
object for transport | [
"Parse",
"the",
"files",
"indicated",
"in",
"opts",
"[",
"src",
"]",
"and",
"load",
"them",
"into",
"a",
"python",
"object",
"for",
"transport"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L118-L133 | train | Parse the files indicated in opts [ src ] and return a python dict that represents the loaded 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/cli/cp.py | SaltCP.run | def run(self):
'''
Make the salt client call
'''
if self.opts['chunked']:
ret = self.run_chunked()
else:
ret = self.run_oldstyle()
salt.output.display_output(
ret,
self.opts.get('output', 'nested'),
... | python | def run(self):
'''
Make the salt client call
'''
if self.opts['chunked']:
ret = self.run_chunked()
else:
ret = self.run_oldstyle()
salt.output.display_output(
ret,
self.opts.get('output', 'nested'),
... | [
"def",
"run",
"(",
"self",
")",
":",
"if",
"self",
".",
"opts",
"[",
"'chunked'",
"]",
":",
"ret",
"=",
"self",
".",
"run_chunked",
"(",
")",
"else",
":",
"ret",
"=",
"self",
".",
"run_oldstyle",
"(",
")",
"salt",
".",
"output",
".",
"display_outpu... | Make the salt client call | [
"Make",
"the",
"salt",
"client",
"call"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L135-L147 | train | Run the salt client call | 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/cli/cp.py | SaltCP.run_oldstyle | def run_oldstyle(self):
'''
Make the salt client call in old-style all-in-one call method
'''
arg = [self._load_files(), self.opts['dest']]
local = salt.client.get_local_client(self.opts['conf_file'])
args = [self.opts['tgt'],
'cp.recv',
ar... | python | def run_oldstyle(self):
'''
Make the salt client call in old-style all-in-one call method
'''
arg = [self._load_files(), self.opts['dest']]
local = salt.client.get_local_client(self.opts['conf_file'])
args = [self.opts['tgt'],
'cp.recv',
ar... | [
"def",
"run_oldstyle",
"(",
"self",
")",
":",
"arg",
"=",
"[",
"self",
".",
"_load_files",
"(",
")",
",",
"self",
".",
"opts",
"[",
"'dest'",
"]",
"]",
"local",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"self",
".",
"opts",
"[",
"'c... | Make the salt client call in old-style all-in-one call method | [
"Make",
"the",
"salt",
"client",
"call",
"in",
"old",
"-",
"style",
"all",
"-",
"in",
"-",
"one",
"call",
"method"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L149-L165 | train | Make the salt client call in old - style all - in - one call method
| 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/cli/cp.py | SaltCP.run_chunked | def run_chunked(self):
'''
Make the salt client call in the new fasion chunked multi-call way
'''
files, empty_dirs = self._list_files()
dest = self.opts['dest']
gzip = self.opts['gzip']
tgt = self.opts['tgt']
timeout = self.opts['timeout']
selecte... | python | def run_chunked(self):
'''
Make the salt client call in the new fasion chunked multi-call way
'''
files, empty_dirs = self._list_files()
dest = self.opts['dest']
gzip = self.opts['gzip']
tgt = self.opts['tgt']
timeout = self.opts['timeout']
selecte... | [
"def",
"run_chunked",
"(",
"self",
")",
":",
"files",
",",
"empty_dirs",
"=",
"self",
".",
"_list_files",
"(",
")",
"dest",
"=",
"self",
".",
"opts",
"[",
"'dest'",
"]",
"gzip",
"=",
"self",
".",
"opts",
"[",
"'gzip'",
"]",
"tgt",
"=",
"self",
".",... | Make the salt client call in the new fasion chunked multi-call way | [
"Make",
"the",
"salt",
"client",
"call",
"in",
"the",
"new",
"fasion",
"chunked",
"multi",
"-",
"call",
"way"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/cp.py#L167-L286 | train | This function runs the salt client call in the new fasion chunked multi - call way. | 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/mdadm_raid.py | list_ | def list_():
'''
List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list
'''
ret = {}
for line in (__salt__['cmd.run_stdout']
(['mdadm', '--detail', '--scan'],
python_shell=False).splitlines()):
if ' ' not in lin... | python | def list_():
'''
List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list
'''
ret = {}
for line in (__salt__['cmd.run_stdout']
(['mdadm', '--detail', '--scan'],
python_shell=False).splitlines()):
if ' ' not in lin... | [
"def",
"list_",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"(",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"[",
"'mdadm'",
",",
"'--detail'",
",",
"'--scan'",
"]",
",",
"python_shell",
"=",
"False",
")",
".",
"splitlines",
"(",
")"... | List the RAID devices.
CLI Example:
.. code-block:: bash
salt '*' raid.list | [
"List",
"the",
"RAID",
"devices",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L43-L66 | train | List the RAID devices. | 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/mdadm_raid.py | detail | def detail(device='/dev/md0'):
'''
Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0'
'''
ret = {}
ret['members'] = {}
# Lets make sure the device exists before running mdadm
if not os.path.exists(device):
msg... | python | def detail(device='/dev/md0'):
'''
Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0'
'''
ret = {}
ret['members'] = {}
# Lets make sure the device exists before running mdadm
if not os.path.exists(device):
msg... | [
"def",
"detail",
"(",
"device",
"=",
"'/dev/md0'",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'members'",
"]",
"=",
"{",
"}",
"# Lets make sure the device exists before running mdadm",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"device",
")",
":... | Show detail for a specified RAID device
CLI Example:
.. code-block:: bash
salt '*' raid.detail '/dev/md0' | [
"Show",
"detail",
"for",
"a",
"specified",
"RAID",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L69-L111 | train | Show detail for a specified RAID device | 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/mdadm_raid.py | destroy | def destroy(device):
'''
Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0
'''
try:
details = detail(device)
except CommandExecutionError:
return Fal... | python | def destroy(device):
'''
Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0
'''
try:
details = detail(device)
except CommandExecutionError:
return Fal... | [
"def",
"destroy",
"(",
"device",
")",
":",
"try",
":",
"details",
"=",
"detail",
"(",
"device",
")",
"except",
"CommandExecutionError",
":",
"return",
"False",
"stop_cmd",
"=",
"[",
"'mdadm'",
",",
"'--stop'",
",",
"device",
"]",
"zero_cmd",
"=",
"[",
"'... | Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI Example:
.. code-block:: bash
salt '*' raid.destroy /dev/md0 | [
"Destroy",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L114-L153 | train | Destroy a RAID device. | 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/mdadm_raid.py | create | def create(name,
level,
devices,
metadata='default',
test_mode=False,
**kwargs):
'''
Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
... | python | def create(name,
level,
devices,
metadata='default',
test_mode=False,
**kwargs):
'''
Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
... | [
"def",
"create",
"(",
"name",
",",
"level",
",",
"devices",
",",
"metadata",
"=",
"'default'",
",",
"test_mode",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"[",
"]",
"raid_devices",
"=",
"len",
"(",
"devices",
")",
"for",
"key",
... | Create a RAID device.
.. versionchanged:: 2014.7.0
.. warning::
Use with CAUTION, as this function can be very destructive if not used
properly!
CLI Examples:
.. code-block:: bash
salt '*' raid.create /dev/md0 level=1 chunk=256 devices="['/dev/xvdd', '/dev/xvde']" test_mode=... | [
"Create",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L174-L259 | train | Create a RAID array. | 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/mdadm_raid.py | save_config | def save_config():
'''
Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. co... | python | def save_config():
'''
Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. co... | [
"def",
"save_config",
"(",
")",
":",
"scan",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'mdadm --detail --scan'",
",",
"python_shell",
"=",
"False",
")",
".",
"splitlines",
"(",
")",
"# Issue with mdadm and ubuntu",
"# REF: http://askubuntu.com/questions/209702/why-i... | Save RAID configuration to config file.
Same as:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu
REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI Example:
.. code-block:: bash
salt '... | [
"Save",
"RAID",
"configuration",
"to",
"config",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L262-L306 | train | Save RAID configuration to config 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/mdadm_raid.py | assemble | def assemble(name,
devices,
test_mode=False,
**kwargs):
'''
Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print ... | python | def assemble(name,
devices,
test_mode=False,
**kwargs):
'''
Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print ... | [
"def",
"assemble",
"(",
"name",
",",
"devices",
",",
"test_mode",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"[",
"]",
"for",
"key",
"in",
"kwargs",
":",
"if",
"not",
"key",
".",
"startswith",
"(",
"'__'",
")",
":",
"opts",
"."... | Assemble a RAID device.
CLI Examples:
.. code-block:: bash
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
.. note::
Adding ``test_mode=True`` as an argument will print out the mdadm
command that would have been run.
name
The name of the array to assemble... | [
"Assemble",
"a",
"RAID",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L309-L360 | train | Assemble a RAID array. | 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/mdadm_raid.py | examine | def examine(device, quiet=False):
'''
Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev... | python | def examine(device, quiet=False):
'''
Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev... | [
"def",
"examine",
"(",
"device",
",",
"quiet",
"=",
"False",
")",
":",
"res",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"'mdadm -Y -E {0}'",
".",
"format",
"(",
"device",
")",
",",
"python_shell",
"=",
"False",
",",
"ignore_retcode",
"=",
"quiet"... | Show detail for a specified RAID component device
device
Device to examine, that is part of the RAID
quiet
If the device is not part of the RAID, do not show any error
CLI Example:
.. code-block:: bash
salt '*' raid.examine '/dev/sda1' | [
"Show",
"detail",
"for",
"a",
"specified",
"RAID",
"component",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L363-L387 | train | Show detail for a specified RAID component | 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/mdadm_raid.py | add | def add(name, device):
'''
Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1
'''
cmd = 'mdadm --manage {0} --add {1}'.format(name, device)
if __salt__['cmd.retcode'](cmd) == 0:
return True
return False | python | def add(name, device):
'''
Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1
'''
cmd = 'mdadm --manage {0} --add {1}'.format(name, device)
if __salt__['cmd.retcode'](cmd) == 0:
return True
return False | [
"def",
"add",
"(",
"name",
",",
"device",
")",
":",
"cmd",
"=",
"'mdadm --manage {0} --add {1}'",
".",
"format",
"(",
"name",
",",
"device",
")",
"if",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"(",
"cmd",
")",
"==",
"0",
":",
"return",
"True",
"return",
... | Add new device to RAID array.
CLI Example:
.. code-block:: bash
salt '*' raid.add /dev/md0 /dev/sda1 | [
"Add",
"new",
"device",
"to",
"RAID",
"array",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mdadm_raid.py#L390-L405 | train | Add new device to RAID array. | 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/boto_elasticsearch_domain.py | exists | def exists(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt... | python | def exists(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt... | [
"def",
"exists",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | Given a domain name, check to see if the given domain exists.
Returns True if the given domain exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.exists mydomain | [
"Given",
"a",
"domain",
"name",
"check",
"to",
"see",
"if",
"the",
"given",
"domain",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L127-L150 | train | Check to see if the given domain exists. | 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/boto_elasticsearch_domain.py | status | def status(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain
'''
conn ... | python | def status(DomainName,
region=None, key=None, keyid=None, profile=None):
'''
Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain
'''
conn ... | [
"def",
"status",
"(",
"DomainName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | Given a domain name describe its status.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_elasticsearch_domain.status mydomain | [
"Given",
"a",
"domain",
"name",
"describe",
"its",
"status",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elasticsearch_domain.py#L153-L181 | train | Given a domain name describe its status. | 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.