id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
33,200
saltstack/salt
salt/proxy/philips_hue.py
call_status
def call_status(*args, **kwargs): ''' Return the status of the lamps. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. CLI Example: .. code-block:: bash salt '*' hue.status salt '*' hue.status id=1 salt '*' hue.status id=1,2...
python
def call_status(*args, **kwargs): ''' Return the status of the lamps. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. CLI Example: .. code-block:: bash salt '*' hue.status salt '*' hue.status id=1 salt '*' hue.status id=1,2...
[ "def", "call_status", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "res", "=", "dict", "(", ")", "devices", "=", "_get_lights", "(", ")", "for", "dev_id", "in", "'id'", "not", "in", "kwargs", "and", "sorted", "(", "devices", ".", "keys", "(...
Return the status of the lamps. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. CLI Example: .. code-block:: bash salt '*' hue.status salt '*' hue.status id=1 salt '*' hue.status id=1,2,3
[ "Return", "the", "status", "of", "the", "lamps", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/philips_hue.py#L291-L316
33,201
saltstack/salt
salt/proxy/philips_hue.py
call_rename
def call_rename(*args, **kwargs): ''' Rename a device. Options: * **id**: Specifies a device ID. Only one device at a time. * **title**: Title of the device. CLI Example: .. code-block:: bash salt '*' hue.rename id=1 title='WC for cats' ''' dev_id = _get_devices(kwargs) ...
python
def call_rename(*args, **kwargs): ''' Rename a device. Options: * **id**: Specifies a device ID. Only one device at a time. * **title**: Title of the device. CLI Example: .. code-block:: bash salt '*' hue.rename id=1 title='WC for cats' ''' dev_id = _get_devices(kwargs) ...
[ "def", "call_rename", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "dev_id", "=", "_get_devices", "(", "kwargs", ")", "if", "len", "(", "dev_id", ")", ">", "1", ":", "raise", "CommandExecutionError", "(", "\"Only one device can be renamed at a time\"",...
Rename a device. Options: * **id**: Specifies a device ID. Only one device at a time. * **title**: Title of the device. CLI Example: .. code-block:: bash salt '*' hue.rename id=1 title='WC for cats'
[ "Rename", "a", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/philips_hue.py#L319-L341
33,202
saltstack/salt
salt/proxy/philips_hue.py
call_color
def call_color(*args, **kwargs): ''' Set a color to the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **color**: Fixed color. Values are: red, green, blue, orange, pink, white, yellow, daylight, purple. Default white. * **t...
python
def call_color(*args, **kwargs): ''' Set a color to the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **color**: Fixed color. Values are: red, green, blue, orange, pink, white, yellow, daylight, purple. Default white. * **t...
[ "def", "call_color", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "res", "=", "dict", "(", ")", "colormap", "=", "{", "'red'", ":", "Const", ".", "COLOR_RED", ",", "'green'", ":", "Const", ".", "COLOR_GREEN", ",", "'blue'", ":", "Const", "....
Set a color to the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **color**: Fixed color. Values are: red, green, blue, orange, pink, white, yellow, daylight, purple. Default white. * **transition**: Transition 0~200. Advanced:...
[ "Set", "a", "color", "to", "the", "lamp", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/philips_hue.py#L396-L454
33,203
saltstack/salt
salt/proxy/philips_hue.py
call_brightness
def call_brightness(*args, **kwargs): ''' Set an effect to the lamp. Arguments: * **value**: 0~255 brightness of the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **transition**: Transition 0~200. Default 0. CLI Example: .. ...
python
def call_brightness(*args, **kwargs): ''' Set an effect to the lamp. Arguments: * **value**: 0~255 brightness of the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **transition**: Transition 0~200. Default 0. CLI Example: .. ...
[ "def", "call_brightness", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "res", "=", "dict", "(", ")", "if", "'value'", "not", "in", "kwargs", ":", "raise", "CommandExecutionError", "(", "\"Parameter 'value' is missing\"", ")", "try", ":", "brightness"...
Set an effect to the lamp. Arguments: * **value**: 0~255 brightness of the lamp. Options: * **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted. * **transition**: Transition 0~200. Default 0. CLI Example: .. code-block:: bash salt '*' hue.brightness...
[ "Set", "an", "effect", "to", "the", "lamp", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/philips_hue.py#L457-L497
33,204
saltstack/salt
salt/fileserver/hgfs.py
_get_branch
def _get_branch(repo, name): ''' Find the requested branch in the specified repo ''' try: return [x for x in _all_branches(repo) if x[0] == name][0] except IndexError: return False
python
def _get_branch(repo, name): ''' Find the requested branch in the specified repo ''' try: return [x for x in _all_branches(repo) if x[0] == name][0] except IndexError: return False
[ "def", "_get_branch", "(", "repo", ",", "name", ")", ":", "try", ":", "return", "[", "x", "for", "x", "in", "_all_branches", "(", "repo", ")", "if", "x", "[", "0", "]", "==", "name", "]", "[", "0", "]", "except", "IndexError", ":", "return", "Fal...
Find the requested branch in the specified repo
[ "Find", "the", "requested", "branch", "in", "the", "specified", "repo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L111-L118
33,205
saltstack/salt
salt/fileserver/hgfs.py
_get_bookmark
def _get_bookmark(repo, name): ''' Find the requested bookmark in the specified repo ''' try: return [x for x in _all_bookmarks(repo) if x[0] == name][0] except IndexError: return False
python
def _get_bookmark(repo, name): ''' Find the requested bookmark in the specified repo ''' try: return [x for x in _all_bookmarks(repo) if x[0] == name][0] except IndexError: return False
[ "def", "_get_bookmark", "(", "repo", ",", "name", ")", ":", "try", ":", "return", "[", "x", "for", "x", "in", "_all_bookmarks", "(", "repo", ")", "if", "x", "[", "0", "]", "==", "name", "]", "[", "0", "]", "except", "IndexError", ":", "return", "...
Find the requested bookmark in the specified repo
[ "Find", "the", "requested", "bookmark", "in", "the", "specified", "repo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L132-L139
33,206
saltstack/salt
salt/fileserver/hgfs.py
_get_tag
def _get_tag(repo, name): ''' Find the requested tag in the specified repo ''' try: return [x for x in _all_tags(repo) if x[0] == name][0] except IndexError: return False
python
def _get_tag(repo, name): ''' Find the requested tag in the specified repo ''' try: return [x for x in _all_tags(repo) if x[0] == name][0] except IndexError: return False
[ "def", "_get_tag", "(", "repo", ",", "name", ")", ":", "try", ":", "return", "[", "x", "for", "x", "in", "_all_tags", "(", "repo", ")", "if", "x", "[", "0", "]", "==", "name", "]", "[", "0", "]", "except", "IndexError", ":", "return", "False" ]
Find the requested tag in the specified repo
[ "Find", "the", "requested", "tag", "in", "the", "specified", "repo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L154-L161
33,207
saltstack/salt
salt/fileserver/hgfs.py
_get_ref
def _get_ref(repo, name): ''' Return ref tuple if ref is in the repo. ''' if name == 'base': name = repo['base'] if name == repo['base'] or name in envs(): if repo['branch_method'] == 'branches': return _get_branch(repo['repo'], name) \ or _get_tag(repo['r...
python
def _get_ref(repo, name): ''' Return ref tuple if ref is in the repo. ''' if name == 'base': name = repo['base'] if name == repo['base'] or name in envs(): if repo['branch_method'] == 'branches': return _get_branch(repo['repo'], name) \ or _get_tag(repo['r...
[ "def", "_get_ref", "(", "repo", ",", "name", ")", ":", "if", "name", "==", "'base'", ":", "name", "=", "repo", "[", "'base'", "]", "if", "name", "==", "repo", "[", "'base'", "]", "or", "name", "in", "envs", "(", ")", ":", "if", "repo", "[", "'b...
Return ref tuple if ref is in the repo.
[ "Return", "ref", "tuple", "if", "ref", "is", "in", "the", "repo", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L164-L181
33,208
saltstack/salt
salt/fileserver/hgfs.py
update
def update(): ''' Execute an hg pull on all of the repos ''' # data for the fileserver event data = {'changed': False, 'backend': 'hgfs'} # _clear_old_remotes runs init(), so use the value from there to avoid a # second init() data['changed'], repos = _clear_old_remotes() ...
python
def update(): ''' Execute an hg pull on all of the repos ''' # data for the fileserver event data = {'changed': False, 'backend': 'hgfs'} # _clear_old_remotes runs init(), so use the value from there to avoid a # second init() data['changed'], repos = _clear_old_remotes() ...
[ "def", "update", "(", ")", ":", "# data for the fileserver event", "data", "=", "{", "'changed'", ":", "False", ",", "'backend'", ":", "'hgfs'", "}", "# _clear_old_remotes runs init(), so use the value from there to avoid a", "# second init()", "data", "[", "'changed'", "...
Execute an hg pull on all of the repos
[ "Execute", "an", "hg", "pull", "on", "all", "of", "the", "repos" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L504-L575
33,209
saltstack/salt
salt/fileserver/hgfs.py
_get_file_list
def _get_file_list(load): ''' Get a list of all files on the file server in a specified environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'saltenv' not in load or load['saltenv'] not in envs(): return [] ret = set() for rep...
python
def _get_file_list(load): ''' Get a list of all files on the file server in a specified environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'saltenv' not in load or load['saltenv'] not in envs(): return [] ret = set() for rep...
[ "def", "_get_file_list", "(", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "if", "'saltenv'", "not", "in", "load", "or", "load", "[", "'saltenv'", "]", "not", "in",...
Get a list of all files on the file server in a specified environment
[ "Get", "a", "list", "of", "all", "files", "on", "the", "file", "server", "in", "a", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L846-L868
33,210
saltstack/salt
salt/fileserver/hgfs.py
_get_dir_list
def _get_dir_list(load): ''' Get a list of all directories on the master ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'saltenv' not in load or load['saltenv'] not in envs(): return [] ret = set() for repo in init(): repo['...
python
def _get_dir_list(load): ''' Get a list of all directories on the master ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'saltenv' not in load or load['saltenv'] not in envs(): return [] ret = set() for repo in init(): repo['...
[ "def", "_get_dir_list", "(", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "if", "'saltenv'", "not", "in", "load", "or", "load", "[", "'saltenv'", "]", "not", "in", ...
Get a list of all directories on the master
[ "Get", "a", "list", "of", "all", "directories", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/hgfs.py#L886-L916
33,211
saltstack/salt
salt/cache/__init__.py
factory
def factory(opts, **kwargs): ''' Creates and returns the cache class. If memory caching is enabled by opts MemCache class will be instantiated. If not Cache class will be returned. ''' if opts.get('memcache_expire_seconds', 0): cls = MemCache else: cls = Cache return cls(...
python
def factory(opts, **kwargs): ''' Creates and returns the cache class. If memory caching is enabled by opts MemCache class will be instantiated. If not Cache class will be returned. ''' if opts.get('memcache_expire_seconds', 0): cls = MemCache else: cls = Cache return cls(...
[ "def", "factory", "(", "opts", ",", "*", "*", "kwargs", ")", ":", "if", "opts", ".", "get", "(", "'memcache_expire_seconds'", ",", "0", ")", ":", "cls", "=", "MemCache", "else", ":", "cls", "=", "Cache", "return", "cls", "(", "opts", ",", "*", "*",...
Creates and returns the cache class. If memory caching is enabled by opts MemCache class will be instantiated. If not Cache class will be returned.
[ "Creates", "and", "returns", "the", "cache", "class", ".", "If", "memory", "caching", "is", "enabled", "by", "opts", "MemCache", "class", "will", "be", "instantiated", ".", "If", "not", "Cache", "class", "will", "be", "returned", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/__init__.py#L24-L34
33,212
saltstack/salt
salt/cache/__init__.py
Cache.cache
def cache(self, bank, key, fun, loop_fun=None, **kwargs): ''' Check cache for the data. If it is there, check to see if it needs to be refreshed. If the data is not there, or it needs to be refreshed, then call the callback function (``fun``) with any given ``**kwargs``. ...
python
def cache(self, bank, key, fun, loop_fun=None, **kwargs): ''' Check cache for the data. If it is there, check to see if it needs to be refreshed. If the data is not there, or it needs to be refreshed, then call the callback function (``fun``) with any given ``**kwargs``. ...
[ "def", "cache", "(", "self", ",", "bank", ",", "key", ",", "fun", ",", "loop_fun", "=", "None", ",", "*", "*", "kwargs", ")", ":", "expire_seconds", "=", "kwargs", ".", "get", "(", "'expire'", ",", "86400", ")", "# 1 day", "updated", "=", "self", "...
Check cache for the data. If it is there, check to see if it needs to be refreshed. If the data is not there, or it needs to be refreshed, then call the callback function (``fun``) with any given ``**kwargs``. In some cases, the callback function returns a list of objects which ...
[ "Check", "cache", "for", "the", "data", ".", "If", "it", "is", "there", "check", "to", "see", "if", "it", "needs", "to", "be", "refreshed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/__init__.py#L96-L132
33,213
saltstack/salt
salt/cache/__init__.py
Cache.store
def store(self, bank, key, data): ''' Store data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which wil...
python
def store(self, bank, key, data): ''' Store data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which wil...
[ "def", "store", "(", "self", ",", "bank", ",", "key", ",", "data", ")", ":", "fun", "=", "'{0}.store'", ".", "format", "(", "self", ".", "driver", ")", "return", "self", ".", "modules", "[", "fun", "]", "(", "bank", ",", "key", ",", "data", ",", ...
Store data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which will hold the data. File extensions should no...
[ "Store", "data", "using", "the", "specified", "module" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/__init__.py#L134-L156
33,214
saltstack/salt
salt/cache/__init__.py
Cache.fetch
def fetch(self, bank, key): ''' Fetch data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which will hold...
python
def fetch(self, bank, key): ''' Fetch data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which will hold...
[ "def", "fetch", "(", "self", ",", "bank", ",", "key", ")", ":", "fun", "=", "'{0}.fetch'", ".", "format", "(", "self", ".", "driver", ")", "return", "self", ".", "modules", "[", "fun", "]", "(", "bank", ",", "key", ",", "*", "*", "self", ".", "...
Fetch data using the specified module :param bank: The name of the location inside the cache which will hold the key and its associated data. :param key: The name of the key (or file inside a directory) which will hold the data. File extensions should no...
[ "Fetch", "data", "using", "the", "specified", "module" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/__init__.py#L158-L180
33,215
saltstack/salt
salt/wheel/error.py
error
def error(name=None, message=''): ''' If name is None Then return empty dict Otherwise raise an exception with __name__ from name, message from message CLI Example: .. code-block:: bash salt-wheel error salt-wheel error.error name="Exception" message="This is an error." ''' ...
python
def error(name=None, message=''): ''' If name is None Then return empty dict Otherwise raise an exception with __name__ from name, message from message CLI Example: .. code-block:: bash salt-wheel error salt-wheel error.error name="Exception" message="This is an error." ''' ...
[ "def", "error", "(", "name", "=", "None", ",", "message", "=", "''", ")", ":", "ret", "=", "{", "}", "if", "name", "is", "not", "None", ":", "salt", ".", "utils", ".", "error", ".", "raise_error", "(", "name", "=", "name", ",", "message", "=", ...
If name is None Then return empty dict Otherwise raise an exception with __name__ from name, message from message CLI Example: .. code-block:: bash salt-wheel error salt-wheel error.error name="Exception" message="This is an error."
[ "If", "name", "is", "None", "Then", "return", "empty", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/error.py#L15-L31
33,216
saltstack/salt
salt/states/boto_asg.py
_determine_termination_policies
def _determine_termination_policies(termination_policies, termination_policies_from_pillar): ''' helper method for present. ensure that termination_policies are set ''' pillar_termination_policies = copy.deepcopy( __salt__['config.option'](termination_policies_from_pillar, []) ) if not ...
python
def _determine_termination_policies(termination_policies, termination_policies_from_pillar): ''' helper method for present. ensure that termination_policies are set ''' pillar_termination_policies = copy.deepcopy( __salt__['config.option'](termination_policies_from_pillar, []) ) if not ...
[ "def", "_determine_termination_policies", "(", "termination_policies", ",", "termination_policies_from_pillar", ")", ":", "pillar_termination_policies", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'config.option'", "]", "(", "termination_policies_from_pillar", ",", ...
helper method for present. ensure that termination_policies are set
[ "helper", "method", "for", "present", ".", "ensure", "that", "termination_policies", "are", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_asg.py#L712-L721
33,217
saltstack/salt
salt/states/boto_asg.py
_determine_scaling_policies
def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar): ''' helper method for present. ensure that scaling_policies are set ''' pillar_scaling_policies = copy.deepcopy( __salt__['config.option'](scaling_policies_from_pillar, {}) ) if not scaling_policies and pil...
python
def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar): ''' helper method for present. ensure that scaling_policies are set ''' pillar_scaling_policies = copy.deepcopy( __salt__['config.option'](scaling_policies_from_pillar, {}) ) if not scaling_policies and pil...
[ "def", "_determine_scaling_policies", "(", "scaling_policies", ",", "scaling_policies_from_pillar", ")", ":", "pillar_scaling_policies", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'config.option'", "]", "(", "scaling_policies_from_pillar", ",", "{", "}", ")", ...
helper method for present. ensure that scaling_policies are set
[ "helper", "method", "for", "present", ".", "ensure", "that", "scaling_policies", "are", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_asg.py#L724-L733
33,218
saltstack/salt
salt/states/boto_asg.py
_determine_scheduled_actions
def _determine_scheduled_actions(scheduled_actions, scheduled_actions_from_pillar): ''' helper method for present, ensure scheduled actions are setup ''' tmp = copy.deepcopy( __salt__['config.option'](scheduled_actions_from_pillar, {}) ) # merge with data from state if scheduled_act...
python
def _determine_scheduled_actions(scheduled_actions, scheduled_actions_from_pillar): ''' helper method for present, ensure scheduled actions are setup ''' tmp = copy.deepcopy( __salt__['config.option'](scheduled_actions_from_pillar, {}) ) # merge with data from state if scheduled_act...
[ "def", "_determine_scheduled_actions", "(", "scheduled_actions", ",", "scheduled_actions_from_pillar", ")", ":", "tmp", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'config.option'", "]", "(", "scheduled_actions_from_pillar", ",", "{", "}", ")", ")", "# merg...
helper method for present, ensure scheduled actions are setup
[ "helper", "method", "for", "present", "ensure", "scheduled", "actions", "are", "setup" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_asg.py#L736-L746
33,219
saltstack/salt
salt/states/boto_asg.py
_determine_notification_info
def _determine_notification_info(notification_arn, notification_arn_from_pillar, notification_types, notification_types_from_pillar): ''' helper method for present. ensure that notification_configs are set ''...
python
def _determine_notification_info(notification_arn, notification_arn_from_pillar, notification_types, notification_types_from_pillar): ''' helper method for present. ensure that notification_configs are set ''...
[ "def", "_determine_notification_info", "(", "notification_arn", ",", "notification_arn_from_pillar", ",", "notification_types", ",", "notification_types_from_pillar", ")", ":", "pillar_arn_list", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'config.option'", "]", ...
helper method for present. ensure that notification_configs are set
[ "helper", "method", "for", "present", ".", "ensure", "that", "notification_configs", "are", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_asg.py#L749-L767
33,220
saltstack/salt
salt/states/boto_asg.py
absent
def absent( name, force=False, region=None, key=None, keyid=None, profile=None, remove_lc=False): ''' Ensure the named autoscale group is deleted. name Name of the autoscale group. force Force deletion of autoscale group. rem...
python
def absent( name, force=False, region=None, key=None, keyid=None, profile=None, remove_lc=False): ''' Ensure the named autoscale group is deleted. name Name of the autoscale group. force Force deletion of autoscale group. rem...
[ "def", "absent", "(", "name", ",", "force", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "remove_lc", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name...
Ensure the named autoscale group is deleted. name Name of the autoscale group. force Force deletion of autoscale group. remove_lc Delete the launch config as well. region The region to connect to. key Secret key to be used. keyid Access key t...
[ "Ensure", "the", "named", "autoscale", "group", "is", "deleted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_asg.py#L822-L892
33,221
saltstack/salt
salt/modules/kubernetesmod.py
_setup_conn_old
def _setup_conn_old(**kwargs): ''' Setup kubernetes API connection singleton the old way ''' host = __salt__['config.option']('kubernetes.api_url', 'http://localhost:8080') username = __salt__['config.option']('kubernetes.user') password = __salt__['config.op...
python
def _setup_conn_old(**kwargs): ''' Setup kubernetes API connection singleton the old way ''' host = __salt__['config.option']('kubernetes.api_url', 'http://localhost:8080') username = __salt__['config.option']('kubernetes.user') password = __salt__['config.op...
[ "def", "_setup_conn_old", "(", "*", "*", "kwargs", ")", ":", "host", "=", "__salt__", "[", "'config.option'", "]", "(", "'kubernetes.api_url'", ",", "'http://localhost:8080'", ")", "username", "=", "__salt__", "[", "'config.option'", "]", "(", "'kubernetes.user'",...
Setup kubernetes API connection singleton the old way
[ "Setup", "kubernetes", "API", "connection", "singleton", "the", "old", "way" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L117-L188
33,222
saltstack/salt
salt/modules/kubernetesmod.py
_setup_conn
def _setup_conn(**kwargs): ''' Setup kubernetes API connection singleton ''' kubeconfig = kwargs.get('kubeconfig') or __salt__['config.option']('kubernetes.kubeconfig') kubeconfig_data = kwargs.get('kubeconfig_data') or __salt__['config.option']('kubernetes.kubeconfig-data') context = kwargs.get...
python
def _setup_conn(**kwargs): ''' Setup kubernetes API connection singleton ''' kubeconfig = kwargs.get('kubeconfig') or __salt__['config.option']('kubernetes.kubeconfig') kubeconfig_data = kwargs.get('kubeconfig_data') or __salt__['config.option']('kubernetes.kubeconfig-data') context = kwargs.get...
[ "def", "_setup_conn", "(", "*", "*", "kwargs", ")", ":", "kubeconfig", "=", "kwargs", ".", "get", "(", "'kubeconfig'", ")", "or", "__salt__", "[", "'config.option'", "]", "(", "'kubernetes.kubeconfig'", ")", "kubeconfig_data", "=", "kwargs", ".", "get", "(",...
Setup kubernetes API connection singleton
[ "Setup", "kubernetes", "API", "connection", "singleton" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L192-L219
33,223
saltstack/salt
salt/modules/kubernetesmod.py
ping
def ping(**kwargs): ''' Checks connections with the kubernetes API server. Returns True if the connection can be established, False otherwise. CLI Example: salt '*' kubernetes.ping ''' status = True try: nodes(**kwargs) except CommandExecutionError: status = Fals...
python
def ping(**kwargs): ''' Checks connections with the kubernetes API server. Returns True if the connection can be established, False otherwise. CLI Example: salt '*' kubernetes.ping ''' status = True try: nodes(**kwargs) except CommandExecutionError: status = Fals...
[ "def", "ping", "(", "*", "*", "kwargs", ")", ":", "status", "=", "True", "try", ":", "nodes", "(", "*", "*", "kwargs", ")", "except", "CommandExecutionError", ":", "status", "=", "False", "return", "status" ]
Checks connections with the kubernetes API server. Returns True if the connection can be established, False otherwise. CLI Example: salt '*' kubernetes.ping
[ "Checks", "connections", "with", "the", "kubernetes", "API", "server", ".", "Returns", "True", "if", "the", "connection", "can", "be", "established", "False", "otherwise", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L251-L265
33,224
saltstack/salt
salt/modules/kubernetesmod.py
nodes
def nodes(**kwargs): ''' Return the names of the nodes composing the kubernetes cluster CLI Examples:: salt '*' kubernetes.nodes salt '*' kubernetes.nodes kubeconfig=/etc/salt/k8s/kubeconfig context=minikube ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes...
python
def nodes(**kwargs): ''' Return the names of the nodes composing the kubernetes cluster CLI Examples:: salt '*' kubernetes.nodes salt '*' kubernetes.nodes kubeconfig=/etc/salt/k8s/kubeconfig context=minikube ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes...
[ "def", "nodes", "(", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", "=", "api_instance", ".", "list_node", ...
Return the names of the nodes composing the kubernetes cluster CLI Examples:: salt '*' kubernetes.nodes salt '*' kubernetes.nodes kubeconfig=/etc/salt/k8s/kubeconfig context=minikube
[ "Return", "the", "names", "of", "the", "nodes", "composing", "the", "kubernetes", "cluster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L268-L290
33,225
saltstack/salt
salt/modules/kubernetesmod.py
node
def node(name, **kwargs): ''' Return the details of the node identified by the specified name CLI Examples:: salt '*' kubernetes.node name='minikube' ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() api_response = api_instance.list_node(...
python
def node(name, **kwargs): ''' Return the details of the node identified by the specified name CLI Examples:: salt '*' kubernetes.node name='minikube' ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() api_response = api_instance.list_node(...
[ "def", "node", "(", "name", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", "=", "api_instance", ".", ...
Return the details of the node identified by the specified name CLI Examples:: salt '*' kubernetes.node name='minikube'
[ "Return", "the", "details", "of", "the", "node", "identified", "by", "the", "specified", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L293-L318
33,226
saltstack/salt
salt/modules/kubernetesmod.py
node_add_label
def node_add_label(node_name, label_name, label_value, **kwargs): ''' Set the value of the label identified by `label_name` to `label_value` on the node identified by the name `node_name`. Creates the lable if not present. CLI Examples:: salt '*' kubernetes.node_add_label node_name="miniku...
python
def node_add_label(node_name, label_name, label_value, **kwargs): ''' Set the value of the label identified by `label_name` to `label_value` on the node identified by the name `node_name`. Creates the lable if not present. CLI Examples:: salt '*' kubernetes.node_add_label node_name="miniku...
[ "def", "node_add_label", "(", "node_name", ",", "label_name", ",", "label_value", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", ...
Set the value of the label identified by `label_name` to `label_value` on the node identified by the name `node_name`. Creates the lable if not present. CLI Examples:: salt '*' kubernetes.node_add_label node_name="minikube" \ label_name="foo" label_value="bar"
[ "Set", "the", "value", "of", "the", "label", "identified", "by", "label_name", "to", "label_value", "on", "the", "node", "identified", "by", "the", "name", "node_name", ".", "Creates", "the", "lable", "if", "not", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L337-L368
33,227
saltstack/salt
salt/modules/kubernetesmod.py
namespaces
def namespaces(**kwargs): ''' Return the names of the available namespaces CLI Examples:: salt '*' kubernetes.namespaces salt '*' kubernetes.namespaces kubeconfig=/etc/salt/k8s/kubeconfig context=minikube ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.cl...
python
def namespaces(**kwargs): ''' Return the names of the available namespaces CLI Examples:: salt '*' kubernetes.namespaces salt '*' kubernetes.namespaces kubeconfig=/etc/salt/k8s/kubeconfig context=minikube ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.cl...
[ "def", "namespaces", "(", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", "=", "api_instance", ".", "list_nam...
Return the names of the available namespaces CLI Examples:: salt '*' kubernetes.namespaces salt '*' kubernetes.namespaces kubeconfig=/etc/salt/k8s/kubeconfig context=minikube
[ "Return", "the", "names", "of", "the", "available", "namespaces" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L404-L426
33,228
saltstack/salt
salt/modules/kubernetesmod.py
deployments
def deployments(namespace='default', **kwargs): ''' Return a list of kubernetes deployments defined in the namespace CLI Examples:: salt '*' kubernetes.deployments salt '*' kubernetes.deployments namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kube...
python
def deployments(namespace='default', **kwargs): ''' Return a list of kubernetes deployments defined in the namespace CLI Examples:: salt '*' kubernetes.deployments salt '*' kubernetes.deployments namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kube...
[ "def", "deployments", "(", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "ExtensionsV1beta1Api", "(", ")", "ap...
Return a list of kubernetes deployments defined in the namespace CLI Examples:: salt '*' kubernetes.deployments salt '*' kubernetes.deployments namespace=default
[ "Return", "a", "list", "of", "kubernetes", "deployments", "defined", "in", "the", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L429-L454
33,229
saltstack/salt
salt/modules/kubernetesmod.py
services
def services(namespace='default', **kwargs): ''' Return a list of kubernetes services defined in the namespace CLI Examples:: salt '*' kubernetes.services salt '*' kubernetes.services namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.clien...
python
def services(namespace='default', **kwargs): ''' Return a list of kubernetes services defined in the namespace CLI Examples:: salt '*' kubernetes.services salt '*' kubernetes.services namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.clien...
[ "def", "services", "(", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", ...
Return a list of kubernetes services defined in the namespace CLI Examples:: salt '*' kubernetes.services salt '*' kubernetes.services namespace=default
[ "Return", "a", "list", "of", "kubernetes", "services", "defined", "in", "the", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L457-L482
33,230
saltstack/salt
salt/modules/kubernetesmod.py
pods
def pods(namespace='default', **kwargs): ''' Return a list of kubernetes pods defined in the namespace CLI Examples:: salt '*' kubernetes.pods salt '*' kubernetes.pods namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() ...
python
def pods(namespace='default', **kwargs): ''' Return a list of kubernetes pods defined in the namespace CLI Examples:: salt '*' kubernetes.pods salt '*' kubernetes.pods namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() ...
[ "def", "pods", "(", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", "="...
Return a list of kubernetes pods defined in the namespace CLI Examples:: salt '*' kubernetes.pods salt '*' kubernetes.pods namespace=default
[ "Return", "a", "list", "of", "kubernetes", "pods", "defined", "in", "the", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L485-L510
33,231
saltstack/salt
salt/modules/kubernetesmod.py
configmaps
def configmaps(namespace='default', **kwargs): ''' Return a list of kubernetes configmaps defined in the namespace CLI Examples:: salt '*' kubernetes.configmaps salt '*' kubernetes.configmaps namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernet...
python
def configmaps(namespace='default', **kwargs): ''' Return a list of kubernetes configmaps defined in the namespace CLI Examples:: salt '*' kubernetes.configmaps salt '*' kubernetes.configmaps namespace=default ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernet...
[ "def", "configmaps", "(", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response",...
Return a list of kubernetes configmaps defined in the namespace CLI Examples:: salt '*' kubernetes.configmaps salt '*' kubernetes.configmaps namespace=default
[ "Return", "a", "list", "of", "kubernetes", "configmaps", "defined", "in", "the", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L541-L566
33,232
saltstack/salt
salt/modules/kubernetesmod.py
show_deployment
def show_deployment(name, namespace='default', **kwargs): ''' Return the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.show_deployment my-nginx default salt '*' kubernetes.show_deployment name=my-nginx namespace=default ''' cfg = _setup_conn...
python
def show_deployment(name, namespace='default', **kwargs): ''' Return the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.show_deployment my-nginx default salt '*' kubernetes.show_deployment name=my-nginx namespace=default ''' cfg = _setup_conn...
[ "def", "show_deployment", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "ExtensionsV1beta1Api"...
Return the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.show_deployment my-nginx default salt '*' kubernetes.show_deployment name=my-nginx namespace=default
[ "Return", "the", "kubernetes", "deployment", "defined", "by", "name", "and", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L569-L594
33,233
saltstack/salt
salt/modules/kubernetesmod.py
show_namespace
def show_namespace(name, **kwargs): ''' Return information for a given namespace defined by the specified name CLI Examples:: salt '*' kubernetes.show_namespace kube-system ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() api_response = ...
python
def show_namespace(name, **kwargs): ''' Return information for a given namespace defined by the specified name CLI Examples:: salt '*' kubernetes.show_namespace kube-system ''' cfg = _setup_conn(**kwargs) try: api_instance = kubernetes.client.CoreV1Api() api_response = ...
[ "def", "show_namespace", "(", "name", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", ")", "api_response", "=", "api_instance...
Return information for a given namespace defined by the specified name CLI Examples:: salt '*' kubernetes.show_namespace kube-system
[ "Return", "information", "for", "a", "given", "namespace", "defined", "by", "the", "specified", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L653-L677
33,234
saltstack/salt
salt/modules/kubernetesmod.py
delete_deployment
def delete_deployment(name, namespace='default', **kwargs): ''' Deletes the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_deployment my-nginx salt '*' kubernetes.delete_deployment name=my-nginx namespace=default ''' cfg = _setup_conn(...
python
def delete_deployment(name, namespace='default', **kwargs): ''' Deletes the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_deployment my-nginx salt '*' kubernetes.delete_deployment name=my-nginx namespace=default ''' cfg = _setup_conn(...
[ "def", "delete_deployment", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "body", "=", "kubernetes", ".", "client", ".", "V1DeleteOptions", "(", "orphan_dependen...
Deletes the kubernetes deployment defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_deployment my-nginx salt '*' kubernetes.delete_deployment name=my-nginx namespace=default
[ "Deletes", "the", "kubernetes", "deployment", "defined", "by", "name", "and", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L746-L798
33,235
saltstack/salt
salt/modules/kubernetesmod.py
delete_service
def delete_service(name, namespace='default', **kwargs): ''' Deletes the kubernetes service defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_service my-nginx default salt '*' kubernetes.delete_service name=my-nginx namespace=default ''' cfg = _setup_conn(**kw...
python
def delete_service(name, namespace='default', **kwargs): ''' Deletes the kubernetes service defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_service my-nginx default salt '*' kubernetes.delete_service name=my-nginx namespace=default ''' cfg = _setup_conn(**kw...
[ "def", "delete_service", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "try", ":", "api_instance", "=", "kubernetes", ".", "client", ".", "CoreV1Api", "(", "...
Deletes the kubernetes service defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_service my-nginx default salt '*' kubernetes.delete_service name=my-nginx namespace=default
[ "Deletes", "the", "kubernetes", "service", "defined", "by", "name", "and", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L801-L828
33,236
saltstack/salt
salt/modules/kubernetesmod.py
delete_pod
def delete_pod(name, namespace='default', **kwargs): ''' Deletes the kubernetes pod defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_pod guestbook-708336848-5nl8c default salt '*' kubernetes.delete_pod name=guestbook-708336848-5nl8c namespace=default ''' cfg ...
python
def delete_pod(name, namespace='default', **kwargs): ''' Deletes the kubernetes pod defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_pod guestbook-708336848-5nl8c default salt '*' kubernetes.delete_pod name=guestbook-708336848-5nl8c namespace=default ''' cfg ...
[ "def", "delete_pod", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "cfg", "=", "_setup_conn", "(", "*", "*", "kwargs", ")", "body", "=", "kubernetes", ".", "client", ".", "V1DeleteOptions", "(", "orphan_dependents", ...
Deletes the kubernetes pod defined by name and namespace CLI Examples:: salt '*' kubernetes.delete_pod guestbook-708336848-5nl8c default salt '*' kubernetes.delete_pod name=guestbook-708336848-5nl8c namespace=default
[ "Deletes", "the", "kubernetes", "pod", "defined", "by", "name", "and", "namespace" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L831-L861
33,237
saltstack/salt
salt/modules/kubernetesmod.py
create_pod
def create_pod( name, namespace, metadata, spec, source, template, saltenv, **kwargs): ''' Creates the kubernetes deployment as defined by the user. ''' body = __create_object_body( kind='Pod', obj_class=kubernetes.client.V1...
python
def create_pod( name, namespace, metadata, spec, source, template, saltenv, **kwargs): ''' Creates the kubernetes deployment as defined by the user. ''' body = __create_object_body( kind='Pod', obj_class=kubernetes.client.V1...
[ "def", "create_pod", "(", "name", ",", "namespace", ",", "metadata", ",", "spec", ",", "source", ",", "template", ",", "saltenv", ",", "*", "*", "kwargs", ")", ":", "body", "=", "__create_object_body", "(", "kind", "=", "'Pod'", ",", "obj_class", "=", ...
Creates the kubernetes deployment as defined by the user.
[ "Creates", "the", "kubernetes", "deployment", "as", "defined", "by", "the", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1003-L1045
33,238
saltstack/salt
salt/modules/kubernetesmod.py
create_secret
def create_secret( name, namespace='default', data=None, source=None, template=None, saltenv='base', **kwargs): ''' Creates the kubernetes secret as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_secret \ pas...
python
def create_secret( name, namespace='default', data=None, source=None, template=None, saltenv='base', **kwargs): ''' Creates the kubernetes secret as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_secret \ pas...
[ "def", "create_secret", "(", "name", ",", "namespace", "=", "'default'", ",", "data", "=", "None", ",", "source", "=", "None", ",", "template", "=", "None", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "if", "source", ":", "data"...
Creates the kubernetes secret as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_secret \ passwords default '{"db": "letmein"}' salt 'minion2' kubernetes.create_secret \ name=passwords namespace=default data='{"db": "letmein"}'
[ "Creates", "the", "kubernetes", "secret", "as", "defined", "by", "the", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1093-L1145
33,239
saltstack/salt
salt/modules/kubernetesmod.py
create_configmap
def create_configmap( name, namespace, data, source=None, template=None, saltenv='base', **kwargs): ''' Creates the kubernetes configmap as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_configmap \ settings ...
python
def create_configmap( name, namespace, data, source=None, template=None, saltenv='base', **kwargs): ''' Creates the kubernetes configmap as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_configmap \ settings ...
[ "def", "create_configmap", "(", "name", ",", "namespace", ",", "data", ",", "source", "=", "None", ",", "template", "=", "None", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "if", "source", ":", "data", "=", "__read_and_render_yaml_f...
Creates the kubernetes configmap as defined by the user. CLI Examples:: salt 'minion1' kubernetes.create_configmap \ settings default '{"example.conf": "# example file"}' salt 'minion2' kubernetes.create_configmap \ name=settings namespace=default data='{"example.conf": "#...
[ "Creates", "the", "kubernetes", "configmap", "as", "defined", "by", "the", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1148-L1196
33,240
saltstack/salt
salt/modules/kubernetesmod.py
create_namespace
def create_namespace( name, **kwargs): ''' Creates a namespace with the specified name. CLI Example: salt '*' kubernetes.create_namespace salt salt '*' kubernetes.create_namespace name=salt ''' meta_obj = kubernetes.client.V1ObjectMeta(name=name) body = kubernet...
python
def create_namespace( name, **kwargs): ''' Creates a namespace with the specified name. CLI Example: salt '*' kubernetes.create_namespace salt salt '*' kubernetes.create_namespace name=salt ''' meta_obj = kubernetes.client.V1ObjectMeta(name=name) body = kubernet...
[ "def", "create_namespace", "(", "name", ",", "*", "*", "kwargs", ")", ":", "meta_obj", "=", "kubernetes", ".", "client", ".", "V1ObjectMeta", "(", "name", "=", "name", ")", "body", "=", "kubernetes", ".", "client", ".", "V1Namespace", "(", "metadata", "=...
Creates a namespace with the specified name. CLI Example: salt '*' kubernetes.create_namespace salt salt '*' kubernetes.create_namespace name=salt
[ "Creates", "a", "namespace", "with", "the", "specified", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1199-L1231
33,241
saltstack/salt
salt/modules/kubernetesmod.py
replace_deployment
def replace_deployment(name, metadata, spec, source, template, saltenv, namespace='default', **kwargs): ''' Replaces an existing deployment with a new ...
python
def replace_deployment(name, metadata, spec, source, template, saltenv, namespace='default', **kwargs): ''' Replaces an existing deployment with a new ...
[ "def", "replace_deployment", "(", "name", ",", "metadata", ",", "spec", ",", "source", ",", "template", ",", "saltenv", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "body", "=", "__create_object_body", "(", "kind", "=", "'Deployme...
Replaces an existing deployment with a new one defined by name and namespace, having the specificed metadata and spec.
[ "Replaces", "an", "existing", "deployment", "with", "a", "new", "one", "defined", "by", "name", "and", "namespace", "having", "the", "specificed", "metadata", "and", "spec", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1234-L1276
33,242
saltstack/salt
salt/modules/kubernetesmod.py
replace_service
def replace_service(name, metadata, spec, source, template, old_service, saltenv, namespace='default', **kwargs): ''' Replaces an existing service with ...
python
def replace_service(name, metadata, spec, source, template, old_service, saltenv, namespace='default', **kwargs): ''' Replaces an existing service with ...
[ "def", "replace_service", "(", "name", ",", "metadata", ",", "spec", ",", "source", ",", "template", ",", "old_service", ",", "saltenv", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "body", "=", "__create_object_body", "(", "kind"...
Replaces an existing service with a new one defined by name and namespace, having the specificed metadata and spec.
[ "Replaces", "an", "existing", "service", "with", "a", "new", "one", "defined", "by", "name", "and", "namespace", "having", "the", "specificed", "metadata", "and", "spec", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1279-L1327
33,243
saltstack/salt
salt/modules/kubernetesmod.py
__create_object_body
def __create_object_body(kind, obj_class, spec_creator, name, namespace, metadata, spec, source, template, ...
python
def __create_object_body(kind, obj_class, spec_creator, name, namespace, metadata, spec, source, template, ...
[ "def", "__create_object_body", "(", "kind", ",", "obj_class", ",", "spec_creator", ",", "name", ",", "namespace", ",", "metadata", ",", "spec", ",", "source", ",", "template", ",", "saltenv", ")", ":", "if", "source", ":", "src_obj", "=", "__read_and_render_...
Create a Kubernetes Object body instance.
[ "Create", "a", "Kubernetes", "Object", "body", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1434-L1464
33,244
saltstack/salt
salt/modules/kubernetesmod.py
__read_and_render_yaml_file
def __read_and_render_yaml_file(source, template, saltenv): ''' Read a yaml file and, if needed, renders that using the specifieds templating. Returns the python objects defined inside of the file. ''' sfn = __salt__['cp.cache_file'](so...
python
def __read_and_render_yaml_file(source, template, saltenv): ''' Read a yaml file and, if needed, renders that using the specifieds templating. Returns the python objects defined inside of the file. ''' sfn = __salt__['cp.cache_file'](so...
[ "def", "__read_and_render_yaml_file", "(", "source", ",", "template", ",", "saltenv", ")", ":", "sfn", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", "saltenv", ")", "if", "not", "sfn", ":", "raise", "CommandExecutionError", "(", "'Source fi...
Read a yaml file and, if needed, renders that using the specifieds templating. Returns the python objects defined inside of the file.
[ "Read", "a", "yaml", "file", "and", "if", "needed", "renders", "that", "using", "the", "specifieds", "templating", ".", "Returns", "the", "python", "objects", "defined", "inside", "of", "the", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1467-L1510
33,245
saltstack/salt
salt/modules/kubernetesmod.py
__dict_to_object_meta
def __dict_to_object_meta(name, namespace, metadata): ''' Converts a dictionary into kubernetes ObjectMetaV1 instance. ''' meta_obj = kubernetes.client.V1ObjectMeta() meta_obj.namespace = namespace # Replicate `kubectl [create|replace|apply] --record` if 'annotations' not in metadata: ...
python
def __dict_to_object_meta(name, namespace, metadata): ''' Converts a dictionary into kubernetes ObjectMetaV1 instance. ''' meta_obj = kubernetes.client.V1ObjectMeta() meta_obj.namespace = namespace # Replicate `kubectl [create|replace|apply] --record` if 'annotations' not in metadata: ...
[ "def", "__dict_to_object_meta", "(", "name", ",", "namespace", ",", "metadata", ")", ":", "meta_obj", "=", "kubernetes", ".", "client", ".", "V1ObjectMeta", "(", ")", "meta_obj", ".", "namespace", "=", "namespace", "# Replicate `kubectl [create|replace|apply] --record...
Converts a dictionary into kubernetes ObjectMetaV1 instance.
[ "Converts", "a", "dictionary", "into", "kubernetes", "ObjectMetaV1", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1513-L1536
33,246
saltstack/salt
salt/modules/kubernetesmod.py
__dict_to_deployment_spec
def __dict_to_deployment_spec(spec): ''' Converts a dictionary into kubernetes AppsV1beta1DeploymentSpec instance. ''' spec_obj = AppsV1beta1DeploymentSpec(template=spec.get('template', '')) for key, value in iteritems(spec): if hasattr(spec_obj, key): setattr(spec_obj, key, valu...
python
def __dict_to_deployment_spec(spec): ''' Converts a dictionary into kubernetes AppsV1beta1DeploymentSpec instance. ''' spec_obj = AppsV1beta1DeploymentSpec(template=spec.get('template', '')) for key, value in iteritems(spec): if hasattr(spec_obj, key): setattr(spec_obj, key, valu...
[ "def", "__dict_to_deployment_spec", "(", "spec", ")", ":", "spec_obj", "=", "AppsV1beta1DeploymentSpec", "(", "template", "=", "spec", ".", "get", "(", "'template'", ",", "''", ")", ")", "for", "key", ",", "value", "in", "iteritems", "(", "spec", ")", ":",...
Converts a dictionary into kubernetes AppsV1beta1DeploymentSpec instance.
[ "Converts", "a", "dictionary", "into", "kubernetes", "AppsV1beta1DeploymentSpec", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1539-L1548
33,247
saltstack/salt
salt/modules/kubernetesmod.py
__dict_to_pod_spec
def __dict_to_pod_spec(spec): ''' Converts a dictionary into kubernetes V1PodSpec instance. ''' spec_obj = kubernetes.client.V1PodSpec() for key, value in iteritems(spec): if hasattr(spec_obj, key): setattr(spec_obj, key, value) return spec_obj
python
def __dict_to_pod_spec(spec): ''' Converts a dictionary into kubernetes V1PodSpec instance. ''' spec_obj = kubernetes.client.V1PodSpec() for key, value in iteritems(spec): if hasattr(spec_obj, key): setattr(spec_obj, key, value) return spec_obj
[ "def", "__dict_to_pod_spec", "(", "spec", ")", ":", "spec_obj", "=", "kubernetes", ".", "client", ".", "V1PodSpec", "(", ")", "for", "key", ",", "value", "in", "iteritems", "(", "spec", ")", ":", "if", "hasattr", "(", "spec_obj", ",", "key", ")", ":", ...
Converts a dictionary into kubernetes V1PodSpec instance.
[ "Converts", "a", "dictionary", "into", "kubernetes", "V1PodSpec", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1551-L1560
33,248
saltstack/salt
salt/modules/kubernetesmod.py
__dict_to_service_spec
def __dict_to_service_spec(spec): ''' Converts a dictionary into kubernetes V1ServiceSpec instance. ''' spec_obj = kubernetes.client.V1ServiceSpec() for key, value in iteritems(spec): # pylint: disable=too-many-nested-blocks if key == 'ports': spec_obj.ports = [] for...
python
def __dict_to_service_spec(spec): ''' Converts a dictionary into kubernetes V1ServiceSpec instance. ''' spec_obj = kubernetes.client.V1ServiceSpec() for key, value in iteritems(spec): # pylint: disable=too-many-nested-blocks if key == 'ports': spec_obj.ports = [] for...
[ "def", "__dict_to_service_spec", "(", "spec", ")", ":", "spec_obj", "=", "kubernetes", ".", "client", ".", "V1ServiceSpec", "(", ")", "for", "key", ",", "value", "in", "iteritems", "(", "spec", ")", ":", "# pylint: disable=too-many-nested-blocks", "if", "key", ...
Converts a dictionary into kubernetes V1ServiceSpec instance.
[ "Converts", "a", "dictionary", "into", "kubernetes", "V1ServiceSpec", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1563-L1583
33,249
saltstack/salt
salt/modules/kubernetesmod.py
__enforce_only_strings_dict
def __enforce_only_strings_dict(dictionary): ''' Returns a dictionary that has string keys and values. ''' ret = {} for key, value in iteritems(dictionary): ret[six.text_type(key)] = six.text_type(value) return ret
python
def __enforce_only_strings_dict(dictionary): ''' Returns a dictionary that has string keys and values. ''' ret = {} for key, value in iteritems(dictionary): ret[six.text_type(key)] = six.text_type(value) return ret
[ "def", "__enforce_only_strings_dict", "(", "dictionary", ")", ":", "ret", "=", "{", "}", "for", "key", ",", "value", "in", "iteritems", "(", "dictionary", ")", ":", "ret", "[", "six", ".", "text_type", "(", "key", ")", "]", "=", "six", ".", "text_type"...
Returns a dictionary that has string keys and values.
[ "Returns", "a", "dictionary", "that", "has", "string", "keys", "and", "values", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kubernetesmod.py#L1586-L1595
33,250
saltstack/salt
salt/utils/virt.py
VirtKey.accept
def accept(self, pub): ''' Accept the provided key ''' try: with salt.utils.files.fopen(self.path, 'r') as fp_: expiry = int(fp_.read()) except (OSError, IOError): log.error( 'Request to sign key for minion \'%s\' on hyper \...
python
def accept(self, pub): ''' Accept the provided key ''' try: with salt.utils.files.fopen(self.path, 'r') as fp_: expiry = int(fp_.read()) except (OSError, IOError): log.error( 'Request to sign key for minion \'%s\' on hyper \...
[ "def", "accept", "(", "self", ",", "pub", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "self", ".", "path", ",", "'r'", ")", "as", "fp_", ":", "expiry", "=", "int", "(", "fp_", ".", "read", "(", ")", ")...
Accept the provided key
[ "Accept", "the", "provided", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virt.py#L32-L64
33,251
saltstack/salt
salt/utils/virt.py
VirtKey.authorize
def authorize(self): ''' Prepare the master to expect a signing request ''' with salt.utils.files.fopen(self.path, 'w+') as fp_: fp_.write(str(int(time.time()))) # future lint: disable=blacklisted-function return True
python
def authorize(self): ''' Prepare the master to expect a signing request ''' with salt.utils.files.fopen(self.path, 'w+') as fp_: fp_.write(str(int(time.time()))) # future lint: disable=blacklisted-function return True
[ "def", "authorize", "(", "self", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "self", ".", "path", ",", "'w+'", ")", "as", "fp_", ":", "fp_", ".", "write", "(", "str", "(", "int", "(", "time", ".", "time", "(", ")", ...
Prepare the master to expect a signing request
[ "Prepare", "the", "master", "to", "expect", "a", "signing", "request" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virt.py#L66-L72
33,252
saltstack/salt
salt/ext/backports_abc.py
patch
def patch(patch_inspect=True): """ Main entry point for patching the ``collections.abc`` and ``inspect`` standard library modules. """ PATCHED['collections.abc.Generator'] = _collections_abc.Generator = Generator PATCHED['collections.abc.Coroutine'] = _collections_abc.Coroutine = Coroutine P...
python
def patch(patch_inspect=True): """ Main entry point for patching the ``collections.abc`` and ``inspect`` standard library modules. """ PATCHED['collections.abc.Generator'] = _collections_abc.Generator = Generator PATCHED['collections.abc.Coroutine'] = _collections_abc.Coroutine = Coroutine P...
[ "def", "patch", "(", "patch_inspect", "=", "True", ")", ":", "PATCHED", "[", "'collections.abc.Generator'", "]", "=", "_collections_abc", ".", "Generator", "=", "Generator", "PATCHED", "[", "'collections.abc.Coroutine'", "]", "=", "_collections_abc", ".", "Coroutine...
Main entry point for patching the ``collections.abc`` and ``inspect`` standard library modules.
[ "Main", "entry", "point", "for", "patching", "the", "collections", ".", "abc", "and", "inspect", "standard", "library", "modules", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/ext/backports_abc.py#L205-L216
33,253
saltstack/salt
salt/utils/kickstart.py
parse_iscsiname
def parse_iscsiname(rule): ''' Parse the iscsiname line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) #parser.add_argument('iqn') args = clean_args(vars(parser.parse_args(rules))) parser = None return args
python
def parse_iscsiname(rule): ''' Parse the iscsiname line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) #parser.add_argument('iqn') args = clean_args(vars(parser.parse_args(rules))) parser = None return args
[ "def", "parse_iscsiname", "(", "rule", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "#parser.add_argument('iqn')", "args", "=", "clean_args"...
Parse the iscsiname line
[ "Parse", "the", "iscsiname", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L345-L356
33,254
saltstack/salt
salt/utils/kickstart.py
parse_partition
def parse_partition(rule): ''' Parse the partition line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) parser.add_argument('mntpoint') parser.add_argument('--size', dest='size', action='store') parser.add_argument('--grow', dest='grow', action='store_tr...
python
def parse_partition(rule): ''' Parse the partition line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) parser.add_argument('mntpoint') parser.add_argument('--size', dest='size', action='store') parser.add_argument('--grow', dest='grow', action='store_tr...
[ "def", "parse_partition", "(", "rule", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "parser", ".", "add_argument", "(", "'mntpoint'", ")...
Parse the partition line
[ "Parse", "the", "partition", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L528-L557
33,255
saltstack/salt
salt/utils/kickstart.py
parse_raid
def parse_raid(rule): ''' Parse the raid line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) partitions = [] newrules = [] for count in range(0, len(rules)): if count == 0: newrules.append(rules[count]) continue ...
python
def parse_raid(rule): ''' Parse the raid line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) partitions = [] newrules = [] for count in range(0, len(rules)): if count == 0: newrules.append(rules[count]) continue ...
[ "def", "parse_raid", "(", "rule", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "partitions", "=", "[", "]", "newrules", "=", "[", "]...
Parse the raid line
[ "Parse", "the", "raid", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L560-L601
33,256
saltstack/salt
salt/utils/kickstart.py
parse_services
def parse_services(rule): ''' Parse the services line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) parser.add_argument('--disabled', dest='disabled', action='store') parser.add_argument('--enabled', dest='enabled', action='store') args = clean_args(v...
python
def parse_services(rule): ''' Parse the services line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) parser.add_argument('--disabled', dest='disabled', action='store') parser.add_argument('--enabled', dest='enabled', action='store') args = clean_args(v...
[ "def", "parse_services", "(", "rule", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "parser", ".", "add_argument", "(", "'--disabled'", "...
Parse the services line
[ "Parse", "the", "services", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L689-L701
33,257
saltstack/salt
salt/utils/kickstart.py
parse_updates
def parse_updates(rule): ''' Parse the updates line ''' rules = shlex.split(rule) rules.pop(0) return {'url': rules[0]} if rules else True
python
def parse_updates(rule): ''' Parse the updates line ''' rules = shlex.split(rule) rules.pop(0) return {'url': rules[0]} if rules else True
[ "def", "parse_updates", "(", "rule", ")", ":", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "return", "{", "'url'", ":", "rules", "[", "0", "]", "}", "if", "rules", "else", "True" ]
Parse the updates line
[ "Parse", "the", "updates", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L739-L745
33,258
saltstack/salt
salt/utils/kickstart.py
parse_volgroup
def parse_volgroup(rule): ''' Parse the volgroup line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) partitions = [] newrules = [] for count in range(0, len(rules)): if count == 0: newrules.append(rules[count]) continue ...
python
def parse_volgroup(rule): ''' Parse the volgroup line ''' parser = argparse.ArgumentParser() rules = shlex.split(rule) rules.pop(0) partitions = [] newrules = [] for count in range(0, len(rules)): if count == 0: newrules.append(rules[count]) continue ...
[ "def", "parse_volgroup", "(", "rule", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "rules", "=", "shlex", ".", "split", "(", "rule", ")", "rules", ".", "pop", "(", "0", ")", "partitions", "=", "[", "]", "newrules", "=", "[", ...
Parse the volgroup line
[ "Parse", "the", "volgroup", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/kickstart.py#L820-L855
33,259
saltstack/salt
salt/modules/mac_power.py
_validate_sleep
def _validate_sleep(minutes): ''' Helper function that validates the minutes parameter. Can be any number between 1 and 180. Can also be the string values "Never" and "Off". Because "On" and "Off" get converted to boolean values on the command line it will error if "On" is passed Returns: The ...
python
def _validate_sleep(minutes): ''' Helper function that validates the minutes parameter. Can be any number between 1 and 180. Can also be the string values "Never" and "Off". Because "On" and "Off" get converted to boolean values on the command line it will error if "On" is passed Returns: The ...
[ "def", "_validate_sleep", "(", "minutes", ")", ":", "# Must be a value between 1 and 180 or Never/Off", "if", "isinstance", "(", "minutes", ",", "six", ".", "string_types", ")", ":", "if", "minutes", ".", "lower", "(", ")", "in", "[", "'never'", ",", "'off'", ...
Helper function that validates the minutes parameter. Can be any number between 1 and 180. Can also be the string values "Never" and "Off". Because "On" and "Off" get converted to boolean values on the command line it will error if "On" is passed Returns: The value to be passed to the command
[ "Helper", "function", "that", "validates", "the", "minutes", "parameter", ".", "Can", "be", "any", "number", "between", "1", "and", "180", ".", "Can", "also", "be", "the", "string", "values", "Never", "and", "Off", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L33-L72
33,260
saltstack/salt
salt/modules/mac_power.py
set_sleep
def set_sleep(minutes): ''' Sets the amount of idle time until the machine sleeps. Sets the same value for Computer, Display, and Hard Disk. Pass "Never" or "Off" for computers that should never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str ...
python
def set_sleep(minutes): ''' Sets the amount of idle time until the machine sleeps. Sets the same value for Computer, Display, and Hard Disk. Pass "Never" or "Off" for computers that should never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str ...
[ "def", "set_sleep", "(", "minutes", ")", ":", "value", "=", "_validate_sleep", "(", "minutes", ")", "cmd", "=", "'systemsetup -setsleep {0}'", ".", "format", "(", "value", ")", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ...
Sets the amount of idle time until the machine sleeps. Sets the same value for Computer, Display, and Hard Disk. Pass "Never" or "Off" for computers that should never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False ...
[ "Sets", "the", "amount", "of", "idle", "time", "until", "the", "machine", "sleeps", ".", "Sets", "the", "same", "value", "for", "Computer", "Display", "and", "Hard", "Disk", ".", "Pass", "Never", "or", "Off", "for", "computers", "that", "should", "never", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L96-L125
33,261
saltstack/salt
salt/modules/mac_power.py
get_computer_sleep
def get_computer_sleep(): ''' Display the amount of idle time until the computer sleeps. :return: A string representing the sleep settings for the computer :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_computer_sleep ''' ret = salt.utils.mac_utils.execute_re...
python
def get_computer_sleep(): ''' Display the amount of idle time until the computer sleeps. :return: A string representing the sleep settings for the computer :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_computer_sleep ''' ret = salt.utils.mac_utils.execute_re...
[ "def", "get_computer_sleep", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getcomputersleep'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "parse_return", "(", "ret", ")" ]
Display the amount of idle time until the computer sleeps. :return: A string representing the sleep settings for the computer :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_computer_sleep
[ "Display", "the", "amount", "of", "idle", "time", "until", "the", "computer", "sleeps", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L128-L143
33,262
saltstack/salt
salt/modules/mac_power.py
set_computer_sleep
def set_computer_sleep(minutes): ''' Set the amount of idle time until the computer sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example...
python
def set_computer_sleep(minutes): ''' Set the amount of idle time until the computer sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example...
[ "def", "set_computer_sleep", "(", "minutes", ")", ":", "value", "=", "_validate_sleep", "(", "minutes", ")", "cmd", "=", "'systemsetup -setcomputersleep {0}'", ".", "format", "(", "value", ")", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success",...
Set the amount of idle time until the computer sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*'...
[ "Set", "the", "amount", "of", "idle", "time", "until", "the", "computer", "sleeps", ".", "Pass", "Never", "of", "Off", "to", "never", "sleep", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L146-L171
33,263
saltstack/salt
salt/modules/mac_power.py
get_display_sleep
def get_display_sleep(): ''' Display the amount of idle time until the display sleeps. :return: A string representing the sleep settings for the displey :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_display_sleep ''' ret = salt.utils.mac_utils.execute_return...
python
def get_display_sleep(): ''' Display the amount of idle time until the display sleeps. :return: A string representing the sleep settings for the displey :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_display_sleep ''' ret = salt.utils.mac_utils.execute_return...
[ "def", "get_display_sleep", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getdisplaysleep'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "parse_return", "(", "ret", ")" ]
Display the amount of idle time until the display sleeps. :return: A string representing the sleep settings for the displey :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_display_sleep
[ "Display", "the", "amount", "of", "idle", "time", "until", "the", "display", "sleeps", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L174-L189
33,264
saltstack/salt
salt/modules/mac_power.py
set_display_sleep
def set_display_sleep(minutes): ''' Set the amount of idle time until the display sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example: ...
python
def set_display_sleep(minutes): ''' Set the amount of idle time until the display sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example: ...
[ "def", "set_display_sleep", "(", "minutes", ")", ":", "value", "=", "_validate_sleep", "(", "minutes", ")", "cmd", "=", "'systemsetup -setdisplaysleep {0}'", ".", "format", "(", "value", ")", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", ...
Set the amount of idle time until the display sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' ...
[ "Set", "the", "amount", "of", "idle", "time", "until", "the", "display", "sleeps", ".", "Pass", "Never", "of", "Off", "to", "never", "sleep", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L192-L217
33,265
saltstack/salt
salt/modules/mac_power.py
get_harddisk_sleep
def get_harddisk_sleep(): ''' Display the amount of idle time until the hard disk sleeps. :return: A string representing the sleep settings for the hard disk :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_harddisk_sleep ''' ret = salt.utils.mac_utils.execute_...
python
def get_harddisk_sleep(): ''' Display the amount of idle time until the hard disk sleeps. :return: A string representing the sleep settings for the hard disk :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_harddisk_sleep ''' ret = salt.utils.mac_utils.execute_...
[ "def", "get_harddisk_sleep", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getharddisksleep'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "parse_return", "(", "ret", ")" ]
Display the amount of idle time until the hard disk sleeps. :return: A string representing the sleep settings for the hard disk :rtype: str CLI Example: ..code-block:: bash salt '*' power.get_harddisk_sleep
[ "Display", "the", "amount", "of", "idle", "time", "until", "the", "hard", "disk", "sleeps", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L220-L235
33,266
saltstack/salt
salt/modules/mac_power.py
set_harddisk_sleep
def set_harddisk_sleep(minutes): ''' Set the amount of idle time until the harddisk sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example...
python
def set_harddisk_sleep(minutes): ''' Set the amount of idle time until the harddisk sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example...
[ "def", "set_harddisk_sleep", "(", "minutes", ")", ":", "value", "=", "_validate_sleep", "(", "minutes", ")", "cmd", "=", "'systemsetup -setharddisksleep {0}'", ".", "format", "(", "value", ")", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success",...
Set the amount of idle time until the harddisk sleeps. Pass "Never" of "Off" to never sleep. :param minutes: Can be an integer between 1 and 180 or "Never" or "Off" :ptype: int, str :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*'...
[ "Set", "the", "amount", "of", "idle", "time", "until", "the", "harddisk", "sleeps", ".", "Pass", "Never", "of", "Off", "to", "never", "sleep", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L238-L263
33,267
saltstack/salt
salt/modules/mac_power.py
get_wake_on_modem
def get_wake_on_modem(): ''' Displays whether 'wake on modem' is on or off if supported :return: A string value representing the "wake on modem" settings :rtype: str CLI Example: .. code-block:: bash salt '*' power.get_wake_on_modem ''' ret = salt.utils.mac_utils.execute_retu...
python
def get_wake_on_modem(): ''' Displays whether 'wake on modem' is on or off if supported :return: A string value representing the "wake on modem" settings :rtype: str CLI Example: .. code-block:: bash salt '*' power.get_wake_on_modem ''' ret = salt.utils.mac_utils.execute_retu...
[ "def", "get_wake_on_modem", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getwakeonmodem'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "salt", ".", ...
Displays whether 'wake on modem' is on or off if supported :return: A string value representing the "wake on modem" settings :rtype: str CLI Example: .. code-block:: bash salt '*' power.get_wake_on_modem
[ "Displays", "whether", "wake", "on", "modem", "is", "on", "or", "off", "if", "supported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L266-L282
33,268
saltstack/salt
salt/modules/mac_power.py
set_wake_on_modem
def set_wake_on_modem(enabled): ''' Set whether or not the computer will wake from sleep when modem activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respe...
python
def set_wake_on_modem(enabled): ''' Set whether or not the computer will wake from sleep when modem activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respe...
[ "def", "set_wake_on_modem", "(", "enabled", ")", ":", "state", "=", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "enabled", ")", "cmd", "=", "'systemsetup -setwakeonmodem {0}'", ".", "format", "(", "state", ")", "salt", ".", "utils", ...
Set whether or not the computer will wake from sleep when modem activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, Fa...
[ "Set", "whether", "or", "not", "the", "computer", "will", "wake", "from", "sleep", "when", "modem", "activity", "is", "detected", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L285-L310
33,269
saltstack/salt
salt/modules/mac_power.py
get_wake_on_network
def get_wake_on_network(): ''' Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network ''' ret = salt.utils.mac_utils.e...
python
def get_wake_on_network(): ''' Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network ''' ret = salt.utils.mac_utils.e...
[ "def", "get_wake_on_network", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getwakeonnetworkaccess'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "salt"...
Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network
[ "Displays", "whether", "wake", "on", "network", "is", "on", "or", "off", "if", "supported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L313-L329
33,270
saltstack/salt
salt/modules/mac_power.py
set_wake_on_network
def set_wake_on_network(enabled): ''' Set whether or not the computer will wake from sleep when network activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False r...
python
def set_wake_on_network(enabled): ''' Set whether or not the computer will wake from sleep when network activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False r...
[ "def", "set_wake_on_network", "(", "enabled", ")", ":", "state", "=", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "enabled", ")", "cmd", "=", "'systemsetup -setwakeonnetworkaccess {0}'", ".", "format", "(", "state", ")", "salt", ".", ...
Set whether or not the computer will wake from sleep when network activity is detected. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, ...
[ "Set", "whether", "or", "not", "the", "computer", "will", "wake", "from", "sleep", "when", "network", "activity", "is", "detected", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L332-L357
33,271
saltstack/salt
salt/modules/mac_power.py
get_restart_power_failure
def get_restart_power_failure(): ''' Displays whether 'restart on power failure' is on or off if supported :return: A string value representing the "restart on power failure" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_power_failure ''' ...
python
def get_restart_power_failure(): ''' Displays whether 'restart on power failure' is on or off if supported :return: A string value representing the "restart on power failure" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_power_failure ''' ...
[ "def", "get_restart_power_failure", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getrestartpowerfailure'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", ...
Displays whether 'restart on power failure' is on or off if supported :return: A string value representing the "restart on power failure" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_power_failure
[ "Displays", "whether", "restart", "on", "power", "failure", "is", "on", "or", "off", "if", "supported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L360-L376
33,272
saltstack/salt
salt/modules/mac_power.py
set_restart_power_failure
def set_restart_power_failure(enabled): ''' Set whether or not the computer will automatically restart after a power failure. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False r...
python
def set_restart_power_failure(enabled): ''' Set whether or not the computer will automatically restart after a power failure. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False r...
[ "def", "set_restart_power_failure", "(", "enabled", ")", ":", "state", "=", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "enabled", ")", "cmd", "=", "'systemsetup -setrestartpowerfailure {0}'", ".", "format", "(", "state", ")", "salt", "...
Set whether or not the computer will automatically restart after a power failure. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, False ...
[ "Set", "whether", "or", "not", "the", "computer", "will", "automatically", "restart", "after", "a", "power", "failure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L379-L404
33,273
saltstack/salt
salt/modules/mac_power.py
get_restart_freeze
def get_restart_freeze(): ''' Displays whether 'restart on freeze' is on or off if supported :return: A string value representing the "restart on freeze" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_freeze ''' ret = salt.utils.mac_utils...
python
def get_restart_freeze(): ''' Displays whether 'restart on freeze' is on or off if supported :return: A string value representing the "restart on freeze" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_freeze ''' ret = salt.utils.mac_utils...
[ "def", "get_restart_freeze", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getrestartfreeze'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "salt", "."...
Displays whether 'restart on freeze' is on or off if supported :return: A string value representing the "restart on freeze" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_restart_freeze
[ "Displays", "whether", "restart", "on", "freeze", "is", "on", "or", "off", "if", "supported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L407-L423
33,274
saltstack/salt
salt/modules/mac_power.py
set_restart_freeze
def set_restart_freeze(enabled): ''' Specifies whether the server restarts automatically after a system freeze. This setting doesn't seem to be editable. The command completes successfully but the setting isn't actually updated. This is probably a macOS. The functions remains in case they ever fix t...
python
def set_restart_freeze(enabled): ''' Specifies whether the server restarts automatically after a system freeze. This setting doesn't seem to be editable. The command completes successfully but the setting isn't actually updated. This is probably a macOS. The functions remains in case they ever fix t...
[ "def", "set_restart_freeze", "(", "enabled", ")", ":", "state", "=", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "enabled", ")", "cmd", "=", "'systemsetup -setrestartfreeze {0}'", ".", "format", "(", "state", ")", "salt", ".", "utils"...
Specifies whether the server restarts automatically after a system freeze. This setting doesn't seem to be editable. The command completes successfully but the setting isn't actually updated. This is probably a macOS. The functions remains in case they ever fix the bug. :param bool enabled: True to ena...
[ "Specifies", "whether", "the", "server", "restarts", "automatically", "after", "a", "system", "freeze", ".", "This", "setting", "doesn", "t", "seem", "to", "be", "editable", ".", "The", "command", "completes", "successfully", "but", "the", "setting", "isn", "t...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L426-L454
33,275
saltstack/salt
salt/modules/mac_power.py
get_sleep_on_power_button
def get_sleep_on_power_button(): ''' Displays whether 'allow power button to sleep computer' is on or off if supported :return: A string value representing the "allow power button to sleep computer" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power...
python
def get_sleep_on_power_button(): ''' Displays whether 'allow power button to sleep computer' is on or off if supported :return: A string value representing the "allow power button to sleep computer" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power...
[ "def", "get_sleep_on_power_button", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "'systemsetup -getallowpowerbuttontosleepcomputer'", ")", "return", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled...
Displays whether 'allow power button to sleep computer' is on or off if supported :return: A string value representing the "allow power button to sleep computer" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_sleep_on_power_button
[ "Displays", "whether", "allow", "power", "button", "to", "sleep", "computer", "is", "on", "or", "off", "if", "supported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L457-L476
33,276
saltstack/salt
salt/modules/mac_power.py
set_sleep_on_power_button
def set_sleep_on_power_button(enabled): ''' Set whether or not the power button can sleep the computer. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: ...
python
def set_sleep_on_power_button(enabled): ''' Set whether or not the power button can sleep the computer. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: ...
[ "def", "set_sleep_on_power_button", "(", "enabled", ")", ":", "state", "=", "salt", ".", "utils", ".", "mac_utils", ".", "validate_enabled", "(", "enabled", ")", "cmd", "=", "'systemsetup -setallowpowerbuttontosleepcomputer {0}'", ".", "format", "(", "state", ")", ...
Set whether or not the power button can sleep the computer. :param bool enabled: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, False if not :rtype: bool ...
[ "Set", "whether", "or", "not", "the", "power", "button", "can", "sleep", "the", "computer", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_power.py#L479-L503
33,277
saltstack/salt
salt/modules/swarm.py
swarm_init
def swarm_init(advertise_addr=str, listen_addr=int, force_new_cluster=bool): ''' Initalize Docker on Minion as a Swarm Manager advertise_addr The ip of the manager listen_addr Listen address used for inter-manager communication, as well as determin...
python
def swarm_init(advertise_addr=str, listen_addr=int, force_new_cluster=bool): ''' Initalize Docker on Minion as a Swarm Manager advertise_addr The ip of the manager listen_addr Listen address used for inter-manager communication, as well as determin...
[ "def", "swarm_init", "(", "advertise_addr", "=", "str", ",", "listen_addr", "=", "int", ",", "force_new_cluster", "=", "bool", ")", ":", "try", ":", "salt_return", "=", "{", "}", "__context__", "[", "'client'", "]", ".", "swarm", ".", "init", "(", "adver...
Initalize Docker on Minion as a Swarm Manager advertise_addr The ip of the manager listen_addr Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an address/p...
[ "Initalize", "Docker", "on", "Minion", "as", "a", "Swarm", "Manager" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L72-L112
33,278
saltstack/salt
salt/modules/swarm.py
joinswarm
def joinswarm(remote_addr=int, listen_addr=int, token=str): ''' Join a Swarm Worker to the cluster remote_addr The manager node you want to connect to for the swarm listen_addr Listen address used for inter-manager communication if the node gets promoted to ...
python
def joinswarm(remote_addr=int, listen_addr=int, token=str): ''' Join a Swarm Worker to the cluster remote_addr The manager node you want to connect to for the swarm listen_addr Listen address used for inter-manager communication if the node gets promoted to ...
[ "def", "joinswarm", "(", "remote_addr", "=", "int", ",", "listen_addr", "=", "int", ",", "token", "=", "str", ")", ":", "try", ":", "salt_return", "=", "{", "}", "__context__", "[", "'client'", "]", ".", "swarm", ".", "join", "(", "remote_addrs", "=", ...
Join a Swarm Worker to the cluster remote_addr The manager node you want to connect to for the swarm listen_addr Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint ...
[ "Join", "a", "Swarm", "Worker", "to", "the", "cluster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L115-L150
33,279
saltstack/salt
salt/modules/swarm.py
leave_swarm
def leave_swarm(force=bool): ''' Force the minion to leave the swarm force Will force the minion/worker/manager to leave the swarm CLI Example: .. code-block:: bash salt '*' swarm.leave_swarm force=False ''' salt_return = {} __context__['client'].swarm.leave(force=for...
python
def leave_swarm(force=bool): ''' Force the minion to leave the swarm force Will force the minion/worker/manager to leave the swarm CLI Example: .. code-block:: bash salt '*' swarm.leave_swarm force=False ''' salt_return = {} __context__['client'].swarm.leave(force=for...
[ "def", "leave_swarm", "(", "force", "=", "bool", ")", ":", "salt_return", "=", "{", "}", "__context__", "[", "'client'", "]", ".", "swarm", ".", "leave", "(", "force", "=", "force", ")", "output", "=", "__context__", "[", "'server_name'", "]", "+", "' ...
Force the minion to leave the swarm force Will force the minion/worker/manager to leave the swarm CLI Example: .. code-block:: bash salt '*' swarm.leave_swarm force=False
[ "Force", "the", "minion", "to", "leave", "the", "swarm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L153-L170
33,280
saltstack/salt
salt/modules/swarm.py
service_create
def service_create(image=str, name=str, command=str, hostname=str, replicas=int, target_port=int, published_port=int): ''' Create Docker Swarm Service Create image The docker image ...
python
def service_create(image=str, name=str, command=str, hostname=str, replicas=int, target_port=int, published_port=int): ''' Create Docker Swarm Service Create image The docker image ...
[ "def", "service_create", "(", "image", "=", "str", ",", "name", "=", "str", ",", "command", "=", "str", ",", "hostname", "=", "str", ",", "replicas", "=", "int", ",", "target_port", "=", "int", ",", "published_port", "=", "int", ")", ":", "try", ":",...
Create Docker Swarm Service Create image The docker image name Is the service name command The docker command to run in the container at launch hostname The hostname of the containers replicas How many replicas you want running in the swarm target_po...
[ "Create", "Docker", "Swarm", "Service", "Create" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L173-L234
33,281
saltstack/salt
salt/modules/swarm.py
swarm_service_info
def swarm_service_info(service_name=str): ''' Swarm Service Information service_name The name of the service that you want information on about the service CLI Example: .. code-block:: bash salt '*' swarm.swarm_service_info service_name=Test_Service ''' try: salt_...
python
def swarm_service_info(service_name=str): ''' Swarm Service Information service_name The name of the service that you want information on about the service CLI Example: .. code-block:: bash salt '*' swarm.swarm_service_info service_name=Test_Service ''' try: salt_...
[ "def", "swarm_service_info", "(", "service_name", "=", "str", ")", ":", "try", ":", "salt_return", "=", "{", "}", "client", "=", "docker", ".", "APIClient", "(", "base_url", "=", "'unix://var/run/docker.sock'", ")", "service", "=", "client", ".", "inspect_serv...
Swarm Service Information service_name The name of the service that you want information on about the service CLI Example: .. code-block:: bash salt '*' swarm.swarm_service_info service_name=Test_Service
[ "Swarm", "Service", "Information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L237-L289
33,282
saltstack/salt
salt/modules/swarm.py
remove_service
def remove_service(service=str): ''' Remove Swarm Service service The name of the service CLI Example: .. code-block:: bash salt '*' swarm.remove_service service=Test_Service ''' try: salt_return = {} client = docker.APIClient(base_url='unix://var/run/dock...
python
def remove_service(service=str): ''' Remove Swarm Service service The name of the service CLI Example: .. code-block:: bash salt '*' swarm.remove_service service=Test_Service ''' try: salt_return = {} client = docker.APIClient(base_url='unix://var/run/dock...
[ "def", "remove_service", "(", "service", "=", "str", ")", ":", "try", ":", "salt_return", "=", "{", "}", "client", "=", "docker", ".", "APIClient", "(", "base_url", "=", "'unix://var/run/docker.sock'", ")", "service", "=", "client", ".", "remove_service", "(...
Remove Swarm Service service The name of the service CLI Example: .. code-block:: bash salt '*' swarm.remove_service service=Test_Service
[ "Remove", "Swarm", "Service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L292-L314
33,283
saltstack/salt
salt/modules/swarm.py
node_ls
def node_ls(server=str): ''' Displays Information about Swarm Nodes with passing in the server server The minion/server name CLI Example: .. code-block:: bash salt '*' swarm.node_ls server=minion1 ''' try: salt_return = {} client = docker.APIClient(base_ur...
python
def node_ls(server=str): ''' Displays Information about Swarm Nodes with passing in the server server The minion/server name CLI Example: .. code-block:: bash salt '*' swarm.node_ls server=minion1 ''' try: salt_return = {} client = docker.APIClient(base_ur...
[ "def", "node_ls", "(", "server", "=", "str", ")", ":", "try", ":", "salt_return", "=", "{", "}", "client", "=", "docker", ".", "APIClient", "(", "base_url", "=", "'unix://var/run/docker.sock'", ")", "service", "=", "client", ".", "nodes", "(", "filters", ...
Displays Information about Swarm Nodes with passing in the server server The minion/server name CLI Example: .. code-block:: bash salt '*' swarm.node_ls server=minion1
[ "Displays", "Information", "about", "Swarm", "Nodes", "with", "passing", "in", "the", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L317-L356
33,284
saltstack/salt
salt/modules/swarm.py
remove_node
def remove_node(node_id=str, force=bool): ''' Remove a node from a swarm and the target needs to be a swarm manager node_id The node id from the return of swarm.node_ls force Forcefully remove the node/minion from the service CLI Example: .. code-block:: bash salt '*...
python
def remove_node(node_id=str, force=bool): ''' Remove a node from a swarm and the target needs to be a swarm manager node_id The node id from the return of swarm.node_ls force Forcefully remove the node/minion from the service CLI Example: .. code-block:: bash salt '*...
[ "def", "remove_node", "(", "node_id", "=", "str", ",", "force", "=", "bool", ")", ":", "client", "=", "docker", ".", "APIClient", "(", "base_url", "=", "'unix://var/run/docker.sock'", ")", "try", ":", "if", "force", "==", "'True'", ":", "service", "=", "...
Remove a node from a swarm and the target needs to be a swarm manager node_id The node id from the return of swarm.node_ls force Forcefully remove the node/minion from the service CLI Example: .. code-block:: bash salt '*' swarm.remove_node node_id=z4gjbe9rwmqahc2a91snvolm5 ...
[ "Remove", "a", "node", "from", "a", "swarm", "and", "the", "target", "needs", "to", "be", "a", "swarm", "manager" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/swarm.py#L359-L386
33,285
saltstack/salt
salt/states/boto_iam_role.py
_sort_policy
def _sort_policy(doc): ''' List-type sub-items in policies don't happen to be order-sensitive, but compare operations will render them unequal, leading to non-idempotent state runs. We'll sort any list-type subitems before comparison to reduce the likelihood of false negatives. ''' if isins...
python
def _sort_policy(doc): ''' List-type sub-items in policies don't happen to be order-sensitive, but compare operations will render them unequal, leading to non-idempotent state runs. We'll sort any list-type subitems before comparison to reduce the likelihood of false negatives. ''' if isins...
[ "def", "_sort_policy", "(", "doc", ")", ":", "if", "isinstance", "(", "doc", ",", "list", ")", ":", "return", "sorted", "(", "[", "_sort_policy", "(", "i", ")", "for", "i", "in", "doc", "]", ")", "elif", "isinstance", "(", "doc", ",", "(", "dict", ...
List-type sub-items in policies don't happen to be order-sensitive, but compare operations will render them unequal, leading to non-idempotent state runs. We'll sort any list-type subitems before comparison to reduce the likelihood of false negatives.
[ "List", "-", "type", "sub", "-", "items", "in", "policies", "don", "t", "happen", "to", "be", "order", "-", "sensitive", "but", "compare", "operations", "will", "render", "them", "unequal", "leading", "to", "non", "-", "idempotent", "state", "runs", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iam_role.py#L355-L366
33,286
saltstack/salt
salt/states/boto_iam_role.py
absent
def absent( name, region=None, key=None, keyid=None, profile=None): ''' Ensure the IAM role is deleted. name Name of the IAM role. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
python
def absent( name, region=None, key=None, keyid=None, profile=None): ''' Ensure the IAM role is deleted. name Name of the IAM role. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
[ "def", "absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''"...
Ensure the IAM role is deleted. name Name of the IAM role. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, k...
[ "Ensure", "the", "IAM", "role", "is", "deleted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iam_role.py#L511-L570
33,287
saltstack/salt
salt/beacons/diskusage.py
beacon
def beacon(config): r''' Monitor the disk usage of the minion Specify thresholds for each disk and only emit a beacon if any of them are exceeded. .. code-block:: yaml beacons: diskusage: - /: 63% - /mnt/nfs: 50% Windows drives must be quoted to avoi...
python
def beacon(config): r''' Monitor the disk usage of the minion Specify thresholds for each disk and only emit a beacon if any of them are exceeded. .. code-block:: yaml beacons: diskusage: - /: 63% - /mnt/nfs: 50% Windows drives must be quoted to avoi...
[ "def", "beacon", "(", "config", ")", ":", "parts", "=", "psutil", ".", "disk_partitions", "(", "all", "=", "True", ")", "ret", "=", "[", "]", "for", "mounts", "in", "config", ":", "mount", "=", "next", "(", "iter", "(", "mounts", ")", ")", "# Becau...
r''' Monitor the disk usage of the minion Specify thresholds for each disk and only emit a beacon if any of them are exceeded. .. code-block:: yaml beacons: diskusage: - /: 63% - /mnt/nfs: 50% Windows drives must be quoted to avoid yaml syntax errors ...
[ "r", "Monitor", "the", "disk", "usage", "of", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/diskusage.py#L47-L125
33,288
saltstack/salt
salt/proxy/cisconso.py
ping
def ping(): ''' Check to see if the host is responding. Returns False if the host didn't respond, True otherwise. CLI Example: .. code-block:: bash salt cisco-nso test.ping ''' try: client = _get_client() client.info() except SaltSystemExit as err: log....
python
def ping(): ''' Check to see if the host is responding. Returns False if the host didn't respond, True otherwise. CLI Example: .. code-block:: bash salt cisco-nso test.ping ''' try: client = _get_client() client.info() except SaltSystemExit as err: log....
[ "def", "ping", "(", ")", ":", "try", ":", "client", "=", "_get_client", "(", ")", "client", ".", "info", "(", ")", "except", "SaltSystemExit", "as", "err", ":", "log", ".", "warning", "(", "err", ")", "return", "False", "return", "True" ]
Check to see if the host is responding. Returns False if the host didn't respond, True otherwise. CLI Example: .. code-block:: bash salt cisco-nso test.ping
[ "Check", "to", "see", "if", "the", "host", "is", "responding", ".", "Returns", "False", "if", "the", "host", "didn", "t", "respond", "True", "otherwise", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L235-L253
33,289
saltstack/salt
salt/proxy/cisconso.py
set_data_value
def set_data_value(datastore, path, data): ''' Get a data entry in a datastore :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, ...
python
def set_data_value(datastore, path, data): ''' Get a data entry in a datastore :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, ...
[ "def", "set_data_value", "(", "datastore", ",", "path", ",", "data", ")", ":", "client", "=", "_get_client", "(", ")", "return", "client", ".", "set_data_value", "(", "datastore", ",", "path", ",", "data", ")" ]
Get a data entry in a datastore :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, a list of element names in order, comma separated :...
[ "Get", "a", "data", "entry", "in", "a", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L287-L306
33,290
saltstack/salt
salt/proxy/cisconso.py
_grains
def _grains(): ''' Helper function to the grains from the proxied devices. ''' client = _get_client() # This is a collection of the configuration of all running devices under NSO ret = client.get_datastore(DatastoreType.RUNNING) GRAINS_CACHE.update(ret) return GRAINS_CACHE
python
def _grains(): ''' Helper function to the grains from the proxied devices. ''' client = _get_client() # This is a collection of the configuration of all running devices under NSO ret = client.get_datastore(DatastoreType.RUNNING) GRAINS_CACHE.update(ret) return GRAINS_CACHE
[ "def", "_grains", "(", ")", ":", "client", "=", "_get_client", "(", ")", "# This is a collection of the configuration of all running devices under NSO", "ret", "=", "client", ".", "get_datastore", "(", "DatastoreType", ".", "RUNNING", ")", "GRAINS_CACHE", ".", "update",...
Helper function to the grains from the proxied devices.
[ "Helper", "function", "to", "the", "grains", "from", "the", "proxied", "devices", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L343-L351
33,291
saltstack/salt
salt/modules/mac_softwareupdate.py
_get_available
def _get_available(recommended=False, restart=False): ''' Utility function to get all available update packages. Sample return date: { 'updatename': '1.2.3-45', ... } ''' cmd = ['softwareupdate', '--list'] out = salt.utils.mac_utils.execute_return_result(cmd) # rexp parses lines that l...
python
def _get_available(recommended=False, restart=False): ''' Utility function to get all available update packages. Sample return date: { 'updatename': '1.2.3-45', ... } ''' cmd = ['softwareupdate', '--list'] out = salt.utils.mac_utils.execute_return_result(cmd) # rexp parses lines that l...
[ "def", "_get_available", "(", "recommended", "=", "False", ",", "restart", "=", "False", ")", ":", "cmd", "=", "[", "'softwareupdate'", ",", "'--list'", "]", "out", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "cmd", ")",...
Utility function to get all available update packages. Sample return date: { 'updatename': '1.2.3-45', ... }
[ "Utility", "function", "to", "get", "all", "available", "update", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L34-L85
33,292
saltstack/salt
salt/modules/mac_softwareupdate.py
ignore
def ignore(name): ''' Ignore a specific program update. When an update is ignored the '-' and version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes "SecUpd2014-001". It will be removed automatically if present. An update is successfully ignored when it no longer shows up after l...
python
def ignore(name): ''' Ignore a specific program update. When an update is ignored the '-' and version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes "SecUpd2014-001". It will be removed automatically if present. An update is successfully ignored when it no longer shows up after l...
[ "def", "ignore", "(", "name", ")", ":", "# remove everything after and including the '-' in the updates name.", "to_ignore", "=", "name", ".", "rsplit", "(", "'-'", ",", "1", ")", "[", "0", "]", "cmd", "=", "[", "'softwareupdate'", ",", "'--ignore'", ",", "to_ig...
Ignore a specific program update. When an update is ignored the '-' and version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes "SecUpd2014-001". It will be removed automatically if present. An update is successfully ignored when it no longer shows up after list_updates. :param name:...
[ "Ignore", "a", "specific", "program", "update", ".", "When", "an", "update", "is", "ignored", "the", "-", "and", "version", "number", "at", "the", "end", "will", "be", "omitted", "so", "SecUpd2014", "-", "001", "-", "1", ".", "0", "becomes", "SecUpd2014"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L108-L133
33,293
saltstack/salt
salt/modules/mac_softwareupdate.py
list_ignored
def list_ignored(): ''' List all updates that have been ignored. Ignored updates are shown without the '-' and version number at the end, this is how the softwareupdate command works. :return: The list of ignored updates :rtype: list CLI Example: .. code-block:: bash salt '*' ...
python
def list_ignored(): ''' List all updates that have been ignored. Ignored updates are shown without the '-' and version number at the end, this is how the softwareupdate command works. :return: The list of ignored updates :rtype: list CLI Example: .. code-block:: bash salt '*' ...
[ "def", "list_ignored", "(", ")", ":", "cmd", "=", "[", "'softwareupdate'", ",", "'--list'", ",", "'--ignore'", "]", "out", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "cmd", ")", "# rep parses lines that look like the following:...
List all updates that have been ignored. Ignored updates are shown without the '-' and version number at the end, this is how the softwareupdate command works. :return: The list of ignored updates :rtype: list CLI Example: .. code-block:: bash salt '*' softwareupdate.list_ignored
[ "List", "all", "updates", "that", "have", "been", "ignored", ".", "Ignored", "updates", "are", "shown", "without", "the", "-", "and", "version", "number", "at", "the", "end", "this", "is", "how", "the", "softwareupdate", "command", "works", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L136-L161
33,294
saltstack/salt
salt/modules/mac_softwareupdate.py
schedule_enabled
def schedule_enabled(): ''' Check the status of automatic update scheduling. :return: True if scheduling is enabled, False if disabled :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.schedule_enabled ''' cmd = ['softwareupdate', '--schedule'] ret = ...
python
def schedule_enabled(): ''' Check the status of automatic update scheduling. :return: True if scheduling is enabled, False if disabled :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.schedule_enabled ''' cmd = ['softwareupdate', '--schedule'] ret = ...
[ "def", "schedule_enabled", "(", ")", ":", "cmd", "=", "[", "'softwareupdate'", ",", "'--schedule'", "]", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "cmd", ")", "enabled", "=", "ret", ".", "split", "(", ")", "["...
Check the status of automatic update scheduling. :return: True if scheduling is enabled, False if disabled :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.schedule_enabled
[ "Check", "the", "status", "of", "automatic", "update", "scheduling", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L184-L203
33,295
saltstack/salt
salt/modules/mac_softwareupdate.py
update_all
def update_all(recommended=False, restart=True): ''' Install all available updates. Returns a dictionary containing the name of the update and the status of its installation. :param bool recommended: If set to True, only install the recommended updates. If set to False (default) all updates are...
python
def update_all(recommended=False, restart=True): ''' Install all available updates. Returns a dictionary containing the name of the update and the status of its installation. :param bool recommended: If set to True, only install the recommended updates. If set to False (default) all updates are...
[ "def", "update_all", "(", "recommended", "=", "False", ",", "restart", "=", "True", ")", ":", "to_update", "=", "_get_available", "(", "recommended", ",", "restart", ")", "if", "not", "to_update", ":", "return", "{", "}", "for", "_update", "in", "to_update...
Install all available updates. Returns a dictionary containing the name of the update and the status of its installation. :param bool recommended: If set to True, only install the recommended updates. If set to False (default) all updates are installed. :param bool restart: Set this to False if yo...
[ "Install", "all", "available", "updates", ".", "Returns", "a", "dictionary", "containing", "the", "name", "of", "the", "update", "and", "the", "status", "of", "its", "installation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L235-L273
33,296
saltstack/salt
salt/modules/mac_softwareupdate.py
update
def update(name): ''' Install a named update. :param str name: The name of the of the update to install. :return: True if successfully updated, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.update <update-name> ''' if not update_av...
python
def update(name): ''' Install a named update. :param str name: The name of the of the update to install. :return: True if successfully updated, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.update <update-name> ''' if not update_av...
[ "def", "update", "(", "name", ")", ":", "if", "not", "update_available", "(", "name", ")", ":", "raise", "SaltInvocationError", "(", "'Update not available: {0}'", ".", "format", "(", "name", ")", ")", "cmd", "=", "[", "'softwareupdate'", ",", "'--install'", ...
Install a named update. :param str name: The name of the of the update to install. :return: True if successfully updated, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.update <update-name>
[ "Install", "a", "named", "update", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L276-L297
33,297
saltstack/salt
salt/modules/mac_softwareupdate.py
list_downloads
def list_downloads(): ''' Return a list of all updates that have been downloaded locally. :return: A list of updates that have been downloaded :rtype: list CLI Example: .. code-block:: bash salt '*' softwareupdate.list_downloads ''' outfiles = [] for root, subFolder, files...
python
def list_downloads(): ''' Return a list of all updates that have been downloaded locally. :return: A list of updates that have been downloaded :rtype: list CLI Example: .. code-block:: bash salt '*' softwareupdate.list_downloads ''' outfiles = [] for root, subFolder, files...
[ "def", "list_downloads", "(", ")", ":", "outfiles", "=", "[", "]", "for", "root", ",", "subFolder", ",", "files", "in", "salt", ".", "utils", ".", "path", ".", "os_walk", "(", "'/Library/Updates'", ")", ":", "for", "f", "in", "files", ":", "outfiles", ...
Return a list of all updates that have been downloaded locally. :return: A list of updates that have been downloaded :rtype: list CLI Example: .. code-block:: bash salt '*' softwareupdate.list_downloads
[ "Return", "a", "list", "of", "all", "updates", "that", "have", "been", "downloaded", "locally", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L319-L349
33,298
saltstack/salt
salt/modules/mac_softwareupdate.py
download
def download(name): ''' Download a named update so that it can be installed later with the ``update`` or ``update_all`` functions :param str name: The update to download. :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' soft...
python
def download(name): ''' Download a named update so that it can be installed later with the ``update`` or ``update_all`` functions :param str name: The update to download. :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' soft...
[ "def", "download", "(", "name", ")", ":", "if", "not", "update_available", "(", "name", ")", ":", "raise", "SaltInvocationError", "(", "'Update not available: {0}'", ".", "format", "(", "name", ")", ")", "if", "name", "in", "list_downloads", "(", ")", ":", ...
Download a named update so that it can be installed later with the ``update`` or ``update_all`` functions :param str name: The update to download. :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' softwareupdate.download <update name...
[ "Download", "a", "named", "update", "so", "that", "it", "can", "be", "installed", "later", "with", "the", "update", "or", "update_all", "functions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L352-L377
33,299
saltstack/salt
salt/modules/mac_softwareupdate.py
download_all
def download_all(recommended=False, restart=True): ''' Download all available updates so that they can be installed later with the ``update`` or ``update_all`` functions. It returns a list of updates that are now downloaded. :param bool recommended: If set to True, only install the recommended ...
python
def download_all(recommended=False, restart=True): ''' Download all available updates so that they can be installed later with the ``update`` or ``update_all`` functions. It returns a list of updates that are now downloaded. :param bool recommended: If set to True, only install the recommended ...
[ "def", "download_all", "(", "recommended", "=", "False", ",", "restart", "=", "True", ")", ":", "to_download", "=", "_get_available", "(", "recommended", ",", "restart", ")", "for", "name", "in", "to_download", ":", "download", "(", "name", ")", "return", ...
Download all available updates so that they can be installed later with the ``update`` or ``update_all`` functions. It returns a list of updates that are now downloaded. :param bool recommended: If set to True, only install the recommended updates. If set to False (default) all updates are installe...
[ "Download", "all", "available", "updates", "so", "that", "they", "can", "be", "installed", "later", "with", "the", "update", "or", "update_all", "functions", ".", "It", "returns", "a", "list", "of", "updates", "that", "are", "now", "downloaded", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L380-L406