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
template_str
Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>'
salt/modules/state.py
def template_str(tem, queue=False, **kwargs): ''' Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>' ''' conflict = _check_queue(queue, kwargs) if conflict is not None: return co...
def template_str(tem, queue=False, **kwargs): ''' Execute the information stored in a string from an sls template CLI Example: .. code-block:: bash salt '*' state.template_str '<Template String>' ''' conflict = _check_queue(queue, kwargs) if conflict is not None: return co...
[ "Execute", "the", "information", "stored", "in", "a", "string", "from", "an", "sls", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L579-L603
[ "def", "template_str", "(", "tem", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "opts", "=", "salt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_request
.. versionadded:: 2015.5.0 Return the state request information, if any CLI Example: .. code-block:: bash salt '*' state.check_request
salt/modules/state.py
def check_request(name=None): ''' .. versionadded:: 2015.5.0 Return the state request information, if any CLI Example: .. code-block:: bash salt '*' state.check_request ''' notify_path = os.path.join(__opts__['cachedir'], 'req_state.p') serial = salt.payload.Serial(__opts__) ...
def check_request(name=None): ''' .. versionadded:: 2015.5.0 Return the state request information, if any CLI Example: .. code-block:: bash salt '*' state.check_request ''' notify_path = os.path.join(__opts__['cachedir'], 'req_state.p') serial = salt.payload.Serial(__opts__) ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L825-L845
[ "def", "check_request", "(", "name", "=", "None", ")", ":", "notify_path", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'req_state.p'", ")", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
highstate
Retrieve the state data from the salt master for this minion and execute it test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash salt '*' state.highstate stuff pillar='{"foo": "bar"}' ...
salt/modules/state.py
def highstate(test=None, queue=False, **kwargs): ''' Retrieve the state data from the salt master for this minion and execute it test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash ...
def highstate(test=None, queue=False, **kwargs): ''' Retrieve the state data from the salt master for this minion and execute it test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash ...
[ "Retrieve", "the", "state", "data", "from", "the", "salt", "master", "for", "this", "minion", "and", "execute", "it" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L921-L1098
[ "def", "highstate", "(", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "_disabled", "(", "[", "'highstate'", "]", ")", ":", "log", ".", "debug", "(", "'Salt highstate run is disabled. To re-enable, run state.enable h...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls
Execute the states in one or more SLS files test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash salt '*' state.sls stuff pillar='{"foo": "bar"}' .. note:: Values passe...
salt/modules/state.py
def sls(mods, test=None, exclude=None, queue=False, sync_mods=None, **kwargs): ''' Execute the states in one or more SLS files test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash s...
def sls(mods, test=None, exclude=None, queue=False, sync_mods=None, **kwargs): ''' Execute the states in one or more SLS files test Run states in test-only (dry-run) mode pillar Custom Pillar values, passed as a dictionary of key-value pairs .. code-block:: bash s...
[ "Execute", "the", "states", "in", "one", "or", "more", "SLS", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1101-L1377
[ "def", "sls", "(", "mods", ",", "test", "=", "None", ",", "exclude", "=", "None", ",", "queue", "=", "False", ",", "sync_mods", "=", "None", ",", "*", "*", "kwargs", ")", ":", "concurrent", "=", "kwargs", ".", "get", "(", "'concurrent'", ",", "Fals...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
top
Execute a specific top file instead of the default. This is useful to apply configurations from a different environment (for example, dev or prod), without modifying the default top file. queue : False Instead of failing immediately when another state run is in progress, queue the new state...
salt/modules/state.py
def top(topfn, test=None, queue=False, **kwargs): ''' Execute a specific top file instead of the default. This is useful to apply configurations from a different environment (for example, dev or prod), without modifying the default top file. queue : False Instead of failing immediately when...
def top(topfn, test=None, queue=False, **kwargs): ''' Execute a specific top file instead of the default. This is useful to apply configurations from a different environment (for example, dev or prod), without modifying the default top file. queue : False Instead of failing immediately when...
[ "Execute", "a", "specific", "top", "file", "instead", "of", "the", "default", ".", "This", "is", "useful", "to", "apply", "configurations", "from", "a", "different", "environment", "(", "for", "example", "dev", "or", "prod", ")", "without", "modifying", "the...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1380-L1468
[ "def", "top", "(", "topfn", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_highstate
Retrieve the highstate data from the salt master and display it Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_highstate
salt/modules/state.py
def show_highstate(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master and display it Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_highstate ''' conflict = _check_queue(queue, kwargs) ...
def show_highstate(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master and display it Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_highstate ''' conflict = _check_queue(queue, kwargs) ...
[ "Retrieve", "the", "highstate", "data", "from", "the", "salt", "master", "and", "display", "it" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1471-L1520
[ "def", "show_highstate", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "pillar_override", "=", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_lowstate
List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate
salt/modules/state.py
def show_lowstate(queue=False, **kwargs): ''' List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate ''' conflict = _check_queue(queue, kwargs) if conflict is not None: assert False return conflict ...
def show_lowstate(queue=False, **kwargs): ''' List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate ''' conflict = _check_queue(queue, kwargs) if conflict is not None: assert False return conflict ...
[ "List", "out", "the", "low", "data", "that", "will", "be", "applied", "to", "this", "minion" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1523-L1557
[ "def", "show_lowstate", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "assert", "False", "return", "conflict", "opts", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_state_usage
Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage
salt/modules/state.py
def show_state_usage(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage ''' conflict = _check_...
def show_state_usage(queue=False, **kwargs): ''' Retrieve the highstate data from the salt master to analyse used and unused states Custom Pillar data can be passed with the ``pillar`` kwarg. CLI Example: .. code-block:: bash salt '*' state.show_state_usage ''' conflict = _check_...
[ "Retrieve", "the", "highstate", "data", "from", "the", "salt", "master", "to", "analyse", "used", "and", "unused", "states" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1560-L1593
[ "def", "show_state_usage", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "pillar", "=", "kwargs", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_states
Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0
salt/modules/state.py
def show_states(queue=False, **kwargs): ''' Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0 ''' conflict = _check_queue(queue, kwargs) if conflict is not None: asser...
def show_states(queue=False, **kwargs): ''' Returns the list of states that will be applied on highstate. CLI Example: .. code-block:: bash salt '*' state.show_states .. versionadded:: 2019.2.0 ''' conflict = _check_queue(queue, kwargs) if conflict is not None: asser...
[ "Returns", "the", "list", "of", "states", "that", "will", "be", "applied", "on", "highstate", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1596-L1641
[ "def", "show_states", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "assert", "False", "return", "conflict", "opts", "=", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls_id
Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requisites .. versionadded:: 2014.7.0 saltenv : base Sp...
salt/modules/state.py
def sls_id(id_, mods, test=None, queue=False, **kwargs): ''' Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requ...
def sls_id(id_, mods, test=None, queue=False, **kwargs): ''' Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requ...
[ "Call", "a", "single", "ID", "from", "the", "named", "module", "(", "s", ")", "and", "handle", "all", "requisites" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1644-L1760
[ "def", "sls_id", "(", "id_", ",", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "retur...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_low_sls
Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Custom Pillar values, passed as a dictionary of key-value pairs ....
salt/modules/state.py
def show_low_sls(mods, test=None, queue=False, **kwargs): ''' Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Cust...
def show_low_sls(mods, test=None, queue=False, **kwargs): ''' Display the low data from a specific sls. The default environment is ``base``, use ``saltenv`` to specify a different environment. saltenv Specify a salt fileserver environment to be used when applying states pillar Cust...
[ "Display", "the", "low", "data", "from", "a", "specific", "sls", ".", "The", "default", "environment", "is", "base", "use", "saltenv", "to", "specify", "a", "different", "environment", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1763-L1851
[ "def", "show_low_sls", "(", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "confl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls_exists
Tests for the existance the of a specific SLS or list of SLS files on the master. Similar to :py:func:`state.show_sls <salt.modules.state.show_sls>`, rather than returning state details, returns True or False. The default environment is ``base``, use ``saltenv`` to specify a different environment. .. v...
salt/modules/state.py
def sls_exists(mods, test=None, queue=False, **kwargs): ''' Tests for the existance the of a specific SLS or list of SLS files on the master. Similar to :py:func:`state.show_sls <salt.modules.state.show_sls>`, rather than returning state details, returns True or False. The default environment is ``b...
def sls_exists(mods, test=None, queue=False, **kwargs): ''' Tests for the existance the of a specific SLS or list of SLS files on the master. Similar to :py:func:`state.show_sls <salt.modules.state.show_sls>`, rather than returning state details, returns True or False. The default environment is ``b...
[ "Tests", "for", "the", "existance", "the", "of", "a", "specific", "SLS", "or", "list", "of", "SLS", "files", "on", "the", "master", ".", "Similar", "to", ":", "py", ":", "func", ":", "state", ".", "show_sls", "<salt", ".", "modules", ".", "state", "....
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1941-L1963
[ "def", "sls_exists", "(", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "return", "isinstance", "(", "show_sls", "(", "mods", ",", "test", "=", "test", ",", "queue", "=", "queue", ",", "*", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
id_exists
Tests for the existence of a specific ID or list of IDs within the specified SLS file(s). Similar to :py:func:`state.sls_exists <salt.modules.state.sls_exists>`, returns True or False. The default environment is base``, use ``saltenv`` to specify a different environment. .. versionadded:: 2019.2.0 ...
salt/modules/state.py
def id_exists(ids, mods, test=None, queue=False, **kwargs): ''' Tests for the existence of a specific ID or list of IDs within the specified SLS file(s). Similar to :py:func:`state.sls_exists <salt.modules.state.sls_exists>`, returns True or False. The default environment is base``, use ``saltenv`` ...
def id_exists(ids, mods, test=None, queue=False, **kwargs): ''' Tests for the existence of a specific ID or list of IDs within the specified SLS file(s). Similar to :py:func:`state.sls_exists <salt.modules.state.sls_exists>`, returns True or False. The default environment is base``, use ``saltenv`` ...
[ "Tests", "for", "the", "existence", "of", "a", "specific", "ID", "or", "list", "of", "IDs", "within", "the", "specified", "SLS", "file", "(", "s", ")", ".", "Similar", "to", ":", "py", ":", "func", ":", "state", ".", "sls_exists", "<salt", ".", "modu...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1966-L1988
[ "def", "id_exists", "(", "ids", ",", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "ids", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "ids", ")", "ids", "=", "set", "(", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_top
Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top
salt/modules/state.py
def show_top(queue=False, **kwargs): ''' Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top ''' if 'env' in kwargs: # "env" is not supported; Use "saltenv". kwargs.pop('env') conflict = _check_que...
def show_top(queue=False, **kwargs): ''' Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top ''' if 'env' in kwargs: # "env" is not supported; Use "saltenv". kwargs.pop('env') conflict = _check_que...
[ "Return", "the", "top", "data", "that", "the", "minion", "will", "use", "for", "a", "highstate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L1991-L2029
[ "def", "show_top", "(", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "conflict", "=", "_check_queue", "(", "queue", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
single
Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-value maps, as you would in a YAML salt file. Alternatively, JSON ...
salt/modules/state.py
def single(fun, name, test=None, queue=False, **kwargs): ''' Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-v...
def single(fun, name, test=None, queue=False, **kwargs): ''' Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-v...
[ "Execute", "a", "single", "state", "function", "with", "the", "named", "kwargs", "returns", "False", "if", "insufficient", "data", "is", "sent", "to", "the", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2032-L2099
[ "def", "single", "(", "fun", ",", "name", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "retur...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear_cache
Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash salt '*' state.clear_cach...
salt/modules/state.py
def clear_cache(): ''' Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash ...
def clear_cache(): ''' Clear out cached state files, forcing even cache runs to refresh the cache on the next state execution. Remember that the state cache is completely disabled by default, this execution only applies if cache=True is used in states CLI Example: .. code-block:: bash ...
[ "Clear", "out", "cached", "state", "files", "forcing", "even", "cache", "runs", "to", "refresh", "the", "cache", "on", "the", "next", "state", "execution", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2102-L2124
[ "def", "clear_cache", "(", ")", ":", "ret", "=", "[", "]", "for", "fn_", "in", "os", ".", "listdir", "(", "__opts__", "[", "'cachedir'", "]", ")", ":", "if", "fn_", ".", "endswith", "(", "'.cache.p'", ")", ":", "path", "=", "os", ".", "path", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pkg
Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '*' state.pkg /tmp/salt_state.tgz 760a9353810e36f6d81416366fc426dc md5
salt/modules/state.py
def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): ''' Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '...
def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): ''' Execute a packaged state run, the packaged state run will exist in a tarball available locally. This packaged state can be generated using salt-ssh. CLI Example: .. code-block:: bash salt '...
[ "Execute", "a", "packaged", "state", "run", "the", "packaged", "state", "run", "will", "exist", "in", "a", "tarball", "available", "locally", ".", "This", "packaged", "state", "can", "be", "generated", "using", "salt", "-", "ssh", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2127-L2200
[ "def", "pkg", "(", "pkg_path", ",", "pkg_sum", ",", "hash_type", ",", "test", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO - Add ability to download from salt master or other source", "popts", "=", "salt", ".", "utils", ".", "state", ".", "get_sls_opt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable
Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed in a state.sls call. sa...
salt/modules/state.py
def disable(states): ''' Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed...
def disable(states): ''' Disable state runs. CLI Example: .. code-block:: bash salt '*' state.disable highstate salt '*' state.disable highstate,test.succeed_without_changes .. note:: To disable a state file from running provide the same name that would be passed...
[ "Disable", "state", "runs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2203-L2251
[ "def", "disable", "(", "states", ")", ":", "ret", "=", "{", "'res'", ":", "True", ",", "'msg'", ":", "''", "}", "states", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "states", ")", "msg", "=", "[", "]", "_disabled", "=", "__s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enable
Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed in a state.sls call. sa...
salt/modules/state.py
def enable(states): ''' Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed ...
def enable(states): ''' Enable state function or sls run CLI Example: .. code-block:: bash salt '*' state.enable highstate salt '*' state.enable test.succeed_without_changes .. note:: To enable a state file from running provide the same name that would be passed ...
[ "Enable", "state", "function", "or", "sls", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2254-L2304
[ "def", "enable", "(", "states", ")", ":", "ret", "=", "{", "'res'", ":", "True", ",", "'msg'", ":", "''", "}", "states", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "states", ")", "log", ".", "debug", "(", "'states %s'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_disabled
Return messages for disabled states that match state functions in funs.
salt/modules/state.py
def _disabled(funs): ''' Return messages for disabled states that match state functions in funs. ''' ret = [] _disabled = __salt__['grains.get']('state_runs_disabled') for state in funs: for _state in _disabled: if '.*' in _state: target_state = _state.spl...
def _disabled(funs): ''' Return messages for disabled states that match state functions in funs. ''' ret = [] _disabled = __salt__['grains.get']('state_runs_disabled') for state in funs: for _state in _disabled: if '.*' in _state: target_state = _state.spl...
[ "Return", "messages", "for", "disabled", "states", "that", "match", "state", "functions", "in", "funs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2320-L2352
[ "def", "_disabled", "(", "funs", ")", ":", "ret", "=", "[", "]", "_disabled", "=", "__salt__", "[", "'grains.get'", "]", "(", "'state_runs_disabled'", ")", "for", "state", "in", "funs", ":", "for", "_state", "in", "_disabled", ":", "if", "'.*'", "in", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
event
r''' Watch Salt's event bus and block until the given tag is matched .. versionadded:: 2016.3.0 .. versionchanged:: 2019.2.0 ``tagmatch`` can now be either a glob or regular expression. This is useful for utilizing Salt's event bus from shell scripts or for taking simple actions directly f...
salt/modules/state.py
def event(tagmatch='*', count=-1, quiet=False, sock_dir=None, pretty=False, node='minion'): r''' Watch Salt's event bus and block until the given tag is matched .. versionadded:: 2016.3.0 .. versionchanged:: 2019.2.0 ``tagmatch`` can now be eith...
def event(tagmatch='*', count=-1, quiet=False, sock_dir=None, pretty=False, node='minion'): r''' Watch Salt's event bus and block until the given tag is matched .. versionadded:: 2016.3.0 .. versionchanged:: 2019.2.0 ``tagmatch`` can now be eith...
[ "r", "Watch", "Salt", "s", "event", "bus", "and", "block", "until", "the", "given", "tag", "is", "matched" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L2355-L2422
[ "def", "event", "(", "tagmatch", "=", "'*'", ",", "count", "=", "-", "1", ",", "quiet", "=", "False", ",", "sock_dir", "=", "None", ",", "pretty", "=", "False", ",", "node", "=", "'minion'", ")", ":", "sevent", "=", "salt", ".", "utils", ".", "ev...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Ensure that a grain is set name The grain name delimiter A delimiter different from the default can be provided. Check whether a grain exists. Does not attempt to check or set the value.
salt/states/grains.py
def exists(name, delimiter=DEFAULT_TARGET_DELIM): ''' Ensure that a grain is set name The grain name delimiter A delimiter different from the default can be provided. Check whether a grain exists. Does not attempt to check or set the value. ''' name = re.sub(delimiter, DEF...
def exists(name, delimiter=DEFAULT_TARGET_DELIM): ''' Ensure that a grain is set name The grain name delimiter A delimiter different from the default can be provided. Check whether a grain exists. Does not attempt to check or set the value. ''' name = re.sub(delimiter, DEF...
[ "Ensure", "that", "a", "grain", "is", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L23-L45
[ "def", "exists", "(", "name", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that a grain is set .. versionchanged:: v2015.8.2 name The grain name value The value to set on the grain force If force is True, the existing grain will be overwritten regardless of its existing or provided value type. Defaults to False .. versionadde...
salt/states/grains.py
def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False): ''' Ensure that a grain is set .. versionchanged:: v2015.8.2 name The grain name value The value to set on the grain force If force is True, the existing grain will be overwritten regardles...
def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False): ''' Ensure that a grain is set .. versionchanged:: v2015.8.2 name The grain name value The value to set on the grain force If force is True, the existing grain will be overwritten regardles...
[ "Ensure", "that", "a", "grain", "is", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L48-L124
[ "def", "present", "(", "name", ",", "value", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ",", "force", "=", "False", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_present
.. versionadded:: 2014.1.0 Ensure the value is present in the list-type grain. Note: If the grain that is provided in ``name`` is not present on the system, this new grain will be created with the corresponding provided value. name The grain name. value The value is present in the...
salt/states/grains.py
def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 2014.1.0 Ensure the value is present in the list-type grain. Note: If the grain that is provided in ``name`` is not present on the system, this new grain will be created with the corresponding provided value. ...
def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 2014.1.0 Ensure the value is present in the list-type grain. Note: If the grain that is provided in ``name`` is not present on the system, this new grain will be created with the corresponding provided value. ...
[ "..", "versionadded", "::", "2014", ".", "1", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L127-L219
[ "def", "list_present", "(", "name", ",", "value", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'chan...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_absent
Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be provided. .. versionadded:: v2015.8.2 The grain should be `l...
salt/states/grains.py
def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be ...
def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): ''' Delete a value from a grain formed as a list. .. versionadded:: 2014.1.0 name The grain name. value The value to delete from the grain list. delimiter A delimiter different from the default ``:`` can be ...
[ "Delete", "a", "value", "from", "a", "grain", "formed", "as", "a", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L222-L295
[ "def", "list_absent", "(", "name", ",", "value", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'chang...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
.. versionadded:: 2014.7.0 Delete a grain from the grains config file name The grain name destructive If destructive is True, delete the entire grain. If destructive is False, set the grain's value to None. Defaults to False. force If force is True, the existing grain...
salt/states/grains.py
def absent(name, destructive=False, delimiter=DEFAULT_TARGET_DELIM, force=False): ''' .. versionadded:: 2014.7.0 Delete a grain from the grains config file name The grain name destructive If destructive is True, delete the entire grain. If ...
def absent(name, destructive=False, delimiter=DEFAULT_TARGET_DELIM, force=False): ''' .. versionadded:: 2014.7.0 Delete a grain from the grains config file name The grain name destructive If destructive is True, delete the entire grain. If ...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L298-L386
[ "def", "absent", "(", "name", ",", "destructive", "=", "False", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ",", "force", "=", "False", ")", ":", "_non_existent", "=", "object", "(", ")", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
append
.. versionadded:: 2014.7.0 Append a value to a list in the grains config file. The grain that is being appended to (name) must exist before the new value can be added. name The grain name value The value to append convert If convert is True, convert non-list contents into...
salt/states/grains.py
def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 2014.7.0 Append a value to a list in the grains config file. The grain that is being appended to (name) must exist before the new value can be added. name The grain name value ...
def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 2014.7.0 Append a value to a list in the grains config file. The grain that is being appended to (name) must exist before the new value can be added. name The grain name value ...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grains.py#L389-L464
[ "def", "append", "(", "name", ",", "value", ",", "convert", "=", "False", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "name", "=", "re", ".", "sub", "(", "delimiter", ",", "DEFAULT_TARGET_DELIM", ",", "name", ")", "ret", "=", "{", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_clear_context
Clear variables stored in __context__. Run this function when a new version of chocolatey is installed.
salt/modules/chocolatey.py
def _clear_context(context): ''' Clear variables stored in __context__. Run this function when a new version of chocolatey is installed. ''' for var in (x for x in __context__ if x.startswith('chocolatey.')): context.pop(var)
def _clear_context(context): ''' Clear variables stored in __context__. Run this function when a new version of chocolatey is installed. ''' for var in (x for x in __context__ if x.startswith('chocolatey.')): context.pop(var)
[ "Clear", "variables", "stored", "in", "__context__", ".", "Run", "this", "function", "when", "a", "new", "version", "of", "chocolatey", "is", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L51-L57
[ "def", "_clear_context", "(", "context", ")", ":", "for", "var", "in", "(", "x", "for", "x", "in", "__context__", "if", "x", ".", "startswith", "(", "'chocolatey.'", ")", ")", ":", "context", ".", "pop", "(", "var", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_yes
Returns ['--yes'] if on v0.9.9.0 or later, otherwise returns an empty list
salt/modules/chocolatey.py
def _yes(context): ''' Returns ['--yes'] if on v0.9.9.0 or later, otherwise returns an empty list ''' if 'chocolatey._yes' in __context__: return context['chocolatey._yes'] if _LooseVersion(chocolatey_version()) >= _LooseVersion('0.9.9'): answer = ['--yes'] else: answer =...
def _yes(context): ''' Returns ['--yes'] if on v0.9.9.0 or later, otherwise returns an empty list ''' if 'chocolatey._yes' in __context__: return context['chocolatey._yes'] if _LooseVersion(chocolatey_version()) >= _LooseVersion('0.9.9'): answer = ['--yes'] else: answer =...
[ "Returns", "[", "--", "yes", "]", "if", "on", "v0", ".", "9", ".", "9", ".", "0", "or", "later", "otherwise", "returns", "an", "empty", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L60-L71
[ "def", "_yes", "(", "context", ")", ":", "if", "'chocolatey._yes'", "in", "__context__", ":", "return", "context", "[", "'chocolatey._yes'", "]", "if", "_LooseVersion", "(", "chocolatey_version", "(", ")", ")", ">=", "_LooseVersion", "(", "'0.9.9'", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_no_progress
Returns ['--no-progress'] if on v0.10.4 or later, otherwise returns an empty list
salt/modules/chocolatey.py
def _no_progress(context): ''' Returns ['--no-progress'] if on v0.10.4 or later, otherwise returns an empty list ''' if 'chocolatey._no_progress' in __context__: return context['chocolatey._no_progress'] if _LooseVersion(chocolatey_version()) >= _LooseVersion('0.10.4'): answer = ...
def _no_progress(context): ''' Returns ['--no-progress'] if on v0.10.4 or later, otherwise returns an empty list ''' if 'chocolatey._no_progress' in __context__: return context['chocolatey._no_progress'] if _LooseVersion(chocolatey_version()) >= _LooseVersion('0.10.4'): answer = ...
[ "Returns", "[", "--", "no", "-", "progress", "]", "if", "on", "v0", ".", "10", ".", "4", "or", "later", "otherwise", "returns", "an", "empty", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L74-L87
[ "def", "_no_progress", "(", "context", ")", ":", "if", "'chocolatey._no_progress'", "in", "__context__", ":", "return", "context", "[", "'chocolatey._no_progress'", "]", "if", "_LooseVersion", "(", "chocolatey_version", "(", ")", ")", ">=", "_LooseVersion", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_find_chocolatey
Returns the full path to chocolatey.bat on the host.
salt/modules/chocolatey.py
def _find_chocolatey(context, salt): ''' Returns the full path to chocolatey.bat on the host. ''' if 'chocolatey._path' in context: return context['chocolatey._path'] choc_defaults = ['C:\\Chocolatey\\bin\\chocolatey.bat', 'C:\\ProgramData\\Chocolatey\\bin\\chocolatey.ex...
def _find_chocolatey(context, salt): ''' Returns the full path to chocolatey.bat on the host. ''' if 'chocolatey._path' in context: return context['chocolatey._path'] choc_defaults = ['C:\\Chocolatey\\bin\\chocolatey.bat', 'C:\\ProgramData\\Chocolatey\\bin\\chocolatey.ex...
[ "Returns", "the", "full", "path", "to", "chocolatey", ".", "bat", "on", "the", "host", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L90-L109
[ "def", "_find_chocolatey", "(", "context", ",", "salt", ")", ":", "if", "'chocolatey._path'", "in", "context", ":", "return", "context", "[", "'chocolatey._path'", "]", "choc_defaults", "=", "[", "'C:\\\\Chocolatey\\\\bin\\\\chocolatey.bat'", ",", "'C:\\\\ProgramData\\\...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
chocolatey_version
Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version
salt/modules/chocolatey.py
def chocolatey_version(): ''' Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version ''' if 'chocolatey._version' in __context__: return __context__['chocolatey._version'] cmd = [_find_chocolatey...
def chocolatey_version(): ''' Returns the version of Chocolatey installed on the minion. CLI Example: .. code-block:: bash salt '*' chocolatey.chocolatey_version ''' if 'chocolatey._version' in __context__: return __context__['chocolatey._version'] cmd = [_find_chocolatey...
[ "Returns", "the", "version", "of", "Chocolatey", "installed", "on", "the", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L112-L130
[ "def", "chocolatey_version", "(", ")", ":", "if", "'chocolatey._version'", "in", "__context__", ":", "return", "__context__", "[", "'chocolatey._version'", "]", "cmd", "=", "[", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "]", "cmd", ".", "appe...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
bootstrap
Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these prerequisites are met by downloading and ...
salt/modules/chocolatey.py
def bootstrap(force=False): ''' Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these p...
def bootstrap(force=False): ''' Download and install the latest version of the Chocolatey package manager via the official bootstrap. Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these p...
[ "Download", "and", "install", "the", "latest", "version", "of", "the", "Chocolatey", "package", "manager", "via", "the", "official", "bootstrap", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L133-L226
[ "def", "bootstrap", "(", "force", "=", "False", ")", ":", "# Check if Chocolatey is already present in the path", "try", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "except", "CommandExecutionError", ":", "choc_path", "=", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results. Searches against name/description/tag. Default is None. all_versions (bool): Display all available package versions in results. Default ...
salt/modules/chocolatey.py
def list_(narrow=None, all_versions=False, pre_versions=False, source=None, local_only=False, exact=False): ''' Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results....
def list_(narrow=None, all_versions=False, pre_versions=False, source=None, local_only=False, exact=False): ''' Instructs Chocolatey to pull a vague package list from the repository. Args: narrow (str): Term used to narrow down results....
[ "Instructs", "Chocolatey", "to", "pull", "a", "vague", "package", "list", "from", "the", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L229-L311
[ "def", "list_", "(", "narrow", "=", "None", ",", "all_versions", "=", "False", ",", "pre_versions", "=", "False", ",", "source", "=", "None", ",", "local_only", "=", "False", ",", "exact", "=", "False", ")", ":", "choc_path", "=", "_find_chocolatey", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_windowsfeatures
Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfeatures
salt/modules/chocolatey.py
def list_windowsfeatures(): ''' Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfe...
def list_windowsfeatures(): ''' Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool. Returns: str: List of Windows Features CLI Example: .. code-block:: bash salt '*' chocolatey.list_windowsfe...
[ "Instructs", "Chocolatey", "to", "pull", "a", "full", "package", "list", "from", "the", "Windows", "Features", "list", "via", "the", "Deployment", "Image", "Servicing", "and", "Management", "tool", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L340-L363
[ "def", "list_windowsfeatures", "(", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'list'", ",", "'--source'", ",", "'windowsfeatures'", "]", "result", "=", "__salt__", "[", "'cmd.r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_cygwin
Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation process i.e product key or feature list override_args Set to tr...
salt/modules/chocolatey.py
def install_cygwin(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation proces...
def install_cygwin(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Cygwin. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation proces...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Cygwin", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L496-L523
[ "def", "install_cygwin", "(", "name", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "source", "=", "'cygwin'", ",", "install_args", "=", "install_args", ",", "override_args", "=", "over...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_gem
Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to latest version available. install_args A list of install arguments you wa...
salt/modules/chocolatey.py
def install_gem(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to lates...
def install_gem(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Ruby's Gems. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to lates...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Ruby", "s", "Gems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L526-L560
[ "def", "install_gem", "(", "name", ",", "version", "=", "None", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "version", "=", "version", ",", "source", "=", "'ruby'", ",", "install_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_missing
Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` instead, as ``installmissing`` is deprecated as of that ver...
salt/modules/chocolatey.py
def install_missing(name, version=None, source=None): ''' Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` i...
def install_missing(name, version=None, source=None): ''' Instructs Chocolatey to install a package if it doesn't already exist. .. versionchanged:: 2014.7.0 If the minion has Chocolatey >= 0.9.8.24 installed, this function calls :mod:`chocolatey.install <salt.modules.chocolatey.install>` i...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "if", "it", "doesn", "t", "already", "exist", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L563-L611
[ "def", "install_missing", "(", "name", ",", "version", "=", "None", ",", "source", "=", "None", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "if", "_LooseVersion", "(", "chocolatey_version", "(", ")", ")", ">=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_python
Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defaults to latest version available. install_args A list of install argume...
salt/modules/chocolatey.py
def install_python(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defa...
def install_python(name, version=None, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via Python's easy_install. name The name of the package to be installed. Only accepts a single argument. version Install a specific version of the package. Defa...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "Python", "s", "easy_install", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L614-L647
[ "def", "install_python", "(", "name", ",", "version", "=", "None", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "version", "=", "version", ",", "source", "=", "'python'", ",", "ins...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_webpi
Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to the installation process i.e product key or feature list override_...
salt/modules/chocolatey.py
def install_webpi(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to th...
def install_webpi(name, install_args=None, override_args=False): ''' Instructs Chocolatey to install a package via the Microsoft Web PI service. name The name of the package to be installed. Only accepts a single argument. install_args A list of install arguments you want to pass to th...
[ "Instructs", "Chocolatey", "to", "install", "a", "package", "via", "the", "Microsoft", "Web", "PI", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L667-L694
[ "def", "install_webpi", "(", "name", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "return", "install", "(", "name", ",", "source", "=", "'webpi'", ",", "install_args", "=", "install_args", ",", "override_args", "=", "overri...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall
Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest version installed. uninstall_args A list of uninstall arguments you...
salt/modules/chocolatey.py
def uninstall(name, version=None, uninstall_args=None, override_args=False): ''' Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest...
def uninstall(name, version=None, uninstall_args=None, override_args=False): ''' Instructs Chocolatey to uninstall a package. name The name of the package to be uninstalled. Only accepts a single argument. version Uninstalls a specific version of the package. Defaults to latest...
[ "Instructs", "Chocolatey", "to", "uninstall", "a", "package", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L697-L744
[ "def", "uninstall", "(", "name", ",", "version", "=", "None", ",", "uninstall_args", "=", "None", ",", "override_args", "=", "False", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "# chocolatey helpfully only supports a ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
upgrade
.. versionadded:: 2016.3.4 Instructs Chocolatey to upgrade packages on the system. (update is being deprecated). This command will install the package if not installed. Args: name (str): The name of the package to update, or "all" to update everything installed on the syst...
salt/modules/chocolatey.py
def upgrade(name, version=None, source=None, force=False, pre_versions=False, install_args=None, override_args=False, force_x86=False, package_args=None): ''' .. versionadded:: 2016.3.4 Instructs Chocolatey to u...
def upgrade(name, version=None, source=None, force=False, pre_versions=False, install_args=None, override_args=False, force_x86=False, package_args=None): ''' .. versionadded:: 2016.3.4 Instructs Chocolatey to u...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "4" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L747-L839
[ "def", "upgrade", "(", "name", ",", "version", "=", "None", ",", "source", "=", "None", ",", "force", "=", "False", ",", "pre_versions", "=", "False", ",", "install_args", "=", "None", ",", "override_args", "=", "False", ",", "force_x86", "=", "False", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the package comes from. Defaults to the official Chocolatey f...
salt/modules/chocolatey.py
def update(name, source=None, pre_versions=False): ''' Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the pa...
def update(name, source=None, pre_versions=False): ''' Instructs Chocolatey to update packages on the system. name The name of the package to update, or "all" to update everything installed on the system. source Chocolatey repository (directory, share or remote URL feed) the pa...
[ "Instructs", "Chocolatey", "to", "update", "packages", "on", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L842-L887
[ "def", "update", "(", "name", ",", "source", "=", "None", ",", "pre_versions", "=", "False", ")", ":", "# chocolatey helpfully only supports a single package argument", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "if", "_LooseVersio...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote (bool): Get the version number of the latest package from the remote fe...
salt/modules/chocolatey.py
def version(name, check_remote=False, source=None, pre_versions=False): ''' Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote...
def version(name, check_remote=False, source=None, pre_versions=False): ''' Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed. Args: name (str): The name of the package to check. Required. check_remote...
[ "Instructs", "Chocolatey", "to", "check", "an", "installed", "package", "version", "and", "optionally", "compare", "it", "to", "one", "available", "from", "a", "remote", "feed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L890-L945
[ "def", "version", "(", "name", ",", "check_remote", "=", "False", ",", "source", "=", "None", ",", "pre_versions", "=", "False", ")", ":", "installed", "=", "list_", "(", "narrow", "=", "name", ",", "local_only", "=", "True", ")", "installed", "=", "{"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_source
Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey sources that need authentication credentials. password Provi...
salt/modules/chocolatey.py
def add_source(name, source_location, username=None, password=None): ''' Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey ...
def add_source(name, source_location, username=None, password=None): ''' Instructs Chocolatey to add a source. name The name of the source to be added as a chocolatey repository. source Location of the source you want to work with. username Provide username for chocolatey ...
[ "Instructs", "Chocolatey", "to", "add", "a", "source", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L948-L987
[ "def", "add_source", "(", "name", ",", "source_location", ",", "username", "=", "None", ",", "password", "=", "None", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'sources'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_change_source_state
Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository.
salt/modules/chocolatey.py
def _change_source_state(name, state): ''' Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository. ''' choc_path = _find_chocolatey(__context__, __salt__) cmd = [choc_path, 'sourc...
def _change_source_state(name, state): ''' Instructs Chocolatey to change the state of a source. name Name of the repository to affect. state State in which you want the chocolatey repository. ''' choc_path = _find_chocolatey(__context__, __salt__) cmd = [choc_path, 'sourc...
[ "Instructs", "Chocolatey", "to", "change", "the", "state", "of", "a", "source", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chocolatey.py#L990-L1010
[ "def", "_change_source_state", "(", "name", ",", "state", ")", ":", "choc_path", "=", "_find_chocolatey", "(", "__context__", ",", "__salt__", ")", "cmd", "=", "[", "choc_path", ",", "'source'", ",", "state", ",", "'--name'", ",", "name", "]", "result", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name>
salt/modules/layman.py
def add(overlay): ''' Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name> ...
def add(overlay): ''' Add the given overlay from the cached remote list to your locally installed overlays. Specify 'ALL' to add all overlays from the remote list. Return a list of the new overlay(s) added: CLI Example: .. code-block:: bash salt '*' layman.add <overlay name> ...
[ "Add", "the", "given", "overlay", "from", "the", "cached", "remote", "list", "to", "your", "locally", "installed", "overlays", ".", "Specify", "ALL", "to", "add", "all", "overlays", "from", "the", "remote", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L33-L65
[ "def", "add", "(", "overlay", ")", ":", "ret", "=", "list", "(", ")", "old_overlays", "=", "list_local", "(", ")", "cmd", "=", "'layman --quietness=0 --add {0}'", ".", "format", "(", "overlay", ")", "add_attempt", "=", "__salt__", "[", "'cmd.run_all'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name>
salt/modules/layman.py
def delete(overlay): ''' Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name> ''' ret = list() o...
def delete(overlay): ''' Remove the given overlay from the your locally installed overlays. Specify 'ALL' to remove all overlays. Return a list of the overlays(s) that were removed: CLI Example: .. code-block:: bash salt '*' layman.delete <overlay name> ''' ret = list() o...
[ "Remove", "the", "given", "overlay", "from", "the", "your", "locally", "installed", "overlays", ".", "Specify", "ALL", "to", "remove", "all", "overlays", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L68-L98
[ "def", "delete", "(", "overlay", ")", ":", "ret", "=", "list", "(", ")", "old_overlays", "=", "list_local", "(", ")", "cmd", "=", "'layman --quietness=0 --delete {0}'", ".", "format", "(", "overlay", ")", "delete_attempt", "=", "__salt__", "[", "'cmd.run_all'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_local
List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local
salt/modules/layman.py
def list_local(): ''' List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local ''' cmd = 'layman --quietness=1 --list-local --nocolor' out = __salt__['cmd.run'](cmd, python_shell=False).split('\n') ...
def list_local(): ''' List the locally installed overlays. Return a list of installed overlays: CLI Example: .. code-block:: bash salt '*' layman.list_local ''' cmd = 'layman --quietness=1 --list-local --nocolor' out = __salt__['cmd.run'](cmd, python_shell=False).split('\n') ...
[ "List", "the", "locally", "installed", "overlays", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/layman.py#L119-L134
[ "def", "list_local", "(", ")", ":", "cmd", "=", "'layman --quietness=1 --list-local --nocolor'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "split", "(", "'\\n'", ")", "ret", "=", "[", "line", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__django_auth_setup
Prepare the connection to the Django authentication framework
salt/auth/django.py
def __django_auth_setup(): ''' Prepare the connection to the Django authentication framework ''' if django.VERSION >= (1, 7): django.setup() global DJANGO_AUTH_CLASS if DJANGO_AUTH_CLASS is not None: return # Versions 1.7 and later of Django don't pull models until # t...
def __django_auth_setup(): ''' Prepare the connection to the Django authentication framework ''' if django.VERSION >= (1, 7): django.setup() global DJANGO_AUTH_CLASS if DJANGO_AUTH_CLASS is not None: return # Versions 1.7 and later of Django don't pull models until # t...
[ "Prepare", "the", "connection", "to", "the", "Django", "authentication", "framework" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/django.py#L93-L116
[ "def", "__django_auth_setup", "(", ")", ":", "if", "django", ".", "VERSION", ">=", "(", "1", ",", "7", ")", ":", "django", ".", "setup", "(", ")", "global", "DJANGO_AUTH_CLASS", "if", "DJANGO_AUTH_CLASS", "is", "not", "None", ":", "return", "# Versions 1.7...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auth
Simple Django auth
salt/auth/django.py
def auth(username, password): ''' Simple Django auth ''' django_auth_path = __opts__['django_auth_path'] if django_auth_path not in sys.path: sys.path.append(django_auth_path) os.environ.setdefault('DJANGO_SETTINGS_MODULE', __opts__['django_auth_settings']) __django_auth_setup() ...
def auth(username, password): ''' Simple Django auth ''' django_auth_path = __opts__['django_auth_path'] if django_auth_path not in sys.path: sys.path.append(django_auth_path) os.environ.setdefault('DJANGO_SETTINGS_MODULE', __opts__['django_auth_settings']) __django_auth_setup() ...
[ "Simple", "Django", "auth" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/django.py#L119-L144
[ "def", "auth", "(", "username", ",", "password", ")", ":", "django_auth_path", "=", "__opts__", "[", "'django_auth_path'", "]", "if", "django_auth_path", "not", "in", "sys", ".", "path", ":", "sys", ".", "path", ".", "append", "(", "django_auth_path", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
confirm_top
Takes the data passed to a top file environment and determines if the data matches this minion
salt/matchers/confirm_top.py
def confirm_top(match, data, nodegroups=None): ''' Takes the data passed to a top file environment and determines if the data matches this minion ''' matcher = 'compound' if not data: log.error('Received bad data when setting the match from the top ' 'file') ret...
def confirm_top(match, data, nodegroups=None): ''' Takes the data passed to a top file environment and determines if the data matches this minion ''' matcher = 'compound' if not data: log.error('Received bad data when setting the match from the top ' 'file') ret...
[ "Takes", "the", "data", "passed", "to", "a", "top", "file", "environment", "and", "determines", "if", "the", "data", "matches", "this", "minion" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/confirm_top.py#L15-L36
[ "def", "confirm_top", "(", "match", ",", "data", ",", "nodegroups", "=", "None", ")", ":", "matcher", "=", "'compound'", "if", "not", "data", ":", "log", ".", "error", "(", "'Received bad data when setting the match from the top '", "'file'", ")", "return", "Fal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_installed
List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed
salt/modules/win_servermanager.py
def list_installed(): ''' List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed ''' cmd = 'Get-WindowsFeature ' \...
def list_installed(): ''' List installed features. Supported on Windows Server 2008 and Windows 8 and newer. Returns: dict: A dictionary of installed features CLI Example: .. code-block:: bash salt '*' win_servermanager.list_installed ''' cmd = 'Get-WindowsFeature ' \...
[ "List", "installed", "features", ".", "Supported", "on", "Windows", "Server", "2008", "and", "Windows", "8", "and", "newer", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L108-L133
[ "def", "list_installed", "(", ")", ":", "cmd", "=", "'Get-WindowsFeature '", "'-ErrorAction SilentlyContinue '", "'-WarningAction SilentlyContinue '", "'| Select DisplayName,Name,Installed'", "features", "=", "_pshell_json", "(", "cmd", ")", "ret", "=", "{", "}", "for", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time to complete un/installation, set -t with a long timeout Args: ...
salt/modules/win_servermanager.py
def install(feature, recurse=False, restart=False, source=None, exclude=None): r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time ...
def install(feature, recurse=False, restart=False, source=None, exclude=None): r''' Install a feature .. note:: Some features require reboot after un/installation, if so until the server is restarted other features can not be installed! .. note:: Some features take a long time ...
[ "r", "Install", "a", "feature" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L136-L298
[ "def", "install", "(", "feature", ",", "recurse", "=", "False", ",", "restart", "=", "False", ",", "source", "=", "None", ",", "exclude", "=", "None", ")", ":", "# If it is a list of features, make it a comma delimited string", "if", "isinstance", "(", "feature", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additionally, some features take a while to complete install...
salt/modules/win_servermanager.py
def remove(feature, remove_payload=False, restart=False): r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additi...
def remove(feature, remove_payload=False, restart=False): r''' Remove an installed feature .. note:: Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additi...
[ "r", "Remove", "an", "installed", "feature" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_servermanager.py#L301-L407
[ "def", "remove", "(", "feature", ",", "remove_payload", "=", "False", ",", "restart", "=", "False", ")", ":", "# If it is a list of features, make it a comma delimited string", "if", "isinstance", "(", "feature", ",", "list", ")", ":", "feature", "=", "','", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
scan
List networks on a wireless interface CLI Examples: salt minion iwtools.scan wlp3s0 salt minion iwtools.scan wlp3s0 list
salt/modules/iwtools.py
def scan(iface, style=None): ''' List networks on a wireless interface CLI Examples: salt minion iwtools.scan wlp3s0 salt minion iwtools.scan wlp3s0 list ''' if not _valid_iface(iface): raise SaltInvocationError( 'The interface specified is not valid' ) ...
def scan(iface, style=None): ''' List networks on a wireless interface CLI Examples: salt minion iwtools.scan wlp3s0 salt minion iwtools.scan wlp3s0 list ''' if not _valid_iface(iface): raise SaltInvocationError( 'The interface specified is not valid' ) ...
[ "List", "networks", "on", "a", "wireless", "interface" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iwtools.py#L28-L75
[ "def", "scan", "(", "iface", ",", "style", "=", "None", ")", ":", "if", "not", "_valid_iface", "(", "iface", ")", ":", "raise", "SaltInvocationError", "(", "'The interface specified is not valid'", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_mode
List networks on a wireless interface CLI Example: salt minion iwtools.set_mode wlp3s0 Managed
salt/modules/iwtools.py
def set_mode(iface, mode): ''' List networks on a wireless interface CLI Example: salt minion iwtools.set_mode wlp3s0 Managed ''' if not _valid_iface(iface): raise SaltInvocationError( 'The interface specified is not valid' ) valid_modes = ('Managed', 'Ad-H...
def set_mode(iface, mode): ''' List networks on a wireless interface CLI Example: salt minion iwtools.set_mode wlp3s0 Managed ''' if not _valid_iface(iface): raise SaltInvocationError( 'The interface specified is not valid' ) valid_modes = ('Managed', 'Ad-H...
[ "List", "networks", "on", "a", "wireless", "interface" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iwtools.py#L78-L100
[ "def", "set_mode", "(", "iface", ",", "mode", ")", ":", "if", "not", "_valid_iface", "(", "iface", ")", ":", "raise", "SaltInvocationError", "(", "'The interface specified is not valid'", ")", "valid_modes", "=", "(", "'Managed'", ",", "'Ad-Hoc'", ",", "'Master'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_interfaces
List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces
salt/modules/iwtools.py
def list_interfaces(style=None): ''' List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces ''' ret = {} tmp = None iface = None out = __salt__['cmd.run']('iwconfig') for line in out.splitlines(): if not line: continue ...
def list_interfaces(style=None): ''' List all of the wireless interfaces CLI Example: salt minion iwtools.list_interfaces ''' ret = {} tmp = None iface = None out = __salt__['cmd.run']('iwconfig') for line in out.splitlines(): if not line: continue ...
[ "List", "all", "of", "the", "wireless", "interfaces" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iwtools.py#L113-L155
[ "def", "list_interfaces", "(", "style", "=", "None", ")", ":", "ret", "=", "{", "}", "tmp", "=", "None", "iface", "=", "None", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'iwconfig'", ")", "for", "line", "in", "out", ".", "splitlines", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
validate
Validate the beacon configuration
salt/beacons/smartos_vmadm.py
def validate(config): ''' Validate the beacon configuration ''' vcfg_ret = True vcfg_msg = 'Valid beacon configuration' if not isinstance(config, list): vcfg_ret = False vcfg_msg = 'Configuration for vmadm beacon must be a list!' return vcfg_ret, vcfg_msg
def validate(config): ''' Validate the beacon configuration ''' vcfg_ret = True vcfg_msg = 'Valid beacon configuration' if not isinstance(config, list): vcfg_ret = False vcfg_msg = 'Configuration for vmadm beacon must be a list!' return vcfg_ret, vcfg_msg
[ "Validate", "the", "beacon", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/smartos_vmadm.py#L55-L66
[ "def", "validate", "(", "config", ")", ":", "vcfg_ret", "=", "True", "vcfg_msg", "=", "'Valid beacon configuration'", "if", "not", "isinstance", "(", "config", ",", "list", ")", ":", "vcfg_ret", "=", "False", "vcfg_msg", "=", "'Configuration for vmadm beacon must ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
Poll vmadm for changes
salt/beacons/smartos_vmadm.py
def beacon(config): ''' Poll vmadm for changes ''' ret = [] # NOTE: lookup current images current_vms = __salt__['vmadm.list']( keyed=True, order='uuid,state,alias,hostname,dns_domain', ) # NOTE: apply configuration if VMADM_STATE['first_run']: log.info('App...
def beacon(config): ''' Poll vmadm for changes ''' ret = [] # NOTE: lookup current images current_vms = __salt__['vmadm.list']( keyed=True, order='uuid,state,alias,hostname,dns_domain', ) # NOTE: apply configuration if VMADM_STATE['first_run']: log.info('App...
[ "Poll", "vmadm", "for", "changes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/smartos_vmadm.py#L69-L139
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "# NOTE: lookup current images", "current_vms", "=", "__salt__", "[", "'vmadm.list'", "]", "(", "keyed", "=", "True", ",", "order", "=", "'uuid,state,alias,hostname,dns_domain'", ",", ")", "# NOTE: ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tsql_query
Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True
salt/modules/mssql.py
def tsql_query(query, **kwargs): ''' Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True ...
def tsql_query(query, **kwargs): ''' Run a SQL query and return query result as list of tuples, or a list of dictionaries if as_dict was passed, or an empty list if no data is available. CLI Example: .. code-block:: bash salt minion mssql.tsql_query 'SELECT @@version as version' as_dict=True ...
[ "Run", "a", "SQL", "query", "and", "return", "query", "result", "as", "list", "of", "tuples", "or", "a", "list", "of", "dictionaries", "if", "as_dict", "was", "passed", "or", "an", "empty", "list", "if", "no", "data", "is", "available", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L74-L91
[ "def", "tsql_query", "(", "query", ",", "*", "*", "kwargs", ")", ":", "try", ":", "cur", "=", "_get_connection", "(", "*", "*", "kwargs", ")", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "query", ")", "# Making sure the result is JSON serializable...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_create
Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME
salt/modules/mssql.py
def db_create(database, containment='NONE', new_database_options=None, **kwargs): ''' Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME '''...
def db_create(database, containment='NONE', new_database_options=None, **kwargs): ''' Creates a new database. Does not update options of existing databases. new_database_options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.db_create DB_NAME '''...
[ "Creates", "a", "new", "database", ".", "Does", "not", "update", "options", "of", "existing", "databases", ".", "new_database_options", "can", "only", "be", "a", "list", "of", "strings" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L134-L164
[ "def", "db_create", "(", "database", ",", "containment", "=", "'NONE'", ",", "new_database_options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "containment", "not", "in", "[", "'NONE'", ",", "'PARTIAL'", "]", ":", "return", "'CONTAINMENT can be o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_remove
Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME'
salt/modules/mssql.py
def db_remove(database_name, **kwargs): ''' Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME' ''' try: if db_exists(database_...
def db_remove(database_name, **kwargs): ''' Drops a specific database from the MS SQL server. It will not drop any of 'master', 'model', 'msdb' or 'tempdb'. CLI Example: .. code-block:: bash salt minion mssql.db_remove database_name='DBNAME' ''' try: if db_exists(database_...
[ "Drops", "a", "specific", "database", "from", "the", "MS", "SQL", "server", ".", "It", "will", "not", "drop", "any", "of", "master", "model", "msdb", "or", "tempdb", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L167-L191
[ "def", "db_remove", "(", "database_name", ",", "*", "*", "kwargs", ")", ":", "try", ":", "if", "db_exists", "(", "database_name", ",", "*", "*", "kwargs", ")", "and", "database_name", "not", "in", "[", "'master'", ",", "'model'", ",", "'msdb'", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_exists
Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner
salt/modules/mssql.py
def role_exists(role, **kwargs): ''' Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner ''' # We should get one, and only one row return len(tsql_query(query='sp_helprole "{0}"'.format(role), as_dict=True, **kwargs)) == 1
def role_exists(role, **kwargs): ''' Checks if a role exists. CLI Example: .. code-block:: bash salt minion mssql.role_exists db_owner ''' # We should get one, and only one row return len(tsql_query(query='sp_helprole "{0}"'.format(role), as_dict=True, **kwargs)) == 1
[ "Checks", "if", "a", "role", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L208-L220
[ "def", "role_exists", "(", "role", ",", "*", "*", "kwargs", ")", ":", "# We should get one, and only one row", "return", "len", "(", "tsql_query", "(", "query", "=", "'sp_helprole \"{0}\"'", ".", "format", "(", "role", ")", ",", "as_dict", "=", "True", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_create
Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash salt minion mssql.role_create role=product01 owner=sysdba gran...
salt/modules/mssql.py
def role_create(role, owner=None, grants=None, **kwargs): ''' Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash ...
def role_create(role, owner=None, grants=None, **kwargs): ''' Creates a new database role. If no owner is specified, the role will be owned by the user that executes CREATE ROLE, which is the user argument or mssql.user option. grants is list of strings. CLI Example: .. code-block:: bash ...
[ "Creates", "a", "new", "database", "role", ".", "If", "no", "owner", "is", "specified", "the", "role", "will", "be", "owned", "by", "the", "user", "that", "executes", "CREATE", "ROLE", "which", "is", "the", "user", "argument", "or", "mssql", ".", "user",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L223-L257
[ "def", "role_create", "(", "role", ",", "owner", "=", "None", ",", "grants", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "grants", ":", "grants", "=", "[", "]", "sql", "=", "'CREATE ROLE {0}'", ".", "format", "(", "role", ")", "if"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_remove
Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01
salt/modules/mssql.py
def role_remove(role, **kwargs): ''' Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01 ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute('DROP ROLE {0}'...
def role_remove(role, **kwargs): ''' Remove a database role. CLI Example: .. code-block:: bash salt minion mssql.role_create role=test_role01 ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute('DROP ROLE {0}'...
[ "Remove", "a", "database", "role", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L260-L279
[ "def", "role_remove", "(", "role", ",", "*", "*", "kwargs", ")", ":", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn", ".", "autocommit", "(", "True", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "cur", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
login_exists
Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN'
salt/modules/mssql.py
def login_exists(login, domain='', **kwargs): ''' Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN' ''' if domain: login = '{0}\\{1}'.format(domain, login) ...
def login_exists(login, domain='', **kwargs): ''' Find if a login exists in the MS SQL server. domain, if provided, will be prepended to login CLI Example: .. code-block:: bash salt minion mssql.login_exists 'LOGIN' ''' if domain: login = '{0}\\{1}'.format(domain, login) ...
[ "Find", "if", "a", "login", "exists", "in", "the", "MS", "SQL", "server", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "login" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L282-L300
[ "def", "login_exists", "(", "login", ",", "domain", "=", "''", ",", "*", "*", "kwargs", ")", ":", "if", "domain", ":", "login", "=", "'{0}\\\\{1}'", ".", "format", "(", "domain", ",", "login", ")", "try", ":", "# We should get one, and only one row", "retu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
login_create
Creates a new login. Does not update password of existing logins. For Windows authentication, provide ``new_login_domain``. For SQL Server authentication, prvide ``new_login_password``. Since hashed passwords are *varbinary* values, if the ``new_login_password`` is 'int / long', it will be considere...
salt/modules/mssql.py
def login_create(login, new_login_password=None, new_login_domain='', new_login_roles=None, new_login_options=None, **kwargs): ''' Creates a new login. Does not update password of existing logins. For Windows authentication, provide ``new_login_domain``. For SQL Server authentication, prvide ``new_lo...
def login_create(login, new_login_password=None, new_login_domain='', new_login_roles=None, new_login_options=None, **kwargs): ''' Creates a new login. Does not update password of existing logins. For Windows authentication, provide ``new_login_domain``. For SQL Server authentication, prvide ``new_lo...
[ "Creates", "a", "new", "login", ".", "Does", "not", "update", "password", "of", "existing", "logins", ".", "For", "Windows", "authentication", "provide", "new_login_domain", ".", "For", "SQL", "Server", "authentication", "prvide", "new_login_password", ".", "Since...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L303-L359
[ "def", "login_create", "(", "login", ",", "new_login_password", "=", "None", ",", "new_login_domain", "=", "''", ",", "new_login_roles", "=", "None", ",", "new_login_options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# One and only one of password and doma...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
login_remove
Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME
salt/modules/mssql.py
def login_remove(login, **kwargs): ''' Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute("DROP LOGIN [{0}]".format...
def login_remove(login, **kwargs): ''' Removes an login. CLI Example: .. code-block:: bash salt minion mssql.login_remove LOGINNAME ''' try: conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() cur.execute("DROP LOGIN [{0}]".format...
[ "Removes", "an", "login", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L362-L381
[ "def", "login_remove", "(", "login", ",", "*", "*", "kwargs", ")", ":", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn", ".", "autocommit", "(", "True", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "cur", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_exists
Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME']
salt/modules/mssql.py
def user_exists(username, domain='', database=None, **kwargs): ''' Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME'] ''' ...
def user_exists(username, domain='', database=None, **kwargs): ''' Find if an user exists in a specific database on the MS SQL server. domain, if provided, will be prepended to username CLI Example: .. code-block:: bash salt minion mssql.user_exists 'USERNAME' [database='DBNAME'] ''' ...
[ "Find", "if", "an", "user", "exists", "in", "a", "specific", "database", "on", "the", "MS", "SQL", "server", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "username" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L384-L400
[ "def", "user_exists", "(", "username", ",", "domain", "=", "''", ",", "database", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "domain", ":", "username", "=", "'{0}\\\\{1}'", ".", "format", "(", "domain", ",", "username", ")", "if", "database"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_create
Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: .. code-block:: bash salt minion mssql.user_create USERNAME database=DBNAME
salt/modules/mssql.py
def user_create(username, login=None, domain='', database=None, roles=None, options=None, **kwargs): ''' Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: ...
def user_create(username, login=None, domain='', database=None, roles=None, options=None, **kwargs): ''' Creates a new user. If login is not specified, the user will be created without a login. domain, if provided, will be prepended to username. options can only be a list of strings CLI Example: ...
[ "Creates", "a", "new", "user", ".", "If", "login", "is", "not", "specified", "the", "user", "will", "be", "created", "without", "a", "login", ".", "domain", "if", "provided", "will", "be", "prepended", "to", "username", ".", "options", "can", "only", "be...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L416-L467
[ "def", "user_create", "(", "username", ",", "login", "=", "None", ",", "domain", "=", "''", ",", "database", "=", "None", ",", "roles", "=", "None", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "domain", "and", "not", "logi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_remove
Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME
salt/modules/mssql.py
def user_remove(username, **kwargs): ''' Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME ''' # 'database' argument is mandatory if 'database' not in kwargs: return False try: conn = _get_connection(**kwa...
def user_remove(username, **kwargs): ''' Removes an user. CLI Example: .. code-block:: bash salt minion mssql.user_remove USERNAME database=DBNAME ''' # 'database' argument is mandatory if 'database' not in kwargs: return False try: conn = _get_connection(**kwa...
[ "Removes", "an", "user", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mssql.py#L470-L492
[ "def", "user_remove", "(", "username", ",", "*", "*", "kwargs", ")", ":", "# 'database' argument is mandatory", "if", "'database'", "not", "in", "kwargs", ":", "return", "False", "try", ":", "conn", "=", "_get_connection", "(", "*", "*", "kwargs", ")", "conn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm 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 ke...
salt/states/boto_cloudwatch_alarm.py
def present( name, attributes, region=None, key=None, keyid=None, profile=None): ''' Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm attributes. region Region to conn...
def present( name, attributes, region=None, key=None, keyid=None, profile=None): ''' Ensure the cloudwatch alarm exists. name Name of the alarm attributes A dict of key/value cloudwatch alarm attributes. region Region to conn...
[ "Ensure", "the", "cloudwatch", "alarm", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudwatch_alarm.py#L73-L177
[ "def", "present", "(", "name", ",", "attributes", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_comments
DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict.
salt/states/docker_container.py
def _format_comments(ret, comments): ''' DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict. ''' if isinstance(comments, six.string_types): ret['comment'] = comments else: ret['comment'] = '...
def _format_comments(ret, comments): ''' DRY code for joining comments together and conditionally adding a period at the end, and adding this comment string to the state return dict. ''' if isinstance(comments, six.string_types): ret['comment'] = comments else: ret['comment'] = '...
[ "DRY", "code", "for", "joining", "comments", "together", "and", "conditionally", "adding", "a", "period", "at", "the", "end", "and", "adding", "this", "comment", "string", "to", "the", "state", "return", "dict", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L79-L90
[ "def", "_format_comments", "(", "ret", ",", "comments", ")", ":", "if", "isinstance", "(", "comments", ",", "six", ".", "string_types", ")", ":", "ret", "[", "'comment'", "]", "=", "comments", "else", ":", "ret", "[", "'comment'", "]", "=", "'. '", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_diff
Check the diff for signs of incorrect argument handling in previous releases, as discovered here: https://github.com/saltstack/salt/pull/39996#issuecomment-288025200
salt/states/docker_container.py
def _check_diff(changes): ''' Check the diff for signs of incorrect argument handling in previous releases, as discovered here: https://github.com/saltstack/salt/pull/39996#issuecomment-288025200 ''' for conf_dict in changes: if conf_dict == 'Networks': continue for ...
def _check_diff(changes): ''' Check the diff for signs of incorrect argument handling in previous releases, as discovered here: https://github.com/saltstack/salt/pull/39996#issuecomment-288025200 ''' for conf_dict in changes: if conf_dict == 'Networks': continue for ...
[ "Check", "the", "diff", "for", "signs", "of", "incorrect", "argument", "handling", "in", "previous", "releases", "as", "discovered", "here", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L93-L115
[ "def", "_check_diff", "(", "changes", ")", ":", "for", "conf_dict", "in", "changes", ":", "if", "conf_dict", "==", "'Networks'", ":", "continue", "for", "item", "in", "changes", "[", "conf_dict", "]", ":", "if", "changes", "[", "conf_dict", "]", "[", "it...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_networks
Common logic for parsing the networks
salt/states/docker_container.py
def _parse_networks(networks): ''' Common logic for parsing the networks ''' networks = salt.utils.args.split_input(networks or []) if not networks: networks = {} else: # We don't want to recurse the repack, as the values of the kwargs # being passed when connecting to th...
def _parse_networks(networks): ''' Common logic for parsing the networks ''' networks = salt.utils.args.split_input(networks or []) if not networks: networks = {} else: # We don't want to recurse the repack, as the values of the kwargs # being passed when connecting to th...
[ "Common", "logic", "for", "parsing", "the", "networks" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L118-L186
[ "def", "_parse_networks", "(", "networks", ")", ":", "networks", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "networks", "or", "[", "]", ")", "if", "not", "networks", ":", "networks", "=", "{", "}", "else", ":", "# We don't want to r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_resolve_image
Resolve the image ID and pull the image if necessary
salt/states/docker_container.py
def _resolve_image(ret, image, client_timeout): ''' Resolve the image ID and pull the image if necessary ''' image_id = __salt__['docker.resolve_image_id'](image) if image_id is False: if not __opts__['test']: # Image not pulled locally, so try pulling it try: ...
def _resolve_image(ret, image, client_timeout): ''' Resolve the image ID and pull the image if necessary ''' image_id = __salt__['docker.resolve_image_id'](image) if image_id is False: if not __opts__['test']: # Image not pulled locally, so try pulling it try: ...
[ "Resolve", "the", "image", "ID", "and", "pull", "the", "image", "if", "necessary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L189-L217
[ "def", "_resolve_image", "(", "ret", ",", "image", ",", "client_timeout", ")", ":", "image_id", "=", "__salt__", "[", "'docker.resolve_image_id'", "]", "(", "image", ")", "if", "image_id", "is", "False", ":", "if", "not", "__opts__", "[", "'test'", "]", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
running
Ensure that a container with a specific configuration is present and running name Name of the container image Image to use for the container .. note:: This state will pull the image if it is not present. However, if the image needs to be built from a Docker...
salt/states/docker_container.py
def running(name, image=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, force=False, watch_action='force', start=True, shutdown_timeout=None, client_timeout=salt.utils.docker.CLIENT_TI...
def running(name, image=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, force=False, watch_action='force', start=True, shutdown_timeout=None, client_timeout=salt.utils.docker.CLIENT_TI...
[ "Ensure", "that", "a", "container", "with", "a", "specific", "configuration", "is", "present", "and", "running" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L220-L2097
[ "def", "running", "(", "name", ",", "image", "=", "None", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "force", "=", "False", ",", "watch_action", "=", "'force'", ",", "start", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run
.. versionadded:: 2018.3.0 .. note:: If no tag is specified in the image name, and nothing matching the specified image is pulled on the minion, the ``docker pull`` that retrieves the image will pull *all tags* for the image. A tag of ``latest`` is not implicit for the pull. For thi...
salt/states/docker_container.py
def run(name, image=None, onlyif=None, unless=None, creates=None, bg=False, failhard=True, replace=False, force=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CL...
def run(name, image=None, onlyif=None, unless=None, creates=None, bg=False, failhard=True, replace=False, force=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CL...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2100-L2330
[ "def", "run", "(", "name", ",", "image", "=", "None", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "creates", "=", "None", ",", "bg", "=", "False", ",", "failhard", "=", "True", ",", "replace", "=", "False", ",", "force", "=", "Fa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stopped
Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state on more than one container at a time. The following two examples accomplish the same thing: .. code-block:: yaml stopped_containers: docker_...
salt/states/docker_container.py
def stopped(name=None, containers=None, shutdown_timeout=None, unpause=False, error_on_absent=True, **kwargs): ''' Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state o...
def stopped(name=None, containers=None, shutdown_timeout=None, unpause=False, error_on_absent=True, **kwargs): ''' Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state o...
[ "Ensure", "that", "a", "container", "(", "or", "containers", ")", "is", "stopped" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2333-L2485
[ "def", "stopped", "(", "name", "=", "None", ",", "containers", "=", "None", ",", "shutdown_timeout", "=", "None", ",", "unpause", "=", "False", ",", "error_on_absent", "=", "True", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent multiple_containers: docker_contain...
salt/states/docker_container.py
def absent(name, force=False): ''' Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent mu...
def absent(name, force=False): ''' Ensure that a container is absent name Name of the container force : False Set to ``True`` to remove the container even if it is running Usage Examples: .. code-block:: yaml mycontainer: docker_container.absent mu...
[ "Ensure", "that", "a", "container", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2488-L2549
[ "def", "absent", "(", "name", ",", "force", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "if", "name", "not", "in", "__salt__", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mod_run_check
Execute the onlyif/unless/creates logic. Returns a result dict if any of the checks fail, otherwise returns True
salt/states/docker_container.py
def mod_run_check(onlyif, unless, creates): ''' Execute the onlyif/unless/creates logic. Returns a result dict if any of the checks fail, otherwise returns True ''' cmd_kwargs = {'use_vt': False, 'bg': False} if onlyif is not None: if isinstance(onlyif, six.string_types): on...
def mod_run_check(onlyif, unless, creates): ''' Execute the onlyif/unless/creates logic. Returns a result dict if any of the checks fail, otherwise returns True ''' cmd_kwargs = {'use_vt': False, 'bg': False} if onlyif is not None: if isinstance(onlyif, six.string_types): on...
[ "Execute", "the", "onlyif", "/", "unless", "/", "creates", "logic", ".", "Returns", "a", "result", "dict", "if", "any", "of", "the", "checks", "fail", "otherwise", "returns", "True" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2552-L2615
[ "def", "mod_run_check", "(", "onlyif", ",", "unless", ",", "creates", ")", ":", "cmd_kwargs", "=", "{", "'use_vt'", ":", "False", ",", "'bg'", ":", "False", "}", "if", "onlyif", "is", "not", "None", ":", "if", "isinstance", "(", "onlyif", ",", "six", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mod_watch
The docker_container watcher, called to invoke the watch command. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being triggered.
salt/states/docker_container.py
def mod_watch(name, sfun=None, **kwargs): ''' The docker_container watcher, called to invoke the watch command. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function sho...
def mod_watch(name, sfun=None, **kwargs): ''' The docker_container watcher, called to invoke the watch command. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function sho...
[ "The", "docker_container", "watcher", "called", "to", "invoke", "the", "watch", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/docker_container.py#L2618-L2647
[ "def", "mod_watch", "(", "name", ",", "sfun", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "sfun", "==", "'running'", ":", "watch_kwargs", "=", "copy", ".", "deepcopy", "(", "kwargs", ")", "if", "watch_kwargs", ".", "get", "(", "'watch_action'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_cache_provider_details
Provide a place to hang onto results of --list-[locations|sizes|images] so we don't have to go out to the API and get them every time.
salt/cloud/clouds/vultrpy.py
def _cache_provider_details(conn=None): ''' Provide a place to hang onto results of --list-[locations|sizes|images] so we don't have to go out to the API and get them every time. ''' DETAILS['avail_locations'] = {} DETAILS['avail_sizes'] = {} DETAILS['avail_images'] = {} locations = avai...
def _cache_provider_details(conn=None): ''' Provide a place to hang onto results of --list-[locations|sizes|images] so we don't have to go out to the API and get them every time. ''' DETAILS['avail_locations'] = {} DETAILS['avail_sizes'] = {} DETAILS['avail_images'] = {} locations = avai...
[ "Provide", "a", "place", "to", "hang", "onto", "results", "of", "--", "list", "-", "[", "locations|sizes|images", "]", "so", "we", "don", "t", "have", "to", "go", "out", "to", "the", "API", "and", "get", "them", "every", "time", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L100-L122
[ "def", "_cache_provider_details", "(", "conn", "=", "None", ")", ":", "DETAILS", "[", "'avail_locations'", "]", "=", "{", "}", "DETAILS", "[", "'avail_sizes'", "]", "=", "{", "}", "DETAILS", "[", "'avail_images'", "]", "=", "{", "}", "locations", "=", "a...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
Return basic data on nodes
salt/cloud/clouds/vultrpy.py
def list_nodes(**kwargs): ''' Return basic data on nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {} for prop in 'id', 'image', 'size', 'state', 'private_ips', 'public_ips': ret[node][prop] = nodes[node][prop] return ret
def list_nodes(**kwargs): ''' Return basic data on nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = {} for prop in 'id', 'image', 'size', 'state', 'private_ips', 'public_ips': ret[node][prop] = nodes[node][prop] return ret
[ "Return", "basic", "data", "on", "nodes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L160-L172
[ "def", "list_nodes", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "nodes", "=", "list_nodes_full", "(", ")", "for", "node", "in", "nodes", ":", "ret", "[", "node", "]", "=", "{", "}", "for", "prop", "in", "'id'", ",", "'image'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
Return all data on nodes
salt/cloud/clouds/vultrpy.py
def list_nodes_full(**kwargs): ''' Return all data on nodes ''' nodes = _query('server/list') ret = {} for node in nodes: name = nodes[node]['label'] ret[name] = nodes[node].copy() ret[name]['id'] = node ret[name]['image'] = nodes[node]['os'] ret[name]['s...
def list_nodes_full(**kwargs): ''' Return all data on nodes ''' nodes = _query('server/list') ret = {} for node in nodes: name = nodes[node]['label'] ret[name] = nodes[node].copy() ret[name]['id'] = node ret[name]['image'] = nodes[node]['os'] ret[name]['s...
[ "Return", "all", "data", "on", "nodes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L175-L192
[ "def", "list_nodes_full", "(", "*", "*", "kwargs", ")", ":", "nodes", "=", "_query", "(", "'server/list'", ")", "ret", "=", "{", "}", "for", "node", "in", "nodes", ":", "name", "=", "nodes", "[", "node", "]", "[", "'label'", "]", "ret", "[", "name"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Remove a node from Vultr
salt/cloud/clouds/vultrpy.py
def destroy(name): ''' Remove a node from Vultr ''' node = show_instance(name, call='action') params = {'SUBID': node['SUBID']} result = _query('server/destroy', method='POST', decode=False, data=_urlencode(params)) # The return of a destroy call is empty in the case of a success. # Err...
def destroy(name): ''' Remove a node from Vultr ''' node = show_instance(name, call='action') params = {'SUBID': node['SUBID']} result = _query('server/destroy', method='POST', decode=False, data=_urlencode(params)) # The return of a destroy call is empty in the case of a success. # Err...
[ "Remove", "a", "node", "from", "Vultr" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L204-L217
[ "def", "destroy", "(", "name", ")", ":", "node", "=", "show_instance", "(", "name", ",", "call", "=", "'action'", ")", "params", "=", "{", "'SUBID'", ":", "node", "[", "'SUBID'", "]", "}", "result", "=", "_query", "(", "'server/destroy'", ",", "method"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details from the provider concerning an instance
salt/cloud/clouds/vultrpy.py
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) nodes = list_nodes_full() # Find under which cloud s...
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) nodes = list_nodes_full() # Find under which cloud s...
[ "Show", "the", "details", "from", "the", "provider", "concerning", "an", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L234-L248
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "nodes", "=", "list_nodes_full", "(", ")", "# Fi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_lookup_vultrid
Helper function to retrieve a Vultr ID
salt/cloud/clouds/vultrpy.py
def _lookup_vultrid(which_key, availkey, keyname): ''' Helper function to retrieve a Vultr ID ''' if DETAILS == {}: _cache_provider_details() which_key = six.text_type(which_key) try: return DETAILS[availkey][which_key][keyname] except KeyError: return False
def _lookup_vultrid(which_key, availkey, keyname): ''' Helper function to retrieve a Vultr ID ''' if DETAILS == {}: _cache_provider_details() which_key = six.text_type(which_key) try: return DETAILS[availkey][which_key][keyname] except KeyError: return False
[ "Helper", "function", "to", "retrieve", "a", "Vultr", "ID" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L251-L262
[ "def", "_lookup_vultrid", "(", "which_key", ",", "availkey", ",", "keyname", ")", ":", "if", "DETAILS", "==", "{", "}", ":", "_cache_provider_details", "(", ")", "which_key", "=", "six", ".", "text_type", "(", "which_key", ")", "try", ":", "return", "DETAI...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict
salt/cloud/clouds/vultrpy.py
def create(vm_): ''' Create a single VM from a data dict ''' if 'driver' not in vm_: vm_['driver'] = vm_['provider'] private_networking = config.get_cloud_config_value( 'enable_private_network', vm_, __opts__, search_global=False, default=False, ) startup_script = config.ge...
def create(vm_): ''' Create a single VM from a data dict ''' if 'driver' not in vm_: vm_['driver'] = vm_['provider'] private_networking = config.get_cloud_config_value( 'enable_private_network', vm_, __opts__, search_global=False, default=False, ) startup_script = config.ge...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L265-L474
[ "def", "create", "(", "vm_", ")", ":", "if", "'driver'", "not", "in", "vm_", ":", "vm_", "[", "'driver'", "]", "=", "vm_", "[", "'provider'", "]", "private_networking", "=", "config", ".", "get_cloud_config_value", "(", "'enable_private_network'", ",", "vm_"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_query
Perform a query directly against the Vultr REST API
salt/cloud/clouds/vultrpy.py
def _query(path, method='GET', data=None, params=None, header_dict=None, decode=True): ''' Perform a query directly against the Vultr REST API ''' api_key = config.get_cloud_config_value( 'api_key', get_configured_provider(), __opts__, search_global=False, ) manag...
def _query(path, method='GET', data=None, params=None, header_dict=None, decode=True): ''' Perform a query directly against the Vultr REST API ''' api_key = config.get_cloud_config_value( 'api_key', get_configured_provider(), __opts__, search_global=False, ) manag...
[ "Perform", "a", "query", "directly", "against", "the", "Vultr", "REST", "API" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vultrpy.py#L477-L519
[ "def", "_query", "(", "path", ",", "method", "=", "'GET'", ",", "data", "=", "None", ",", "params", "=", "None", ",", "header_dict", "=", "None", ",", "decode", "=", "True", ")", ":", "api_key", "=", "config", ".", "get_cloud_config_value", "(", "'api_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Grabs external pillar data based on configured function
salt/pillar/redismod.py
def ext_pillar(minion_id, pillar, function, **kwargs): ''' Grabs external pillar data based on configured function ''' if function.startswith('_') or function not in globals(): return {} # Call specified function to pull redis data return globals()[function](minion_id, pillar, **kwargs)
def ext_pillar(minion_id, pillar, function, **kwargs): ''' Grabs external pillar data based on configured function ''' if function.startswith('_') or function not in globals(): return {} # Call specified function to pull redis data return globals()[function](minion_id, pillar, **kwargs)
[ "Grabs", "external", "pillar", "data", "based", "on", "configured", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L51-L58
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "function", ",", "*", "*", "kwargs", ")", ":", "if", "function", ".", "startswith", "(", "'_'", ")", "or", "function", "not", "in", "globals", "(", ")", ":", "return", "{", "}", "# Call specifi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
key_value
Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted sets. pillar_key Pillar key to return data into
salt/pillar/redismod.py
def key_value(minion_id, pillar, # pylint: disable=W0613 pillar_key='redis_pillar'): ''' Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted se...
def key_value(minion_id, pillar, # pylint: disable=W0613 pillar_key='redis_pillar'): ''' Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted se...
[ "Looks", "for", "key", "in", "redis", "matching", "minion_id", "returns", "a", "structure", "based", "on", "the", "data", "type", "of", "the", "redis", "key", ".", "String", "for", "string", "type", "dict", "for", "hash", "type", "and", "lists", "for", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L61-L93
[ "def", "key_value", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "pillar_key", "=", "'redis_pillar'", ")", ":", "# Identify key type and process as needed based on that type", "key_type", "=", "__salt__", "[", "'redis.key_type'", "]", "(", "minion_id", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
key_json
Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into
salt/pillar/redismod.py
def key_json(minion_id, pillar, # pylint: disable=W0613 pillar_key=None): ''' Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into '...
def key_json(minion_id, pillar, # pylint: disable=W0613 pillar_key=None): ''' Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set. pillar_key Pillar key to return data into '...
[ "Pulls", "a", "string", "from", "redis", "and", "deserializes", "it", "from", "json", ".", "Deserialized", "dictionary", "data", "loaded", "directly", "into", "top", "level", "if", "pillar_key", "is", "not", "set", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/redismod.py#L96-L118
[ "def", "key_json", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "pillar_key", "=", "None", ")", ":", "key_data", "=", "__salt__", "[", "'redis.get_key'", "]", "(", "minion_id", ")", "# Return nothing for non-existent keys", "if", "not", "key_data...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync
Sync portage/overlay trees and update the eix database CLI Example: .. code-block:: bash salt '*' eix.sync
salt/modules/eix.py
def sync(): ''' Sync portage/overlay trees and update the eix database CLI Example: .. code-block:: bash salt '*' eix.sync ''' # Funtoo patches eix to use 'ego sync' if __grains__['os'] == 'Funtoo': cmd = 'eix-sync -q' else: cmd = 'eix-sync -q -C "--ask" -C "n"...
def sync(): ''' Sync portage/overlay trees and update the eix database CLI Example: .. code-block:: bash salt '*' eix.sync ''' # Funtoo patches eix to use 'ego sync' if __grains__['os'] == 'Funtoo': cmd = 'eix-sync -q' else: cmd = 'eix-sync -q -C "--ask" -C "n"...
[ "Sync", "portage", "/", "overlay", "trees", "and", "update", "the", "eix", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eix.py#L20-L50
[ "def", "sync", "(", ")", ":", "# Funtoo patches eix to use 'ego sync'", "if", "__grains__", "[", "'os'", "]", "==", "'Funtoo'", ":", "cmd", "=", "'eix-sync -q'", "else", ":", "cmd", "=", "'eix-sync -q -C \"--ask\" -C \"n\"'", "if", "'makeconf.features_contains'", "in"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456
salt/modules/pw_group.py
def add(name, gid=None, **kwargs): ''' Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456 ''' kwargs = salt.utils.args.clean_kwargs(**kwargs) if salt.utils.data.is_true(kwargs.pop('system', False)): log.warning('pw_group module does not s...
def add(name, gid=None, **kwargs): ''' Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456 ''' kwargs = salt.utils.args.clean_kwargs(**kwargs) if salt.utils.data.is_true(kwargs.pop('system', False)): log.warning('pw_group module does not s...
[ "Add", "the", "specified", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pw_group.py#L43-L65
[ "def", "add", "(", "name", ",", "gid", "=", "None", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "if", "salt", ".", "utils", ".", "data", ".", "is_true", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
adduser
Add a user in the group. CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it.
salt/modules/pw_group.py
def adduser(name, username): ''' Add a user in the group. CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it. ''' # Note: pw exits with code 65 if group is unknown ...
def adduser(name, username): ''' Add a user in the group. CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it. ''' # Note: pw exits with code 65 if group is unknown ...
[ "Add", "a", "user", "in", "the", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pw_group.py#L145-L162
[ "def", "adduser", "(", "name", ",", "username", ")", ":", "# Note: pw exits with code 65 if group is unknown", "retcode", "=", "__salt__", "[", "'cmd.retcode'", "]", "(", "'pw groupmod {0} -m {1}'", ".", "format", "(", "name", ",", "username", ")", ",", "python_shel...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deluser
Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True.
salt/modules/pw_group.py
def deluser(name, username): ''' Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True. ''' grp_info = __salt__['group.info'](name) if user...
def deluser(name, username): ''' Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True. ''' grp_info = __salt__['group.info'](name) if user...
[ "Remove", "a", "user", "from", "the", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pw_group.py#L165-L187
[ "def", "deluser", "(", "name", ",", "username", ")", ":", "grp_info", "=", "__salt__", "[", "'group.info'", "]", "(", "name", ")", "if", "username", "not", "in", "grp_info", "[", "'members'", "]", ":", "return", "True", "# Note: pw exits with code 65 if group ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
datasource_exists
Ensures that a datasource with given properties exist on the jboss instance. If datasource doesn't exist, it is created, otherwise only the properties that are different will be updated. name Datasource property name jboss_config Dict with connection properties (see state description) d...
salt/states/jboss7.py
def datasource_exists(name, jboss_config, datasource_properties, recreate=False, profile=None): ''' Ensures that a datasource with given properties exist on the jboss instance. If datasource doesn't exist, it is created, otherwise only the properties that are different will be updated. name Dat...
def datasource_exists(name, jboss_config, datasource_properties, recreate=False, profile=None): ''' Ensures that a datasource with given properties exist on the jboss instance. If datasource doesn't exist, it is created, otherwise only the properties that are different will be updated. name Dat...
[ "Ensures", "that", "a", "datasource", "with", "given", "properties", "exist", "on", "the", "jboss", "instance", ".", "If", "datasource", "doesn", "t", "exist", "it", "is", "created", "otherwise", "only", "the", "properties", "that", "are", "different", "will",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/jboss7.py#L56-L176
[ "def", "datasource_exists", "(", "name", ",", "jboss_config", ",", "datasource_properties", ",", "recreate", "=", "False", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\" ======================== STATE: jboss7.datasource_exists (name: %s) \"", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
bindings_exist
Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see state description) bindings: Dict with bindings to set. profile:...
salt/states/jboss7.py
def bindings_exist(name, jboss_config, bindings, profile=None): ''' Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see stat...
def bindings_exist(name, jboss_config, bindings, profile=None): ''' Ensures that given JNDI binding are present on the server. If a binding doesn't exist on the server it will be created. If it already exists its value will be changed. jboss_config: Dict with connection properties (see stat...
[ "Ensures", "that", "given", "JNDI", "binding", "are", "present", "on", "the", "server", ".", "If", "a", "binding", "doesn", "t", "exist", "on", "the", "server", "it", "will", "be", "created", ".", "If", "it", "already", "exists", "its", "value", "will", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/jboss7.py#L203-L261
[ "def", "bindings_exist", "(", "name", ",", "jboss_config", ",", "bindings", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\" ======================== STATE: jboss7.bindings_exist (name: %s) (profile: %s) \"", ",", "name", ",", "profile", ")", "log"...
e8541fd6e744ab0df786c0f76102e41631f45d46