partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
_item_present
Ensure that an item is created name Irrelevant, not used item config, property, resource, constraint etc. item_id id of the item item_type item type show show command (probably None, default: show) create create command (create or set f.e., defaul...
salt/states/pcs.py
def _item_present(name, item, item_id, item_type, show='show', create='create', extra_args=None, cibname=None): ''' Ensure that an item is created name Irrelevant, not used item config, property, resource, constraint etc. item_id id of the item item_type item typ...
def _item_present(name, item, item_id, item_type, show='show', create='create', extra_args=None, cibname=None): ''' Ensure that an item is created name Irrelevant, not used item config, property, resource, constraint etc. item_id id of the item item_type item typ...
[ "Ensure", "that", "an", "item", "is", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L248-L357
[ "def", "_item_present", "(", "name", ",", "item", ",", "item_id", ",", "item_type", ",", "show", "=", "'show'", ",", "create", "=", "'create'", ",", "extra_args", "=", "None", ",", "cibname", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auth
Ensure all nodes are authorized to the cluster name Irrelevant, not used (recommended: pcs_auth__auth) nodes a list of nodes which should be authorized to the cluster pcsuser user for communication with pcs (default: hacluster) pcspasswd password for pcsuser (default: ha...
salt/states/pcs.py
def auth(name, nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None): ''' Ensure all nodes are authorized to the cluster name Irrelevant, not used (recommended: pcs_auth__auth) nodes a list of nodes which should be authorized to the cluster pcsuser user for com...
def auth(name, nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None): ''' Ensure all nodes are authorized to the cluster name Irrelevant, not used (recommended: pcs_auth__auth) nodes a list of nodes which should be authorized to the cluster pcsuser user for com...
[ "Ensure", "all", "nodes", "are", "authorized", "to", "the", "cluster" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L360-L444
[ "def", "auth", "(", "name", ",", "nodes", ",", "pcsuser", "=", "'hacluster'", ",", "pcspasswd", "=", "'hacluster'", ",", "extra_args", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_setup
Setup Pacemaker cluster on nodes. Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_setup__setup) nodes a list of nodes which should be set up pcsclustername Name of the Pacemaker cluster extra_args list of ex...
salt/states/pcs.py
def cluster_setup(name, nodes, pcsclustername='pcscluster', extra_args=None): ''' Setup Pacemaker cluster on nodes. Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_setup__setup) nodes a list of nodes which should be set up ...
def cluster_setup(name, nodes, pcsclustername='pcscluster', extra_args=None): ''' Setup Pacemaker cluster on nodes. Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_setup__setup) nodes a list of nodes which should be set up ...
[ "Setup", "Pacemaker", "cluster", "on", "nodes", ".", "Should", "be", "run", "on", "one", "cluster", "node", "only", "(", "there", "may", "be", "races", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L447-L533
[ "def", "cluster_setup", "(", "name", ",", "nodes", ",", "pcsclustername", "=", "'pcscluster'", ",", "extra_args", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_node_present
Add a node to the Pacemaker cluster via PCS Should be run on one cluster node only (there may be races) Can only be run on a already setup/added node name Irrelevant, not used (recommended: pcs_setup__node_add_{{node}}) node node that should be added extra_args list of e...
salt/states/pcs.py
def cluster_node_present(name, node, extra_args=None): ''' Add a node to the Pacemaker cluster via PCS Should be run on one cluster node only (there may be races) Can only be run on a already setup/added node name Irrelevant, not used (recommended: pcs_setup__node_add_{{node}}) node...
def cluster_node_present(name, node, extra_args=None): ''' Add a node to the Pacemaker cluster via PCS Should be run on one cluster node only (there may be races) Can only be run on a already setup/added node name Irrelevant, not used (recommended: pcs_setup__node_add_{{node}}) node...
[ "Add", "a", "node", "to", "the", "Pacemaker", "cluster", "via", "PCS", "Should", "be", "run", "on", "one", "cluster", "node", "only", "(", "there", "may", "be", "races", ")", "Can", "only", "be", "run", "on", "a", "already", "setup", "/", "added", "n...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L536-L632
[ "def", "cluster_node_present", "(", "name", ",", "node", ",", "extra_args", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "node_add_requir...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cib_present
Ensure that a CIB-file with the content of the current live CIB is created Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}}) cibname name/path of the file containing the CIB scope sp...
salt/states/pcs.py
def cib_present(name, cibname, scope=None, extra_args=None): ''' Ensure that a CIB-file with the content of the current live CIB is created Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}}) cibn...
def cib_present(name, cibname, scope=None, extra_args=None): ''' Ensure that a CIB-file with the content of the current live CIB is created Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}}) cibn...
[ "Ensure", "that", "a", "CIB", "-", "file", "with", "the", "content", "of", "the", "current", "live", "CIB", "is", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L635-L748
[ "def", "cib_present", "(", "name", ",", "cibname", ",", "scope", "=", "None", ",", "extra_args", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cib_pushed
Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{cibname}}) cibname name/path of the file containing the CIB ...
salt/states/pcs.py
def cib_pushed(name, cibname, scope=None, extra_args=None): ''' Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{...
def cib_pushed(name, cibname, scope=None, extra_args=None): ''' Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{...
[ "Ensure", "that", "a", "CIB", "-", "file", "is", "pushed", "if", "it", "is", "changed", "since", "the", "creation", "of", "it", "with", "pcs", ".", "cib_present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L751-L821
[ "def", "cib_pushed", "(", "name", ",", "cibname", ",", "scope", "=", "None", ",", "extra_args", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
prop_has_value
Ensure that a property in the cluster is set to a given value Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}}) prop name of the property value value of the property extra_args ...
salt/states/pcs.py
def prop_has_value(name, prop, value, extra_args=None, cibname=None): ''' Ensure that a property in the cluster is set to a given value Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}}) prop ...
def prop_has_value(name, prop, value, extra_args=None, cibname=None): ''' Ensure that a property in the cluster is set to a given value Should be run on one cluster node only (there may be races) name Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}}) prop ...
[ "Ensure", "that", "a", "property", "in", "the", "cluster", "is", "set", "to", "a", "given", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L824-L858
[ "def", "prop_has_value", "(", "name", ",", "prop", ",", "value", ",", "extra_args", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'property'", ",", "item_id", "=", "'{0}={1}'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_defaults_to
Ensure a resource default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recommended: pcs_properties__resource_defaults_to_{{default}}) default ...
salt/states/pcs.py
def resource_defaults_to(name, default, value, extra_args=None, cibname=None): ''' Ensure a resource default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant...
def resource_defaults_to(name, default, value, extra_args=None, cibname=None): ''' Ensure a resource default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant...
[ "Ensure", "a", "resource", "default", "in", "the", "cluster", "is", "set", "to", "a", "given", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L861-L897
[ "def", "resource_defaults_to", "(", "name", ",", "default", ",", "value", ",", "extra_args", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'resource'", ",", "item_id", "=", "'{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_op_defaults_to
Ensure a resource operation default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recommended: pcs_properties__resource_op_defaults_to_{{op_default}}) ...
salt/states/pcs.py
def resource_op_defaults_to(name, op_default, value, extra_args=None, cibname=None): ''' Ensure a resource operation default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name ...
def resource_op_defaults_to(name, op_default, value, extra_args=None, cibname=None): ''' Ensure a resource operation default in the cluster is set to a given value Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name ...
[ "Ensure", "a", "resource", "operation", "default", "in", "the", "cluster", "is", "set", "to", "a", "given", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L900-L936
[ "def", "resource_op_defaults_to", "(", "name", ",", "op_default", ",", "value", ",", "extra_args", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'resource'", ",", "item_id", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stonith_present
Ensure that a fencing resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recommended: pcs_stonith__created_{{stonith_id}}) stonith_id name for the stonith resource...
salt/states/pcs.py
def stonith_present(name, stonith_id, stonith_device_type, stonith_device_options=None, cibname=None): ''' Ensure that a fencing resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevan...
def stonith_present(name, stonith_id, stonith_device_type, stonith_device_options=None, cibname=None): ''' Ensure that a fencing resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevan...
[ "Ensure", "that", "a", "fencing", "resource", "is", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L939-L981
[ "def", "stonith_present", "(", "name", ",", "stonith_id", ",", "stonith_device_type", ",", "stonith_device_options", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'stonith'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_present
Ensure that a resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recommended: {{formulaname}}__resource_present_{{resource_id}}) resource_id name for the resource ...
salt/states/pcs.py
def resource_present(name, resource_id, resource_type, resource_options=None, cibname=None): ''' Ensure that a resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recom...
def resource_present(name, resource_id, resource_type, resource_options=None, cibname=None): ''' Ensure that a resource is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recom...
[ "Ensure", "that", "a", "resource", "is", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L984-L1021
[ "def", "resource_present", "(", "name", ",", "resource_id", ",", "resource_type", ",", "resource_options", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'resource'", ",", "item_id"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
constraint_present
Ensure that a constraint is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not used (recommended: {{formulaname}}__constraint_present_{{constraint_id}}) constraint_id name for the c...
salt/states/pcs.py
def constraint_present(name, constraint_id, constraint_type, constraint_options=None, cibname=None): ''' Ensure that a constraint is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not u...
def constraint_present(name, constraint_id, constraint_type, constraint_options=None, cibname=None): ''' Ensure that a constraint is created Should be run on one cluster node only (there may be races) Can only be run on a node with a functional pacemaker/corosync name Irrelevant, not u...
[ "Ensure", "that", "a", "constraint", "is", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L1024-L1064
[ "def", "constraint_present", "(", "name", ",", "constraint_id", ",", "constraint_type", ",", "constraint_options", "=", "None", ",", "cibname", "=", "None", ")", ":", "return", "_item_present", "(", "name", "=", "name", ",", "item", "=", "'constraint'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_top_cfg
Allow top_cfg to be YAML
salt/pillar/makostack.py
def _parse_top_cfg(content, filename): ''' Allow top_cfg to be YAML ''' try: obj = salt.utils.yaml.safe_load(content) if isinstance(obj, list): log.debug('MakoStack cfg `%s` parsed as YAML', filename) return obj except Exception as err: pass log.de...
def _parse_top_cfg(content, filename): ''' Allow top_cfg to be YAML ''' try: obj = salt.utils.yaml.safe_load(content) if isinstance(obj, list): log.debug('MakoStack cfg `%s` parsed as YAML', filename) return obj except Exception as err: pass log.de...
[ "Allow", "top_cfg", "to", "be", "YAML" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/makostack.py#L564-L576
[ "def", "_parse_top_cfg", "(", "content", ",", "filename", ")", ":", "try", ":", "obj", "=", "salt", ".", "utils", ".", "yaml", ".", "safe_load", "(", "content", ")", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "log", ".", "debug", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_enabled
See if jail service is actually enabled on boot CLI Example: .. code-block:: bash salt '*' jail.is_enabled <jail name>
salt/modules/freebsdjail.py
def is_enabled(): ''' See if jail service is actually enabled on boot CLI Example: .. code-block:: bash salt '*' jail.is_enabled <jail name> ''' cmd = 'service -e' services = __salt__['cmd.run'](cmd, python_shell=False) for service in services.split('\\n'): if re.searc...
def is_enabled(): ''' See if jail service is actually enabled on boot CLI Example: .. code-block:: bash salt '*' jail.is_enabled <jail name> ''' cmd = 'service -e' services = __salt__['cmd.run'](cmd, python_shell=False) for service in services.split('\\n'): if re.searc...
[ "See", "if", "jail", "service", "is", "actually", "enabled", "on", "boot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L73-L88
[ "def", "is_enabled", "(", ")", ":", "cmd", "=", "'service -e'", "services", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "for", "service", "in", "services", ".", "split", "(", "'\\\\n'", ")", ":", "if", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_enabled
Return which jails are set to be run CLI Example: .. code-block:: bash salt '*' jail.get_enabled
salt/modules/freebsdjail.py
def get_enabled(): ''' Return which jails are set to be run CLI Example: .. code-block:: bash salt '*' jail.get_enabled ''' ret = [] for rconf in ('/etc/rc.conf', '/etc/rc.conf.local'): if os.access(rconf, os.R_OK): with salt.utils.files.fopen(rconf, 'r') as _f...
def get_enabled(): ''' Return which jails are set to be run CLI Example: .. code-block:: bash salt '*' jail.get_enabled ''' ret = [] for rconf in ('/etc/rc.conf', '/etc/rc.conf.local'): if os.access(rconf, os.R_OK): with salt.utils.files.fopen(rconf, 'r') as _f...
[ "Return", "which", "jails", "are", "set", "to", "be", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L91-L114
[ "def", "get_enabled", "(", ")", ":", "ret", "=", "[", "]", "for", "rconf", "in", "(", "'/etc/rc.conf'", ",", "'/etc/rc.conf.local'", ")", ":", "if", "os", ".", "access", "(", "rconf", ",", "os", ".", "R_OK", ")", ":", "with", "salt", ".", "utils", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_config
Display specified jail's configuration CLI Example: .. code-block:: bash salt '*' jail.show_config <jail name>
salt/modules/freebsdjail.py
def show_config(jail): ''' Display specified jail's configuration CLI Example: .. code-block:: bash salt '*' jail.show_config <jail name> ''' ret = {} if subprocess.call(["jls", "-nq", "-j", jail]) == 0: jls = subprocess.check_output(["jls", "-nq", "-j", jail]) # pylint: ...
def show_config(jail): ''' Display specified jail's configuration CLI Example: .. code-block:: bash salt '*' jail.show_config <jail name> ''' ret = {} if subprocess.call(["jls", "-nq", "-j", jail]) == 0: jls = subprocess.check_output(["jls", "-nq", "-j", jail]) # pylint: ...
[ "Display", "specified", "jail", "s", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L117-L172
[ "def", "show_config", "(", "jail", ")", ":", "ret", "=", "{", "}", "if", "subprocess", ".", "call", "(", "[", "\"jls\"", ",", "\"-nq\"", ",", "\"-j\"", ",", "jail", "]", ")", "==", "0", ":", "jls", "=", "subprocess", ".", "check_output", "(", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fstab
Display contents of a fstab(5) file defined in specified jail's configuration. If no file is defined, return False. CLI Example: .. code-block:: bash salt '*' jail.fstab <jail name>
salt/modules/freebsdjail.py
def fstab(jail): ''' Display contents of a fstab(5) file defined in specified jail's configuration. If no file is defined, return False. CLI Example: .. code-block:: bash salt '*' jail.fstab <jail name> ''' ret = [] config = show_config(jail) if 'fstab' in config: ...
def fstab(jail): ''' Display contents of a fstab(5) file defined in specified jail's configuration. If no file is defined, return False. CLI Example: .. code-block:: bash salt '*' jail.fstab <jail name> ''' ret = [] config = show_config(jail) if 'fstab' in config: ...
[ "Display", "contents", "of", "a", "fstab", "(", "5", ")", "file", "defined", "in", "specified", "jail", "s", "configuration", ".", "If", "no", "file", "is", "defined", "return", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L175-L217
[ "def", "fstab", "(", "jail", ")", ":", "ret", "=", "[", "]", "config", "=", "show_config", "(", "jail", ")", "if", "'fstab'", "in", "config", ":", "c_fstab", "=", "config", "[", "'fstab'", "]", "elif", "'mount.fstab'", "in", "config", ":", "c_fstab", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
See if specified jail is currently running CLI Example: .. code-block:: bash salt '*' jail.status <jail name>
salt/modules/freebsdjail.py
def status(jail): ''' See if specified jail is currently running CLI Example: .. code-block:: bash salt '*' jail.status <jail name> ''' cmd = 'jls' found_jails = __salt__['cmd.run'](cmd, python_shell=False) for found_jail in found_jails.split('\\n'): if re.search(jail,...
def status(jail): ''' See if specified jail is currently running CLI Example: .. code-block:: bash salt '*' jail.status <jail name> ''' cmd = 'jls' found_jails = __salt__['cmd.run'](cmd, python_shell=False) for found_jail in found_jails.split('\\n'): if re.search(jail,...
[ "See", "if", "specified", "jail", "is", "currently", "running" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L220-L235
[ "def", "status", "(", "jail", ")", ":", "cmd", "=", "'jls'", "found_jails", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "for", "found_jail", "in", "found_jails", ".", "split", "(", "'\\\\n'", ")", ":", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sysctl
Dump all jail related kernel states (sysctl) CLI Example: .. code-block:: bash salt '*' jail.sysctl
salt/modules/freebsdjail.py
def sysctl(): ''' Dump all jail related kernel states (sysctl) CLI Example: .. code-block:: bash salt '*' jail.sysctl ''' ret = {} sysctl_jail = __salt__['cmd.run']('sysctl security.jail') for line in sysctl_jail.splitlines(): key, value = line.split(':', 1) re...
def sysctl(): ''' Dump all jail related kernel states (sysctl) CLI Example: .. code-block:: bash salt '*' jail.sysctl ''' ret = {} sysctl_jail = __salt__['cmd.run']('sysctl security.jail') for line in sysctl_jail.splitlines(): key, value = line.split(':', 1) re...
[ "Dump", "all", "jail", "related", "kernel", "states", "(", "sysctl", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L238-L253
[ "def", "sysctl", "(", ")", ":", "ret", "=", "{", "}", "sysctl_jail", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'sysctl security.jail'", ")", "for", "line", "in", "sysctl_jail", ".", "splitlines", "(", ")", ":", "key", ",", "value", "=", "line", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_pecl
Execute the command passed with pecl
salt/modules/pecl.py
def _pecl(command, defaults=False): ''' Execute the command passed with pecl ''' cmdline = 'pecl {0}'.format(command) if salt.utils.data.is_true(defaults): cmdline = 'yes ' "''" + ' | ' + cmdline ret = __salt__['cmd.run_all'](cmdline, python_shell=True) if ret['retcode'] == 0: ...
def _pecl(command, defaults=False): ''' Execute the command passed with pecl ''' cmdline = 'pecl {0}'.format(command) if salt.utils.data.is_true(defaults): cmdline = 'yes ' "''" + ' | ' + cmdline ret = __salt__['cmd.run_all'](cmdline, python_shell=True) if ret['retcode'] == 0: ...
[ "Execute", "the", "command", "passed", "with", "pecl" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L40-L54
[ "def", "_pecl", "(", "command", ",", "defaults", "=", "False", ")", ":", "cmdline", "=", "'pecl {0}'", ".", "format", "(", "command", ")", "if", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "defaults", ")", ":", "cmdline", "=", "'yes '", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
.. versionadded:: 0.17.0 Installs one or several pecl extensions. pecls The pecl extensions to install. defaults Use default answers for extensions such as pecl_http which ask questions before installation. Without this option, the pecl.installed state will hang indefinite...
salt/modules/pecl.py
def install(pecls, defaults=False, force=False, preferred_state='stable'): ''' .. versionadded:: 0.17.0 Installs one or several pecl extensions. pecls The pecl extensions to install. defaults Use default answers for extensions such as pecl_http which ask questions before i...
def install(pecls, defaults=False, force=False, preferred_state='stable'): ''' .. versionadded:: 0.17.0 Installs one or several pecl extensions. pecls The pecl extensions to install. defaults Use default answers for extensions such as pecl_http which ask questions before i...
[ "..", "versionadded", "::", "0", ".", "17", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L57-L107
[ "def", "install", "(", "pecls", ",", "defaults", "=", "False", ",", "force", "=", "False", ",", "preferred_state", "=", "'stable'", ")", ":", "if", "isinstance", "(", "pecls", ",", "six", ".", "string_types", ")", ":", "pecls", "=", "[", "pecls", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall
Uninstall one or several pecl extensions. pecls The pecl extensions to uninstall. CLI Example: .. code-block:: bash salt '*' pecl.uninstall fuse
salt/modules/pecl.py
def uninstall(pecls): ''' Uninstall one or several pecl extensions. pecls The pecl extensions to uninstall. CLI Example: .. code-block:: bash salt '*' pecl.uninstall fuse ''' if isinstance(pecls, six.string_types): pecls = [pecls] return _pecl('uninstall {0}'....
def uninstall(pecls): ''' Uninstall one or several pecl extensions. pecls The pecl extensions to uninstall. CLI Example: .. code-block:: bash salt '*' pecl.uninstall fuse ''' if isinstance(pecls, six.string_types): pecls = [pecls] return _pecl('uninstall {0}'....
[ "Uninstall", "one", "or", "several", "pecl", "extensions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L110-L125
[ "def", "uninstall", "(", "pecls", ")", ":", "if", "isinstance", "(", "pecls", ",", "six", ".", "string_types", ")", ":", "pecls", "=", "[", "pecls", "]", "return", "_pecl", "(", "'uninstall {0}'", ".", "format", "(", "_cmd_quote", "(", "' '", ".", "joi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
List installed pecl extensions. CLI Example: .. code-block:: bash salt '*' pecl.list
salt/modules/pecl.py
def list_(channel=None): ''' List installed pecl extensions. CLI Example: .. code-block:: bash salt '*' pecl.list ''' pecl_channel_pat = re.compile('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)') pecls = {} command = 'list' if channel: command = '{0} -c {1}'.format(command, _cmd...
def list_(channel=None): ''' List installed pecl extensions. CLI Example: .. code-block:: bash salt '*' pecl.list ''' pecl_channel_pat = re.compile('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)') pecls = {} command = 'list' if channel: command = '{0} -c {1}'.format(command, _cmd...
[ "List", "installed", "pecl", "extensions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L146-L169
[ "def", "list_", "(", "channel", "=", "None", ")", ":", "pecl_channel_pat", "=", "re", ".", "compile", "(", "'^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)'", ")", "pecls", "=", "{", "}", "command", "=", "'list'", "if", "channel", ":", "command", "=", "'{0} -c {1}'", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_client
Return cloud client
salt/runners/cloud.py
def _get_client(): ''' Return cloud client ''' client = salt.cloud.CloudClient( os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud') ) return client
def _get_client(): ''' Return cloud client ''' client = salt.cloud.CloudClient( os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud') ) return client
[ "Return", "cloud", "client" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L24-L31
[ "def", "_get_client", "(", ")", ":", "client", "=", "salt", ".", "cloud", ".", "CloudClient", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__opts__", "[", "'conf_file'", "]", ")", ",", "'cloud'", ")", ")", "ret...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
profile
Create a cloud vm with the given profile and instances, instances can be a list or comma-delimited string CLI Example: .. code-block:: bash salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3
salt/runners/cloud.py
def profile(prof=None, instances=None, opts=None, **kwargs): ''' Create a cloud vm with the given profile and instances, instances can be a list or comma-delimited string CLI Example: .. code-block:: bash salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3 ''' if prof i...
def profile(prof=None, instances=None, opts=None, **kwargs): ''' Create a cloud vm with the given profile and instances, instances can be a list or comma-delimited string CLI Example: .. code-block:: bash salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3 ''' if prof i...
[ "Create", "a", "cloud", "vm", "with", "the", "given", "profile", "and", "instances", "instances", "can", "be", "a", "list", "or", "comma", "-", "delimited", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L88-L115
[ "def", "profile", "(", "prof", "=", "None", ",", "instances", "=", "None", ",", "opts", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "prof", "is", "None", "and", "'profile'", "in", "kwargs", ":", "prof", "=", "kwargs", "[", "'profile'", "]...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
map_run
Execute a salt cloud map file
salt/runners/cloud.py
def map_run(path=None, opts=None, **kwargs): ''' Execute a salt cloud map file ''' client = _get_client() if isinstance(opts, dict): client.opts.update(opts) info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs)) return info
def map_run(path=None, opts=None, **kwargs): ''' Execute a salt cloud map file ''' client = _get_client() if isinstance(opts, dict): client.opts.update(opts) info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs)) return info
[ "Execute", "a", "salt", "cloud", "map", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L118-L126
[ "def", "map_run", "(", "path", "=", "None", ",", "opts", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_client", "(", ")", "if", "isinstance", "(", "opts", ",", "dict", ")", ":", "client", ".", "opts", ".", "update", "(", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy the named vm(s)
salt/runners/cloud.py
def destroy(instances, opts=None): ''' Destroy the named vm(s) ''' client = _get_client() if isinstance(opts, dict): client.opts.update(opts) info = client.destroy(instances) return info
def destroy(instances, opts=None): ''' Destroy the named vm(s) ''' client = _get_client() if isinstance(opts, dict): client.opts.update(opts) info = client.destroy(instances) return info
[ "Destroy", "the", "named", "vm", "(", "s", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L129-L137
[ "def", "destroy", "(", "instances", ",", "opts", "=", "None", ")", ":", "client", "=", "_get_client", "(", ")", "if", "isinstance", "(", "opts", ",", "dict", ")", ":", "client", ".", "opts", ".", "update", "(", "opts", ")", "info", "=", "client", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
action
Execute a single action on the given map/provider/instance CLI Example: .. code-block:: bash salt-run cloud.action start my-salt-vm
salt/runners/cloud.py
def action(func=None, cloudmap=None, instances=None, provider=None, instance=None, opts=None, **kwargs): ''' Execute a single action on the given map/provider/instance CLI Example: .. code-block:: bash salt-run cloud.action sta...
def action(func=None, cloudmap=None, instances=None, provider=None, instance=None, opts=None, **kwargs): ''' Execute a single action on the given map/provider/instance CLI Example: .. code-block:: bash salt-run cloud.action sta...
[ "Execute", "a", "single", "action", "on", "the", "given", "map", "/", "provider", "/", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L140-L171
[ "def", "action", "(", "func", "=", "None", ",", "cloudmap", "=", "None", ",", "instances", "=", "None", ",", "provider", "=", "None", ",", "instance", "=", "None", ",", "opts", "=", "None", ",", "*", "*", "kwargs", ")", ":", "info", "=", "{", "}"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create an instance using Salt Cloud CLI Example: .. code-block:: bash salt-run cloud.create my-ec2-config myinstance \ image=ami-1624987f size='t1.micro' ssh_username=ec2-user \ securitygroup=default delvol_on_destroy=True
salt/runners/cloud.py
def create(provider, instances, opts=None, **kwargs): ''' Create an instance using Salt Cloud CLI Example: .. code-block:: bash salt-run cloud.create my-ec2-config myinstance \ image=ami-1624987f size='t1.micro' ssh_username=ec2-user \ securitygroup=default delvol_on_d...
def create(provider, instances, opts=None, **kwargs): ''' Create an instance using Salt Cloud CLI Example: .. code-block:: bash salt-run cloud.create my-ec2-config myinstance \ image=ami-1624987f size='t1.micro' ssh_username=ec2-user \ securitygroup=default delvol_on_d...
[ "Create", "an", "instance", "using", "Salt", "Cloud" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L174-L190
[ "def", "create", "(", "provider", ",", "instances", ",", "opts", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_client", "(", ")", "if", "isinstance", "(", "opts", ",", "dict", ")", ":", "client", ".", "opts", ".", "update", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_splunk_search_props
Get splunk search properties from an object
salt/modules/splunk_search.py
def _get_splunk_search_props(search): ''' Get splunk search properties from an object ''' props = search.content props["app"] = search.access.app props["sharing"] = search.access.sharing return props
def _get_splunk_search_props(search): ''' Get splunk search properties from an object ''' props = search.content props["app"] = search.access.app props["sharing"] = search.access.sharing return props
[ "Get", "splunk", "search", "properties", "from", "an", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L82-L89
[ "def", "_get_splunk_search_props", "(", "search", ")", ":", "props", "=", "search", ".", "content", "props", "[", "\"app\"", "]", "=", "search", ".", "access", ".", "app", "props", "[", "\"sharing\"", "]", "=", "search", ".", "access", ".", "sharing", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
Get a splunk search CLI Example: splunk_search.get 'my search name'
salt/modules/splunk_search.py
def get(name, profile="splunk"): ''' Get a splunk search CLI Example: splunk_search.get 'my search name' ''' client = _get_splunk(profile) search = None # uglyness of splunk lib try: search = client.saved_searches[name] except KeyError: pass return searc...
def get(name, profile="splunk"): ''' Get a splunk search CLI Example: splunk_search.get 'my search name' ''' client = _get_splunk(profile) search = None # uglyness of splunk lib try: search = client.saved_searches[name] except KeyError: pass return searc...
[ "Get", "a", "splunk", "search" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L92-L107
[ "def", "get", "(", "name", ",", "profile", "=", "\"splunk\"", ")", ":", "client", "=", "_get_splunk", "(", "profile", ")", "search", "=", "None", "# uglyness of splunk lib", "try", ":", "search", "=", "client", ".", "saved_searches", "[", "name", "]", "exc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Update a splunk search CLI Example: splunk_search.update 'my search name' sharing=app
salt/modules/splunk_search.py
def update(name, profile="splunk", **kwargs): ''' Update a splunk search CLI Example: splunk_search.update 'my search name' sharing=app ''' client = _get_splunk(profile) search = client.saved_searches[name] props = _get_splunk_search_props(search) updates = kwargs update_ne...
def update(name, profile="splunk", **kwargs): ''' Update a splunk search CLI Example: splunk_search.update 'my search name' sharing=app ''' client = _get_splunk(profile) search = client.saved_searches[name] props = _get_splunk_search_props(search) updates = kwargs update_ne...
[ "Update", "a", "splunk", "search" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L110-L141
[ "def", "update", "(", "name", ",", "profile", "=", "\"splunk\"", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_splunk", "(", "profile", ")", "search", "=", "client", ".", "saved_searches", "[", "name", "]", "props", "=", "_get_splunk_search_props...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a splunk search CLI Example: splunk_search.create 'my search name' search='error msg'
salt/modules/splunk_search.py
def create(name, profile="splunk", **kwargs): ''' Create a splunk search CLI Example: splunk_search.create 'my search name' search='error msg' ''' client = _get_splunk(profile) search = client.saved_searches.create(name, **kwargs) # use the REST API to set owner and permissions ...
def create(name, profile="splunk", **kwargs): ''' Create a splunk search CLI Example: splunk_search.create 'my search name' search='error msg' ''' client = _get_splunk(profile) search = client.saved_searches.create(name, **kwargs) # use the REST API to set owner and permissions ...
[ "Create", "a", "splunk", "search" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L144-L170
[ "def", "create", "(", "name", ",", "profile", "=", "\"splunk\"", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_splunk", "(", "profile", ")", "search", "=", "client", ".", "saved_searches", ".", "create", "(", "name", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Delete a splunk search CLI Example: splunk_search.delete 'my search name'
salt/modules/splunk_search.py
def delete(name, profile="splunk"): ''' Delete a splunk search CLI Example: splunk_search.delete 'my search name' ''' client = _get_splunk(profile) try: client.saved_searches.delete(name) return True except KeyError: return None
def delete(name, profile="splunk"): ''' Delete a splunk search CLI Example: splunk_search.delete 'my search name' ''' client = _get_splunk(profile) try: client.saved_searches.delete(name) return True except KeyError: return None
[ "Delete", "a", "splunk", "search" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L173-L186
[ "def", "delete", "(", "name", ",", "profile", "=", "\"splunk\"", ")", ":", "client", "=", "_get_splunk", "(", "profile", ")", "try", ":", "client", ".", "saved_searches", ".", "delete", "(", "name", ")", "return", "True", "except", "KeyError", ":", "retu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
List splunk searches (names only) CLI Example: splunk_search.list
salt/modules/splunk_search.py
def list_(profile="splunk"): ''' List splunk searches (names only) CLI Example: splunk_search.list ''' client = _get_splunk(profile) searches = [x['name'] for x in client.saved_searches] return searches
def list_(profile="splunk"): ''' List splunk searches (names only) CLI Example: splunk_search.list ''' client = _get_splunk(profile) searches = [x['name'] for x in client.saved_searches] return searches
[ "List", "splunk", "searches", "(", "names", "only", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L189-L198
[ "def", "list_", "(", "profile", "=", "\"splunk\"", ")", ":", "client", "=", "_get_splunk", "(", "profile", ")", "searches", "=", "[", "x", "[", "'name'", "]", "for", "x", "in", "client", ".", "saved_searches", "]", "return", "searches" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_all
Get all splunk search details. Produces results that can be used to create an sls file. if app or owner are specified, results will be limited to matching saved searches. if description_contains is specified, results will be limited to those where "description_contains in description" is true if n...
salt/modules/splunk_search.py
def list_all(prefix=None, app=None, owner=None, description_contains=None, name_not_contains=None, profile="splunk"): ''' Get all splunk search details. Produces results that can be used to create an sls file. if app or owner are specified, results will be limited to matching saved sea...
def list_all(prefix=None, app=None, owner=None, description_contains=None, name_not_contains=None, profile="splunk"): ''' Get all splunk search details. Produces results that can be used to create an sls file. if app or owner are specified, results will be limited to matching saved sea...
[ "Get", "all", "splunk", "search", "details", ".", "Produces", "results", "that", "can", "be", "used", "to", "create", "an", "sls", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L201-L300
[ "def", "list_all", "(", "prefix", "=", "None", ",", "app", "=", "None", ",", "owner", "=", "None", ",", "description_contains", "=", "None", ",", "name_not_contains", "=", "None", ",", "profile", "=", "\"splunk\"", ")", ":", "client", "=", "_get_splunk", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_present
.. versionadded:: 2014.7.0 Verify the set exists. name A user-defined set name. set_type The type for the set. family Networking family, either ipv4 or ipv6
salt/states/ipset.py
def set_present(name, set_type, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Verify the set exists. name A user-defined set name. set_type The type for the set. family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'cha...
def set_present(name, set_type, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Verify the set exists. name A user-defined set name. set_type The type for the set. family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'cha...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L68-L115
[ "def", "set_present", "(", "name", ",", "set_type", ",", "family", "=", "'ipv4'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_absent
.. versionadded:: 2014.7.0 Verify the set is absent. family Networking family, either ipv4 or ipv6
salt/states/ipset.py
def set_absent(name, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Verify the set is absent. family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} set_check = __salt__['ipse...
def set_absent(name, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Verify the set is absent. family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} set_check = __salt__['ipse...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L118-L163
[ "def", "set_absent", "(", "name", ",", "family", "=", "'ipv4'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "set_check",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
.. versionadded:: 2014.7.0 Remove a entry or entries from a chain name A user-defined name to call this entry by in another part of a state or formula. This should not be an actual entry. family Network family, ipv4 or ipv6.
salt/states/ipset.py
def absent(name, entry=None, entries=None, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Remove a entry or entries from a chain name A user-defined name to call this entry by in another part of a state or formula. This should not be an actual entry. family Netwo...
def absent(name, entry=None, entries=None, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Remove a entry or entries from a chain name A user-defined name to call this entry by in another part of a state or formula. This should not be an actual entry. family Netwo...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L239-L309
[ "def", "absent", "(", "name", ",", "entry", "=", "None", ",", "entries", "=", "None", ",", "family", "=", "'ipv4'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
flush
.. versionadded:: 2014.7.0 Flush current ipset set family Networking family, either ipv4 or ipv6
salt/states/ipset.py
def flush(name, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Flush current ipset set family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} set_check = __salt__['ipset.check...
def flush(name, family='ipv4', **kwargs): ''' .. versionadded:: 2014.7.0 Flush current ipset set family Networking family, either ipv4 or ipv6 ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} set_check = __salt__['ipset.check...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L312-L351
[ "def", "flush", "(", "name", ",", "family", "=", "'ipv4'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "set_check", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
installed
Make sure that a gem is installed. name The name of the gem to install ruby: None Only for RVM or rbenv installations: the ruby version and gemset to target. gem_bin: None Custom ``gem`` command to run instead of the default. Use this to install gems to a non-defau...
salt/states/gem.py
def installed(name, # pylint: disable=C0103 ruby=None, gem_bin=None, user=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None): # pylint: disable=C...
def installed(name, # pylint: disable=C0103 ruby=None, gem_bin=None, user=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None): # pylint: disable=C...
[ "Make", "sure", "that", "a", "gem", "is", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L33-L143
[ "def", "installed", "(", "name", ",", "# pylint: disable=C0103", "ruby", "=", "None", ",", "gem_bin", "=", "None", ",", "user", "=", "None", ",", "version", "=", "None", ",", "rdoc", "=", "False", ",", "ri", "=", "False", ",", "pre_releases", "=", "Fal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
removed
Make sure that a gem is not installed. name The name of the gem to uninstall gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. user: None The u...
salt/states/gem.py
def removed(name, ruby=None, user=None, gem_bin=None): ''' Make sure that a gem is not installed. name The name of the gem to uninstall gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby version and gemset to use. ...
def removed(name, ruby=None, user=None, gem_bin=None): ''' Make sure that a gem is not installed. name The name of the gem to uninstall gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby version and gemset to use. ...
[ "Make", "sure", "that", "a", "gem", "is", "not", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L146-L182
[ "def", "removed", "(", "name", ",", "ruby", "=", "None", ",", "user", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sources_add
Make sure that a gem source is added. name The URL of the gem source to be added ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` command .. versionadded:: 0.17.0
salt/states/gem.py
def sources_add(name, ruby=None, user=None): ''' Make sure that a gem source is added. name The URL of the gem source to be added ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` command ...
def sources_add(name, ruby=None, user=None): ''' Make sure that a gem source is added. name The URL of the gem source to be added ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` command ...
[ "Make", "sure", "that", "a", "gem", "source", "is", "added", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L185-L216
[ "def", "sources_add", "(", "name", ",", "ruby", "=", "None", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "name"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sources_remove
Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` command .. versionadded:: 0.17.0
salt/states/gem.py
def sources_remove(name, ruby=None, user=None): ''' Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` com...
def sources_remove(name, ruby=None, user=None): ''' Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` com...
[ "Make", "sure", "that", "a", "gem", "source", "is", "removed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L219-L252
[ "def", "sources_remove", "(", "name", ",", "ruby", "=", "None", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
joined
Ensure the current node joined to a cluster with node user@host name Irrelevant, not used (recommended: user@host) user The user of node to join to (default: rabbit) host The host of node to join to ram_node Join node as a RAM node runas The user to run the r...
salt/states/rabbitmq_cluster.py
def joined(name, host, user='rabbit', ram_node=None, runas='root'): ''' Ensure the current node joined to a cluster with node user@host name Irrelevant, not used (recommended: user@host) user The user of node to join to (default: rabbit) host The host of node to join to ...
def joined(name, host, user='rabbit', ram_node=None, runas='root'): ''' Ensure the current node joined to a cluster with node user@host name Irrelevant, not used (recommended: user@host) user The user of node to join to (default: rabbit) host The host of node to join to ...
[ "Ensure", "the", "current", "node", "joined", "to", "a", "cluster", "with", "node", "user@host" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_cluster.py#L34-L77
[ "def", "joined", "(", "name", ",", "host", ",", "user", "=", "'rabbit'", ",", "ram_node", "=", "None", ",", "runas", "=", "'root'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_create
Create an image CLI Example: .. code-block:: bash salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi
salt/modules/glanceng.py
def image_create(auth=None, **kwargs): ''' Create an image CLI Example: .. code-block:: bash salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi...
def image_create(auth=None, **kwargs): ''' Create an image CLI Example: .. code-block:: bash salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi...
[ "Create", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L108-L121
[ "def", "image_create", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "keep_name", "=", "True", ",", "*", "*", "kwargs", ")", "return", "cloud", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_delete
Delete an image CLI Example: .. code-block:: bash salt '*' glanceng.image_delete name=image1 salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d
salt/modules/glanceng.py
def image_delete(auth=None, **kwargs): ''' Delete an image CLI Example: .. code-block:: bash salt '*' glanceng.image_delete name=image1 salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs...
def image_delete(auth=None, **kwargs): ''' Delete an image CLI Example: .. code-block:: bash salt '*' glanceng.image_delete name=image1 salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs...
[ "Delete", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L124-L137
[ "def", "image_delete", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "delete_image", "(", "*", "*...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_list
List images CLI Example: .. code-block:: bash salt '*' glanceng.image_list salt '*' glanceng.image_list
salt/modules/glanceng.py
def image_list(auth=None, **kwargs): ''' List images CLI Example: .. code-block:: bash salt '*' glanceng.image_list salt '*' glanceng.image_list ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.list_images(**kwargs)
def image_list(auth=None, **kwargs): ''' List images CLI Example: .. code-block:: bash salt '*' glanceng.image_list salt '*' glanceng.image_list ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.list_images(**kwargs)
[ "List", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L140-L153
[ "def", "image_list", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "list_images", "(", "*", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_search
Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search
salt/modules/glanceng.py
def image_search(auth=None, **kwargs): ''' Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.search_images(**k...
def image_search(auth=None, **kwargs): ''' Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.search_images(**k...
[ "Search", "for", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L156-L169
[ "def", "image_search", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "search_images", "(", "*", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_get
Get a single image CLI Example: .. code-block:: bash salt '*' glanceng.image_get name=image1 salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d
salt/modules/glanceng.py
def image_get(auth=None, **kwargs): ''' Get a single image CLI Example: .. code-block:: bash salt '*' glanceng.image_get name=image1 salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) ...
def image_get(auth=None, **kwargs): ''' Get a single image CLI Example: .. code-block:: bash salt '*' glanceng.image_get name=image1 salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) ...
[ "Get", "a", "single", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L172-L185
[ "def", "image_get", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "get_image", "(", "*", "*", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_image_properties
Update properties for an image CLI Example: .. code-block:: bash salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b054162506d min_ram=1024
salt/modules/glanceng.py
def update_image_properties(auth=None, **kwargs): ''' Update properties for an image CLI Example: .. code-block:: bash salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b...
def update_image_properties(auth=None, **kwargs): ''' Update properties for an image CLI Example: .. code-block:: bash salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b...
[ "Update", "properties", "for", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L188-L201
[ "def", "update_image_properties", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "update_image_propertie...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_device
Deletes a device from Vistara based on DNS name or partial name. By default, delete_device will only perform the delete if a single host is returned. Set safety_on=False to delete all matches (up to default API search page size) CLI Example: .. code-block:: bash salt-run vistara.delete_device...
salt/runners/vistara.py
def delete_device(name, safety_on=True): ''' Deletes a device from Vistara based on DNS name or partial name. By default, delete_device will only perform the delete if a single host is returned. Set safety_on=False to delete all matches (up to default API search page size) CLI Example: .. code...
def delete_device(name, safety_on=True): ''' Deletes a device from Vistara based on DNS name or partial name. By default, delete_device will only perform the delete if a single host is returned. Set safety_on=False to delete all matches (up to default API search page size) CLI Example: .. code...
[ "Deletes", "a", "device", "from", "Vistara", "based", "on", "DNS", "name", "or", "partial", "name", ".", "By", "default", "delete_device", "will", "only", "perform", "the", "delete", "if", "a", "single", "host", "is", "returned", ".", "Set", "safety_on", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vistara.py#L67-L114
[ "def", "delete_device", "(", "name", ",", "safety_on", "=", "True", ")", ":", "config", "=", "_get_vistara_configuration", "(", ")", "if", "not", "config", ":", "return", "False", "access_token", "=", "_get_oath2_access_token", "(", "config", "[", "'client_key'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_oath2_access_token
Query the vistara API and get an access_token
salt/runners/vistara.py
def _get_oath2_access_token(client_key, client_secret): ''' Query the vistara API and get an access_token ''' if not client_key and not client_secret: log.error( "client_key and client_secret have not been specified " "and are required parameters." ) retu...
def _get_oath2_access_token(client_key, client_secret): ''' Query the vistara API and get an access_token ''' if not client_key and not client_secret: log.error( "client_key and client_secret have not been specified " "and are required parameters." ) retu...
[ "Query", "the", "vistara", "API", "and", "get", "an", "access_token" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vistara.py#L181-L220
[ "def", "_get_oath2_access_token", "(", "client_key", ",", "client_secret", ")", ":", "if", "not", "client_key", "and", "not", "client_secret", ":", "log", ".", "error", "(", "\"client_key and client_secret have not been specified \"", "\"and are required parameters.\"", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Return server version (``apachectl -v``) CLI Example: .. code-block:: bash salt '*' apache.version
salt/modules/apache.py
def version(): ''' Return server version (``apachectl -v``) CLI Example: .. code-block:: bash salt '*' apache.version ''' cmd = '{0} -v'.format(_detect_os()) out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1]
def version(): ''' Return server version (``apachectl -v``) CLI Example: .. code-block:: bash salt '*' apache.version ''' cmd = '{0} -v'.format(_detect_os()) out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1]
[ "Return", "server", "version", "(", "apachectl", "-", "v", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L65-L78
[ "def", "version", "(", ")", ":", "cmd", "=", "'{0} -v'", ".", "format", "(", "_detect_os", "(", ")", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "ret", "=", "out", "[", "0", "]", ".", "split",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fullversion
Return server version (``apachectl -V``) CLI Example: .. code-block:: bash salt '*' apache.fullversion
salt/modules/apache.py
def fullversion(): ''' Return server version (``apachectl -V``) CLI Example: .. code-block:: bash salt '*' apache.fullversion ''' cmd = '{0} -V'.format(_detect_os()) ret = {} ret['compiled_with'] = [] out = __salt__['cmd.run'](cmd).splitlines() # Example # -D APR_...
def fullversion(): ''' Return server version (``apachectl -V``) CLI Example: .. code-block:: bash salt '*' apache.fullversion ''' cmd = '{0} -V'.format(_detect_os()) ret = {} ret['compiled_with'] = [] out = __salt__['cmd.run'](cmd).splitlines() # Example # -D APR_...
[ "Return", "server", "version", "(", "apachectl", "-", "V", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L81-L107
[ "def", "fullversion", "(", ")", ":", "cmd", "=", "'{0} -V'", ".", "format", "(", "_detect_os", "(", ")", ")", "ret", "=", "{", "}", "ret", "[", "'compiled_with'", "]", "=", "[", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
modules
Return list of static and shared modules (``apachectl -M``) CLI Example: .. code-block:: bash salt '*' apache.modules
salt/modules/apache.py
def modules(): ''' Return list of static and shared modules (``apachectl -M``) CLI Example: .. code-block:: bash salt '*' apache.modules ''' cmd = '{0} -M'.format(_detect_os()) ret = {} ret['static'] = [] ret['shared'] = [] out = __salt__['cmd.run'](cmd).splitlines() ...
def modules(): ''' Return list of static and shared modules (``apachectl -M``) CLI Example: .. code-block:: bash salt '*' apache.modules ''' cmd = '{0} -M'.format(_detect_os()) ret = {} ret['static'] = [] ret['shared'] = [] out = __salt__['cmd.run'](cmd).splitlines() ...
[ "Return", "list", "of", "static", "and", "shared", "modules", "(", "apachectl", "-", "M", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L110-L133
[ "def", "modules", "(", ")", ":", "cmd", "=", "'{0} -M'", ".", "format", "(", "_detect_os", "(", ")", ")", "ret", "=", "{", "}", "ret", "[", "'static'", "]", "=", "[", "]", "ret", "[", "'shared'", "]", "=", "[", "]", "out", "=", "__salt__", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servermods
Return list of modules compiled into the server (``apachectl -l``) CLI Example: .. code-block:: bash salt '*' apache.servermods
salt/modules/apache.py
def servermods(): ''' Return list of modules compiled into the server (``apachectl -l``) CLI Example: .. code-block:: bash salt '*' apache.servermods ''' cmd = '{0} -l'.format(_detect_os()) ret = [] out = __salt__['cmd.run'](cmd).splitlines() for line in out: if no...
def servermods(): ''' Return list of modules compiled into the server (``apachectl -l``) CLI Example: .. code-block:: bash salt '*' apache.servermods ''' cmd = '{0} -l'.format(_detect_os()) ret = [] out = __salt__['cmd.run'](cmd).splitlines() for line in out: if no...
[ "Return", "list", "of", "modules", "compiled", "into", "the", "server", "(", "apachectl", "-", "l", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L136-L154
[ "def", "servermods", "(", ")", ":", "cmd", "=", "'{0} -l'", ".", "format", "(", "_detect_os", "(", ")", ")", "ret", "=", "[", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
directives
Return list of directives together with expected arguments and places where the directive is valid (``apachectl -L``) CLI Example: .. code-block:: bash salt '*' apache.directives
salt/modules/apache.py
def directives(): ''' Return list of directives together with expected arguments and places where the directive is valid (``apachectl -L``) CLI Example: .. code-block:: bash salt '*' apache.directives ''' cmd = '{0} -L'.format(_detect_os()) ret = {} out = __salt__['cmd.run...
def directives(): ''' Return list of directives together with expected arguments and places where the directive is valid (``apachectl -L``) CLI Example: .. code-block:: bash salt '*' apache.directives ''' cmd = '{0} -L'.format(_detect_os()) ret = {} out = __salt__['cmd.run...
[ "Return", "list", "of", "directives", "together", "with", "expected", "arguments", "and", "places", "where", "the", "directive", "is", "valid", "(", "apachectl", "-", "L", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L157-L178
[ "def", "directives", "(", ")", ":", "cmd", "=", "'{0} -L'", ".", "format", "(", "_detect_os", "(", ")", ")", "ret", "=", "{", "}", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "out", "=", "out", ".", "replace", "(", "'\\n\\t'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vhosts
Show the settings as parsed from the config file (currently only shows the virtualhost settings) (``apachectl -S``). Because each additional virtual host adds to the execution time, this command may require a long timeout be specified by using ``-t 10``. CLI Example: .. code-block:: bash ...
salt/modules/apache.py
def vhosts(): ''' Show the settings as parsed from the config file (currently only shows the virtualhost settings) (``apachectl -S``). Because each additional virtual host adds to the execution time, this command may require a long timeout be specified by using ``-t 10``. CLI Example: ...
def vhosts(): ''' Show the settings as parsed from the config file (currently only shows the virtualhost settings) (``apachectl -S``). Because each additional virtual host adds to the execution time, this command may require a long timeout be specified by using ``-t 10``. CLI Example: ...
[ "Show", "the", "settings", "as", "parsed", "from", "the", "config", "file", "(", "currently", "only", "shows", "the", "virtualhost", "settings", ")", "(", "apachectl", "-", "S", ")", ".", "Because", "each", "additional", "virtual", "host", "adds", "to", "t...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L181-L224
[ "def", "vhosts", "(", ")", ":", "cmd", "=", "'{0} -S'", ".", "format", "(", "_detect_os", "(", ")", ")", "ret", "=", "{", "}", "namevhost", "=", "''", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "for", "line", "in", "out", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
signal
Signals httpd to start, restart, or stop. CLI Example: .. code-block:: bash salt '*' apache.signal restart
salt/modules/apache.py
def signal(signal=None): ''' Signals httpd to start, restart, or stop. CLI Example: .. code-block:: bash salt '*' apache.signal restart ''' no_extra_args = ('configtest', 'status', 'fullstatus') valid_signals = ('start', 'stop', 'restart', 'graceful', 'graceful-stop') if sign...
def signal(signal=None): ''' Signals httpd to start, restart, or stop. CLI Example: .. code-block:: bash salt '*' apache.signal restart ''' no_extra_args = ('configtest', 'status', 'fullstatus') valid_signals = ('start', 'stop', 'restart', 'graceful', 'graceful-stop') if sign...
[ "Signals", "httpd", "to", "start", "restart", "or", "stop", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L227-L261
[ "def", "signal", "(", "signal", "=", "None", ")", ":", "no_extra_args", "=", "(", "'configtest'", ",", "'status'", ",", "'fullstatus'", ")", "valid_signals", "=", "(", "'start'", ",", "'stop'", ",", "'restart'", ",", "'graceful'", ",", "'graceful-stop'", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
useradd
Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not exist, it will be created. Valid options that can be passed are: .. code-block:: text n Don't update file; display results on stdout. m Force MD5 hashing of the password (default). d Force CRYPT(3) hashi...
salt/modules/apache.py
def useradd(pwfile, user, password, opts=''): ''' Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not exist, it will be created. Valid options that can be passed are: .. code-block:: text n Don't update file; display results on stdout. m Force MD5 hashing ...
def useradd(pwfile, user, password, opts=''): ''' Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not exist, it will be created. Valid options that can be passed are: .. code-block:: text n Don't update file; display results on stdout. m Force MD5 hashing ...
[ "Add", "HTTP", "user", "using", "the", "htpasswd", "command", ".", "If", "the", "htpasswd", "file", "does", "not", "exist", "it", "will", "be", "created", ".", "Valid", "options", "that", "can", "be", "passed", "are", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L264-L284
[ "def", "useradd", "(", "pwfile", ",", "user", ",", "password", ",", "opts", "=", "''", ")", ":", "return", "__salt__", "[", "'webutil.useradd'", "]", "(", "pwfile", ",", "user", ",", "password", ",", "opts", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_status
Get Information from the Apache server-status handler .. note:: The server-status handler is disabled by default. In order for this function to work it needs to be enabled. See http://httpd.apache.org/docs/2.2/mod/mod_status.html The following configuration needs to exists in pillar/g...
salt/modules/apache.py
def server_status(profile='default'): ''' Get Information from the Apache server-status handler .. note:: The server-status handler is disabled by default. In order for this function to work it needs to be enabled. See http://httpd.apache.org/docs/2.2/mod/mod_status.html The f...
def server_status(profile='default'): ''' Get Information from the Apache server-status handler .. note:: The server-status handler is disabled by default. In order for this function to work it needs to be enabled. See http://httpd.apache.org/docs/2.2/mod/mod_status.html The f...
[ "Get", "Information", "from", "the", "Apache", "server", "-", "status", "handler" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L300-L400
[ "def", "server_status", "(", "profile", "=", "'default'", ")", ":", "ret", "=", "{", "'Scoreboard'", ":", "{", "'_'", ":", "0", ",", "'S'", ":", "0", ",", "'R'", ":", "0", ",", "'W'", ":", "0", ",", "'K'", ":", "0", ",", "'D'", ":", "0", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_config
Recursively goes through config structure and builds final Apache configuration :param conf: defined config structure :param slot: name of section container if needed
salt/modules/apache.py
def _parse_config(conf, slot=None): ''' Recursively goes through config structure and builds final Apache configuration :param conf: defined config structure :param slot: name of section container if needed ''' ret = cStringIO() if isinstance(conf, six.string_types): if slot: ...
def _parse_config(conf, slot=None): ''' Recursively goes through config structure and builds final Apache configuration :param conf: defined config structure :param slot: name of section container if needed ''' ret = cStringIO() if isinstance(conf, six.string_types): if slot: ...
[ "Recursively", "goes", "through", "config", "structure", "and", "builds", "final", "Apache", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L403-L449
[ "def", "_parse_config", "(", "conf", ",", "slot", "=", "None", ")", ":", "ret", "=", "cStringIO", "(", ")", "if", "isinstance", "(", "conf", ",", "six", ".", "string_types", ")", ":", "if", "slot", ":", "print", "(", "'{0} {1}'", ".", "format", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config
Create VirtualHost configuration files name File for the virtual host config VirtualHost configurations .. note:: This function is not meant to be used from the command line. Config is meant to be an ordered dict of all of the apache configs. CLI Example: .. code...
salt/modules/apache.py
def config(name, config, edit=True): ''' Create VirtualHost configuration files name File for the virtual host config VirtualHost configurations .. note:: This function is not meant to be used from the command line. Config is meant to be an ordered dict of all of t...
def config(name, config, edit=True): ''' Create VirtualHost configuration files name File for the virtual host config VirtualHost configurations .. note:: This function is not meant to be used from the command line. Config is meant to be an ordered dict of all of t...
[ "Create", "VirtualHost", "configuration", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L452-L484
[ "def", "config", "(", "name", ",", "config", ",", "edit", "=", "True", ")", ":", "configs", "=", "[", "]", "for", "entry", "in", "config", ":", "key", "=", "next", "(", "six", ".", "iterkeys", "(", "entry", ")", ")", "configs", ".", "append", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the SQS queue exists. name Name of the SQS queue. attributes A dict of key/value SQS attributes. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pilla...
salt/states/boto_sqs.py
def present( name, attributes=None, region=None, key=None, keyid=None, profile=None, ): ''' Ensure the SQS queue exists. name Name of the SQS queue. attributes A dict of key/value SQS attributes. region Region to connect to. ...
def present( name, attributes=None, region=None, key=None, keyid=None, profile=None, ): ''' Ensure the SQS queue exists. name Name of the SQS queue. attributes A dict of key/value SQS attributes. region Region to connect to. ...
[ "Ensure", "the", "SQS", "queue", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sqs.py#L82-L250
[ "def", "present", "(", "name", ",", "attributes", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure the named sqs queue is deleted. name Name of the SQS queue. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pillar key (string) that contains a dict with r...
salt/states/boto_sqs.py
def absent( name, region=None, key=None, keyid=None, profile=None, ): ''' Ensure the named sqs queue is deleted. name Name of the SQS queue. region Region to connect to. key Secret key to be used. keyid Access key to be ...
def absent( name, region=None, key=None, keyid=None, profile=None, ): ''' Ensure the named sqs queue is deleted. name Name of the SQS queue. region Region to connect to. key Secret key to be used. keyid Access key to be ...
[ "Ensure", "the", "named", "sqs", "queue", "is", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sqs.py#L253-L321
[ "def", "absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_group_changes
Determine if the groups need to be changed
salt/states/user.py
def _group_changes(cur, wanted, remove=False): ''' Determine if the groups need to be changed ''' old = set(cur) new = set(wanted) if (remove and old != new) or (not remove and not new.issubset(old)): return True return False
def _group_changes(cur, wanted, remove=False): ''' Determine if the groups need to be changed ''' old = set(cur) new = set(wanted) if (remove and old != new) or (not remove and not new.issubset(old)): return True return False
[ "Determine", "if", "the", "groups", "need", "to", "be", "changed" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L44-L52
[ "def", "_group_changes", "(", "cur", ",", "wanted", ",", "remove", "=", "False", ")", ":", "old", "=", "set", "(", "cur", ")", "new", "=", "set", "(", "wanted", ")", "if", "(", "remove", "and", "old", "!=", "new", ")", "or", "(", "not", "remove",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_changes
Return a dict of the changes required for a user if the user is present, otherwise return False. Updated in 2015.8.0 to include support for windows homedrive, profile, logonscript, and description fields. Updated in 2014.7.0 to include support for shadow attributes, all attributes supported as int...
salt/states/user.py
def _changes(name, uid=None, gid=None, groups=None, optional_groups=None, remove_groups=True, home=None, createhome=True, password=None, enforce_password=True, empty_password=False, ...
def _changes(name, uid=None, gid=None, groups=None, optional_groups=None, remove_groups=True, home=None, createhome=True, password=None, enforce_password=True, empty_password=False, ...
[ "Return", "a", "dict", "of", "the", "changes", "required", "for", "a", "user", "if", "the", "user", "is", "present", "otherwise", "return", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L55-L222
[ "def", "_changes", "(", "name", ",", "uid", "=", "None", ",", "gid", "=", "None", ",", "groups", "=", "None", ",", "optional_groups", "=", "None", ",", "remove_groups", "=", "True", ",", "home", "=", "None", ",", "createhome", "=", "True", ",", "pass...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the named user is present with the specified properties name The name of the user to manage uid The user id to assign. If not specified, and the user does not exist, then the next available uid will be assigned. gid The id of the default group to assign to the ...
salt/states/user.py
def present(name, uid=None, gid=None, usergroup=None, groups=None, optional_groups=None, remove_groups=True, home=None, createhome=True, password=None, hash_password=False, enforce_passwor...
def present(name, uid=None, gid=None, usergroup=None, groups=None, optional_groups=None, remove_groups=True, home=None, createhome=True, password=None, hash_password=False, enforce_passwor...
[ "Ensure", "that", "the", "named", "user", "is", "present", "with", "the", "specified", "properties" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L225-L872
[ "def", "present", "(", "name", ",", "uid", "=", "None", ",", "gid", "=", "None", ",", "usergroup", "=", "None", ",", "groups", "=", "None", ",", "optional_groups", "=", "None", ",", "remove_groups", "=", "True", ",", "home", "=", "None", ",", "create...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure that the named user is absent name The name of the user to remove purge Set purge to True to delete all of the user's files as well as the user, Default is ``False``. force If the user is logged in, the absent state will fail. Set the force option to True to...
salt/states/user.py
def absent(name, purge=False, force=False): ''' Ensure that the named user is absent name The name of the user to remove purge Set purge to True to delete all of the user's files as well as the user, Default is ``False``. force If the user is logged in, the absent ...
def absent(name, purge=False, force=False): ''' Ensure that the named user is absent name The name of the user to remove purge Set purge to True to delete all of the user's files as well as the user, Default is ``False``. force If the user is logged in, the absent ...
[ "Ensure", "that", "the", "named", "user", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L875-L919
[ "def", "absent", "(", "name", ",", "purge", "=", "False", ",", "force", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "lusr", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parse
Parse a salt:// URL; return the path and a possible saltenv query.
salt/utils/url.py
def parse(url): ''' Parse a salt:// URL; return the path and a possible saltenv query. ''' if not url.startswith('salt://'): return url, None # urlparse will split on valid filename chars such as '?' and '&' resource = url.split('salt://', 1)[-1] if '?env=' in resource: # "...
def parse(url): ''' Parse a salt:// URL; return the path and a possible saltenv query. ''' if not url.startswith('salt://'): return url, None # urlparse will split on valid filename chars such as '?' and '&' resource = url.split('salt://', 1)[-1] if '?env=' in resource: # "...
[ "Parse", "a", "salt", ":", "//", "URL", ";", "return", "the", "path", "and", "a", "possible", "saltenv", "query", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L19-L40
[ "def", "parse", "(", "url", ")", ":", "if", "not", "url", ".", "startswith", "(", "'salt://'", ")", ":", "return", "url", ",", "None", "# urlparse will split on valid filename chars such as '?' and '&'", "resource", "=", "url", ".", "split", "(", "'salt://'", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
join `path` and `saltenv` into a 'salt://' URL.
salt/utils/url.py
def create(path, saltenv=None): ''' join `path` and `saltenv` into a 'salt://' URL. ''' if salt.utils.platform.is_windows(): path = salt.utils.path.sanitize_win_path(path) path = salt.utils.data.decode(path) query = 'saltenv={0}'.format(saltenv) if saltenv else '' url = salt.utils.d...
def create(path, saltenv=None): ''' join `path` and `saltenv` into a 'salt://' URL. ''' if salt.utils.platform.is_windows(): path = salt.utils.path.sanitize_win_path(path) path = salt.utils.data.decode(path) query = 'saltenv={0}'.format(saltenv) if saltenv else '' url = salt.utils.d...
[ "join", "path", "and", "saltenv", "into", "a", "salt", ":", "//", "URL", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L43-L53
[ "def", "create", "(", "path", ",", "saltenv", "=", "None", ")", ":", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "path", "=", "salt", ".", "utils", ".", "path", ".", "sanitize_win_path", "(", "path", ")", "path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_escaped
test whether `url` is escaped with `|`
salt/utils/url.py
def is_escaped(url): ''' test whether `url` is escaped with `|` ''' scheme = urlparse(url).scheme if not scheme: return url.startswith('|') elif scheme == 'salt': path, saltenv = parse(url) if salt.utils.platform.is_windows() and '|' in url: return path.starts...
def is_escaped(url): ''' test whether `url` is escaped with `|` ''' scheme = urlparse(url).scheme if not scheme: return url.startswith('|') elif scheme == 'salt': path, saltenv = parse(url) if salt.utils.platform.is_windows() and '|' in url: return path.starts...
[ "test", "whether", "url", "is", "escaped", "with", "|" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L56-L70
[ "def", "is_escaped", "(", "url", ")", ":", "scheme", "=", "urlparse", "(", "url", ")", ".", "scheme", "if", "not", "scheme", ":", "return", "url", ".", "startswith", "(", "'|'", ")", "elif", "scheme", "==", "'salt'", ":", "path", ",", "saltenv", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
escape
add escape character `|` to `url`
salt/utils/url.py
def escape(url): ''' add escape character `|` to `url` ''' if salt.utils.platform.is_windows(): return url scheme = urlparse(url).scheme if not scheme: if url.startswith('|'): return url else: return '|{0}'.format(url) elif scheme == 'salt': ...
def escape(url): ''' add escape character `|` to `url` ''' if salt.utils.platform.is_windows(): return url scheme = urlparse(url).scheme if not scheme: if url.startswith('|'): return url else: return '|{0}'.format(url) elif scheme == 'salt': ...
[ "add", "escape", "character", "|", "to", "url" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L73-L93
[ "def", "escape", "(", "url", ")", ":", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "return", "url", "scheme", "=", "urlparse", "(", "url", ")", ".", "scheme", "if", "not", "scheme", ":", "if", "url", ".", "startsw...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unescape
remove escape character `|` from `url`
salt/utils/url.py
def unescape(url): ''' remove escape character `|` from `url` ''' scheme = urlparse(url).scheme if not scheme: return url.lstrip('|') elif scheme == 'salt': path, saltenv = parse(url) if salt.utils.platform.is_windows() and '|' in url: return create(path.lstri...
def unescape(url): ''' remove escape character `|` from `url` ''' scheme = urlparse(url).scheme if not scheme: return url.lstrip('|') elif scheme == 'salt': path, saltenv = parse(url) if salt.utils.platform.is_windows() and '|' in url: return create(path.lstri...
[ "remove", "escape", "character", "|", "from", "url" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L96-L110
[ "def", "unescape", "(", "url", ")", ":", "scheme", "=", "urlparse", "(", "url", ")", ".", "scheme", "if", "not", "scheme", ":", "return", "url", ".", "lstrip", "(", "'|'", ")", "elif", "scheme", "==", "'salt'", ":", "path", ",", "saltenv", "=", "pa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_env
append `saltenv` to `url` as a query parameter to a 'salt://' url
salt/utils/url.py
def add_env(url, saltenv): ''' append `saltenv` to `url` as a query parameter to a 'salt://' url ''' if not url.startswith('salt://'): return url path, senv = parse(url) return create(path, saltenv)
def add_env(url, saltenv): ''' append `saltenv` to `url` as a query parameter to a 'salt://' url ''' if not url.startswith('salt://'): return url path, senv = parse(url) return create(path, saltenv)
[ "append", "saltenv", "to", "url", "as", "a", "query", "parameter", "to", "a", "salt", ":", "//", "url" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L113-L121
[ "def", "add_env", "(", "url", ",", "saltenv", ")", ":", "if", "not", "url", ".", "startswith", "(", "'salt://'", ")", ":", "return", "url", "path", ",", "senv", "=", "parse", "(", "url", ")", "return", "create", "(", "path", ",", "saltenv", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
split_env
remove the saltenv query parameter from a 'salt://' url
salt/utils/url.py
def split_env(url): ''' remove the saltenv query parameter from a 'salt://' url ''' if not url.startswith('salt://'): return url, None path, senv = parse(url) return create(path), senv
def split_env(url): ''' remove the saltenv query parameter from a 'salt://' url ''' if not url.startswith('salt://'): return url, None path, senv = parse(url) return create(path), senv
[ "remove", "the", "saltenv", "query", "parameter", "from", "a", "salt", ":", "//", "url" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L124-L132
[ "def", "split_env", "(", "url", ")", ":", "if", "not", "url", ".", "startswith", "(", "'salt://'", ")", ":", "return", "url", ",", "None", "path", ",", "senv", "=", "parse", "(", "url", ")", "return", "create", "(", "path", ")", ",", "senv" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_http_basic_auth
Return a string with http basic auth incorporated into it
salt/utils/url.py
def add_http_basic_auth(url, user=None, password=None, https_only=False): ''' Return a string with http basic auth incorporated into it ''' if user is None and password is None: return url else: urltuple = urlpar...
def add_http_basic_auth(url, user=None, password=None, https_only=False): ''' Return a string with http basic auth incorporated into it ''' if user is None and password is None: return url else: urltuple = urlpar...
[ "Return", "a", "string", "with", "http", "basic", "auth", "incorporated", "into", "it" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L152-L179
[ "def", "add_http_basic_auth", "(", "url", ",", "user", "=", "None", ",", "password", "=", "None", ",", "https_only", "=", "False", ")", ":", "if", "user", "is", "None", "and", "password", "is", "None", ":", "return", "url", "else", ":", "urltuple", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
redact_http_basic_auth
Remove HTTP user and password
salt/utils/url.py
def redact_http_basic_auth(output): ''' Remove HTTP user and password ''' # We can't use re.compile because re.compile(someregex).sub() doesn't # support flags even in Python 2.7. url_re = '(https?)://.*@' redacted = r'\1://<redacted>@' if sys.version_info >= (2, 7): # re.sub() s...
def redact_http_basic_auth(output): ''' Remove HTTP user and password ''' # We can't use re.compile because re.compile(someregex).sub() doesn't # support flags even in Python 2.7. url_re = '(https?)://.*@' redacted = r'\1://<redacted>@' if sys.version_info >= (2, 7): # re.sub() s...
[ "Remove", "HTTP", "user", "and", "password" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L182-L201
[ "def", "redact_http_basic_auth", "(", "output", ")", ":", "# We can't use re.compile because re.compile(someregex).sub() doesn't", "# support flags even in Python 2.7.", "url_re", "=", "'(https?)://.*@'", "redacted", "=", "r'\\1://<redacted>@'", "if", "sys", ".", "version_info", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_hold
Resolve a package name from a line containing the hold expression. If the regex is not matched, None is returned. yum ==> 2:vim-enhanced-7.4.629-5.el6.* dnf ==> vim-enhanced-2:7.4.827-1.fc22.*
salt/modules/yumpkg.py
def _get_hold(line, pattern=__HOLD_PATTERN, full=True): ''' Resolve a package name from a line containing the hold expression. If the regex is not matched, None is returned. yum ==> 2:vim-enhanced-7.4.629-5.el6.* dnf ==> vim-enhanced-2:7.4.827-1.fc22.* ''' if full: if _yum() == 'dnf...
def _get_hold(line, pattern=__HOLD_PATTERN, full=True): ''' Resolve a package name from a line containing the hold expression. If the regex is not matched, None is returned. yum ==> 2:vim-enhanced-7.4.629-5.el6.* dnf ==> vim-enhanced-2:7.4.827-1.fc22.* ''' if full: if _yum() == 'dnf...
[ "Resolve", "a", "package", "name", "from", "a", "line", "containing", "the", "hold", "expression", ".", "If", "the", "regex", "is", "not", "matched", "None", "is", "returned", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L109-L136
[ "def", "_get_hold", "(", "line", ",", "pattern", "=", "__HOLD_PATTERN", ",", "full", "=", "True", ")", ":", "if", "full", ":", "if", "_yum", "(", ")", "==", "'dnf'", ":", "lock_re", "=", "r'({0}-\\S+)'", ".", "format", "(", "pattern", ")", "else", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_yum
Determine package manager name (yum or dnf), depending on the system version.
salt/modules/yumpkg.py
def _yum(): ''' Determine package manager name (yum or dnf), depending on the system version. ''' contextkey = 'yum_bin' if contextkey not in __context__: if ('fedora' in __grains__['os'].lower() and int(__grains__['osrelease']) >= 22): __context__[contextkey] = 'd...
def _yum(): ''' Determine package manager name (yum or dnf), depending on the system version. ''' contextkey = 'yum_bin' if contextkey not in __context__: if ('fedora' in __grains__['os'].lower() and int(__grains__['osrelease']) >= 22): __context__[contextkey] = 'd...
[ "Determine", "package", "manager", "name", "(", "yum", "or", "dnf", ")", "depending", "on", "the", "system", "version", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L139-L153
[ "def", "_yum", "(", ")", ":", "contextkey", "=", "'yum_bin'", "if", "contextkey", "not", "in", "__context__", ":", "if", "(", "'fedora'", "in", "__grains__", "[", "'os'", "]", ".", "lower", "(", ")", "and", "int", "(", "__grains__", "[", "'osrelease'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_call_yum
Call yum/dnf.
salt/modules/yumpkg.py
def _call_yum(args, **kwargs): ''' Call yum/dnf. ''' params = {'output_loglevel': 'trace', 'python_shell': False, 'env': salt.utils.environment.get_module_environment(globals())} params.update(kwargs) cmd = [] if salt.utils.systemd.has_scope(__context__) and __sal...
def _call_yum(args, **kwargs): ''' Call yum/dnf. ''' params = {'output_loglevel': 'trace', 'python_shell': False, 'env': salt.utils.environment.get_module_environment(globals())} params.update(kwargs) cmd = [] if salt.utils.systemd.has_scope(__context__) and __sal...
[ "Call", "yum", "/", "dnf", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L156-L170
[ "def", "_call_yum", "(", "args", ",", "*", "*", "kwargs", ")", ":", "params", "=", "{", "'output_loglevel'", ":", "'trace'", ",", "'python_shell'", ":", "False", ",", "'env'", ":", "salt", ".", "utils", ".", "environment", ".", "get_module_environment", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_yum_pkginfo
Parse yum/dnf output (which could contain irregular line breaks if package names are long) retrieving the name, version, etc., and return a list of pkginfo namedtuples.
salt/modules/yumpkg.py
def _yum_pkginfo(output): ''' Parse yum/dnf output (which could contain irregular line breaks if package names are long) retrieving the name, version, etc., and return a list of pkginfo namedtuples. ''' cur = {} keys = itertools.cycle(('name', 'version', 'repoid')) values = salt.utils.it...
def _yum_pkginfo(output): ''' Parse yum/dnf output (which could contain irregular line breaks if package names are long) retrieving the name, version, etc., and return a list of pkginfo namedtuples. ''' cur = {} keys = itertools.cycle(('name', 'version', 'repoid')) values = salt.utils.it...
[ "Parse", "yum", "/", "dnf", "output", "(", "which", "could", "contain", "irregular", "line", "breaks", "if", "package", "names", "are", "long", ")", "retrieving", "the", "name", "version", "etc", ".", "and", "return", "a", "list", "of", "pkginfo", "namedtu...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L173-L208
[ "def", "_yum_pkginfo", "(", "output", ")", ":", "cur", "=", "{", "}", "keys", "=", "itertools", ".", "cycle", "(", "(", "'name'", ",", "'version'", ",", "'repoid'", ")", ")", "values", "=", "salt", ".", "utils", ".", "itertools", ".", "split", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_versionlock
Ensure that the appropriate versionlock plugin is present
salt/modules/yumpkg.py
def _check_versionlock(): ''' Ensure that the appropriate versionlock plugin is present ''' if _yum() == 'dnf': if int(__grains__.get('osmajorrelease')) >= 26: if six.PY3: vl_plugin = 'python3-dnf-plugin-versionlock' else: vl_plugin = 'pyth...
def _check_versionlock(): ''' Ensure that the appropriate versionlock plugin is present ''' if _yum() == 'dnf': if int(__grains__.get('osmajorrelease')) >= 26: if six.PY3: vl_plugin = 'python3-dnf-plugin-versionlock' else: vl_plugin = 'pyth...
[ "Ensure", "that", "the", "appropriate", "versionlock", "plugin", "is", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L211-L234
[ "def", "_check_versionlock", "(", ")", ":", "if", "_yum", "(", ")", "==", "'dnf'", ":", "if", "int", "(", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", ")", ">=", "26", ":", "if", "six", ".", "PY3", ":", "vl_plugin", "=", "'python3-dnf-plugin...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_options
Returns a list of options to be used in the yum/dnf command, based on the kwargs passed.
salt/modules/yumpkg.py
def _get_options(**kwargs): ''' Returns a list of options to be used in the yum/dnf command, based on the kwargs passed. ''' # Get repo options from the kwargs fromrepo = kwargs.pop('fromrepo', '') repo = kwargs.pop('repo', '') disablerepo = kwargs.pop('disablerepo', '') enablerepo =...
def _get_options(**kwargs): ''' Returns a list of options to be used in the yum/dnf command, based on the kwargs passed. ''' # Get repo options from the kwargs fromrepo = kwargs.pop('fromrepo', '') repo = kwargs.pop('repo', '') disablerepo = kwargs.pop('disablerepo', '') enablerepo =...
[ "Returns", "a", "list", "of", "options", "to", "be", "used", "in", "the", "yum", "/", "dnf", "command", "based", "on", "the", "kwargs", "passed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L237-L307
[ "def", "_get_options", "(", "*", "*", "kwargs", ")", ":", "# Get repo options from the kwargs", "fromrepo", "=", "kwargs", ".", "pop", "(", "'fromrepo'", ",", "''", ")", "repo", "=", "kwargs", ".", "pop", "(", "'repo'", ",", "''", ")", "disablerepo", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_yum_config
Returns a dict representing the yum config options and values. We try to pull all of the yum config options into a standard dict object. This is currently only used to get the reposdir settings, but could be used for other things if needed. If the yum python library is available, use that, which will ...
salt/modules/yumpkg.py
def _get_yum_config(): ''' Returns a dict representing the yum config options and values. We try to pull all of the yum config options into a standard dict object. This is currently only used to get the reposdir settings, but could be used for other things if needed. If the yum python library ...
def _get_yum_config(): ''' Returns a dict representing the yum config options and values. We try to pull all of the yum config options into a standard dict object. This is currently only used to get the reposdir settings, but could be used for other things if needed. If the yum python library ...
[ "Returns", "a", "dict", "representing", "the", "yum", "config", "options", "and", "values", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L310-L382
[ "def", "_get_yum_config", "(", ")", ":", "# in case of any non-fatal failures, these defaults will be used", "conf", "=", "{", "'reposdir'", ":", "[", "'/etc/yum/repos.d'", ",", "'/etc/yum.repos.d'", "]", ",", "}", "if", "HAS_YUM", ":", "try", ":", "yb", "=", "yum",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_yum_config_value
Look for a specific config variable and return its value
salt/modules/yumpkg.py
def _get_yum_config_value(name): ''' Look for a specific config variable and return its value ''' conf = _get_yum_config() if name in conf.keys(): return conf.get(name) return None
def _get_yum_config_value(name): ''' Look for a specific config variable and return its value ''' conf = _get_yum_config() if name in conf.keys(): return conf.get(name) return None
[ "Look", "for", "a", "specific", "config", "variable", "and", "return", "its", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L385-L392
[ "def", "_get_yum_config_value", "(", "name", ")", ":", "conf", "=", "_get_yum_config", "(", ")", "if", "name", "in", "conf", ".", "keys", "(", ")", ":", "return", "conf", ".", "get", "(", "name", ")", "return", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_normalize_basedir
Takes a basedir argument as a string or a list. If the string or list is empty, then look up the default from the 'reposdir' option in the yum config. Returns a list of directories.
salt/modules/yumpkg.py
def _normalize_basedir(basedir=None): ''' Takes a basedir argument as a string or a list. If the string or list is empty, then look up the default from the 'reposdir' option in the yum config. Returns a list of directories. ''' # if we are passed a string (for backward compatibility), conve...
def _normalize_basedir(basedir=None): ''' Takes a basedir argument as a string or a list. If the string or list is empty, then look up the default from the 'reposdir' option in the yum config. Returns a list of directories. ''' # if we are passed a string (for backward compatibility), conve...
[ "Takes", "a", "basedir", "argument", "as", "a", "string", "or", "a", "list", ".", "If", "the", "string", "or", "list", "is", "empty", "then", "look", "up", "the", "default", "from", "the", "reposdir", "option", "in", "the", "yum", "config", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L395-L417
[ "def", "_normalize_basedir", "(", "basedir", "=", "None", ")", ":", "# if we are passed a string (for backward compatibility), convert to a list", "if", "isinstance", "(", "basedir", ",", "six", ".", "string_types", ")", ":", "basedir", "=", "[", "x", ".", "strip", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
normalize_name
Strips the architecture from the specified package name, if necessary. Circumstances where this would be done include: * If the arch is 32 bit and the package name ends in a 32-bit arch. * If the arch matches the OS arch, or is ``noarch``. CLI Example: .. code-block:: bash salt '*' pkg.n...
salt/modules/yumpkg.py
def normalize_name(name): ''' Strips the architecture from the specified package name, if necessary. Circumstances where this would be done include: * If the arch is 32 bit and the package name ends in a 32-bit arch. * If the arch matches the OS arch, or is ``noarch``. CLI Example: .. cod...
def normalize_name(name): ''' Strips the architecture from the specified package name, if necessary. Circumstances where this would be done include: * If the arch is 32 bit and the package name ends in a 32-bit arch. * If the arch matches the OS arch, or is ``noarch``. CLI Example: .. cod...
[ "Strips", "the", "architecture", "from", "the", "specified", "package", "name", "if", "necessary", ".", "Circumstances", "where", "this", "would", "be", "done", "include", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L420-L443
[ "def", "normalize_name", "(", "name", ")", ":", "try", ":", "arch", "=", "name", ".", "rsplit", "(", "'.'", ",", "1", ")", "[", "-", "1", "]", "if", "arch", "not", "in", "salt", ".", "utils", ".", "pkg", ".", "rpm", ".", "ARCHES", "+", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version_cmp
.. versionadded:: 2015.5.4 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. ignore_epoch : False Set to ``True`` to ignore the epoch when comparing versions .. versio...
salt/modules/yumpkg.py
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): ''' .. versionadded:: 2015.5.4 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. ignore_epoch : False Set to ...
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): ''' .. versionadded:: 2015.5.4 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. ignore_epoch : False Set to ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "4" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L599-L619
[ "def", "version_cmp", "(", "pkg1", ",", "pkg2", ",", "ignore_epoch", "=", "False", ",", "*", "*", "kwargs", ")", ":", "return", "__salt__", "[", "'lowpkg.version_cmp'", "]", "(", "pkg1", ",", "pkg2", ",", "ignore_epoch", "=", "ignore_epoch", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_pkgs
List the packages currently installed as a dict. By default, the dict contains versions as a comma separated string:: {'<package_name>': '<version>[,<version>...]'} versions_as_list: If set to true, the versions are provided as a list {'<package_name>': ['<version>', '<version>']} ...
salt/modules/yumpkg.py
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict. By default, the dict contains versions as a comma separated string:: {'<package_name>': '<version>[,<version>...]'} versions_as_list: If set to true, the versions are provided as a lis...
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict. By default, the dict contains versions as a comma separated string:: {'<package_name>': '<version>[,<version>...]'} versions_as_list: If set to true, the versions are provided as a lis...
[ "List", "the", "packages", "currently", "installed", "as", "a", "dict", ".", "By", "default", "the", "dict", "contains", "versions", "as", "a", "comma", "separated", "string", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L622-L706
[ "def", "list_pkgs", "(", "versions_as_list", "=", "False", ",", "*", "*", "kwargs", ")", ":", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "versions_as_list", ")", "# not yet implemented or not applicable", "if", "any", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_repo_pkgs
.. versionadded:: 2014.1.0 .. versionchanged:: 2014.7.0 All available versions of each package are now returned. This required a slight modification to the structure of the return dict. The return data shown below reflects the updated return dict structure. Note that packages which a...
salt/modules/yumpkg.py
def list_repo_pkgs(*args, **kwargs): ''' .. versionadded:: 2014.1.0 .. versionchanged:: 2014.7.0 All available versions of each package are now returned. This required a slight modification to the structure of the return dict. The return data shown below reflects the updated return d...
def list_repo_pkgs(*args, **kwargs): ''' .. versionadded:: 2014.1.0 .. versionchanged:: 2014.7.0 All available versions of each package are now returned. This required a slight modification to the structure of the return dict. The return data shown below reflects the updated return d...
[ "..", "versionadded", "::", "2014", ".", "1", ".", "0", "..", "versionchanged", "::", "2014", ".", "7", ".", "0", "All", "available", "versions", "of", "each", "package", "are", "now", "returned", ".", "This", "required", "a", "slight", "modification", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L709-L952
[ "def", "list_repo_pkgs", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "byrepo", "=", "kwargs", ".", "pop", "(", "'byrepo'", ",", "False", ")", "cacheonly", "=", "kwargs", ".", "pop", "(", "'cacheonly'", ",", "False", ")", "fromrepo", "=", "kw...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_upgrades
Check whether or not an upgrade is available for all packages The ``fromrepo``, ``enablerepo``, and ``disablerepo`` arguments are supported, as used in pkg states, and the ``disableexcludes`` option is also supported. .. versionadded:: 2014.7.0 Support for the ``disableexcludes`` option C...
salt/modules/yumpkg.py
def list_upgrades(refresh=True, **kwargs): ''' Check whether or not an upgrade is available for all packages The ``fromrepo``, ``enablerepo``, and ``disablerepo`` arguments are supported, as used in pkg states, and the ``disableexcludes`` option is also supported. .. versionadded:: 2014.7.0 ...
def list_upgrades(refresh=True, **kwargs): ''' Check whether or not an upgrade is available for all packages The ``fromrepo``, ``enablerepo``, and ``disablerepo`` arguments are supported, as used in pkg states, and the ``disableexcludes`` option is also supported. .. versionadded:: 2014.7.0 ...
[ "Check", "whether", "or", "not", "an", "upgrade", "is", "available", "for", "all", "packages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L955-L984
[ "def", "list_upgrades", "(", "refresh", "=", "True", ",", "*", "*", "kwargs", ")", ":", "options", "=", "_get_options", "(", "*", "*", "kwargs", ")", "if", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "refresh", ")", ":", "refresh_db", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_downloaded
.. versionadded:: 2017.7.0 List prefetched packages downloaded by Yum in the local disk. CLI example: .. code-block:: bash salt '*' pkg.list_downloaded
salt/modules/yumpkg.py
def list_downloaded(**kwargs): ''' .. versionadded:: 2017.7.0 List prefetched packages downloaded by Yum in the local disk. CLI example: .. code-block:: bash salt '*' pkg.list_downloaded ''' CACHE_DIR = os.path.join('/var/cache/', _yum()) ret = {} for root, dirnames, fil...
def list_downloaded(**kwargs): ''' .. versionadded:: 2017.7.0 List prefetched packages downloaded by Yum in the local disk. CLI example: .. code-block:: bash salt '*' pkg.list_downloaded ''' CACHE_DIR = os.path.join('/var/cache/', _yum()) ret = {} for root, dirnames, fil...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L991-L1017
[ "def", "list_downloaded", "(", "*", "*", "kwargs", ")", ":", "CACHE_DIR", "=", "os", ".", "path", ".", "join", "(", "'/var/cache/'", ",", "_yum", "(", ")", ")", "ret", "=", "{", "}", "for", "root", ",", "dirnames", ",", "filenames", "in", "salt", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info_installed
.. versionadded:: 2015.8.1 Return the information of the named package(s), installed on the system. :param all_versions: Include information for all versions of the packages installed on the minion. CLI example: .. code-block:: bash salt '*' pkg.info_installed <package1> sal...
salt/modules/yumpkg.py
def info_installed(*names, **kwargs): ''' .. versionadded:: 2015.8.1 Return the information of the named package(s), installed on the system. :param all_versions: Include information for all versions of the packages installed on the minion. CLI example: .. code-block:: bash ...
def info_installed(*names, **kwargs): ''' .. versionadded:: 2015.8.1 Return the information of the named package(s), installed on the system. :param all_versions: Include information for all versions of the packages installed on the minion. CLI example: .. code-block:: bash ...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "1" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1020-L1053
[ "def", "info_installed", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "all_versions", "=", "kwargs", ".", "get", "(", "'all_versions'", ",", "False", ")", "ret", "=", "dict", "(", ")", "for", "pkg_name", ",", "pkgs_nfo", "in", "__salt__", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
refresh_db
Check the yum repos for updated packages Returns: - ``True``: Updates are available - ``False``: An error occurred - ``None``: No updates are available repo Refresh just the specified repo disablerepo Do not refresh the specified repo enablerepo Refresh a disable...
salt/modules/yumpkg.py
def refresh_db(**kwargs): ''' Check the yum repos for updated packages Returns: - ``True``: Updates are available - ``False``: An error occurred - ``None``: No updates are available repo Refresh just the specified repo disablerepo Do not refresh the specified repo ...
def refresh_db(**kwargs): ''' Check the yum repos for updated packages Returns: - ``True``: Updates are available - ``False``: An error occurred - ``None``: No updates are available repo Refresh just the specified repo disablerepo Do not refresh the specified repo ...
[ "Check", "the", "yum", "repos", "for", "updated", "packages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1056-L1124
[ "def", "refresh_db", "(", "*", "*", "kwargs", ")", ":", "# Remove rtag file to keep multiple refreshes from happening in pkg states", "salt", ".", "utils", ".", "pkg", ".", "clear_rtag", "(", "__opts__", ")", "retcodes", "=", "{", "100", ":", "True", ",", "0", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now used to isolate commands which modify installed packages from the ``salt-minion`` daemon's control group. This is done to keep systemd from killing any yum/dnf commands spawned by S...
salt/modules/yumpkg.py
def install(name=None, refresh=False, skip_verify=False, pkgs=None, sources=None, downloadonly=False, reinstall=False, normalize=True, update_holds=False, saltenv='base', ignore_epoch=False, ...
def install(name=None, refresh=False, skip_verify=False, pkgs=None, sources=None, downloadonly=False, reinstall=False, normalize=True, update_holds=False, saltenv='base', ignore_epoch=False, ...
[ "..", "versionchanged", "::", "2015", ".", "8", ".", "12", "2016", ".", "3", ".", "3", "2016", ".", "11", ".", "0", "On", "minions", "running", "systemd", ">", "=", "205", "systemd", "-", "run", "(", "1", ")", "_", "is", "now", "used", "to", "i...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1158-L1720
[ "def", "install", "(", "name", "=", "None", ",", "refresh", "=", "False", ",", "skip_verify", "=", "False", ",", "pkgs", "=", "None", ",", "sources", "=", "None", ",", "downloadonly", "=", "False", ",", "reinstall", "=", "False", ",", "normalize", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
upgrade
Run a full system upgrade (a ``yum upgrade`` or ``dnf upgrade``), or upgrade specified packages. If the packages aren't installed, they will not be installed. .. versionchanged:: 2014.7.0 .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now ...
salt/modules/yumpkg.py
def upgrade(name=None, pkgs=None, refresh=True, skip_verify=False, normalize=True, minimal=False, obsoletes=True, **kwargs): ''' Run a full system upgrade (a ``yum upgrade`` or ``dnf upgrade``), or upgrade specified packages...
def upgrade(name=None, pkgs=None, refresh=True, skip_verify=False, normalize=True, minimal=False, obsoletes=True, **kwargs): ''' Run a full system upgrade (a ``yum upgrade`` or ``dnf upgrade``), or upgrade specified packages...
[ "Run", "a", "full", "system", "upgrade", "(", "a", "yum", "upgrade", "or", "dnf", "upgrade", ")", "or", "upgrade", "specified", "packages", ".", "If", "the", "packages", "aren", "t", "installed", "they", "will", "not", "be", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1723-L1923
[ "def", "upgrade", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "refresh", "=", "True", ",", "skip_verify", "=", "False", ",", "normalize", "=", "True", ",", "minimal", "=", "False", ",", "obsoletes", "=", "True", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
.. versionadded:: 2019.2.0 Calls :py:func:`pkg.upgrade <salt.modules.yumpkg.upgrade>` with ``obsoletes=False``. Mirrors the CLI behavior of ``yum update``. See :py:func:`pkg.upgrade <salt.modules.yumpkg.upgrade>` for further documentation. .. code-block:: bash salt '*' pkg.update
salt/modules/yumpkg.py
def update(name=None, pkgs=None, refresh=True, skip_verify=False, normalize=True, minimal=False, obsoletes=False, **kwargs): ''' .. versionadded:: 2019.2.0 Calls :py:func:`pkg.upgrade <salt.modules.yumpkg.upgrade>` with ``obso...
def update(name=None, pkgs=None, refresh=True, skip_verify=False, normalize=True, minimal=False, obsoletes=False, **kwargs): ''' .. versionadded:: 2019.2.0 Calls :py:func:`pkg.upgrade <salt.modules.yumpkg.upgrade>` with ``obso...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1926-L1946
[ "def", "update", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "refresh", "=", "True", ",", "skip_verify", "=", "False", ",", "normalize", "=", "True", ",", "minimal", "=", "False", ",", "obsoletes", "=", "False", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now used to isolate commands which modify installed packages from the ``salt-minion`` daemon's control group. This is done to keep systemd from killing any yum/dnf commands spawned by S...
salt/modules/yumpkg.py
def remove(name=None, pkgs=None, **kwargs): # pylint: disable=W0613 ''' .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now used to isolate commands which modify installed packages from the ``salt-minion`` daemon's control group. Th...
def remove(name=None, pkgs=None, **kwargs): # pylint: disable=W0613 ''' .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now used to isolate commands which modify installed packages from the ``salt-minion`` daemon's control group. Th...
[ "..", "versionchanged", "::", "2015", ".", "8", ".", "12", "2016", ".", "3", ".", "3", "2016", ".", "11", ".", "0", "On", "minions", "running", "systemd", ">", "=", "205", "systemd", "-", "run", "(", "1", ")", "_", "is", "now", "used", "to", "i...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/yumpkg.py#L1949-L2033
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=W0613", "try", ":", "pkg_params", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ",", "pkgs", ")", "[", "0...
e8541fd6e744ab0df786c0f76102e41631f45d46