repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/modules/rabbitmq.py
change_password
def change_password(name, password, runas=None): ''' Changes a user's password. CLI Example: .. code-block:: bash salt '*' rabbitmq.change_password rabbit_user password ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() if sal...
python
def change_password(name, password, runas=None): ''' Changes a user's password. CLI Example: .. code-block:: bash salt '*' rabbitmq.change_password rabbit_user password ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() if sal...
[ "def", "change_password", "(", "name", ",", "password", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", ...
Changes a user's password. CLI Example: .. code-block:: bash salt '*' rabbitmq.change_password rabbit_user password
[ "Changes", "a", "user", "s", "password", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L368-L402
train
saltstack/salt
salt/modules/rabbitmq.py
check_password
def check_password(name, password, runas=None): ''' .. versionadded:: 2016.3.0 Checks if a user's password is valid. CLI Example: .. code-block:: bash salt '*' rabbitmq.check_password rabbit_user password ''' # try to get the rabbitmq-version - adapted from _get_rabbitmq_plugin ...
python
def check_password(name, password, runas=None): ''' .. versionadded:: 2016.3.0 Checks if a user's password is valid. CLI Example: .. code-block:: bash salt '*' rabbitmq.check_password rabbit_user password ''' # try to get the rabbitmq-version - adapted from _get_rabbitmq_plugin ...
[ "def", "check_password", "(", "name", ",", "password", ",", "runas", "=", "None", ")", ":", "# try to get the rabbitmq-version - adapted from _get_rabbitmq_plugin", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", ...
.. versionadded:: 2016.3.0 Checks if a user's password is valid. CLI Example: .. code-block:: bash salt '*' rabbitmq.check_password rabbit_user password
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L427-L505
train
saltstack/salt
salt/modules/rabbitmq.py
add_vhost
def add_vhost(vhost, runas=None): ''' Adds a vhost via rabbitmqctl add_vhost. CLI Example: .. code-block:: bash salt '*' rabbitmq add_vhost '<vhost_name>' ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() res = __salt__['cmd....
python
def add_vhost(vhost, runas=None): ''' Adds a vhost via rabbitmqctl add_vhost. CLI Example: .. code-block:: bash salt '*' rabbitmq add_vhost '<vhost_name>' ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() res = __salt__['cmd....
[ "def", "add_vhost", "(", "vhost", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", "get_us...
Adds a vhost via rabbitmqctl add_vhost. CLI Example: .. code-block:: bash salt '*' rabbitmq add_vhost '<vhost_name>'
[ "Adds", "a", "vhost", "via", "rabbitmqctl", "add_vhost", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L508-L527
train
saltstack/salt
salt/modules/rabbitmq.py
set_permissions
def set_permissions(vhost, user, conf='.*', write='.*', read='.*', runas=None): ''' Sets permissions for vhost via rabbitmqctl set_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.set_permissions myvhost myuser ''' if runas is None and not salt.utils.platform.is_windows...
python
def set_permissions(vhost, user, conf='.*', write='.*', read='.*', runas=None): ''' Sets permissions for vhost via rabbitmqctl set_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.set_permissions myvhost myuser ''' if runas is None and not salt.utils.platform.is_windows...
[ "def", "set_permissions", "(", "vhost", ",", "user", ",", "conf", "=", "'.*'", ",", "write", "=", "'.*'", ",", "read", "=", "'.*'", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform...
Sets permissions for vhost via rabbitmqctl set_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.set_permissions myvhost myuser
[ "Sets", "permissions", "for", "vhost", "via", "rabbitmqctl", "set_permissions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L551-L570
train
saltstack/salt
salt/modules/rabbitmq.py
list_permissions
def list_permissions(vhost, runas=None): ''' Lists permissions for vhost via rabbitmqctl list_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_permissions /myvhost ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_us...
python
def list_permissions(vhost, runas=None): ''' Lists permissions for vhost via rabbitmqctl list_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_permissions /myvhost ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_us...
[ "def", "list_permissions", "(", "vhost", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", ...
Lists permissions for vhost via rabbitmqctl list_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_permissions /myvhost
[ "Lists", "permissions", "for", "vhost", "via", "rabbitmqctl", "list_permissions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L573-L591
train
saltstack/salt
salt/modules/rabbitmq.py
list_user_permissions
def list_user_permissions(name, runas=None): ''' List permissions for a user via rabbitmqctl list_user_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_user_permissions user ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.u...
python
def list_user_permissions(name, runas=None): ''' List permissions for a user via rabbitmqctl list_user_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_user_permissions user ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.u...
[ "def", "list_user_permissions", "(", "name", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", "."...
List permissions for a user via rabbitmqctl list_user_permissions CLI Example: .. code-block:: bash salt '*' rabbitmq.list_user_permissions user
[ "List", "permissions", "for", "a", "user", "via", "rabbitmqctl", "list_user_permissions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L594-L612
train
saltstack/salt
salt/modules/rabbitmq.py
set_user_tags
def set_user_tags(name, tags, runas=None): '''Add user tags via rabbitmqctl set_user_tags CLI Example: .. code-block:: bash salt '*' rabbitmq.set_user_tags myadmin administrator ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() ...
python
def set_user_tags(name, tags, runas=None): '''Add user tags via rabbitmqctl set_user_tags CLI Example: .. code-block:: bash salt '*' rabbitmq.set_user_tags myadmin administrator ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() ...
[ "def", "set_user_tags", "(", "name", ",", "tags", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "use...
Add user tags via rabbitmqctl set_user_tags CLI Example: .. code-block:: bash salt '*' rabbitmq.set_user_tags myadmin administrator
[ "Add", "user", "tags", "via", "rabbitmqctl", "set_user_tags" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L615-L636
train
saltstack/salt
salt/modules/rabbitmq.py
join_cluster
def join_cluster(host, user='rabbit', ram_node=None, runas=None): ''' Join a rabbit cluster CLI Example: .. code-block:: bash salt '*' rabbitmq.join_cluster rabbit.example.com rabbit ''' cmd = [RABBITMQCTL, 'join_cluster'] if ram_node: cmd.append('--ram') cmd.append('{...
python
def join_cluster(host, user='rabbit', ram_node=None, runas=None): ''' Join a rabbit cluster CLI Example: .. code-block:: bash salt '*' rabbitmq.join_cluster rabbit.example.com rabbit ''' cmd = [RABBITMQCTL, 'join_cluster'] if ram_node: cmd.append('--ram') cmd.append('{...
[ "def", "join_cluster", "(", "host", ",", "user", "=", "'rabbit'", ",", "ram_node", "=", "None", ",", "runas", "=", "None", ")", ":", "cmd", "=", "[", "RABBITMQCTL", ",", "'join_cluster'", "]", "if", "ram_node", ":", "cmd", ".", "append", "(", "'--ram'"...
Join a rabbit cluster CLI Example: .. code-block:: bash salt '*' rabbitmq.join_cluster rabbit.example.com rabbit
[ "Join", "a", "rabbit", "cluster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L681-L702
train
saltstack/salt
salt/modules/rabbitmq.py
list_queues
def list_queues(runas=None, *args): ''' Returns queue details of the / virtual host CLI Example: .. code-block:: bash salt '*' rabbitmq.list_queues messages consumers ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() cmd = [R...
python
def list_queues(runas=None, *args): ''' Returns queue details of the / virtual host CLI Example: .. code-block:: bash salt '*' rabbitmq.list_queues messages consumers ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() cmd = [R...
[ "def", "list_queues", "(", "runas", "=", "None", ",", "*", "args", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", ...
Returns queue details of the / virtual host CLI Example: .. code-block:: bash salt '*' rabbitmq.list_queues messages consumers
[ "Returns", "queue", "details", "of", "the", "/", "virtual", "host" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L789-L805
train
saltstack/salt
salt/modules/rabbitmq.py
list_policies
def list_policies(vhost="/", runas=None): ''' Return a dictionary of policies nested by vhost and name based on the data returned from rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.list_policies ''' r...
python
def list_policies(vhost="/", runas=None): ''' Return a dictionary of policies nested by vhost and name based on the data returned from rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.list_policies ''' r...
[ "def", "list_policies", "(", "vhost", "=", "\"/\"", ",", "runas", "=", "None", ")", ":", "ret", "=", "{", "}", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt",...
Return a dictionary of policies nested by vhost and name based on the data returned from rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.list_policies
[ "Return", "a", "dictionary", "of", "policies", "nested", "by", "vhost", "and", "name", "based", "on", "the", "data", "returned", "from", "rabbitmqctl", "list_policies", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L830-L891
train
saltstack/salt
salt/modules/rabbitmq.py
set_policy
def set_policy(vhost, name, pattern, definition, priority=None, runas=None, apply_to=None): ''' Set a policy based on rabbitmqctl set_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-b...
python
def set_policy(vhost, name, pattern, definition, priority=None, runas=None, apply_to=None): ''' Set a policy based on rabbitmqctl set_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-b...
[ "def", "set_policy", "(", "vhost", ",", "name", ",", "pattern", ",", "definition", ",", "priority", "=", "None", ",", "runas", "=", "None", ",", "apply_to", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", ...
Set a policy based on rabbitmqctl set_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.set_policy / HA '.*' '{"ha-mode":"all"}'
[ "Set", "a", "policy", "based", "on", "rabbitmqctl", "set_policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L894-L928
train
saltstack/salt
salt/modules/rabbitmq.py
delete_policy
def delete_policy(vhost, name, runas=None): ''' Delete a policy based on rabbitmqctl clear_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.delete_policy / HA ''' if runas is None and not salt.utils.platform.is_windows(): ...
python
def delete_policy(vhost, name, runas=None): ''' Delete a policy based on rabbitmqctl clear_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.delete_policy / HA ''' if runas is None and not salt.utils.platform.is_windows(): ...
[ "def", "delete_policy", "(", "vhost", ",", "name", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "us...
Delete a policy based on rabbitmqctl clear_policy. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.delete_policy / HA
[ "Delete", "a", "policy", "based", "on", "rabbitmqctl", "clear_policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L931-L951
train
saltstack/salt
salt/modules/rabbitmq.py
policy_exists
def policy_exists(vhost, name, runas=None): ''' Return whether the policy exists based on rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.policy_exists / HA ''' if runas is None and not salt.utils.platform....
python
def policy_exists(vhost, name, runas=None): ''' Return whether the policy exists based on rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.policy_exists / HA ''' if runas is None and not salt.utils.platform....
[ "def", "policy_exists", "(", "vhost", ",", "name", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "us...
Return whether the policy exists based on rabbitmqctl list_policies. Reference: http://www.rabbitmq.com/ha.html CLI Example: .. code-block:: bash salt '*' rabbitmq.policy_exists / HA
[ "Return", "whether", "the", "policy", "exists", "based", "on", "rabbitmqctl", "list_policies", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L954-L969
train
saltstack/salt
salt/modules/rabbitmq.py
list_available_plugins
def list_available_plugins(runas=None): ''' Returns a list of the names of all available plugins (enabled and disabled). CLI Example: .. code-block:: bash salt '*' rabbitmq.list_available_plugins ''' if runas is None and not salt.utils.platform.is_windows(): ...
python
def list_available_plugins(runas=None): ''' Returns a list of the names of all available plugins (enabled and disabled). CLI Example: .. code-block:: bash salt '*' rabbitmq.list_available_plugins ''' if runas is None and not salt.utils.platform.is_windows(): ...
[ "def", "list_available_plugins", "(", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", "get_user", ...
Returns a list of the names of all available plugins (enabled and disabled). CLI Example: .. code-block:: bash salt '*' rabbitmq.list_available_plugins
[ "Returns", "a", "list", "of", "the", "names", "of", "all", "available", "plugins", "(", "enabled", "and", "disabled", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L972-L987
train
saltstack/salt
salt/modules/rabbitmq.py
plugin_is_enabled
def plugin_is_enabled(name, runas=None): ''' Return whether the plugin is enabled. CLI Example: .. code-block:: bash salt '*' rabbitmq.plugin_is_enabled rabbitmq_plugin_name ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() r...
python
def plugin_is_enabled(name, runas=None): ''' Return whether the plugin is enabled. CLI Example: .. code-block:: bash salt '*' rabbitmq.plugin_is_enabled rabbitmq_plugin_name ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() r...
[ "def", "plugin_is_enabled", "(", "name", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", ...
Return whether the plugin is enabled. CLI Example: .. code-block:: bash salt '*' rabbitmq.plugin_is_enabled rabbitmq_plugin_name
[ "Return", "whether", "the", "plugin", "is", "enabled", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L1008-L1020
train
saltstack/salt
salt/modules/rabbitmq.py
enable_plugin
def enable_plugin(name, runas=None): ''' Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() cmd =...
python
def enable_plugin(name, runas=None): ''' Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() cmd =...
[ "def", "enable_plugin", "(", "name", ",", "runas", "=", "None", ")", ":", "if", "runas", "is", "None", "and", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "runas", "=", "salt", ".", "utils", ".", "user", ".", "get...
Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo
[ "Enable", "a", "RabbitMQ", "plugin", "via", "the", "rabbitmq", "-", "plugins", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rabbitmq.py#L1023-L1037
train
saltstack/salt
salt/modules/cyg.py
_check_cygwin_installed
def _check_cygwin_installed(cyg_arch='x86_64'): ''' Return True or False if cygwin is installed. Use the cygcheck executable to check install. It is installed as part of the base package, and we use it to check packages ''' path_to_cygcheck = os.sep.join(['C:', ...
python
def _check_cygwin_installed(cyg_arch='x86_64'): ''' Return True or False if cygwin is installed. Use the cygcheck executable to check install. It is installed as part of the base package, and we use it to check packages ''' path_to_cygcheck = os.sep.join(['C:', ...
[ "def", "_check_cygwin_installed", "(", "cyg_arch", "=", "'x86_64'", ")", ":", "path_to_cygcheck", "=", "os", ".", "sep", ".", "join", "(", "[", "'C:'", ",", "_get_cyg_dir", "(", "cyg_arch", ")", ",", "'bin'", ",", "'cygcheck.exe'", "]", ")", "LOG", ".", ...
Return True or False if cygwin is installed. Use the cygcheck executable to check install. It is installed as part of the base package, and we use it to check packages
[ "Return", "True", "or", "False", "if", "cygwin", "is", "installed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L64-L78
train
saltstack/salt
salt/modules/cyg.py
_get_all_packages
def _get_all_packages(mirror=DEFAULT_MIRROR, cyg_arch='x86_64'): ''' Return the list of packages based on the mirror provided. ''' if 'cyg.all_packages' not in __context__: __context__['cyg.all_packages'] = {} if mirror not in __context__['cyg.all_packages']: __...
python
def _get_all_packages(mirror=DEFAULT_MIRROR, cyg_arch='x86_64'): ''' Return the list of packages based on the mirror provided. ''' if 'cyg.all_packages' not in __context__: __context__['cyg.all_packages'] = {} if mirror not in __context__['cyg.all_packages']: __...
[ "def", "_get_all_packages", "(", "mirror", "=", "DEFAULT_MIRROR", ",", "cyg_arch", "=", "'x86_64'", ")", ":", "if", "'cyg.all_packages'", "not", "in", "__context__", ":", "__context__", "[", "'cyg.all_packages'", "]", "=", "{", "}", "if", "mirror", "not", "in"...
Return the list of packages based on the mirror provided.
[ "Return", "the", "list", "of", "packages", "based", "on", "the", "mirror", "provided", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L81-L103
train
saltstack/salt
salt/modules/cyg.py
check_valid_package
def check_valid_package(package, cyg_arch='x86_64', mirrors=None): ''' Check if the package is valid on the given mirrors. Args: package: The name of the package cyg_arch: The cygwin architecture mirrors: any mirrors to check Retu...
python
def check_valid_package(package, cyg_arch='x86_64', mirrors=None): ''' Check if the package is valid on the given mirrors. Args: package: The name of the package cyg_arch: The cygwin architecture mirrors: any mirrors to check Retu...
[ "def", "check_valid_package", "(", "package", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "if", "mirrors", "is", "None", ":", "mirrors", "=", "[", "{", "DEFAULT_MIRROR", ":", "DEFAULT_MIRROR_KEY", "}", "]", "LOG", ".", "debug",...
Check if the package is valid on the given mirrors. Args: package: The name of the package cyg_arch: The cygwin architecture mirrors: any mirrors to check Returns (bool): True if Valid, otherwise False CLI Example: .. code-block:: bash salt '*' cyg.check_valid_packag...
[ "Check", "if", "the", "package", "is", "valid", "on", "the", "given", "mirrors", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L106-L134
train
saltstack/salt
salt/modules/cyg.py
_run_silent_cygwin
def _run_silent_cygwin(cyg_arch='x86_64', args=None, mirrors=None): ''' Retrieve the correct setup.exe. Run it with the correct arguments to get the bare minimum cygwin installation up and running. ''' cyg_cache_dir = os.sep.join(['c:', 'cygcache'])...
python
def _run_silent_cygwin(cyg_arch='x86_64', args=None, mirrors=None): ''' Retrieve the correct setup.exe. Run it with the correct arguments to get the bare minimum cygwin installation up and running. ''' cyg_cache_dir = os.sep.join(['c:', 'cygcache'])...
[ "def", "_run_silent_cygwin", "(", "cyg_arch", "=", "'x86_64'", ",", "args", "=", "None", ",", "mirrors", "=", "None", ")", ":", "cyg_cache_dir", "=", "os", ".", "sep", ".", "join", "(", "[", "'c:'", ",", "'cygcache'", "]", ")", "cyg_setup", "=", "'setu...
Retrieve the correct setup.exe. Run it with the correct arguments to get the bare minimum cygwin installation up and running.
[ "Retrieve", "the", "correct", "setup", ".", "exe", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L137-L191
train
saltstack/salt
salt/modules/cyg.py
_cygcheck
def _cygcheck(args, cyg_arch='x86_64'): ''' Run the cygcheck executable. ''' cmd = ' '.join([ os.sep.join(['c:', _get_cyg_dir(cyg_arch), 'bin', 'cygcheck']), '-c', args]) ret = __salt__['cmd.run_all'](cmd) if ret['retcode'] == 0: return ret['stdout'] else: r...
python
def _cygcheck(args, cyg_arch='x86_64'): ''' Run the cygcheck executable. ''' cmd = ' '.join([ os.sep.join(['c:', _get_cyg_dir(cyg_arch), 'bin', 'cygcheck']), '-c', args]) ret = __salt__['cmd.run_all'](cmd) if ret['retcode'] == 0: return ret['stdout'] else: r...
[ "def", "_cygcheck", "(", "args", ",", "cyg_arch", "=", "'x86_64'", ")", ":", "cmd", "=", "' '", ".", "join", "(", "[", "os", ".", "sep", ".", "join", "(", "[", "'c:'", ",", "_get_cyg_dir", "(", "cyg_arch", ")", ",", "'bin'", ",", "'cygcheck'", "]",...
Run the cygcheck executable.
[ "Run", "the", "cygcheck", "executable", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L194-L207
train
saltstack/salt
salt/modules/cyg.py
install
def install(packages=None, cyg_arch='x86_64', mirrors=None): ''' Install one or several packages. packages : None The packages to install cyg_arch : x86_64 Specify the architecture to install the package under Current options are x86 and x86_64 CLI ...
python
def install(packages=None, cyg_arch='x86_64', mirrors=None): ''' Install one or several packages. packages : None The packages to install cyg_arch : x86_64 Specify the architecture to install the package under Current options are x86 and x86_64 CLI ...
[ "def", "install", "(", "packages", "=", "None", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "args", "=", "[", "]", "# If we want to install packages", "if", "packages", "is", "not", "None", ":", "args", ".", "append", "(", "'...
Install one or several packages. packages : None The packages to install cyg_arch : x86_64 Specify the architecture to install the package under Current options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.install dos2unix salt '*' cyg.in...
[ "Install", "one", "or", "several", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L210-L239
train
saltstack/salt
salt/modules/cyg.py
uninstall
def uninstall(packages, cyg_arch='x86_64', mirrors=None): ''' Uninstall one or several packages. packages The packages to uninstall. cyg_arch : x86_64 Specify the architecture to remove the package from Current options are x86 and x86_64 CLI Exa...
python
def uninstall(packages, cyg_arch='x86_64', mirrors=None): ''' Uninstall one or several packages. packages The packages to uninstall. cyg_arch : x86_64 Specify the architecture to remove the package from Current options are x86 and x86_64 CLI Exa...
[ "def", "uninstall", "(", "packages", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "args", "=", "[", "]", "if", "packages", "is", "not", "None", ":", "args", ".", "append", "(", "'--remove-packages {pkgs}'", ".", "format", "(",...
Uninstall one or several packages. packages The packages to uninstall. cyg_arch : x86_64 Specify the architecture to remove the package from Current options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.uninstall dos2unix salt '*' cyg.unin...
[ "Uninstall", "one", "or", "several", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L242-L270
train
saltstack/salt
salt/modules/cyg.py
update
def update(cyg_arch='x86_64', mirrors=None): ''' Update all packages. cyg_arch : x86_64 Specify the cygwin architecture update Current options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.update salt '*' cyg.update dos2unix mirrors="[{'http://...
python
def update(cyg_arch='x86_64', mirrors=None): ''' Update all packages. cyg_arch : x86_64 Specify the cygwin architecture update Current options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.update salt '*' cyg.update dos2unix mirrors="[{'http://...
[ "def", "update", "(", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "args", "=", "[", "]", "args", ".", "append", "(", "'--upgrade-also'", ")", "# Can't update something that isn't installed", "if", "not", "_check_cygwin_installed", "(", "c...
Update all packages. cyg_arch : x86_64 Specify the cygwin architecture update Current options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.update salt '*' cyg.update dos2unix mirrors="[{'http://mirror': 'http://url/to/public/key}]"
[ "Update", "all", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L273-L296
train
saltstack/salt
salt/modules/cyg.py
list_
def list_(package='', cyg_arch='x86_64'): ''' List locally installed packages. package : '' package name to check. else all cyg_arch : Cygwin architecture to use Options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.list ''' pkgs =...
python
def list_(package='', cyg_arch='x86_64'): ''' List locally installed packages. package : '' package name to check. else all cyg_arch : Cygwin architecture to use Options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.list ''' pkgs =...
[ "def", "list_", "(", "package", "=", "''", ",", "cyg_arch", "=", "'x86_64'", ")", ":", "pkgs", "=", "{", "}", "args", "=", "' '", ".", "join", "(", "[", "'-c'", ",", "'-d'", ",", "package", "]", ")", "stdout", "=", "_cygcheck", "(", "args", ",", ...
List locally installed packages. package : '' package name to check. else all cyg_arch : Cygwin architecture to use Options are x86 and x86_64 CLI Example: .. code-block:: bash salt '*' cyg.list
[ "List", "locally", "installed", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cyg.py#L299-L328
train
saltstack/salt
salt/roster/cloud.py
targets
def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613 ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' ret = {} cloud_opts = salt.config.cloud_config( os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud...
python
def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613 ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' ret = {} cloud_opts = salt.config.cloud_config( os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud...
[ "def", "targets", "(", "tgt", ",", "tgt_type", "=", "'glob'", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=W0613", "ret", "=", "{", "}", "cloud_opts", "=", "salt", ".", "config", ".", "cloud_config", "(", "os", ".", "path", ".", "join", "(", ...
Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster
[ "Return", "the", "targets", "from", "the", "flat", "yaml", "file", "checks", "opts", "for", "location", "but", "defaults", "to", "/", "etc", "/", "salt", "/", "roster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/cloud.py#L34-L94
train
saltstack/salt
salt/roster/cloud.py
extract_ipv4
def extract_ipv4(roster_order, ipv4): ''' Extract the preferred IP address from the ipv4 grain ''' for ip_type in roster_order: for ip_ in ipv4: if ':' in ip_: continue if not salt.utils.validate.net.ipv4_addr(ip_): continue if ...
python
def extract_ipv4(roster_order, ipv4): ''' Extract the preferred IP address from the ipv4 grain ''' for ip_type in roster_order: for ip_ in ipv4: if ':' in ip_: continue if not salt.utils.validate.net.ipv4_addr(ip_): continue if ...
[ "def", "extract_ipv4", "(", "roster_order", ",", "ipv4", ")", ":", "for", "ip_type", "in", "roster_order", ":", "for", "ip_", "in", "ipv4", ":", "if", "':'", "in", "ip_", ":", "continue", "if", "not", "salt", ".", "utils", ".", "validate", ".", "net", ...
Extract the preferred IP address from the ipv4 grain
[ "Extract", "the", "preferred", "IP", "address", "from", "the", "ipv4", "grain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/cloud.py#L97-L113
train
saltstack/salt
salt/utils/nxos_api.py
_prepare_connection
def _prepare_connection(**nxos_api_kwargs): ''' Prepare the connection with the remote network device, and clean up the key value pairs, removing the args used for the connection init. ''' nxos_api_kwargs = clean_kwargs(**nxos_api_kwargs) init_kwargs = {} # Clean up any arguments that are no...
python
def _prepare_connection(**nxos_api_kwargs): ''' Prepare the connection with the remote network device, and clean up the key value pairs, removing the args used for the connection init. ''' nxos_api_kwargs = clean_kwargs(**nxos_api_kwargs) init_kwargs = {} # Clean up any arguments that are no...
[ "def", "_prepare_connection", "(", "*", "*", "nxos_api_kwargs", ")", ":", "nxos_api_kwargs", "=", "clean_kwargs", "(", "*", "*", "nxos_api_kwargs", ")", "init_kwargs", "=", "{", "}", "# Clean up any arguments that are not required", "for", "karg", ",", "warg", "in",...
Prepare the connection with the remote network device, and clean up the key value pairs, removing the args used for the connection init.
[ "Prepare", "the", "connection", "with", "the", "remote", "network", "device", "and", "clean", "up", "the", "key", "value", "pairs", "removing", "the", "args", "used", "for", "the", "connection", "init", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nxos_api.py#L34-L60
train
saltstack/salt
salt/utils/nxos_api.py
rpc
def rpc(commands, method='cli', **kwargs): ''' Execute an arbitrary RPC request via the Nexus API. commands The commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii``) or structured document (``cli``). Defaults to ``cli`...
python
def rpc(commands, method='cli', **kwargs): ''' Execute an arbitrary RPC request via the Nexus API. commands The commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii``) or structured document (``cli``). Defaults to ``cli`...
[ "def", "rpc", "(", "commands", ",", "method", "=", "'cli'", ",", "*", "*", "kwargs", ")", ":", "init_args", "=", "_prepare_connection", "(", "*", "*", "kwargs", ")", "log", ".", "error", "(", "'These are the init args:'", ")", "log", ".", "error", "(", ...
Execute an arbitrary RPC request via the Nexus API. commands The commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii``) or structured document (``cli``). Defaults to ``cli`` (structured data). transport: ``https`` Specifies the ty...
[ "Execute", "an", "arbitrary", "RPC", "request", "via", "the", "Nexus", "API", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nxos_api.py#L63-L144
train
saltstack/salt
salt/utils/reactor.py
Reactor.render_reaction
def render_reaction(self, glob_ref, tag, data): ''' Execute the render system against a single reaction file and return the data structure ''' react = {} if glob_ref.startswith('salt://'): glob_ref = self.minion.functions['cp.cache_file'](glob_ref) or '' ...
python
def render_reaction(self, glob_ref, tag, data): ''' Execute the render system against a single reaction file and return the data structure ''' react = {} if glob_ref.startswith('salt://'): glob_ref = self.minion.functions['cp.cache_file'](glob_ref) or '' ...
[ "def", "render_reaction", "(", "self", ",", "glob_ref", ",", "tag", ",", "data", ")", ":", "react", "=", "{", "}", "if", "glob_ref", ".", "startswith", "(", "'salt://'", ")", ":", "glob_ref", "=", "self", ".", "minion", ".", "functions", "[", "'cp.cach...
Execute the render system against a single reaction file and return the data structure
[ "Execute", "the", "render", "system", "against", "a", "single", "reaction", "file", "and", "return", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L100-L127
train
saltstack/salt
salt/utils/reactor.py
Reactor.list_reactors
def list_reactors(self, tag): ''' Take in the tag from an event and return a list of the reactors to process ''' log.debug('Gathering reactors for tag %s', tag) reactors = [] if isinstance(self.opts['reactor'], six.string_types): try: w...
python
def list_reactors(self, tag): ''' Take in the tag from an event and return a list of the reactors to process ''' log.debug('Gathering reactors for tag %s', tag) reactors = [] if isinstance(self.opts['reactor'], six.string_types): try: w...
[ "def", "list_reactors", "(", "self", ",", "tag", ")", ":", "log", ".", "debug", "(", "'Gathering reactors for tag %s'", ",", "tag", ")", "reactors", "=", "[", "]", "if", "isinstance", "(", "self", ".", "opts", "[", "'reactor'", "]", ",", "six", ".", "s...
Take in the tag from an event and return a list of the reactors to process
[ "Take", "in", "the", "tag", "from", "an", "event", "and", "return", "a", "list", "of", "the", "reactors", "to", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L129-L158
train
saltstack/salt
salt/utils/reactor.py
Reactor.list_all
def list_all(self): ''' Return a list of the reactors ''' if isinstance(self.minion.opts['reactor'], six.string_types): log.debug('Reading reactors from yaml %s', self.opts['reactor']) try: with salt.utils.files.fopen(self.opts['reactor']) as fp_: ...
python
def list_all(self): ''' Return a list of the reactors ''' if isinstance(self.minion.opts['reactor'], six.string_types): log.debug('Reading reactors from yaml %s', self.opts['reactor']) try: with salt.utils.files.fopen(self.opts['reactor']) as fp_: ...
[ "def", "list_all", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "minion", ".", "opts", "[", "'reactor'", "]", ",", "six", ".", "string_types", ")", ":", "log", ".", "debug", "(", "'Reading reactors from yaml %s'", ",", "self", ".", "opts"...
Return a list of the reactors
[ "Return", "a", "list", "of", "the", "reactors" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L160-L179
train
saltstack/salt
salt/utils/reactor.py
Reactor.add_reactor
def add_reactor(self, tag, reaction): ''' Add a reactor ''' reactors = self.list_all() for reactor in reactors: _tag = next(six.iterkeys(reactor)) if _tag == tag: return {'status': False, 'comment': 'Reactor already exists.'} self....
python
def add_reactor(self, tag, reaction): ''' Add a reactor ''' reactors = self.list_all() for reactor in reactors: _tag = next(six.iterkeys(reactor)) if _tag == tag: return {'status': False, 'comment': 'Reactor already exists.'} self....
[ "def", "add_reactor", "(", "self", ",", "tag", ",", "reaction", ")", ":", "reactors", "=", "self", ".", "list_all", "(", ")", "for", "reactor", "in", "reactors", ":", "_tag", "=", "next", "(", "six", ".", "iterkeys", "(", "reactor", ")", ")", "if", ...
Add a reactor
[ "Add", "a", "reactor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L181-L192
train
saltstack/salt
salt/utils/reactor.py
Reactor.delete_reactor
def delete_reactor(self, tag): ''' Delete a reactor ''' reactors = self.list_all() for reactor in reactors: _tag = next(six.iterkeys(reactor)) if _tag == tag: self.minion.opts['reactor'].remove(reactor) return {'status': Tru...
python
def delete_reactor(self, tag): ''' Delete a reactor ''' reactors = self.list_all() for reactor in reactors: _tag = next(six.iterkeys(reactor)) if _tag == tag: self.minion.opts['reactor'].remove(reactor) return {'status': Tru...
[ "def", "delete_reactor", "(", "self", ",", "tag", ")", ":", "reactors", "=", "self", ".", "list_all", "(", ")", "for", "reactor", "in", "reactors", ":", "_tag", "=", "next", "(", "six", ".", "iterkeys", "(", "reactor", ")", ")", "if", "_tag", "==", ...
Delete a reactor
[ "Delete", "a", "reactor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L194-L205
train
saltstack/salt
salt/utils/reactor.py
Reactor.resolve_aliases
def resolve_aliases(self, chunks): ''' Preserve backward compatibility by rewriting the 'state' key in the low chunks if it is using a legacy type. ''' for idx, _ in enumerate(chunks): new_state = self.aliases.get(chunks[idx]['state']) if new_state is not ...
python
def resolve_aliases(self, chunks): ''' Preserve backward compatibility by rewriting the 'state' key in the low chunks if it is using a legacy type. ''' for idx, _ in enumerate(chunks): new_state = self.aliases.get(chunks[idx]['state']) if new_state is not ...
[ "def", "resolve_aliases", "(", "self", ",", "chunks", ")", ":", "for", "idx", ",", "_", "in", "enumerate", "(", "chunks", ")", ":", "new_state", "=", "self", ".", "aliases", ".", "get", "(", "chunks", "[", "idx", "]", "[", "'state'", "]", ")", "if"...
Preserve backward compatibility by rewriting the 'state' key in the low chunks if it is using a legacy type.
[ "Preserve", "backward", "compatibility", "by", "rewriting", "the", "state", "key", "in", "the", "low", "chunks", "if", "it", "is", "using", "a", "legacy", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L207-L215
train
saltstack/salt
salt/utils/reactor.py
Reactor.reactions
def reactions(self, tag, data, reactors): ''' Render a list of reactor files and returns a reaction struct ''' log.debug('Compiling reactions for tag %s', tag) high = {} chunks = [] try: for fn_ in reactors: high.update(self.render_reac...
python
def reactions(self, tag, data, reactors): ''' Render a list of reactor files and returns a reaction struct ''' log.debug('Compiling reactions for tag %s', tag) high = {} chunks = [] try: for fn_ in reactors: high.update(self.render_reac...
[ "def", "reactions", "(", "self", ",", "tag", ",", "data", ",", "reactors", ")", ":", "log", ".", "debug", "(", "'Compiling reactions for tag %s'", ",", "tag", ")", "high", "=", "{", "}", "chunks", "=", "[", "]", "try", ":", "for", "fn_", "in", "react...
Render a list of reactor files and returns a reaction struct
[ "Render", "a", "list", "of", "reactor", "files", "and", "returns", "a", "reaction", "struct" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L217-L241
train
saltstack/salt
salt/utils/reactor.py
Reactor.run
def run(self): ''' Enter into the server loop ''' salt.utils.process.appendproctitle(self.__class__.__name__) # instantiate some classes inside our new process self.event = salt.utils.event.get_event( self.opts['__role'], self.opts['sock_d...
python
def run(self): ''' Enter into the server loop ''' salt.utils.process.appendproctitle(self.__class__.__name__) # instantiate some classes inside our new process self.event = salt.utils.event.get_event( self.opts['__role'], self.opts['sock_d...
[ "def", "run", "(", "self", ")", ":", "salt", ".", "utils", ".", "process", ".", "appendproctitle", "(", "self", ".", "__class__", ".", "__name__", ")", "# instantiate some classes inside our new process", "self", ".", "event", "=", "salt", ".", "utils", ".", ...
Enter into the server loop
[ "Enter", "into", "the", "server", "loop" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L250-L325
train
saltstack/salt
salt/utils/reactor.py
ReactWrap.populate_client_cache
def populate_client_cache(self, low): ''' Populate the client cache with an instance of the specified type ''' reaction_type = low['state'] if reaction_type not in self.client_cache: log.debug('Reactor is populating %s client cache', reaction_type) if reac...
python
def populate_client_cache(self, low): ''' Populate the client cache with an instance of the specified type ''' reaction_type = low['state'] if reaction_type not in self.client_cache: log.debug('Reactor is populating %s client cache', reaction_type) if reac...
[ "def", "populate_client_cache", "(", "self", ",", "low", ")", ":", "reaction_type", "=", "low", "[", "'state'", "]", "if", "reaction_type", "not", "in", "self", ".", "client_cache", ":", "log", ".", "debug", "(", "'Reactor is populating %s client cache'", ",", ...
Populate the client cache with an instance of the specified type
[ "Populate", "the", "client", "cache", "with", "an", "instance", "of", "the", "specified", "type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L353-L376
train
saltstack/salt
salt/utils/reactor.py
ReactWrap.run
def run(self, low): ''' Execute a reaction by invoking the proper wrapper func ''' self.populate_client_cache(low) try: l_fun = getattr(self, low['state']) except AttributeError: log.error( 'ReactWrap is missing a wrapper function f...
python
def run(self, low): ''' Execute a reaction by invoking the proper wrapper func ''' self.populate_client_cache(low) try: l_fun = getattr(self, low['state']) except AttributeError: log.error( 'ReactWrap is missing a wrapper function f...
[ "def", "run", "(", "self", ",", "low", ")", ":", "self", ".", "populate_client_cache", "(", "low", ")", "try", ":", "l_fun", "=", "getattr", "(", "self", ",", "low", "[", "'state'", "]", ")", "except", "AttributeError", ":", "log", ".", "error", "(",...
Execute a reaction by invoking the proper wrapper func
[ "Execute", "a", "reaction", "by", "invoking", "the", "proper", "wrapper", "func" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L378-L490
train
saltstack/salt
salt/utils/reactor.py
ReactWrap.runner
def runner(self, fun, **kwargs): ''' Wrap RunnerClient for executing :ref:`runner modules <all-salt.runners>` ''' return self.pool.fire_async(self.client_cache['runner'].low, args=(fun, kwargs))
python
def runner(self, fun, **kwargs): ''' Wrap RunnerClient for executing :ref:`runner modules <all-salt.runners>` ''' return self.pool.fire_async(self.client_cache['runner'].low, args=(fun, kwargs))
[ "def", "runner", "(", "self", ",", "fun", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "pool", ".", "fire_async", "(", "self", ".", "client_cache", "[", "'runner'", "]", ".", "low", ",", "args", "=", "(", "fun", ",", "kwargs", ")", "...
Wrap RunnerClient for executing :ref:`runner modules <all-salt.runners>`
[ "Wrap", "RunnerClient", "for", "executing", ":", "ref", ":", "runner", "modules", "<all", "-", "salt", ".", "runners", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L492-L496
train
saltstack/salt
salt/utils/reactor.py
ReactWrap.local
def local(self, fun, tgt, **kwargs): ''' Wrap LocalClient for running :ref:`execution modules <all-salt.modules>` ''' self.client_cache['local'].cmd_async(tgt, fun, **kwargs)
python
def local(self, fun, tgt, **kwargs): ''' Wrap LocalClient for running :ref:`execution modules <all-salt.modules>` ''' self.client_cache['local'].cmd_async(tgt, fun, **kwargs)
[ "def", "local", "(", "self", ",", "fun", ",", "tgt", ",", "*", "*", "kwargs", ")", ":", "self", ".", "client_cache", "[", "'local'", "]", ".", "cmd_async", "(", "tgt", ",", "fun", ",", "*", "*", "kwargs", ")" ]
Wrap LocalClient for running :ref:`execution modules <all-salt.modules>`
[ "Wrap", "LocalClient", "for", "running", ":", "ref", ":", "execution", "modules", "<all", "-", "salt", ".", "modules", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L504-L508
train
saltstack/salt
salt/utils/reactor.py
ReactWrap.caller
def caller(self, fun, **kwargs): ''' Wrap LocalCaller to execute remote exec functions locally on the Minion ''' self.client_cache['caller'].cmd(fun, *kwargs['arg'], **kwargs['kwarg'])
python
def caller(self, fun, **kwargs): ''' Wrap LocalCaller to execute remote exec functions locally on the Minion ''' self.client_cache['caller'].cmd(fun, *kwargs['arg'], **kwargs['kwarg'])
[ "def", "caller", "(", "self", ",", "fun", ",", "*", "*", "kwargs", ")", ":", "self", ".", "client_cache", "[", "'caller'", "]", ".", "cmd", "(", "fun", ",", "*", "kwargs", "[", "'arg'", "]", ",", "*", "*", "kwargs", "[", "'kwarg'", "]", ")" ]
Wrap LocalCaller to execute remote exec functions locally on the Minion
[ "Wrap", "LocalCaller", "to", "execute", "remote", "exec", "functions", "locally", "on", "the", "Minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/reactor.py#L510-L514
train
saltstack/salt
salt/runners/auth.py
mk_token
def mk_token(**load): r''' Create an eauth token using provided credentials Non-root users may specify an expiration date -- if allowed via the :conf_master:`token_expire_user_override` setting -- by passing an additional ``token_expire`` param. This overrides the :conf_master:`token_expire` se...
python
def mk_token(**load): r''' Create an eauth token using provided credentials Non-root users may specify an expiration date -- if allowed via the :conf_master:`token_expire_user_override` setting -- by passing an additional ``token_expire`` param. This overrides the :conf_master:`token_expire` se...
[ "def", "mk_token", "(", "*", "*", "load", ")", ":", "# This will hang if the master daemon is not running.", "netapi", "=", "salt", ".", "netapi", ".", "NetapiClient", "(", "__opts__", ")", "if", "not", "netapi", ".", "_is_master_running", "(", ")", ":", "raise"...
r''' Create an eauth token using provided credentials Non-root users may specify an expiration date -- if allowed via the :conf_master:`token_expire_user_override` setting -- by passing an additional ``token_expire`` param. This overrides the :conf_master:`token_expire` setting of the same name in ...
[ "r", "Create", "an", "eauth", "token", "using", "provided", "credentials" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/auth.py#L19-L50
train
saltstack/salt
salt/runners/auth.py
del_token
def del_token(token): ''' Delete an eauth token by name CLI Example: .. code-block:: shell salt-run auth.del_token 6556760736e4077daa601baec2b67c24 ''' token_path = os.path.join(__opts__['token_dir'], token) if os.path.exists(token_path): return os.remove(token_path) is No...
python
def del_token(token): ''' Delete an eauth token by name CLI Example: .. code-block:: shell salt-run auth.del_token 6556760736e4077daa601baec2b67c24 ''' token_path = os.path.join(__opts__['token_dir'], token) if os.path.exists(token_path): return os.remove(token_path) is No...
[ "def", "del_token", "(", "token", ")", ":", "token_path", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'token_dir'", "]", ",", "token", ")", "if", "os", ".", "path", ".", "exists", "(", "token_path", ")", ":", "return", "os", ".", "r...
Delete an eauth token by name CLI Example: .. code-block:: shell salt-run auth.del_token 6556760736e4077daa601baec2b67c24
[ "Delete", "an", "eauth", "token", "by", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/auth.py#L53-L66
train
saltstack/salt
salt/thorium/runner.py
cmd
def cmd( name, func=None, arg=(), **kwargs): ''' Execute a runner asynchronous: USAGE: .. code-block:: yaml run_cloud: runner.cmd: - func: cloud.create - arg: - my-ec2-config - myinstance ...
python
def cmd( name, func=None, arg=(), **kwargs): ''' Execute a runner asynchronous: USAGE: .. code-block:: yaml run_cloud: runner.cmd: - func: cloud.create - arg: - my-ec2-config - myinstance ...
[ "def", "cmd", "(", "name", ",", "func", "=", "None", ",", "arg", "=", "(", ")", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "Tr...
Execute a runner asynchronous: USAGE: .. code-block:: yaml run_cloud: runner.cmd: - func: cloud.create - arg: - my-ec2-config - myinstance run_cloud: runner.cmd: - func: cloud.create - kwargs:...
[ "Execute", "a", "runner", "asynchronous", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/runner.py#L11-L53
train
saltstack/salt
salt/serializers/configparser.py
deserialize
def deserialize(stream_or_string, **options): ''' Deserialize any string or stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower configparser module. ''' if six.PY3: cp = configparser.ConfigPar...
python
def deserialize(stream_or_string, **options): ''' Deserialize any string or stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower configparser module. ''' if six.PY3: cp = configparser.ConfigPar...
[ "def", "deserialize", "(", "stream_or_string", ",", "*", "*", "options", ")", ":", "if", "six", ".", "PY3", ":", "cp", "=", "configparser", ".", "ConfigParser", "(", "*", "*", "options", ")", "else", ":", "cp", "=", "configparser", ".", "SafeConfigParser...
Deserialize any string or stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower configparser module.
[ "Deserialize", "any", "string", "or", "stream", "like", "object", "into", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/configparser.py#L24-L57
train
saltstack/salt
salt/serializers/configparser.py
serialize
def serialize(obj, **options): ''' Serialize Python data to a configparser formatted string or file. :param obj: the data structure to serialize :param options: options given to lower configparser module. ''' try: if not isinstance(obj, dict): raise TypeError("configparser ...
python
def serialize(obj, **options): ''' Serialize Python data to a configparser formatted string or file. :param obj: the data structure to serialize :param options: options given to lower configparser module. ''' try: if not isinstance(obj, dict): raise TypeError("configparser ...
[ "def", "serialize", "(", "obj", ",", "*", "*", "options", ")", ":", "try", ":", "if", "not", "isinstance", "(", "obj", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"configparser can only serialize dictionaries, not {0}\"", ".", "format", "(", "type", ...
Serialize Python data to a configparser formatted string or file. :param obj: the data structure to serialize :param options: options given to lower configparser module.
[ "Serialize", "Python", "data", "to", "a", "configparser", "formatted", "string", "or", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/configparser.py#L60-L85
train
saltstack/salt
salt/serializers/configparser.py
_read_dict
def _read_dict(cp, dictionary): ''' Cribbed from python3's ConfigParser.read_dict function. ''' for section, keys in dictionary.items(): section = six.text_type(section) if _is_defaultsect(section): if six.PY2: section = configparser.DEFAULTSECT else:...
python
def _read_dict(cp, dictionary): ''' Cribbed from python3's ConfigParser.read_dict function. ''' for section, keys in dictionary.items(): section = six.text_type(section) if _is_defaultsect(section): if six.PY2: section = configparser.DEFAULTSECT else:...
[ "def", "_read_dict", "(", "cp", ",", "dictionary", ")", ":", "for", "section", ",", "keys", "in", "dictionary", ".", "items", "(", ")", ":", "section", "=", "six", ".", "text_type", "(", "section", ")", "if", "_is_defaultsect", "(", "section", ")", ":"...
Cribbed from python3's ConfigParser.read_dict function.
[ "Cribbed", "from", "python3", "s", "ConfigParser", ".", "read_dict", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/configparser.py#L95-L112
train
saltstack/salt
salt/states/boto_s3.py
object_present
def object_present( name, source=None, hash_type=None, extra_args=None, extra_args_from_pillar='boto_s3_object_extra_args', region=None, key=None, keyid=None, profile=None, ): ''' Ensure object exists in S3. name The name of the state definition. This wil...
python
def object_present( name, source=None, hash_type=None, extra_args=None, extra_args_from_pillar='boto_s3_object_extra_args', region=None, key=None, keyid=None, profile=None, ): ''' Ensure object exists in S3. name The name of the state definition. This wil...
[ "def", "object_present", "(", "name", ",", "source", "=", "None", ",", "hash_type", "=", "None", ",", "extra_args", "=", "None", ",", "extra_args_from_pillar", "=", "'boto_s3_object_extra_args'", ",", "region", "=", "None", ",", "key", "=", "None", ",", "key...
Ensure object exists in S3. name The name of the state definition. This will be used to determine the location of the object in S3, by splitting on the first slash and using the first part as the bucket name and the remainder as the S3 key. source The source file to upl...
[ "Ensure", "object", "exists", "in", "S3", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_s3.py#L110-L310
train
saltstack/salt
salt/states/pecl.py
installed
def installed(name, version=None, defaults=False, force=False, preferred_state='stable'): ''' .. versionadded:: 0.17.0 Make sure that a pecl extension is installed. name The pecl extension name to install version The pecl ext...
python
def installed(name, version=None, defaults=False, force=False, preferred_state='stable'): ''' .. versionadded:: 0.17.0 Make sure that a pecl extension is installed. name The pecl extension name to install version The pecl ext...
[ "def", "installed", "(", "name", ",", "version", "=", "None", ",", "defaults", "=", "False", ",", "force", "=", "False", ",", "preferred_state", "=", "'stable'", ")", ":", "# Check to see if we have a designated version", "if", "not", "isinstance", "(", "version...
.. versionadded:: 0.17.0 Make sure that a pecl extension is installed. name The pecl extension name to install version The pecl extension version to install. This option may be ignored to install the latest stable version. defaults Use default answers for extensions s...
[ "..", "versionadded", "::", "0", ".", "17", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pecl.py#L34-L105
train
saltstack/salt
salt/states/pecl.py
removed
def removed(name): ''' Make sure that a pecl extension is not installed. name The pecl extension name to uninstall ''' ret = {'name': name, 'result': None, 'comment': '', 'changes': {}} if name not in __salt__['pecl.list'](): ret['result'] = True ret['comment'] = 'Pecl e...
python
def removed(name): ''' Make sure that a pecl extension is not installed. name The pecl extension name to uninstall ''' ret = {'name': name, 'result': None, 'comment': '', 'changes': {}} if name not in __salt__['pecl.list'](): ret['result'] = True ret['comment'] = 'Pecl e...
[ "def", "removed", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "name", "not", "in", "__salt__", "[", "'pecl.list'", "]", "(", ...
Make sure that a pecl extension is not installed. name The pecl extension name to uninstall
[ "Make", "sure", "that", "a", "pecl", "extension", "is", "not", "installed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pecl.py#L108-L133
train
saltstack/salt
salt/states/boto_kms.py
key_present
def key_present( name, policy, description=None, key_usage=None, grants=None, manage_grants=False, key_rotation=False, enabled=True, region=None, key=None, keyid=None, profile=None): ''' Ensure the KMS key exists. KM...
python
def key_present( name, policy, description=None, key_usage=None, grants=None, manage_grants=False, key_rotation=False, enabled=True, region=None, key=None, keyid=None, profile=None): ''' Ensure the KMS key exists. KM...
[ "def", "key_present", "(", "name", ",", "policy", ",", "description", "=", "None", ",", "key_usage", "=", "None", ",", "grants", "=", "None", ",", "manage_grants", "=", "False", ",", "key_rotation", "=", "False", ",", "enabled", "=", "True", ",", "region...
Ensure the KMS key exists. KMS keys can not be deleted, so this function must be used to ensure the key is enabled or disabled. name Name of the key. policy Key usage policy. description Description of the key. key_usage Specifies the intended use of the key. Can ...
[ "Ensure", "the", "KMS", "key", "exists", ".", "KMS", "keys", "can", "not", "be", "deleted", "so", "this", "function", "must", "be", "used", "to", "ensure", "the", "key", "is", "enabled", "or", "disabled", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_kms.py#L71-L151
train
saltstack/salt
salt/roster/__init__.py
get_roster_file
def get_roster_file(options): ''' Find respective roster file. :param options: :return: ''' template = None # The __disable_custom_roster is always True if Salt SSH Client comes # from Salt API. In that case no way to define own 'roster_file', instead # this file needs to be chosen ...
python
def get_roster_file(options): ''' Find respective roster file. :param options: :return: ''' template = None # The __disable_custom_roster is always True if Salt SSH Client comes # from Salt API. In that case no way to define own 'roster_file', instead # this file needs to be chosen ...
[ "def", "get_roster_file", "(", "options", ")", ":", "template", "=", "None", "# The __disable_custom_roster is always True if Salt SSH Client comes", "# from Salt API. In that case no way to define own 'roster_file', instead", "# this file needs to be chosen from already validated rosters", ...
Find respective roster file. :param options: :return:
[ "Find", "respective", "roster", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/__init__.py#L21-L59
train
saltstack/salt
salt/roster/__init__.py
Roster._gen_back
def _gen_back(self): ''' Return a list of loaded roster backends ''' back = set() if self.backends: for backend in self.backends: fun = '{0}.targets'.format(backend) if fun in self.rosters: back.add(backend) ...
python
def _gen_back(self): ''' Return a list of loaded roster backends ''' back = set() if self.backends: for backend in self.backends: fun = '{0}.targets'.format(backend) if fun in self.rosters: back.add(backend) ...
[ "def", "_gen_back", "(", "self", ")", ":", "back", "=", "set", "(", ")", "if", "self", ".", "backends", ":", "for", "backend", "in", "self", ".", "backends", ":", "fun", "=", "'{0}.targets'", ".", "format", "(", "backend", ")", "if", "fun", "in", "...
Return a list of loaded roster backends
[ "Return", "a", "list", "of", "loaded", "roster", "backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/__init__.py#L81-L92
train
saltstack/salt
salt/roster/__init__.py
Roster.targets
def targets(self, tgt, tgt_type): ''' Return a dict of {'id': {'ipv4': <ipaddr>}} data sets to be used as targets given the passed tgt and tgt_type ''' targets = {} for back in self._gen_back(): f_str = '{0}.targets'.format(back) if f_str not in se...
python
def targets(self, tgt, tgt_type): ''' Return a dict of {'id': {'ipv4': <ipaddr>}} data sets to be used as targets given the passed tgt and tgt_type ''' targets = {} for back in self._gen_back(): f_str = '{0}.targets'.format(back) if f_str not in se...
[ "def", "targets", "(", "self", ",", "tgt", ",", "tgt_type", ")", ":", "targets", "=", "{", "}", "for", "back", "in", "self", ".", "_gen_back", "(", ")", ":", "f_str", "=", "'{0}.targets'", ".", "format", "(", "back", ")", "if", "f_str", "not", "in"...
Return a dict of {'id': {'ipv4': <ipaddr>}} data sets to be used as targets given the passed tgt and tgt_type
[ "Return", "a", "dict", "of", "{", "id", ":", "{", "ipv4", ":", "<ipaddr", ">", "}}", "data", "sets", "to", "be", "used", "as", "targets", "given", "the", "passed", "tgt", "and", "tgt_type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/__init__.py#L94-L112
train
saltstack/salt
salt/utils/args.py
clean_kwargs
def clean_kwargs(**kwargs): ''' Return a dict without any of the __pub* keys (or any other keys starting with a dunder) from the kwargs dict passed into the execution module functions. These keys are useful for tracking what was used to invoke the function call, but they may not be desirable to have...
python
def clean_kwargs(**kwargs): ''' Return a dict without any of the __pub* keys (or any other keys starting with a dunder) from the kwargs dict passed into the execution module functions. These keys are useful for tracking what was used to invoke the function call, but they may not be desirable to have...
[ "def", "clean_kwargs", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "for", "key", ",", "val", "in", "six", ".", "iteritems", "(", "kwargs", ")", ":", "if", "not", "key", ".", "startswith", "(", "'__'", ")", ":", "ret", "[", "key", "...
Return a dict without any of the __pub* keys (or any other keys starting with a dunder) from the kwargs dict passed into the execution module functions. These keys are useful for tracking what was used to invoke the function call, but they may not be desirable to have if passing the kwargs forward whole...
[ "Return", "a", "dict", "without", "any", "of", "the", "__pub", "*", "keys", "(", "or", "any", "other", "keys", "starting", "with", "a", "dunder", ")", "from", "the", "kwargs", "dict", "passed", "into", "the", "execution", "module", "functions", ".", "The...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L30-L48
train
saltstack/salt
salt/utils/args.py
invalid_kwargs
def invalid_kwargs(invalid_kwargs, raise_exc=True): ''' Raise a SaltInvocationError if invalid_kwargs is non-empty ''' if invalid_kwargs: if isinstance(invalid_kwargs, dict): new_invalid = [ '{0}={1}'.format(x, y) for x, y in six.iteritems(invalid_kwar...
python
def invalid_kwargs(invalid_kwargs, raise_exc=True): ''' Raise a SaltInvocationError if invalid_kwargs is non-empty ''' if invalid_kwargs: if isinstance(invalid_kwargs, dict): new_invalid = [ '{0}={1}'.format(x, y) for x, y in six.iteritems(invalid_kwar...
[ "def", "invalid_kwargs", "(", "invalid_kwargs", ",", "raise_exc", "=", "True", ")", ":", "if", "invalid_kwargs", ":", "if", "isinstance", "(", "invalid_kwargs", ",", "dict", ")", ":", "new_invalid", "=", "[", "'{0}={1}'", ".", "format", "(", "x", ",", "y",...
Raise a SaltInvocationError if invalid_kwargs is non-empty
[ "Raise", "a", "SaltInvocationError", "if", "invalid_kwargs", "is", "non", "-", "empty" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L51-L69
train
saltstack/salt
salt/utils/args.py
condition_input
def condition_input(args, kwargs): ''' Return a single arg structure for the publisher to safely use ''' ret = [] for arg in args: if (six.PY3 and isinstance(arg, six.integer_types) and salt.utils.jid.is_jid(six.text_type(arg))) or \ (six.PY2 and isinstance(arg, long)): # pylint: di...
python
def condition_input(args, kwargs): ''' Return a single arg structure for the publisher to safely use ''' ret = [] for arg in args: if (six.PY3 and isinstance(arg, six.integer_types) and salt.utils.jid.is_jid(six.text_type(arg))) or \ (six.PY2 and isinstance(arg, long)): # pylint: di...
[ "def", "condition_input", "(", "args", ",", "kwargs", ")", ":", "ret", "=", "[", "]", "for", "arg", "in", "args", ":", "if", "(", "six", ".", "PY3", "and", "isinstance", "(", "arg", ",", "six", ".", "integer_types", ")", "and", "salt", ".", "utils"...
Return a single arg structure for the publisher to safely use
[ "Return", "a", "single", "arg", "structure", "for", "the", "publisher", "to", "safely", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L72-L88
train
saltstack/salt
salt/utils/args.py
parse_input
def parse_input(args, kwargs=None, condition=True, no_parse=None): ''' Parse out the args and kwargs from a list of input values. Optionally, return the args and kwargs without passing them to condition_input(). Don't pull args with key=val apart if it has a newline in it. ''' if no_parse is No...
python
def parse_input(args, kwargs=None, condition=True, no_parse=None): ''' Parse out the args and kwargs from a list of input values. Optionally, return the args and kwargs without passing them to condition_input(). Don't pull args with key=val apart if it has a newline in it. ''' if no_parse is No...
[ "def", "parse_input", "(", "args", ",", "kwargs", "=", "None", ",", "condition", "=", "True", ",", "no_parse", "=", "None", ")", ":", "if", "no_parse", "is", "None", ":", "no_parse", "=", "(", ")", "if", "kwargs", "is", "None", ":", "kwargs", "=", ...
Parse out the args and kwargs from a list of input values. Optionally, return the args and kwargs without passing them to condition_input(). Don't pull args with key=val apart if it has a newline in it.
[ "Parse", "out", "the", "args", "and", "kwargs", "from", "a", "list", "of", "input", "values", ".", "Optionally", "return", "the", "args", "and", "kwargs", "without", "passing", "them", "to", "condition_input", "()", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L91-L126
train
saltstack/salt
salt/utils/args.py
yamlify_arg
def yamlify_arg(arg): ''' yaml.safe_load the arg ''' if not isinstance(arg, six.string_types): return arg if arg.strip() == '': # Because YAML loads empty (or all whitespace) strings as None, we # return the original string # >>> import yaml # >>> yaml.load('...
python
def yamlify_arg(arg): ''' yaml.safe_load the arg ''' if not isinstance(arg, six.string_types): return arg if arg.strip() == '': # Because YAML loads empty (or all whitespace) strings as None, we # return the original string # >>> import yaml # >>> yaml.load('...
[ "def", "yamlify_arg", "(", "arg", ")", ":", "if", "not", "isinstance", "(", "arg", ",", "six", ".", "string_types", ")", ":", "return", "arg", "if", "arg", ".", "strip", "(", ")", "==", "''", ":", "# Because YAML loads empty (or all whitespace) strings as None...
yaml.safe_load the arg
[ "yaml", ".", "safe_load", "the", "arg" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L146-L217
train
saltstack/salt
salt/utils/args.py
get_function_argspec
def get_function_argspec(func, is_class_method=None): ''' A small wrapper around getargspec that also supports callable classes :param is_class_method: Pass True if you are sure that the function being passed is a class method. The reason for this is that on Python 3 ...
python
def get_function_argspec(func, is_class_method=None): ''' A small wrapper around getargspec that also supports callable classes :param is_class_method: Pass True if you are sure that the function being passed is a class method. The reason for this is that on Python 3 ...
[ "def", "get_function_argspec", "(", "func", ",", "is_class_method", "=", "None", ")", ":", "if", "not", "callable", "(", "func", ")", ":", "raise", "TypeError", "(", "'{0} is not a callable'", ".", "format", "(", "func", ")", ")", "if", "six", ".", "PY2", ...
A small wrapper around getargspec that also supports callable classes :param is_class_method: Pass True if you are sure that the function being passed is a class method. The reason for this is that on Python 3 ``inspect.ismethod`` only returns ``True`` for bou...
[ "A", "small", "wrapper", "around", "getargspec", "that", "also", "supports", "callable", "classes", ":", "param", "is_class_method", ":", "Pass", "True", "if", "you", "are", "sure", "that", "the", "function", "being", "passed", "is", "a", "class", "method", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L239-L285
train
saltstack/salt
salt/utils/args.py
shlex_split
def shlex_split(s, **kwargs): ''' Only split if variable is a string ''' if isinstance(s, six.string_types): # On PY2, shlex.split will fail with unicode types if there are # non-ascii characters in the string. So, we need to make sure we # invoke it with a str type, and then dec...
python
def shlex_split(s, **kwargs): ''' Only split if variable is a string ''' if isinstance(s, six.string_types): # On PY2, shlex.split will fail with unicode types if there are # non-ascii characters in the string. So, we need to make sure we # invoke it with a str type, and then dec...
[ "def", "shlex_split", "(", "s", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "s", ",", "six", ".", "string_types", ")", ":", "# On PY2, shlex.split will fail with unicode types if there are", "# non-ascii characters in the string. So, we need to make sure we"...
Only split if variable is a string
[ "Only", "split", "if", "variable", "is", "a", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L288-L301
train
saltstack/salt
salt/utils/args.py
arg_lookup
def arg_lookup(fun, aspec=None): ''' Return a dict containing the arguments and default arguments to the function. ''' ret = {'kwargs': {}} if aspec is None: aspec = get_function_argspec(fun) if aspec.defaults: ret['kwargs'] = dict(zip(aspec.args[::-1], aspec.defaults[::-1]))...
python
def arg_lookup(fun, aspec=None): ''' Return a dict containing the arguments and default arguments to the function. ''' ret = {'kwargs': {}} if aspec is None: aspec = get_function_argspec(fun) if aspec.defaults: ret['kwargs'] = dict(zip(aspec.args[::-1], aspec.defaults[::-1]))...
[ "def", "arg_lookup", "(", "fun", ",", "aspec", "=", "None", ")", ":", "ret", "=", "{", "'kwargs'", ":", "{", "}", "}", "if", "aspec", "is", "None", ":", "aspec", "=", "get_function_argspec", "(", "fun", ")", "if", "aspec", ".", "defaults", ":", "re...
Return a dict containing the arguments and default arguments to the function.
[ "Return", "a", "dict", "containing", "the", "arguments", "and", "default", "arguments", "to", "the", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L304-L315
train
saltstack/salt
salt/utils/args.py
argspec_report
def argspec_report(functions, module=''): ''' Pass in a functions dict as it is returned from the loader and return the argspec function signatures ''' ret = {} if '*' in module or '.' in module: for fun in fnmatch.filter(functions, module): try: aspec = get_f...
python
def argspec_report(functions, module=''): ''' Pass in a functions dict as it is returned from the loader and return the argspec function signatures ''' ret = {} if '*' in module or '.' in module: for fun in fnmatch.filter(functions, module): try: aspec = get_f...
[ "def", "argspec_report", "(", "functions", ",", "module", "=", "''", ")", ":", "ret", "=", "{", "}", "if", "'*'", "in", "module", "or", "'.'", "in", "module", ":", "for", "fun", "in", "fnmatch", ".", "filter", "(", "functions", ",", "module", ")", ...
Pass in a functions dict as it is returned from the loader and return the argspec function signatures
[ "Pass", "in", "a", "functions", "dict", "as", "it", "is", "returned", "from", "the", "loader", "and", "return", "the", "argspec", "function", "signatures" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L318-L360
train
saltstack/salt
salt/utils/args.py
split_input
def split_input(val, mapper=None): ''' Take an input value and split it into a list, returning the resulting list ''' if mapper is None: mapper = lambda x: x if isinstance(val, list): return list(map(mapper, val)) try: return list(map(mapper, [x.strip() for x in val.split...
python
def split_input(val, mapper=None): ''' Take an input value and split it into a list, returning the resulting list ''' if mapper is None: mapper = lambda x: x if isinstance(val, list): return list(map(mapper, val)) try: return list(map(mapper, [x.strip() for x in val.split...
[ "def", "split_input", "(", "val", ",", "mapper", "=", "None", ")", ":", "if", "mapper", "is", "None", ":", "mapper", "=", "lambda", "x", ":", "x", "if", "isinstance", "(", "val", ",", "list", ")", ":", "return", "list", "(", "map", "(", "mapper", ...
Take an input value and split it into a list, returning the resulting list
[ "Take", "an", "input", "value", "and", "split", "it", "into", "a", "list", "returning", "the", "resulting", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L363-L374
train
saltstack/salt
salt/utils/args.py
format_call
def format_call(fun, data, initial_ret=None, expected_extra_kws=(), is_class_method=None): ''' Build the required arguments and keyword arguments required for the passed function. :param fun: The function to get the argspec from :param...
python
def format_call(fun, data, initial_ret=None, expected_extra_kws=(), is_class_method=None): ''' Build the required arguments and keyword arguments required for the passed function. :param fun: The function to get the argspec from :param...
[ "def", "format_call", "(", "fun", ",", "data", ",", "initial_ret", "=", "None", ",", "expected_extra_kws", "=", "(", ")", ",", "is_class_method", "=", "None", ")", ":", "ret", "=", "initial_ret", "is", "not", "None", "and", "initial_ret", "or", "{", "}",...
Build the required arguments and keyword arguments required for the passed function. :param fun: The function to get the argspec from :param data: A dictionary containing the required data to build the arguments and keyword arguments. :param initial_ret: The initial return data pre-pop...
[ "Build", "the", "required", "arguments", "and", "keyword", "arguments", "required", "for", "the", "passed", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L394-L509
train
saltstack/salt
salt/utils/args.py
parse_function
def parse_function(s): ''' Parse a python-like function call syntax. For example: module.function(arg, arg, kw=arg, kw=arg) This function takes care only about the function name and arguments list carying on quoting and bracketing. It doesn't perform identifiers and other syntax validity check. ...
python
def parse_function(s): ''' Parse a python-like function call syntax. For example: module.function(arg, arg, kw=arg, kw=arg) This function takes care only about the function name and arguments list carying on quoting and bracketing. It doesn't perform identifiers and other syntax validity check. ...
[ "def", "parse_function", "(", "s", ")", ":", "sh", "=", "shlex", ".", "shlex", "(", "s", ",", "posix", "=", "True", ")", "sh", ".", "escapedquotes", "=", "'\"\\''", "word", "=", "[", "]", "args", "=", "[", "]", "kwargs", "=", "{", "}", "brackets"...
Parse a python-like function call syntax. For example: module.function(arg, arg, kw=arg, kw=arg) This function takes care only about the function name and arguments list carying on quoting and bracketing. It doesn't perform identifiers and other syntax validity check. Returns a tuple of three values:...
[ "Parse", "a", "python", "-", "like", "function", "call", "syntax", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L512-L568
train
saltstack/salt
salt/utils/args.py
prepare_kwargs
def prepare_kwargs(all_kwargs, class_init_kwargs): ''' Filter out the kwargs used for the init of the class and the kwargs used to invoke the command required. all_kwargs All the kwargs the Execution Function has been invoked. class_init_kwargs The kwargs of the ``__init__`` of the...
python
def prepare_kwargs(all_kwargs, class_init_kwargs): ''' Filter out the kwargs used for the init of the class and the kwargs used to invoke the command required. all_kwargs All the kwargs the Execution Function has been invoked. class_init_kwargs The kwargs of the ``__init__`` of the...
[ "def", "prepare_kwargs", "(", "all_kwargs", ",", "class_init_kwargs", ")", ":", "fun_kwargs", "=", "{", "}", "init_kwargs", "=", "{", "}", "for", "karg", ",", "warg", "in", "six", ".", "iteritems", "(", "all_kwargs", ")", ":", "if", "karg", "not", "in", ...
Filter out the kwargs used for the init of the class and the kwargs used to invoke the command required. all_kwargs All the kwargs the Execution Function has been invoked. class_init_kwargs The kwargs of the ``__init__`` of the class.
[ "Filter", "out", "the", "kwargs", "used", "for", "the", "init", "of", "the", "class", "and", "the", "kwargs", "used", "to", "invoke", "the", "command", "required", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/args.py#L571-L591
train
saltstack/salt
salt/modules/aixpkg.py
_check_pkg
def _check_pkg(target): ''' Return name, version and if rpm package for specified target ''' ret = {} cmd = ['/usr/bin/lslpp', '-Lc', target] lines = __salt__['cmd.run']( cmd, python_shell=False).splitlines() name = '' version_num = '' rpmpkg = False for ...
python
def _check_pkg(target): ''' Return name, version and if rpm package for specified target ''' ret = {} cmd = ['/usr/bin/lslpp', '-Lc', target] lines = __salt__['cmd.run']( cmd, python_shell=False).splitlines() name = '' version_num = '' rpmpkg = False for ...
[ "def", "_check_pkg", "(", "target", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'/usr/bin/lslpp'", ",", "'-Lc'", ",", "target", "]", "lines", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "spli...
Return name, version and if rpm package for specified target
[ "Return", "name", "version", "and", "if", "rpm", "package", "for", "specified", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aixpkg.py#L42-L75
train
saltstack/salt
salt/modules/aixpkg.py
list_pkgs
def list_pkgs(versions_as_list=False, **kwargs): ''' List the filesets/rpm packages currently installed as a dict: .. code-block:: python {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' ret = {} versions_as_list = salt.uti...
python
def list_pkgs(versions_as_list=False, **kwargs): ''' List the filesets/rpm packages currently installed as a dict: .. code-block:: python {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' ret = {} versions_as_list = salt.uti...
[ "def", "list_pkgs", "(", "versions_as_list", "=", "False", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "versions_as_list", ")", "# not yet implemented or not applicab...
List the filesets/rpm packages currently installed as a dict: .. code-block:: python {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs
[ "List", "the", "filesets", "/", "rpm", "packages", "currently", "installed", "as", "a", "dict", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aixpkg.py#L86-L157
train
saltstack/salt
salt/modules/aixpkg.py
install
def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs): ''' Install the named fileset(s)/rpm package(s). name The name of the fileset or rpm package to be installed. refresh Whether or not to update the yum database before executing. Multiple Package...
python
def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs): ''' Install the named fileset(s)/rpm package(s). name The name of the fileset or rpm package to be installed. refresh Whether or not to update the yum database before executing. Multiple Package...
[ "def", "install", "(", "name", "=", "None", ",", "refresh", "=", "False", ",", "pkgs", "=", "None", ",", "version", "=", "None", ",", "test", "=", "False", ",", "*", "*", "kwargs", ")", ":", "targets", "=", "salt", ".", "utils", ".", "args", ".",...
Install the named fileset(s)/rpm package(s). name The name of the fileset or rpm package to be installed. refresh Whether or not to update the yum database before executing. Multiple Package Installation Options: pkgs A list of filesets and/or rpm packages to install. ...
[ "Install", "the", "named", "fileset", "(", "s", ")", "/", "rpm", "package", "(", "s", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aixpkg.py#L188-L286
train
saltstack/salt
salt/modules/aixpkg.py
remove
def remove(name=None, pkgs=None, **kwargs): ''' Remove specified fileset(s)/rpm package(s). name The name of the fileset or rpm package to be deleted. Multiple Package Options: pkgs A list of filesets and/or rpm packages to delete. Must be passed as a python list. The ``n...
python
def remove(name=None, pkgs=None, **kwargs): ''' Remove specified fileset(s)/rpm package(s). name The name of the fileset or rpm package to be deleted. Multiple Package Options: pkgs A list of filesets and/or rpm packages to delete. Must be passed as a python list. The ``n...
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "targets", "=", "salt", ".", "utils", ".", "args", ".", "split_input", "(", "pkgs", ")", "if", "pkgs", "else", "[", "name", "]", "if", "not", ...
Remove specified fileset(s)/rpm package(s). name The name of the fileset or rpm package to be deleted. Multiple Package Options: pkgs A list of filesets and/or rpm packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option i...
[ "Remove", "specified", "fileset", "(", "s", ")", "/", "rpm", "package", "(", "s", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aixpkg.py#L289-L359
train
saltstack/salt
salt/modules/data.py
clear
def clear(): ''' Clear out all of the data in the minion datastore, this function is destructive! CLI Example: .. code-block:: bash salt '*' data.clear ''' try: os.remove(os.path.join(__opts__['cachedir'], 'datastore')) except (IOError, OSError): pass retur...
python
def clear(): ''' Clear out all of the data in the minion datastore, this function is destructive! CLI Example: .. code-block:: bash salt '*' data.clear ''' try: os.remove(os.path.join(__opts__['cachedir'], 'datastore')) except (IOError, OSError): pass retur...
[ "def", "clear", "(", ")", ":", "try", ":", "os", ".", "remove", "(", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'datastore'", ")", ")", "except", "(", "IOError", ",", "OSError", ")", ":", "pass", "return", "True"...
Clear out all of the data in the minion datastore, this function is destructive! CLI Example: .. code-block:: bash salt '*' data.clear
[ "Clear", "out", "all", "of", "the", "data", "in", "the", "minion", "datastore", "this", "function", "is", "destructive!" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L23-L38
train
saltstack/salt
salt/modules/data.py
load
def load(): ''' Return all of the data in the minion datastore CLI Example: .. code-block:: bash salt '*' data.load ''' serial = salt.payload.Serial(__opts__) try: datastore_path = os.path.join(__opts__['cachedir'], 'datastore') with salt.utils.files.fopen(datasto...
python
def load(): ''' Return all of the data in the minion datastore CLI Example: .. code-block:: bash salt '*' data.load ''' serial = salt.payload.Serial(__opts__) try: datastore_path = os.path.join(__opts__['cachedir'], 'datastore') with salt.utils.files.fopen(datasto...
[ "def", "load", "(", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "try", ":", "datastore_path", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'datastore'", ")", "with", "sa...
Return all of the data in the minion datastore CLI Example: .. code-block:: bash salt '*' data.load
[ "Return", "all", "of", "the", "data", "in", "the", "minion", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L41-L58
train
saltstack/salt
salt/modules/data.py
dump
def dump(new_data): ''' Replace the entire datastore with a passed data structure CLI Example: .. code-block:: bash salt '*' data.dump '{'eggs': 'spam'}' ''' if not isinstance(new_data, dict): if isinstance(ast.literal_eval(new_data), dict): new_data = ast.literal_...
python
def dump(new_data): ''' Replace the entire datastore with a passed data structure CLI Example: .. code-block:: bash salt '*' data.dump '{'eggs': 'spam'}' ''' if not isinstance(new_data, dict): if isinstance(ast.literal_eval(new_data), dict): new_data = ast.literal_...
[ "def", "dump", "(", "new_data", ")", ":", "if", "not", "isinstance", "(", "new_data", ",", "dict", ")", ":", "if", "isinstance", "(", "ast", ".", "literal_eval", "(", "new_data", ")", ",", "dict", ")", ":", "new_data", "=", "ast", ".", "literal_eval", ...
Replace the entire datastore with a passed data structure CLI Example: .. code-block:: bash salt '*' data.dump '{'eggs': 'spam'}'
[ "Replace", "the", "entire", "datastore", "with", "a", "passed", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L61-L86
train
saltstack/salt
salt/modules/data.py
update
def update(key, value): ''' Update a key with a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.update <key> <value> ''' store = load() store[key] = value dump(store) return True
python
def update(key, value): ''' Update a key with a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.update <key> <value> ''' store = load() store[key] = value dump(store) return True
[ "def", "update", "(", "key", ",", "value", ")", ":", "store", "=", "load", "(", ")", "store", "[", "key", "]", "=", "value", "dump", "(", "store", ")", "return", "True" ]
Update a key with a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.update <key> <value>
[ "Update", "a", "key", "with", "a", "value", "in", "the", "minion", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L89-L102
train
saltstack/salt
salt/modules/data.py
cas
def cas(key, value, old_value): ''' Check and set a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.cas <key> <value> <old_value> ''' store = load() if key not in store: return False if store[key] != old_value: return False s...
python
def cas(key, value, old_value): ''' Check and set a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.cas <key> <value> <old_value> ''' store = load() if key not in store: return False if store[key] != old_value: return False s...
[ "def", "cas", "(", "key", ",", "value", ",", "old_value", ")", ":", "store", "=", "load", "(", ")", "if", "key", "not", "in", "store", ":", "return", "False", "if", "store", "[", "key", "]", "!=", "old_value", ":", "return", "False", "store", "[", ...
Check and set a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.cas <key> <value> <old_value>
[ "Check", "and", "set", "a", "value", "in", "the", "minion", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L105-L124
train
saltstack/salt
salt/modules/data.py
pop
def pop(key, default=None): ''' Pop (return & delete) a value from the minion datastore .. versionadded:: 2015.5.2 CLI Example: .. code-block:: bash salt '*' data.pop <key> "there was no val" ''' store = load() val = store.pop(key, default) dump(store) return val
python
def pop(key, default=None): ''' Pop (return & delete) a value from the minion datastore .. versionadded:: 2015.5.2 CLI Example: .. code-block:: bash salt '*' data.pop <key> "there was no val" ''' store = load() val = store.pop(key, default) dump(store) return val
[ "def", "pop", "(", "key", ",", "default", "=", "None", ")", ":", "store", "=", "load", "(", ")", "val", "=", "store", ".", "pop", "(", "key", ",", "default", ")", "dump", "(", "store", ")", "return", "val" ]
Pop (return & delete) a value from the minion datastore .. versionadded:: 2015.5.2 CLI Example: .. code-block:: bash salt '*' data.pop <key> "there was no val"
[ "Pop", "(", "return", "&", "delete", ")", "a", "value", "from", "the", "minion", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L127-L142
train
saltstack/salt
salt/modules/data.py
get
def get(key, default=None): ''' Get a (list of) value(s) from the minion datastore .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt '*' data.get key salt '*' data.get '["key1", "key2"]' ''' store = load() if isinstance(key, six.string_types): ...
python
def get(key, default=None): ''' Get a (list of) value(s) from the minion datastore .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt '*' data.get key salt '*' data.get '["key1", "key2"]' ''' store = load() if isinstance(key, six.string_types): ...
[ "def", "get", "(", "key", ",", "default", "=", "None", ")", ":", "store", "=", "load", "(", ")", "if", "isinstance", "(", "key", ",", "six", ".", "string_types", ")", ":", "return", "store", ".", "get", "(", "key", ",", "default", ")", "elif", "d...
Get a (list of) value(s) from the minion datastore .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt '*' data.get key salt '*' data.get '["key1", "key2"]'
[ "Get", "a", "(", "list", "of", ")", "value", "(", "s", ")", "from", "the", "minion", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/data.py#L145-L165
train
saltstack/salt
salt/modules/keystoneng.py
compare_changes
def compare_changes(obj, **kwargs): ''' Compare two dicts returning only keys that exist in the first dict and are different in the second one ''' changes = {} for k, v in obj.items(): if k in kwargs: if v != kwargs[k]: changes[k] = kwargs[k] return change...
python
def compare_changes(obj, **kwargs): ''' Compare two dicts returning only keys that exist in the first dict and are different in the second one ''' changes = {} for k, v in obj.items(): if k in kwargs: if v != kwargs[k]: changes[k] = kwargs[k] return change...
[ "def", "compare_changes", "(", "obj", ",", "*", "*", "kwargs", ")", ":", "changes", "=", "{", "}", "for", "k", ",", "v", "in", "obj", ".", "items", "(", ")", ":", "if", "k", "in", "kwargs", ":", "if", "v", "!=", "kwargs", "[", "k", "]", ":", ...
Compare two dicts returning only keys that exist in the first dict and are different in the second one
[ "Compare", "two", "dicts", "returning", "only", "keys", "that", "exist", "in", "the", "first", "dict", "and", "are", "different", "in", "the", "second", "one" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L51-L61
train
saltstack/salt
salt/modules/keystoneng.py
get_entity
def get_entity(ent_type, **kwargs): ''' Attempt to query Keystone for more information about an entity ''' try: func = 'keystoneng.{}_get'.format(ent_type) ent = __salt__[func](**kwargs) except OpenStackCloudException as e: # NOTE(SamYaple): If this error was something other ...
python
def get_entity(ent_type, **kwargs): ''' Attempt to query Keystone for more information about an entity ''' try: func = 'keystoneng.{}_get'.format(ent_type) ent = __salt__[func](**kwargs) except OpenStackCloudException as e: # NOTE(SamYaple): If this error was something other ...
[ "def", "get_entity", "(", "ent_type", ",", "*", "*", "kwargs", ")", ":", "try", ":", "func", "=", "'keystoneng.{}_get'", ".", "format", "(", "ent_type", ")", "ent", "=", "__salt__", "[", "func", "]", "(", "*", "*", "kwargs", ")", "except", "OpenStackCl...
Attempt to query Keystone for more information about an entity
[ "Attempt", "to", "query", "Keystone", "for", "more", "information", "about", "an", "entity" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L64-L83
train
saltstack/salt
salt/modules/keystoneng.py
_clean_kwargs
def _clean_kwargs(keep_name=False, **kwargs): ''' Sanatize the the arguments for use with shade ''' if 'name' in kwargs and not keep_name: kwargs['name_or_id'] = kwargs.pop('name') return __utils__['args.clean_kwargs'](**kwargs)
python
def _clean_kwargs(keep_name=False, **kwargs): ''' Sanatize the the arguments for use with shade ''' if 'name' in kwargs and not keep_name: kwargs['name_or_id'] = kwargs.pop('name') return __utils__['args.clean_kwargs'](**kwargs)
[ "def", "_clean_kwargs", "(", "keep_name", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'name'", "in", "kwargs", "and", "not", "keep_name", ":", "kwargs", "[", "'name_or_id'", "]", "=", "kwargs", ".", "pop", "(", "'name'", ")", "return", "__u...
Sanatize the the arguments for use with shade
[ "Sanatize", "the", "the", "arguments", "for", "use", "with", "shade" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L86-L93
train
saltstack/salt
salt/modules/keystoneng.py
get_operator_cloud
def get_operator_cloud(auth=None): ''' Return an operator_cloud ''' if auth is None: auth = __salt__['config.option']('keystone', {}) if 'shade_opcloud' in __context__: if __context__['shade_opcloud'].auth == auth: return __context__['shade_opcloud'] __context__['shad...
python
def get_operator_cloud(auth=None): ''' Return an operator_cloud ''' if auth is None: auth = __salt__['config.option']('keystone', {}) if 'shade_opcloud' in __context__: if __context__['shade_opcloud'].auth == auth: return __context__['shade_opcloud'] __context__['shad...
[ "def", "get_operator_cloud", "(", "auth", "=", "None", ")", ":", "if", "auth", "is", "None", ":", "auth", "=", "__salt__", "[", "'config.option'", "]", "(", "'keystone'", ",", "{", "}", ")", "if", "'shade_opcloud'", "in", "__context__", ":", "if", "__con...
Return an operator_cloud
[ "Return", "an", "operator_cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L105-L115
train
saltstack/salt
salt/modules/keystoneng.py
get_openstack_cloud
def get_openstack_cloud(auth=None): ''' Return an openstack_cloud ''' if auth is None: auth = __salt__['config.option']('keystone', {}) if 'shade_oscloud' in __context__: if __context__['shade_oscloud'].auth == auth: return __context__['shade_oscloud'] __context__['sh...
python
def get_openstack_cloud(auth=None): ''' Return an openstack_cloud ''' if auth is None: auth = __salt__['config.option']('keystone', {}) if 'shade_oscloud' in __context__: if __context__['shade_oscloud'].auth == auth: return __context__['shade_oscloud'] __context__['sh...
[ "def", "get_openstack_cloud", "(", "auth", "=", "None", ")", ":", "if", "auth", "is", "None", ":", "auth", "=", "__salt__", "[", "'config.option'", "]", "(", "'keystone'", ",", "{", "}", ")", "if", "'shade_oscloud'", "in", "__context__", ":", "if", "__co...
Return an openstack_cloud
[ "Return", "an", "openstack_cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L118-L128
train
saltstack/salt
salt/modules/keystoneng.py
group_create
def group_create(auth=None, **kwargs): ''' Create a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_create name=group1 salt '*' keystoneng.group_create name=group2 domain=domain1 description='my group2' ''' cloud = get_operator_cloud(auth) kwargs = _clean...
python
def group_create(auth=None, **kwargs): ''' Create a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_create name=group1 salt '*' keystoneng.group_create name=group2 domain=domain1 description='my group2' ''' cloud = get_operator_cloud(auth) kwargs = _clean...
[ "def", "group_create", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "keep_name", "=", "True", ",", "*", "*", "kwargs", ")", "return", "cloud", "....
Create a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_create name=group1 salt '*' keystoneng.group_create name=group2 domain=domain1 description='my group2'
[ "Create", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L131-L144
train
saltstack/salt
salt/modules/keystoneng.py
group_delete
def group_delete(auth=None, **kwargs): ''' Delete a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_delete name=group1 salt '*' keystoneng.group_delete name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_delete name=0e4febc2a5ab4f...
python
def group_delete(auth=None, **kwargs): ''' Delete a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_delete name=group1 salt '*' keystoneng.group_delete name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_delete name=0e4febc2a5ab4f...
[ "def", "group_delete", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "delete_group", "(", "*", "*...
Delete a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_delete name=group1 salt '*' keystoneng.group_delete name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_delete name=0e4febc2a5ab4f2c8f374b054162506d
[ "Delete", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L147-L161
train
saltstack/salt
salt/modules/keystoneng.py
group_update
def group_update(auth=None, **kwargs): ''' Update a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_update name=group1 description='new description' salt '*' keystoneng.group_create name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e new_name=newgroupname ...
python
def group_update(auth=None, **kwargs): ''' Update a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_update name=group1 description='new description' salt '*' keystoneng.group_create name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e new_name=newgroupname ...
[ "def", "group_update", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "if", "'new_name'", "in", "kwargs", ":", "kwargs", "...
Update a group CLI Example: .. code-block:: bash salt '*' keystoneng.group_update name=group1 description='new description' salt '*' keystoneng.group_create name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e new_name=newgroupname salt '*' keystoneng.group_create name=0e4febc2a5ab4...
[ "Update", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L164-L180
train
saltstack/salt
salt/modules/keystoneng.py
group_list
def group_list(auth=None, **kwargs): ''' List groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_list salt '*' keystoneng.group_list domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return ...
python
def group_list(auth=None, **kwargs): ''' List groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_list salt '*' keystoneng.group_list domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return ...
[ "def", "group_list", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "list_groups", "(", "*", "*", ...
List groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_list salt '*' keystoneng.group_list domain_id=b62e76fbeeff4e8fb77073f591cf211e
[ "List", "groups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L183-L196
train
saltstack/salt
salt/modules/keystoneng.py
group_search
def group_search(auth=None, **kwargs): ''' Search for groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_search name=group1 salt '*' keystoneng.group_search domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwar...
python
def group_search(auth=None, **kwargs): ''' Search for groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_search name=group1 salt '*' keystoneng.group_search domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwar...
[ "def", "group_search", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "search_groups", "(", "*", "...
Search for groups CLI Example: .. code-block:: bash salt '*' keystoneng.group_search name=group1 salt '*' keystoneng.group_search domain_id=b62e76fbeeff4e8fb77073f591cf211e
[ "Search", "for", "groups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L199-L212
train
saltstack/salt
salt/modules/keystoneng.py
group_get
def group_get(auth=None, **kwargs): ''' Get a single group CLI Example: .. code-block:: bash salt '*' keystoneng.group_get name=group1 salt '*' keystoneng.group_get name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_get name=0e4febc2a5ab4f2c8f374b...
python
def group_get(auth=None, **kwargs): ''' Get a single group CLI Example: .. code-block:: bash salt '*' keystoneng.group_get name=group1 salt '*' keystoneng.group_get name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_get name=0e4febc2a5ab4f2c8f374b...
[ "def", "group_get", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "get_group", "(", "*", "*", "...
Get a single group CLI Example: .. code-block:: bash salt '*' keystoneng.group_get name=group1 salt '*' keystoneng.group_get name=group2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.group_get name=0e4febc2a5ab4f2c8f374b054162506d
[ "Get", "a", "single", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L215-L229
train
saltstack/salt
salt/modules/keystoneng.py
project_create
def project_create(auth=None, **kwargs): ''' Create a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_create name=project1 salt '*' keystoneng.project_create name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_create name=...
python
def project_create(auth=None, **kwargs): ''' Create a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_create name=project1 salt '*' keystoneng.project_create name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_create name=...
[ "def", "project_create", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "keep_name", "=", "True", ",", "*", "*", "kwargs", ")", "return", "cloud", ...
Create a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_create name=project1 salt '*' keystoneng.project_create name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_create name=project3 enabled=False description='my project3'
[ "Create", "a", "project" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L232-L246
train
saltstack/salt
salt/modules/keystoneng.py
project_delete
def project_delete(auth=None, **kwargs): ''' Delete a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_delete name=project1 salt '*' keystoneng.project_delete name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_delete name=...
python
def project_delete(auth=None, **kwargs): ''' Delete a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_delete name=project1 salt '*' keystoneng.project_delete name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_delete name=...
[ "def", "project_delete", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "delete_project", "(", "*",...
Delete a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_delete name=project1 salt '*' keystoneng.project_delete name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_delete name=f315afcf12f24ad88c92b936c38f2d5a
[ "Delete", "a", "project" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L249-L263
train
saltstack/salt
salt/modules/keystoneng.py
project_update
def project_update(auth=None, **kwargs): ''' Update a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_update name=project1 new_name=newproject salt '*' keystoneng.project_update name=project2 enabled=False description='new description' ''' cloud = get_ope...
python
def project_update(auth=None, **kwargs): ''' Update a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_update name=project1 new_name=newproject salt '*' keystoneng.project_update name=project2 enabled=False description='new description' ''' cloud = get_ope...
[ "def", "project_update", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "if", "'new_name'", "in", "kwargs", ":", "kwargs", ...
Update a project CLI Example: .. code-block:: bash salt '*' keystoneng.project_update name=project1 new_name=newproject salt '*' keystoneng.project_update name=project2 enabled=False description='new description'
[ "Update", "a", "project" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L266-L281
train
saltstack/salt
salt/modules/keystoneng.py
project_list
def project_list(auth=None, **kwargs): ''' List projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_list salt '*' keystoneng.project_list domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_openstack_cloud(auth) kwargs = _clean_kwargs(**kwargs) ...
python
def project_list(auth=None, **kwargs): ''' List projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_list salt '*' keystoneng.project_list domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_openstack_cloud(auth) kwargs = _clean_kwargs(**kwargs) ...
[ "def", "project_list", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "list_projects", "(", "*", ...
List projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_list salt '*' keystoneng.project_list domain_id=b62e76fbeeff4e8fb77073f591cf211e
[ "List", "projects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L284-L297
train
saltstack/salt
salt/modules/keystoneng.py
project_search
def project_search(auth=None, **kwargs): ''' Search projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_search salt '*' keystoneng.project_search name=project1 salt '*' keystoneng.project_search domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = ...
python
def project_search(auth=None, **kwargs): ''' Search projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_search salt '*' keystoneng.project_search name=project1 salt '*' keystoneng.project_search domain_id=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = ...
[ "def", "project_search", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "search_projects", "(", "*"...
Search projects CLI Example: .. code-block:: bash salt '*' keystoneng.project_search salt '*' keystoneng.project_search name=project1 salt '*' keystoneng.project_search domain_id=b62e76fbeeff4e8fb77073f591cf211e
[ "Search", "projects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L300-L314
train
saltstack/salt
salt/modules/keystoneng.py
project_get
def project_get(auth=None, **kwargs): ''' Get a single project CLI Example: .. code-block:: bash salt '*' keystoneng.project_get name=project1 salt '*' keystoneng.project_get name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_get name=f315afcf...
python
def project_get(auth=None, **kwargs): ''' Get a single project CLI Example: .. code-block:: bash salt '*' keystoneng.project_get name=project1 salt '*' keystoneng.project_get name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_get name=f315afcf...
[ "def", "project_get", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_openstack_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "get_project", "(", "*", "*"...
Get a single project CLI Example: .. code-block:: bash salt '*' keystoneng.project_get name=project1 salt '*' keystoneng.project_get name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e salt '*' keystoneng.project_get name=f315afcf12f24ad88c92b936c38f2d5a
[ "Get", "a", "single", "project" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L317-L331
train
saltstack/salt
salt/modules/keystoneng.py
domain_create
def domain_create(auth=None, **kwargs): ''' Create a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_create name=domain1 ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(keep_name=True, **kwargs) return cloud.create_domain(**kwargs)
python
def domain_create(auth=None, **kwargs): ''' Create a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_create name=domain1 ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(keep_name=True, **kwargs) return cloud.create_domain(**kwargs)
[ "def", "domain_create", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "keep_name", "=", "True", ",", "*", "*", "kwargs", ")", "return", "cloud", "...
Create a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_create name=domain1
[ "Create", "a", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L334-L346
train
saltstack/salt
salt/modules/keystoneng.py
domain_delete
def domain_delete(auth=None, **kwargs): ''' Delete a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_delete name=domain1 salt '*' keystoneng.domain_delete name=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(...
python
def domain_delete(auth=None, **kwargs): ''' Delete a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_delete name=domain1 salt '*' keystoneng.domain_delete name=b62e76fbeeff4e8fb77073f591cf211e ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(...
[ "def", "domain_delete", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "delete_domain", "(", "*", ...
Delete a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_delete name=domain1 salt '*' keystoneng.domain_delete name=b62e76fbeeff4e8fb77073f591cf211e
[ "Delete", "a", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L349-L362
train
saltstack/salt
salt/modules/keystoneng.py
domain_update
def domain_update(auth=None, **kwargs): ''' Update a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_update name=domain1 new_name=newdomain salt '*' keystoneng.domain_update name=domain1 enabled=True description='new description' ''' cloud = get_operator_cl...
python
def domain_update(auth=None, **kwargs): ''' Update a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_update name=domain1 new_name=newdomain salt '*' keystoneng.domain_update name=domain1 enabled=True description='new description' ''' cloud = get_operator_cl...
[ "def", "domain_update", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "if", "'new_name'", "in", "kwargs", ":", "kwargs", ...
Update a domain CLI Example: .. code-block:: bash salt '*' keystoneng.domain_update name=domain1 new_name=newdomain salt '*' keystoneng.domain_update name=domain1 enabled=True description='new description'
[ "Update", "a", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L365-L380
train
saltstack/salt
salt/modules/keystoneng.py
domain_list
def domain_list(auth=None, **kwargs): ''' List domains CLI Example: .. code-block:: bash salt '*' keystoneng.domain_list ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.list_domains(**kwargs)
python
def domain_list(auth=None, **kwargs): ''' List domains CLI Example: .. code-block:: bash salt '*' keystoneng.domain_list ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.list_domains(**kwargs)
[ "def", "domain_list", "(", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cloud", "=", "get_operator_cloud", "(", "auth", ")", "kwargs", "=", "_clean_kwargs", "(", "*", "*", "kwargs", ")", "return", "cloud", ".", "list_domains", "(", "*", "*"...
List domains CLI Example: .. code-block:: bash salt '*' keystoneng.domain_list
[ "List", "domains" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystoneng.py#L383-L395
train