repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
saltstack/salt
salt/fileclient.py
Client.cache_dest
def cache_dest(self, url, saltenv='base', cachedir=None): ''' Return the expected cache location for the specified URL and environment. ''' proto = urlparse(url).scheme if proto == '': # Local file path return url if proto == 'salt': ...
python
def cache_dest(self, url, saltenv='base', cachedir=None): ''' Return the expected cache location for the specified URL and environment. ''' proto = urlparse(url).scheme if proto == '': # Local file path return url if proto == 'salt': ...
[ "def", "cache_dest", "(", "self", ",", "url", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "proto", "=", "urlparse", "(", "url", ")", ".", "scheme", "if", "proto", "==", "''", ":", "# Local file path", "return", "url", "if", ...
Return the expected cache location for the specified URL and environment.
[ "Return", "the", "expected", "cache", "location", "for", "the", "specified", "URL", "and", "environment", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L344-L365
train
Return the expected cache location for the specified URL and environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client.list_states
def list_states(self, saltenv): ''' Return a list of all available sls modules on the master for a given environment ''' states = set() for path in self.file_list(saltenv): if salt.utils.platform.is_windows(): path = path.replace('\\', '/') ...
python
def list_states(self, saltenv): ''' Return a list of all available sls modules on the master for a given environment ''' states = set() for path in self.file_list(saltenv): if salt.utils.platform.is_windows(): path = path.replace('\\', '/') ...
[ "def", "list_states", "(", "self", ",", "saltenv", ")", ":", "states", "=", "set", "(", ")", "for", "path", "in", "self", ".", "file_list", "(", "saltenv", ")", ":", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "pa...
Return a list of all available sls modules on the master for a given environment
[ "Return", "a", "list", "of", "all", "available", "sls", "modules", "on", "the", "master", "for", "a", "given", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L367-L382
train
Return a list of all sls modules on the master for a given environment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client.get_state
def get_state(self, sls, saltenv, cachedir=None): ''' Get a state file from the master and store it in the local minion cache; return the location of the file ''' if '.' in sls: sls = sls.replace('.', '/') sls_url = salt.utils.url.create(sls + '.sls') ...
python
def get_state(self, sls, saltenv, cachedir=None): ''' Get a state file from the master and store it in the local minion cache; return the location of the file ''' if '.' in sls: sls = sls.replace('.', '/') sls_url = salt.utils.url.create(sls + '.sls') ...
[ "def", "get_state", "(", "self", ",", "sls", ",", "saltenv", ",", "cachedir", "=", "None", ")", ":", "if", "'.'", "in", "sls", ":", "sls", "=", "sls", ".", "replace", "(", "'.'", ",", "'/'", ")", "sls_url", "=", "salt", ".", "utils", ".", "url", ...
Get a state file from the master and store it in the local minion cache; return the location of the file
[ "Get", "a", "state", "file", "from", "the", "master", "and", "store", "it", "in", "the", "local", "minion", "cache", ";", "return", "the", "location", "of", "the", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L384-L397
train
Get a state file from the master and store it in the local minion cache ; return the location of the file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client.get_dir
def get_dir(self, path, dest='', saltenv='base', gzip=None, cachedir=None): ''' Get a directory recursively from the salt-master ''' ret = [] # Strip trailing slash path = self._check_proto(path).rstrip('/') # Break up the path into a list containi...
python
def get_dir(self, path, dest='', saltenv='base', gzip=None, cachedir=None): ''' Get a directory recursively from the salt-master ''' ret = [] # Strip trailing slash path = self._check_proto(path).rstrip('/') # Break up the path into a list containi...
[ "def", "get_dir", "(", "self", ",", "path", ",", "dest", "=", "''", ",", "saltenv", "=", "'base'", ",", "gzip", "=", "None", ",", "cachedir", "=", "None", ")", ":", "ret", "=", "[", "]", "# Strip trailing slash", "path", "=", "self", ".", "_check_pro...
Get a directory recursively from the salt-master
[ "Get", "a", "directory", "recursively", "from", "the", "salt", "-", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L399-L456
train
Get a directory recursively from the salt - master
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client.get_url
def get_url(self, url, dest, makedirs=False, saltenv='base', no_cache=False, cachedir=None, source_hash=None): ''' Get a single file from a URL. ''' url_data = urlparse(url) url_scheme = url_data.scheme url_path = os.path.join( url_data.net...
python
def get_url(self, url, dest, makedirs=False, saltenv='base', no_cache=False, cachedir=None, source_hash=None): ''' Get a single file from a URL. ''' url_data = urlparse(url) url_scheme = url_data.scheme url_path = os.path.join( url_data.net...
[ "def", "get_url", "(", "self", ",", "url", ",", "dest", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "no_cache", "=", "False", ",", "cachedir", "=", "None", ",", "source_hash", "=", "None", ")", ":", "url_data", "=", "urlparse", ...
Get a single file from a URL.
[ "Get", "a", "single", "file", "from", "a", "URL", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L458-L740
train
Get a single file from a URL.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client.get_template
def get_template( self, url, dest, template='jinja', makedirs=False, saltenv='base', cachedir=None, **kwargs): ''' Cache a file then process it as a template ''' if 'env' in kwargs: ...
python
def get_template( self, url, dest, template='jinja', makedirs=False, saltenv='base', cachedir=None, **kwargs): ''' Cache a file then process it as a template ''' if 'env' in kwargs: ...
[ "def", "get_template", "(", "self", ",", "url", ",", "dest", ",", "template", "=", "'jinja'", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs"...
Cache a file then process it as a template
[ "Cache", "a", "file", "then", "process", "it", "as", "a", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L742-L792
train
Get a template from the cache file and return the path to the dest file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
Client._extrn_path
def _extrn_path(self, url, saltenv, cachedir=None): ''' Return the extrn_filepath for a given url ''' url_data = urlparse(url) if salt.utils.platform.is_windows(): netloc = salt.utils.path.sanitize_win_path(url_data.netloc) else: netloc = url_data....
python
def _extrn_path(self, url, saltenv, cachedir=None): ''' Return the extrn_filepath for a given url ''' url_data = urlparse(url) if salt.utils.platform.is_windows(): netloc = salt.utils.path.sanitize_win_path(url_data.netloc) else: netloc = url_data....
[ "def", "_extrn_path", "(", "self", ",", "url", ",", "saltenv", ",", "cachedir", "=", "None", ")", ":", "url_data", "=", "urlparse", "(", "url", ")", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "netloc", "=", "salt",...
Return the extrn_filepath for a given url
[ "Return", "the", "extrn_filepath", "for", "a", "given", "url" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L794-L826
train
Return the extrn_filepath for a given url
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient._find_file
def _find_file(self, path, saltenv='base'): ''' Locate the file path ''' fnd = {'path': '', 'rel': ''} if salt.utils.url.is_escaped(path): # The path arguments are escaped path = salt.utils.url.unescape(path) for root in self.opts['...
python
def _find_file(self, path, saltenv='base'): ''' Locate the file path ''' fnd = {'path': '', 'rel': ''} if salt.utils.url.is_escaped(path): # The path arguments are escaped path = salt.utils.url.unescape(path) for root in self.opts['...
[ "def", "_find_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "fnd", "=", "{", "'path'", ":", "''", ",", "'rel'", ":", "''", "}", "if", "salt", ".", "utils", ".", "url", ".", "is_escaped", "(", "path", ")", ":", "# The p...
Locate the file path
[ "Locate", "the", "file", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L833-L849
train
Locate the file path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.get_file
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Copies a file from the local files directory into :param:`dest` gzip compression settings are ign...
python
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Copies a file from the local files directory into :param:`dest` gzip compression settings are ign...
[ "def", "get_file", "(", "self", ",", "path", ",", "dest", "=", "''", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "gzip", "=", "None", ",", "cachedir", "=", "None", ")", ":", "path", "=", "self", ".", "_check_proto", "(", "pat...
Copies a file from the local files directory into :param:`dest` gzip compression settings are ignored for local files
[ "Copies", "a", "file", "from", "the", "local", "files", "directory", "into", ":", "param", ":", "dest", "gzip", "compression", "settings", "are", "ignored", "for", "local", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L851-L868
train
Gets a file from the local files directory into the specified destination directory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.file_list
def file_list(self, saltenv='base', prefix=''): ''' Return a list of files in the given environment with optional relative prefix path to limit directory traversal ''' ret = [] prefix = prefix.strip('/') for path in self.opts['pillar_roots'].get(saltenv, []): ...
python
def file_list(self, saltenv='base', prefix=''): ''' Return a list of files in the given environment with optional relative prefix path to limit directory traversal ''' ret = [] prefix = prefix.strip('/') for path in self.opts['pillar_roots'].get(saltenv, []): ...
[ "def", "file_list", "(", "self", ",", "saltenv", "=", "'base'", ",", "prefix", "=", "''", ")", ":", "ret", "=", "[", "]", "prefix", "=", "prefix", ".", "strip", "(", "'/'", ")", "for", "path", "in", "self", ".", "opts", "[", "'pillar_roots'", "]", ...
Return a list of files in the given environment with optional relative prefix path to limit directory traversal
[ "Return", "a", "list", "of", "files", "in", "the", "given", "environment", "with", "optional", "relative", "prefix", "path", "to", "limit", "directory", "traversal" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L870-L886
train
Return a list of files in the given environment with optional relative prefix path to limit directory traversal
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.__get_file_path
def __get_file_path(self, path, saltenv='base'): ''' Return either a file path or the result of a remote find_file call. ''' try: path = self._check_proto(path) except MinionError as err: # Local file path if not os.path.isfile(path): ...
python
def __get_file_path(self, path, saltenv='base'): ''' Return either a file path or the result of a remote find_file call. ''' try: path = self._check_proto(path) except MinionError as err: # Local file path if not os.path.isfile(path): ...
[ "def", "__get_file_path", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "try", ":", "path", "=", "self", ".", "_check_proto", "(", "path", ")", "except", "MinionError", "as", "err", ":", "# Local file path", "if", "not", "os", ".", ...
Return either a file path or the result of a remote find_file call.
[ "Return", "either", "a", "file", "path", "or", "the", "result", "of", "a", "remote", "find_file", "call", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L919-L935
train
Return either a file path or the result of a remote find_file call.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.hash_file
def hash_file(self, path, saltenv='base'): ''' Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. ''' ret = {} fnd = self.__get_file_path(path,...
python
def hash_file(self, path, saltenv='base'): ''' Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. ''' ret = {} fnd = self.__get_file_path(path,...
[ "def", "hash_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "}", "fnd", "=", "self", ".", "__get_file_path", "(", "path", ",", "saltenv", ")", "if", "fnd", "is", "None", ":", "return", "ret", "try", ":", ...
Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file.
[ "Return", "the", "hash", "of", "a", "file", "to", "get", "the", "hash", "of", "a", "file", "in", "the", "pillar_roots", "prepend", "the", "path", "with", "salt", ":", "//", "<file", "on", "server", ">", "otherwise", "prepend", "the", "file", "with", "/...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L937-L958
train
Return the hash of a file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.hash_and_stat_file
def hash_and_stat_file(self, path, saltenv='base'): ''' Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. Additionally, return the stat result of the file, o...
python
def hash_and_stat_file(self, path, saltenv='base'): ''' Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. Additionally, return the stat result of the file, o...
[ "def", "hash_and_stat_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "}", "fnd", "=", "self", ".", "__get_file_path", "(", "path", ",", "saltenv", ")", "if", "fnd", "is", "None", ":", "return", "ret", ",", ...
Return the hash of a file, to get the hash of a file in the pillar_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. Additionally, return the stat result of the file, or None if no stat results were found.
[ "Return", "the", "hash", "of", "a", "file", "to", "get", "the", "hash", "of", "a", "file", "in", "the", "pillar_roots", "prepend", "the", "path", "with", "salt", ":", "//", "<file", "on", "server", ">", "otherwise", "prepend", "the", "file", "with", "/...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L960-L989
train
Return the hash of a file and the stat result of the file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
PillarClient.envs
def envs(self): ''' Return the available environments ''' ret = [] for saltenv in self.opts['pillar_roots']: ret.append(saltenv) return ret
python
def envs(self): ''' Return the available environments ''' ret = [] for saltenv in self.opts['pillar_roots']: ret.append(saltenv) return ret
[ "def", "envs", "(", "self", ")", ":", "ret", "=", "[", "]", "for", "saltenv", "in", "self", ".", "opts", "[", "'pillar_roots'", "]", ":", "ret", ".", "append", "(", "saltenv", ")", "return", "ret" ]
Return the available environments
[ "Return", "the", "available", "environments" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1003-L1010
train
Return the available environments
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient._refresh_channel
def _refresh_channel(self): ''' Reset the channel, in the event of an interruption ''' self.channel = salt.transport.client.ReqChannel.factory(self.opts) return self.channel
python
def _refresh_channel(self): ''' Reset the channel, in the event of an interruption ''' self.channel = salt.transport.client.ReqChannel.factory(self.opts) return self.channel
[ "def", "_refresh_channel", "(", "self", ")", ":", "self", ".", "channel", "=", "salt", ".", "transport", ".", "client", ".", "ReqChannel", ".", "factory", "(", "self", ".", "opts", ")", "return", "self", ".", "channel" ]
Reset the channel, in the event of an interruption
[ "Reset", "the", "channel", "in", "the", "event", "of", "an", "interruption" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1041-L1046
train
Refresh the channel
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.get_file
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Get a single file from the salt-master path must be a salt server location, aka, salt://path/to/f...
python
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Get a single file from the salt-master path must be a salt server location, aka, salt://path/to/f...
[ "def", "get_file", "(", "self", ",", "path", ",", "dest", "=", "''", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "gzip", "=", "None", ",", "cachedir", "=", "None", ")", ":", "path", ",", "senv", "=", "salt", ".", "utils", "...
Get a single file from the salt-master path must be a salt server location, aka, salt://path/to/file, if dest is omitted, then the downloaded file will be placed in the minion cache
[ "Get", "a", "single", "file", "from", "the", "salt", "-", "master", "path", "must", "be", "a", "salt", "server", "location", "aka", "salt", ":", "//", "path", "/", "to", "/", "file", "if", "dest", "is", "omitted", "then", "the", "downloaded", "file", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1064-L1262
train
Get a single file from the salt - master and store it in the specified location.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.dir_list
def dir_list(self, saltenv='base', prefix=''): ''' List the dirs on the master ''' load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_dir_list'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.s...
python
def dir_list(self, saltenv='base', prefix=''): ''' List the dirs on the master ''' load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_dir_list'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.s...
[ "def", "dir_list", "(", "self", ",", "saltenv", "=", "'base'", ",", "prefix", "=", "''", ")", ":", "load", "=", "{", "'saltenv'", ":", "saltenv", ",", "'prefix'", ":", "prefix", ",", "'cmd'", ":", "'_dir_list'", "}", "return", "salt", ".", "utils", "...
List the dirs on the master
[ "List", "the", "dirs", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1284-L1292
train
List the dirs on the master
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.__hash_and_stat_file
def __hash_and_stat_file(self, path, saltenv='base'): ''' Common code for hashing and stating files ''' try: path = self._check_proto(path) except MinionError as err: if not os.path.isfile(path): log.warning( 'specified ...
python
def __hash_and_stat_file(self, path, saltenv='base'): ''' Common code for hashing and stating files ''' try: path = self._check_proto(path) except MinionError as err: if not os.path.isfile(path): log.warning( 'specified ...
[ "def", "__hash_and_stat_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "try", ":", "path", "=", "self", ".", "_check_proto", "(", "path", ")", "except", "MinionError", "as", "err", ":", "if", "not", "os", ".", "path", ".", ...
Common code for hashing and stating files
[ "Common", "code", "for", "hashing", "and", "stating", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1304-L1326
train
Common code for hashing and stating files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.hash_and_stat_file
def hash_and_stat_file(self, path, saltenv='base'): ''' The same as hash_file, but also return the file's mode, or None if no mode data is present. ''' hash_result = self.hash_file(path, saltenv) try: path = self._check_proto(path) except MinionError a...
python
def hash_and_stat_file(self, path, saltenv='base'): ''' The same as hash_file, but also return the file's mode, or None if no mode data is present. ''' hash_result = self.hash_file(path, saltenv) try: path = self._check_proto(path) except MinionError a...
[ "def", "hash_and_stat_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ")", ":", "hash_result", "=", "self", ".", "hash_file", "(", "path", ",", "saltenv", ")", "try", ":", "path", "=", "self", ".", "_check_proto", "(", "path", ")", "exc...
The same as hash_file, but also return the file's mode, or None if no mode data is present.
[ "The", "same", "as", "hash_file", "but", "also", "return", "the", "file", "s", "mode", "or", "None", "if", "no", "mode", "data", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1336-L1360
train
A method to hash a file and return the mode and stat data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.list_env
def list_env(self, saltenv='base'): ''' Return a list of the files in the file server's specified environment ''' load = {'saltenv': saltenv, 'cmd': '_file_list'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.sen...
python
def list_env(self, saltenv='base'): ''' Return a list of the files in the file server's specified environment ''' load = {'saltenv': saltenv, 'cmd': '_file_list'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.sen...
[ "def", "list_env", "(", "self", ",", "saltenv", "=", "'base'", ")", ":", "load", "=", "{", "'saltenv'", ":", "saltenv", ",", "'cmd'", ":", "'_file_list'", "}", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "self", ".", "channel", "...
Return a list of the files in the file server's specified environment
[ "Return", "a", "list", "of", "the", "files", "in", "the", "file", "server", "s", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1362-L1369
train
Return a list of the files in the specified environment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.envs
def envs(self): ''' Return a list of available environments ''' load = {'cmd': '_file_envs'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.send(load)
python
def envs(self): ''' Return a list of available environments ''' load = {'cmd': '_file_envs'} return salt.utils.data.decode(self.channel.send(load)) if six.PY2 \ else self.channel.send(load)
[ "def", "envs", "(", "self", ")", ":", "load", "=", "{", "'cmd'", ":", "'_file_envs'", "}", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "self", ".", "channel", ".", "send", "(", "load", ")", ")", "if", "six", ".", "PY2", "else...
Return a list of available environments
[ "Return", "a", "list", "of", "available", "environments" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1371-L1377
train
Return a list of available environments
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileclient.py
RemoteClient.master_tops
def master_tops(self): ''' Return the metadata derived from the master_tops system ''' log.debug( 'The _ext_nodes master function has been renamed to _master_tops. ' 'To ensure compatibility when using older Salt masters we will ' 'continue to invoke t...
python
def master_tops(self): ''' Return the metadata derived from the master_tops system ''' log.debug( 'The _ext_nodes master function has been renamed to _master_tops. ' 'To ensure compatibility when using older Salt masters we will ' 'continue to invoke t...
[ "def", "master_tops", "(", "self", ")", ":", "log", ".", "debug", "(", "'The _ext_nodes master function has been renamed to _master_tops. '", "'To ensure compatibility when using older Salt masters we will '", "'continue to invoke the function as _ext_nodes until the '", "'Magnesium releas...
Return the metadata derived from the master_tops system
[ "Return", "the", "metadata", "derived", "from", "the", "master_tops", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L1387-L1405
train
Return the master_tops system_till_master_tops is set to None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltsupport.py
SaltSupportState.check_destination
def check_destination(self, location, group): ''' Check destination for the archives. :return: ''' # Pre-create destination, since rsync will # put one file named as group try: destination = os.path.join(location, group) if os.path.exists(d...
python
def check_destination(self, location, group): ''' Check destination for the archives. :return: ''' # Pre-create destination, since rsync will # put one file named as group try: destination = os.path.join(location, group) if os.path.exists(d...
[ "def", "check_destination", "(", "self", ",", "location", ",", "group", ")", ":", "# Pre-create destination, since rsync will", "# put one file named as group", "try", ":", "destination", "=", "os", ".", "path", ".", "join", "(", "location", ",", "group", ")", "if...
Check destination for the archives. :return:
[ "Check", "destination", "for", "the", "archives", ".", ":", "return", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltsupport.py#L96-L113
train
Check destination for the archives.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltsupport.py
SaltSupportState.collected
def collected(self, group, filename=None, host=None, location=None, move=True, all=True): ''' Sync archives to a central place. :param name: :param group: :param filename: :param host: :param location: :param move: :param all: :return: ...
python
def collected(self, group, filename=None, host=None, location=None, move=True, all=True): ''' Sync archives to a central place. :param name: :param group: :param filename: :param host: :param location: :param move: :param all: :return: ...
[ "def", "collected", "(", "self", ",", "group", ",", "filename", "=", "None", ",", "host", "=", "None", ",", "location", "=", "None", ",", "move", "=", "True", ",", "all", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "'support.collected'", ...
Sync archives to a central place. :param name: :param group: :param filename: :param host: :param location: :param move: :param all: :return:
[ "Sync", "archives", "to", "a", "central", "place", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltsupport.py#L115-L139
train
Sync archives to a central place.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltsupport.py
SaltSupportState.taken
def taken(self, profile='default', pillar=None, archive=None, output='nested'): ''' Takes minion support config data. :param profile: :param pillar: :param archive: :param output: :return: ''' ret = { 'name': 'support.taken', ...
python
def taken(self, profile='default', pillar=None, archive=None, output='nested'): ''' Takes minion support config data. :param profile: :param pillar: :param archive: :param output: :return: ''' ret = { 'name': 'support.taken', ...
[ "def", "taken", "(", "self", ",", "profile", "=", "'default'", ",", "pillar", "=", "None", ",", "archive", "=", "None", ",", "output", "=", "'nested'", ")", ":", "ret", "=", "{", "'name'", ":", "'support.taken'", ",", "'changes'", ":", "{", "}", ",",...
Takes minion support config data. :param profile: :param pillar: :param archive: :param output: :return:
[ "Takes", "minion", "support", "config", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltsupport.py#L141-L168
train
Takes minion support config data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
create_disk
def create_disk(name, size): ''' Create a VMM disk with the specified `name` and `size`. size: Size in megabytes, or use a specifier such as M, G, T. CLI Example: .. code-block:: bash salt '*' vmctl.create_disk /path/to/disk.img size=10G ''' ret = False cmd = 'vmctl c...
python
def create_disk(name, size): ''' Create a VMM disk with the specified `name` and `size`. size: Size in megabytes, or use a specifier such as M, G, T. CLI Example: .. code-block:: bash salt '*' vmctl.create_disk /path/to/disk.img size=10G ''' ret = False cmd = 'vmctl c...
[ "def", "create_disk", "(", "name", ",", "size", ")", ":", "ret", "=", "False", "cmd", "=", "'vmctl create {0} -s {1}'", ".", "format", "(", "name", ",", "size", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", ...
Create a VMM disk with the specified `name` and `size`. size: Size in megabytes, or use a specifier such as M, G, T. CLI Example: .. code-block:: bash salt '*' vmctl.create_disk /path/to/disk.img size=10G
[ "Create", "a", "VMM", "disk", "with", "the", "specified", "name", "and", "size", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L50-L78
train
Create a VMM disk with the specified name and size.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
load
def load(path): ''' Load additional configuration from the specified file. path Path to the configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.load path=/etc/vm.switches.conf ''' ret = False cmd = 'vmctl load {0}'.format(path) result = __salt__['...
python
def load(path): ''' Load additional configuration from the specified file. path Path to the configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.load path=/etc/vm.switches.conf ''' ret = False cmd = 'vmctl load {0}'.format(path) result = __salt__['...
[ "def", "load", "(", "path", ")", ":", "ret", "=", "False", "cmd", "=", "'vmctl load {0}'", ".", "format", "(", "path", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'trace'", ",", "python_shell", "="...
Load additional configuration from the specified file. path Path to the configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.load path=/etc/vm.switches.conf
[ "Load", "additional", "configuration", "from", "the", "specified", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L81-L107
train
Load additional configuration from the specified file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
reload
def reload(): ''' Remove all stopped VMs and reload configuration from the default configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.reload ''' ret = False cmd = 'vmctl reload' result = __salt__['cmd.run_all'](cmd, output...
python
def reload(): ''' Remove all stopped VMs and reload configuration from the default configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.reload ''' ret = False cmd = 'vmctl reload' result = __salt__['cmd.run_all'](cmd, output...
[ "def", "reload", "(", ")", ":", "ret", "=", "False", "cmd", "=", "'vmctl reload'", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'trace'", ",", "python_shell", "=", "False", ")", "if", "result", "[", "'re...
Remove all stopped VMs and reload configuration from the default configuration file. CLI Example: .. code-block:: bash salt '*' vmctl.reload
[ "Remove", "all", "stopped", "VMs", "and", "reload", "configuration", "from", "the", "default", "configuration", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L110-L133
train
Reloads the current configuration file from the default configuration file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
reset
def reset(all=False, vms=False, switches=False): ''' Reset the running state of VMM or a subsystem. all: Reset the running state. switches: Reset the configured switches. vms: Reset and terminate all VMs. CLI Example: .. code-block:: bash salt '*' vmctl...
python
def reset(all=False, vms=False, switches=False): ''' Reset the running state of VMM or a subsystem. all: Reset the running state. switches: Reset the configured switches. vms: Reset and terminate all VMs. CLI Example: .. code-block:: bash salt '*' vmctl...
[ "def", "reset", "(", "all", "=", "False", ",", "vms", "=", "False", ",", "switches", "=", "False", ")", ":", "ret", "=", "False", "cmd", "=", "[", "'vmctl'", ",", "'reset'", "]", "if", "all", ":", "cmd", ".", "append", "(", "'all'", ")", "elif", ...
Reset the running state of VMM or a subsystem. all: Reset the running state. switches: Reset the configured switches. vms: Reset and terminate all VMs. CLI Example: .. code-block:: bash salt '*' vmctl.reset all=True
[ "Reset", "the", "running", "state", "of", "VMM", "or", "a", "subsystem", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L136-L177
train
Reset the running state of a single or multiple virtual machines or subsystems.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
start
def start(name=None, id=None, bootpath=None, disk=None, disks=None, local_iface=False, memory=None, nics=0, switch=None): ''' Starts a VM defined by the specified parameters. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id....
python
def start(name=None, id=None, bootpath=None, disk=None, disks=None, local_iface=False, memory=None, nics=0, switch=None): ''' Starts a VM defined by the specified parameters. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id....
[ "def", "start", "(", "name", "=", "None", ",", "id", "=", "None", ",", "bootpath", "=", "None", ",", "disk", "=", "None", ",", "disks", "=", "None", ",", "local_iface", "=", "False", ",", "memory", "=", "None", ",", "nics", "=", "0", ",", "switch...
Starts a VM defined by the specified parameters. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. bootpath: Path to a kernel or BIOS image to load. disk: Path to a single disk to use. disks: List of mul...
[ "Starts", "a", "VM", "defined", "by", "the", "specified", "parameters", ".", "When", "both", "a", "name", "and", "id", "are", "provided", "the", "id", "is", "ignored", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L180-L283
train
Start a new virtual machine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
status
def status(name=None, id=None): ''' List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.status ...
python
def status(name=None, id=None): ''' List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.status ...
[ "def", "status", "(", "name", "=", "None", ",", "id", "=", "None", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'vmctl'", ",", "'status'", "]", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'tr...
List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.status # to list all VMs salt '*' vmctl...
[ "List", "VMs", "running", "on", "the", "host", "or", "only", "the", "VM", "specified", "by", "id", ".", "When", "both", "a", "name", "and", "id", "are", "provided", "the", "id", "is", "ignored", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L286-L358
train
Return a list of VMs running on the host or only the VM specified by id.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/vmctl.py
stop
def stop(name=None, id=None): ''' Stop (terminate) the VM identified by the given id or name. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.stop name=alpine '...
python
def stop(name=None, id=None): ''' Stop (terminate) the VM identified by the given id or name. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.stop name=alpine '...
[ "def", "stop", "(", "name", "=", "None", ",", "id", "=", "None", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'vmctl'", ",", "'stop'", "]", "if", "not", "(", "name", "or", "id", ")", ":", "raise", "SaltInvocationError", "(", "'Must provide eit...
Stop (terminate) the VM identified by the given id or name. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.stop name=alpine
[ "Stop", "(", "terminate", ")", "the", "VM", "identified", "by", "the", "given", "id", "or", "name", ".", "When", "both", "a", "name", "and", "id", "are", "provided", "the", "id", "is", "ignored", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vmctl.py#L361-L403
train
Stop the specified virtual machine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/munin.py
run_all
def run_all(): ''' Run all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.run_all ''' plugins = list_plugins() ret = {} for plugin in plugins: ret.update(run(plugin)) return ret
python
def run_all(): ''' Run all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.run_all ''' plugins = list_plugins() ret = {} for plugin in plugins: ret.update(run(plugin)) return ret
[ "def", "run_all", "(", ")", ":", "plugins", "=", "list_plugins", "(", ")", "ret", "=", "{", "}", "for", "plugin", "in", "plugins", ":", "ret", ".", "update", "(", "run", "(", "plugin", ")", ")", "return", "ret" ]
Run all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.run_all
[ "Run", "all", "the", "munin", "plugins" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/munin.py#L73-L87
train
Run all the munin plugins
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/munin.py
list_plugins
def list_plugins(): ''' List all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.list_plugins ''' pluginlist = os.listdir(PLUGINDIR) ret = [] for plugin in pluginlist: # Check if execute bit statf = os.path.join(PLUGINDIR, plugin) try...
python
def list_plugins(): ''' List all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.list_plugins ''' pluginlist = os.listdir(PLUGINDIR) ret = [] for plugin in pluginlist: # Check if execute bit statf = os.path.join(PLUGINDIR, plugin) try...
[ "def", "list_plugins", "(", ")", ":", "pluginlist", "=", "os", ".", "listdir", "(", "PLUGINDIR", ")", "ret", "=", "[", "]", "for", "plugin", "in", "pluginlist", ":", "# Check if execute bit", "statf", "=", "os", ".", "path", ".", "join", "(", "PLUGINDIR"...
List all the munin plugins CLI Example: .. code-block:: bash salt '*' munin.list_plugins
[ "List", "all", "the", "munin", "plugins" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/munin.py#L90-L111
train
List all the munin plugins in order of creation
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/kernelpkg_linux_yum.py
list_installed
def list_installed(): ''' Return a list of all installed kernels. CLI Example: .. code-block:: bash salt '*' kernelpkg.list_installed ''' result = __salt__['pkg.version'](_package_name(), versions_as_list=True) if result is None: return [] if six.PY2: return s...
python
def list_installed(): ''' Return a list of all installed kernels. CLI Example: .. code-block:: bash salt '*' kernelpkg.list_installed ''' result = __salt__['pkg.version'](_package_name(), versions_as_list=True) if result is None: return [] if six.PY2: return s...
[ "def", "list_installed", "(", ")", ":", "result", "=", "__salt__", "[", "'pkg.version'", "]", "(", "_package_name", "(", ")", ",", "versions_as_list", "=", "True", ")", "if", "result", "is", "None", ":", "return", "[", "]", "if", "six", ".", "PY2", ":"...
Return a list of all installed kernels. CLI Example: .. code-block:: bash salt '*' kernelpkg.list_installed
[ "Return", "a", "list", "of", "all", "installed", "kernels", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kernelpkg_linux_yum.py#L64-L81
train
Return a list of all installed kernels.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/kernelpkg_linux_yum.py
upgrade
def upgrade(reboot=False, at_time=None): ''' Upgrade the kernel and optionally reboot the system. reboot : False Request a reboot if a new kernel is available. at_time : immediate Schedule the reboot at some point in the future. This argument is ignored if ``reboot=False``. See...
python
def upgrade(reboot=False, at_time=None): ''' Upgrade the kernel and optionally reboot the system. reboot : False Request a reboot if a new kernel is available. at_time : immediate Schedule the reboot at some point in the future. This argument is ignored if ``reboot=False``. See...
[ "def", "upgrade", "(", "reboot", "=", "False", ",", "at_time", "=", "None", ")", ":", "result", "=", "__salt__", "[", "'pkg.upgrade'", "]", "(", "name", "=", "_package_name", "(", ")", ")", "_needs_reboot", "=", "needs_reboot", "(", ")", "ret", "=", "{...
Upgrade the kernel and optionally reboot the system. reboot : False Request a reboot if a new kernel is available. at_time : immediate Schedule the reboot at some point in the future. This argument is ignored if ``reboot=False``. See :py:func:`~salt.modules.system.reboot` for m...
[ "Upgrade", "the", "kernel", "and", "optionally", "reboot", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kernelpkg_linux_yum.py#L138-L178
train
Upgrade the kernel and optionally reboot the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/kernelpkg_linux_yum.py
remove
def remove(release): ''' Remove a specific version of the kernel. release The release number of an installed kernel. This must be the entire release number as returned by :py:func:`~salt.modules.kernelpkg_linux_yum.list_installed`, not the package name. CLI Example: .. cod...
python
def remove(release): ''' Remove a specific version of the kernel. release The release number of an installed kernel. This must be the entire release number as returned by :py:func:`~salt.modules.kernelpkg_linux_yum.list_installed`, not the package name. CLI Example: .. cod...
[ "def", "remove", "(", "release", ")", ":", "if", "release", "not", "in", "list_installed", "(", ")", ":", "raise", "CommandExecutionError", "(", "'Kernel release \\'{0}\\' is not installed'", ".", "format", "(", "release", ")", ")", "if", "release", "==", "activ...
Remove a specific version of the kernel. release The release number of an installed kernel. This must be the entire release number as returned by :py:func:`~salt.modules.kernelpkg_linux_yum.list_installed`, not the package name. CLI Example: .. code-block:: bash salt '*' ...
[ "Remove", "a", "specific", "version", "of", "the", "kernel", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kernelpkg_linux_yum.py#L195-L246
train
Remove a specific version of a kernel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
context_cache
def context_cache(func): ''' A decorator to be used module functions which need to cache their context. To evaluate a __context__ and re-hydrate it if a given key is empty or contains no items, pass a list of keys to evaulate. ''' def context_cache_wrap(*args, **kwargs): func_contex...
python
def context_cache(func): ''' A decorator to be used module functions which need to cache their context. To evaluate a __context__ and re-hydrate it if a given key is empty or contains no items, pass a list of keys to evaulate. ''' def context_cache_wrap(*args, **kwargs): func_contex...
[ "def", "context_cache", "(", "func", ")", ":", "def", "context_cache_wrap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "func_context", "=", "func", ".", "__globals__", "[", "'__context__'", "]", "func_opts", "=", "func", ".", "__globals__", "[", ...
A decorator to be used module functions which need to cache their context. To evaluate a __context__ and re-hydrate it if a given key is empty or contains no items, pass a list of keys to evaulate.
[ "A", "decorator", "to", "be", "used", "module", "functions", "which", "need", "to", "cache", "their", "context", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L344-L363
train
A decorator to be used to cache the current context of a given key .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheDict._enforce_ttl_key
def _enforce_ttl_key(self, key): ''' Enforce the TTL to a specific key, delete if its past TTL ''' if key not in self._key_cache_time or self._ttl == 0: return if time.time() - self._key_cache_time[key] > self._ttl: del self._key_cache_time[key] ...
python
def _enforce_ttl_key(self, key): ''' Enforce the TTL to a specific key, delete if its past TTL ''' if key not in self._key_cache_time or self._ttl == 0: return if time.time() - self._key_cache_time[key] > self._ttl: del self._key_cache_time[key] ...
[ "def", "_enforce_ttl_key", "(", "self", ",", "key", ")", ":", "if", "key", "not", "in", "self", ".", "_key_cache_time", "or", "self", ".", "_ttl", "==", "0", ":", "return", "if", "time", ".", "time", "(", ")", "-", "self", ".", "_key_cache_time", "["...
Enforce the TTL to a specific key, delete if its past TTL
[ "Enforce", "the", "TTL", "to", "a", "specific", "key", "delete", "if", "its", "past", "TTL" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L65-L73
train
Enforces the TTL to a specific key delete it if it is past TTL
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheDisk._enforce_ttl_key
def _enforce_ttl_key(self, key): ''' Enforce the TTL to a specific key, delete if its past TTL ''' if key not in self._key_cache_time or self._ttl == 0: return if time.time() - self._key_cache_time[key] > self._ttl: del self._key_cache_time[key] ...
python
def _enforce_ttl_key(self, key): ''' Enforce the TTL to a specific key, delete if its past TTL ''' if key not in self._key_cache_time or self._ttl == 0: return if time.time() - self._key_cache_time[key] > self._ttl: del self._key_cache_time[key] ...
[ "def", "_enforce_ttl_key", "(", "self", ",", "key", ")", ":", "if", "key", "not", "in", "self", ".", "_key_cache_time", "or", "self", ".", "_ttl", "==", "0", ":", "return", "if", "time", ".", "time", "(", ")", "-", "self", ".", "_key_cache_time", "["...
Enforce the TTL to a specific key, delete if its past TTL
[ "Enforce", "the", "TTL", "to", "a", "specific", "key", "delete", "if", "its", "past", "TTL" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L106-L114
train
Enforces the TTL to a specific key delete it if it is past TTL
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheDisk._read
def _read(self): ''' Read in from disk ''' if msgpack is None: log.error('Cache cannot be read from the disk: msgpack is missing') elif not os.path.exists(self._path): log.debug('Cache path does not exist for reading: %s', self._path) else: ...
python
def _read(self): ''' Read in from disk ''' if msgpack is None: log.error('Cache cannot be read from the disk: msgpack is missing') elif not os.path.exists(self._path): log.debug('Cache path does not exist for reading: %s', self._path) else: ...
[ "def", "_read", "(", "self", ")", ":", "if", "msgpack", "is", "None", ":", "log", ".", "error", "(", "'Cache cannot be read from the disk: msgpack is missing'", ")", "elif", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "_path", ")", ":", "log...
Read in from disk
[ "Read", "in", "from", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L172-L195
train
Read in from disk and store the cache in self. _dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheDisk.store
def store(self): ''' Write content of the entire cache to disk ''' if msgpack is None: log.error('Cache cannot be stored on disk: msgpack is missing') else: # TODO Dir hashing? try: with salt.utils.files.fopen(self._path, 'wb+')...
python
def store(self): ''' Write content of the entire cache to disk ''' if msgpack is None: log.error('Cache cannot be stored on disk: msgpack is missing') else: # TODO Dir hashing? try: with salt.utils.files.fopen(self._path, 'wb+')...
[ "def", "store", "(", "self", ")", ":", "if", "msgpack", "is", "None", ":", "log", ".", "error", "(", "'Cache cannot be stored on disk: msgpack is missing'", ")", "else", ":", "# TODO Dir hashing?", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", ...
Write content of the entire cache to disk
[ "Write", "content", "of", "the", "entire", "cache", "to", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L197-L213
train
Store the contents of the entire cache to disk
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheCli.put_cache
def put_cache(self, minions): ''' published the given minions to the ConCache ''' self.cupd_out.send(self.serial.dumps(minions))
python
def put_cache(self, minions): ''' published the given minions to the ConCache ''' self.cupd_out.send(self.serial.dumps(minions))
[ "def", "put_cache", "(", "self", ",", "minions", ")", ":", "self", ".", "cupd_out", ".", "send", "(", "self", ".", "serial", ".", "dumps", "(", "minions", ")", ")" ]
published the given minions to the ConCache
[ "published", "the", "given", "minions", "to", "the", "ConCache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L244-L248
train
Publish the given minions to the ConCache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheCli.get_cached
def get_cached(self): ''' queries the ConCache for a list of currently connected minions ''' msg = self.serial.dumps('minions') self.creq_out.send(msg) min_list = self.serial.loads(self.creq_out.recv()) return min_list
python
def get_cached(self): ''' queries the ConCache for a list of currently connected minions ''' msg = self.serial.dumps('minions') self.creq_out.send(msg) min_list = self.serial.loads(self.creq_out.recv()) return min_list
[ "def", "get_cached", "(", "self", ")", ":", "msg", "=", "self", ".", "serial", ".", "dumps", "(", "'minions'", ")", "self", ".", "creq_out", ".", "send", "(", "msg", ")", "min_list", "=", "self", ".", "serial", ".", "loads", "(", "self", ".", "creq...
queries the ConCache for a list of currently connected minions
[ "queries", "the", "ConCache", "for", "a", "list", "of", "currently", "connected", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L250-L257
train
queries the ConCache for a list of currently connected minions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheRegex.sweep
def sweep(self): ''' Sweep the cache and remove the outdated or least frequently used entries ''' if self.max_age < time.time() - self.timestamp: self.clear() self.timestamp = time.time() else: paterns = list(self.cache.values()) ...
python
def sweep(self): ''' Sweep the cache and remove the outdated or least frequently used entries ''' if self.max_age < time.time() - self.timestamp: self.clear() self.timestamp = time.time() else: paterns = list(self.cache.values()) ...
[ "def", "sweep", "(", "self", ")", ":", "if", "self", ".", "max_age", "<", "time", ".", "time", "(", ")", "-", "self", ".", "timestamp", ":", "self", ".", "clear", "(", ")", "self", ".", "timestamp", "=", "time", ".", "time", "(", ")", "else", "...
Sweep the cache and remove the outdated or least frequently used entries
[ "Sweep", "the", "cache", "and", "remove", "the", "outdated", "or", "least", "frequently", "used", "entries" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L286-L298
train
Sweep the cache and remove the outdated or least frequently used entries
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
CacheRegex.get
def get(self, pattern): ''' Get a compiled regular expression object based on pattern and cache it when it is not in the cache already ''' try: self.cache[pattern][0] += 1 return self.cache[pattern][1] except KeyError: pass if l...
python
def get(self, pattern): ''' Get a compiled regular expression object based on pattern and cache it when it is not in the cache already ''' try: self.cache[pattern][0] += 1 return self.cache[pattern][1] except KeyError: pass if l...
[ "def", "get", "(", "self", ",", "pattern", ")", ":", "try", ":", "self", ".", "cache", "[", "pattern", "]", "[", "0", "]", "+=", "1", "return", "self", ".", "cache", "[", "pattern", "]", "[", "1", "]", "except", "KeyError", ":", "pass", "if", "...
Get a compiled regular expression object based on pattern and cache it when it is not in the cache already
[ "Get", "a", "compiled", "regular", "expression", "object", "based", "on", "pattern", "and", "cache", "it", "when", "it", "is", "not", "in", "the", "cache", "already" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L300-L315
train
Get a compiled regular expression object based on pattern and cache it if it is not in the cache and return it
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
ContextCache.cache_context
def cache_context(self, context): ''' Cache the given context to disk ''' if not os.path.isdir(os.path.dirname(self.cache_path)): os.mkdir(os.path.dirname(self.cache_path)) with salt.utils.files.fopen(self.cache_path, 'w+b') as cache: self.serial.dump(cont...
python
def cache_context(self, context): ''' Cache the given context to disk ''' if not os.path.isdir(os.path.dirname(self.cache_path)): os.mkdir(os.path.dirname(self.cache_path)) with salt.utils.files.fopen(self.cache_path, 'w+b') as cache: self.serial.dump(cont...
[ "def", "cache_context", "(", "self", ",", "context", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "os", ".", "path", ".", "dirname", "(", "self", ".", "cache_path", ")", ")", ":", "os", ".", "mkdir", "(", "os", ".", "path", ".", ...
Cache the given context to disk
[ "Cache", "the", "given", "context", "to", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L327-L334
train
Cache the given context to disk
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/cache.py
ContextCache.get_cache_context
def get_cache_context(self): ''' Retrieve a context cache from disk ''' with salt.utils.files.fopen(self.cache_path, 'rb') as cache: return salt.utils.data.decode(self.serial.load(cache))
python
def get_cache_context(self): ''' Retrieve a context cache from disk ''' with salt.utils.files.fopen(self.cache_path, 'rb') as cache: return salt.utils.data.decode(self.serial.load(cache))
[ "def", "get_cache_context", "(", "self", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "self", ".", "cache_path", ",", "'rb'", ")", "as", "cache", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "self"...
Retrieve a context cache from disk
[ "Retrieve", "a", "context", "cache", "from", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cache.py#L336-L341
train
Retrieve a context cache from disk
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/doc.py
strip_rst
def strip_rst(docs): ''' Strip/replace reStructuredText directives in docstrings ''' for func, docstring in six.iteritems(docs): log.debug('Stripping docstring for %s', func) if not docstring: continue docstring_new = docstring if six.PY3 else salt.utils.data.encode(d...
python
def strip_rst(docs): ''' Strip/replace reStructuredText directives in docstrings ''' for func, docstring in six.iteritems(docs): log.debug('Stripping docstring for %s', func) if not docstring: continue docstring_new = docstring if six.PY3 else salt.utils.data.encode(d...
[ "def", "strip_rst", "(", "docs", ")", ":", "for", "func", ",", "docstring", "in", "six", ".", "iteritems", "(", "docs", ")", ":", "log", ".", "debug", "(", "'Stripping docstring for %s'", ",", "func", ")", "if", "not", "docstring", ":", "continue", "docs...
Strip/replace reStructuredText directives in docstrings
[ "Strip", "/", "replace", "reStructuredText", "directives", "in", "docstrings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/doc.py#L16-L46
train
Strip reStructuredText directives in docstrings Strip/replace reStructuredText directives in docstrings
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/doc.py
parse_docstring
def parse_docstring(docstring): ''' Parse a docstring into its parts. Currently only parses dependencies, can be extended to parse whatever is needed. Parses into a dictionary: { 'full': full docstring, 'deps': list of dependencies (empty list if none) } ...
python
def parse_docstring(docstring): ''' Parse a docstring into its parts. Currently only parses dependencies, can be extended to parse whatever is needed. Parses into a dictionary: { 'full': full docstring, 'deps': list of dependencies (empty list if none) } ...
[ "def", "parse_docstring", "(", "docstring", ")", ":", "# First try with regex search for :depends:", "ret", "=", "{", "'full'", ":", "docstring", "}", "regex", "=", "r'([ \\t]*):depends:[ \\t]+- (\\w+)[^\\n]*\\n(\\1[ \\t]+- (\\w+)[^\\n]*\\n)*'", "match", "=", "re", ".", "se...
Parse a docstring into its parts. Currently only parses dependencies, can be extended to parse whatever is needed. Parses into a dictionary: { 'full': full docstring, 'deps': list of dependencies (empty list if none) }
[ "Parse", "a", "docstring", "into", "its", "parts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/doc.py#L49-L83
train
Parses a docstring into its parts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_elasticache.py
present
def present( name, engine=None, cache_node_type=None, num_cache_nodes=None, preferred_availability_zone=None, port=None, cache_parameter_group_name=None, cache_security_group_names=None, replication_group_id=None, auto_minor_version_upgrade...
python
def present( name, engine=None, cache_node_type=None, num_cache_nodes=None, preferred_availability_zone=None, port=None, cache_parameter_group_name=None, cache_security_group_names=None, replication_group_id=None, auto_minor_version_upgrade...
[ "def", "present", "(", "name", ",", "engine", "=", "None", ",", "cache_node_type", "=", "None", ",", "num_cache_nodes", "=", "None", ",", "preferred_availability_zone", "=", "None", ",", "port", "=", "None", ",", "cache_parameter_group_name", "=", "None", ",",...
Ensure the cache cluster exists. name Name of the cache cluster (cache cluster id). engine The name of the cache engine to be used for this cache cluster. Valid values are memcached or redis. cache_node_type The compute and memory capacity of the nodes in the cache cluster...
[ "Ensure", "the", "cache", "cluster", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elasticache.py#L100-L263
train
Ensure a cache cluster exists and contains the specified attributes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_elasticache.py
subnet_group_present
def subnet_group_present(name, subnet_ids=None, subnet_names=None, description=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure ElastiCache subnet group exists. .. versionadded:: 2015.8.0 name The name for the Elast...
python
def subnet_group_present(name, subnet_ids=None, subnet_names=None, description=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure ElastiCache subnet group exists. .. versionadded:: 2015.8.0 name The name for the Elast...
[ "def", "subnet_group_present", "(", "name", ",", "subnet_ids", "=", "None", ",", "subnet_names", "=", "None", ",", "description", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ","...
Ensure ElastiCache subnet group exists. .. versionadded:: 2015.8.0 name The name for the ElastiCache subnet group. This value is stored as a lowercase string. subnet_ids A list of VPC subnet IDs for the cache subnet group. Exclusive with subnet_names. subnet_names A list of ...
[ "Ensure", "ElastiCache", "subnet", "group", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elasticache.py#L266-L329
train
Ensure a cache subnet group exists.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_elasticache.py
creategroup
def creategroup(name, primary_cluster_id, replication_group_description, wait=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the a replication group is create. name Name of replication group wait Waits for the group to be available primary_clust...
python
def creategroup(name, primary_cluster_id, replication_group_description, wait=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the a replication group is create. name Name of replication group wait Waits for the group to be available primary_clust...
[ "def", "creategroup", "(", "name", ",", "primary_cluster_id", ",", "replication_group_description", ",", "wait", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=...
Ensure the a replication group is create. name Name of replication group wait Waits for the group to be available primary_cluster_id Name of the master cache node replication_group_description Description for the group region Region to connect to. ke...
[ "Ensure", "the", "a", "replication", "group", "is", "create", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elasticache.py#L386-L438
train
Create a new replication group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_clear_dict
def _clear_dict(endpoint_props): ''' Eliminates None entries from the features of the endpoint dict. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_val is not None )
python
def _clear_dict(endpoint_props): ''' Eliminates None entries from the features of the endpoint dict. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_val is not None )
[ "def", "_clear_dict", "(", "endpoint_props", ")", ":", "return", "dict", "(", "(", "prop_name", ",", "prop_val", ")", "for", "prop_name", ",", "prop_val", "in", "six", ".", "iteritems", "(", "endpoint_props", ")", "if", "prop_val", "is", "not", "None", ")"...
Eliminates None entries from the features of the endpoint dict.
[ "Eliminates", "None", "entries", "from", "the", "features", "of", "the", "endpoint", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L85-L93
train
Clears the dictionary of all None entries from the features of the endpoint dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_ignore_keys
def _ignore_keys(endpoint_props): ''' Ignores some keys that might be different without any important info. These keys are defined under _DO_NOT_COMPARE_FIELDS. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_name not in...
python
def _ignore_keys(endpoint_props): ''' Ignores some keys that might be different without any important info. These keys are defined under _DO_NOT_COMPARE_FIELDS. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_name not in...
[ "def", "_ignore_keys", "(", "endpoint_props", ")", ":", "return", "dict", "(", "(", "prop_name", ",", "prop_val", ")", "for", "prop_name", ",", "prop_val", "in", "six", ".", "iteritems", "(", "endpoint_props", ")", "if", "prop_name", "not", "in", "_DO_NOT_CO...
Ignores some keys that might be different without any important info. These keys are defined under _DO_NOT_COMPARE_FIELDS.
[ "Ignores", "some", "keys", "that", "might", "be", "different", "without", "any", "important", "info", ".", "These", "keys", "are", "defined", "under", "_DO_NOT_COMPARE_FIELDS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L96-L105
train
Ignores some keys that might be different without any important info.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_unique
def _unique(list_of_dicts): ''' Returns an unique list of dictionaries given a list that may contain duplicates. ''' unique_list = [] for ele in list_of_dicts: if ele not in unique_list: unique_list.append(ele) return unique_list
python
def _unique(list_of_dicts): ''' Returns an unique list of dictionaries given a list that may contain duplicates. ''' unique_list = [] for ele in list_of_dicts: if ele not in unique_list: unique_list.append(ele) return unique_list
[ "def", "_unique", "(", "list_of_dicts", ")", ":", "unique_list", "=", "[", "]", "for", "ele", "in", "list_of_dicts", ":", "if", "ele", "not", "in", "unique_list", ":", "unique_list", ".", "append", "(", "ele", ")", "return", "unique_list" ]
Returns an unique list of dictionaries given a list that may contain duplicates.
[ "Returns", "an", "unique", "list", "of", "dictionaries", "given", "a", "list", "that", "may", "contain", "duplicates", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L108-L116
train
Returns an unique list of dictionaries given a list that may contain duplicates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_clear_ignore
def _clear_ignore(endpoint_props): ''' Both _clear_dict and _ignore_keys in a single iteration. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_name not in _DO_NOT_COMPARE_FIELDS and prop_val is not None )
python
def _clear_ignore(endpoint_props): ''' Both _clear_dict and _ignore_keys in a single iteration. ''' return dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(endpoint_props) if prop_name not in _DO_NOT_COMPARE_FIELDS and prop_val is not None )
[ "def", "_clear_ignore", "(", "endpoint_props", ")", ":", "return", "dict", "(", "(", "prop_name", ",", "prop_val", ")", "for", "prop_name", ",", "prop_val", "in", "six", ".", "iteritems", "(", "endpoint_props", ")", "if", "prop_name", "not", "in", "_DO_NOT_C...
Both _clear_dict and _ignore_keys in a single iteration.
[ "Both", "_clear_dict", "and", "_ignore_keys", "in", "a", "single", "iteration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L119-L127
train
Clear the dictionary of _ignore_keys and _clear_dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_find_match
def _find_match(ele, lst): ''' Find a matching element in a list. ''' for _ele in lst: for match_key in _MATCH_KEYS: if _ele.get(match_key) == ele.get(match_key): return ele
python
def _find_match(ele, lst): ''' Find a matching element in a list. ''' for _ele in lst: for match_key in _MATCH_KEYS: if _ele.get(match_key) == ele.get(match_key): return ele
[ "def", "_find_match", "(", "ele", ",", "lst", ")", ":", "for", "_ele", "in", "lst", ":", "for", "match_key", "in", "_MATCH_KEYS", ":", "if", "_ele", ".", "get", "(", "match_key", ")", "==", "ele", ".", "get", "(", "match_key", ")", ":", "return", "...
Find a matching element in a list.
[ "Find", "a", "matching", "element", "in", "a", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L140-L147
train
Find a matching element in a list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_update_on_fields
def _update_on_fields(prev_ele, new_ele): ''' Return a dict with fields that differ between two dicts. ''' fields_update = dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(new_ele) if new_ele.get(prop_name) != prev_ele.get(prop_name) or prop_name in _MATCH_KEY...
python
def _update_on_fields(prev_ele, new_ele): ''' Return a dict with fields that differ between two dicts. ''' fields_update = dict( (prop_name, prop_val) for prop_name, prop_val in six.iteritems(new_ele) if new_ele.get(prop_name) != prev_ele.get(prop_name) or prop_name in _MATCH_KEY...
[ "def", "_update_on_fields", "(", "prev_ele", ",", "new_ele", ")", ":", "fields_update", "=", "dict", "(", "(", "prop_name", ",", "prop_val", ")", "for", "prop_name", ",", "prop_val", "in", "six", ".", "iteritems", "(", "new_ele", ")", "if", "new_ele", ".",...
Return a dict with fields that differ between two dicts.
[ "Return", "a", "dict", "with", "fields", "that", "differ", "between", "two", "dicts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L150-L165
train
Return a dict with fields that differ between two dicts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
_compute_diff
def _compute_diff(expected_endpoints, configured_endpoints): ''' Compares configured endpoints with the expected configuration and returns the differences. ''' new_endpoints = [] update_endpoints = [] remove_endpoints = [] ret = _compute_diff_ret() # noth configured => configure with e...
python
def _compute_diff(expected_endpoints, configured_endpoints): ''' Compares configured endpoints with the expected configuration and returns the differences. ''' new_endpoints = [] update_endpoints = [] remove_endpoints = [] ret = _compute_diff_ret() # noth configured => configure with e...
[ "def", "_compute_diff", "(", "expected_endpoints", ",", "configured_endpoints", ")", ":", "new_endpoints", "=", "[", "]", "update_endpoints", "=", "[", "]", "remove_endpoints", "=", "[", "]", "ret", "=", "_compute_diff_ret", "(", ")", "# noth configured => configure...
Compares configured endpoints with the expected configuration and returns the differences.
[ "Compares", "configured", "endpoints", "with", "the", "expected", "configuration", "and", "returns", "the", "differences", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L168-L218
train
Compute the differences between the expected and configured endpoints.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
create
def create(name, endpoint='incidents', api_url=None, page_id=None, api_key=None, api_version=None, **kwargs): ''' Insert a new entry under a specific endpoint. endpoint: incidents Insert under this specific endpoint. page_id ...
python
def create(name, endpoint='incidents', api_url=None, page_id=None, api_key=None, api_version=None, **kwargs): ''' Insert a new entry under a specific endpoint. endpoint: incidents Insert under this specific endpoint. page_id ...
[ "def", "create", "(", "name", ",", "endpoint", "=", "'incidents'", ",", "api_url", "=", "None", ",", "page_id", "=", "None", ",", "api_key", "=", "None", ",", "api_version", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "_default_ret", ...
Insert a new entry under a specific endpoint. endpoint: incidents Insert under this specific endpoint. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API version. Can also be specifi...
[ "Insert", "a", "new", "entry", "under", "a", "specific", "endpoint", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L225-L286
train
Create a new entry under a specific endpoint.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
update
def update(name, endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None, **kwargs): ''' Update attribute(s) of a specific endpoint. id The unique ID of the enpoint entry. endpoint: i...
python
def update(name, endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None, **kwargs): ''' Update attribute(s) of a specific endpoint. id The unique ID of the enpoint entry. endpoint: i...
[ "def", "update", "(", "name", ",", "endpoint", "=", "'incidents'", ",", "id", "=", "None", ",", "api_url", "=", "None", ",", "page_id", "=", "None", ",", "api_key", "=", "None", ",", "api_version", "=", "None", ",", "*", "*", "kwargs", ")", ":", "r...
Update attribute(s) of a specific endpoint. id The unique ID of the enpoint entry. endpoint: incidents Endpoint name. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API ...
[ "Update", "attribute", "(", "s", ")", "of", "a", "specific", "endpoint", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L289-L356
train
Update an enpoint entry in a specific endpoint.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
delete
def delete(name, endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None): ''' Remove an entry from an endpoint. endpoint: incidents Request a specific endpoint. page_id Page ID. Can als...
python
def delete(name, endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None): ''' Remove an entry from an endpoint. endpoint: incidents Request a specific endpoint. page_id Page ID. Can als...
[ "def", "delete", "(", "name", ",", "endpoint", "=", "'incidents'", ",", "id", "=", "None", ",", "api_url", "=", "None", ",", "page_id", "=", "None", ",", "api_key", "=", "None", ",", "api_version", "=", "None", ")", ":", "ret", "=", "_default_ret", "...
Remove an entry from an endpoint. endpoint: incidents Request a specific endpoint. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API version. Can also be specified in the config fil...
[ "Remove", "an", "entry", "from", "an", "endpoint", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L359-L414
train
Delete an entry from an incidents status page
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/statuspage.py
managed
def managed(name, config, api_url=None, page_id=None, api_key=None, api_version=None, pace=_PACE, allow_empty=False): ''' Manage the StatusPage configuration. config Dictionary with the expected configuration of the...
python
def managed(name, config, api_url=None, page_id=None, api_key=None, api_version=None, pace=_PACE, allow_empty=False): ''' Manage the StatusPage configuration. config Dictionary with the expected configuration of the...
[ "def", "managed", "(", "name", ",", "config", ",", "api_url", "=", "None", ",", "page_id", "=", "None", ",", "api_key", "=", "None", ",", "api_version", "=", "None", ",", "pace", "=", "_PACE", ",", "allow_empty", "=", "False", ")", ":", "complete_diff"...
Manage the StatusPage configuration. config Dictionary with the expected configuration of the StatusPage. The main level keys of this dictionary represent the endpoint name. If a certain endpoint does not exist in this structure, it will be ignored / not configured. page_id Pag...
[ "Manage", "the", "StatusPage", "configuration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/statuspage.py#L417-L590
train
Manage the status page configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/splunk.py
present
def present(email, profile="splunk", **kwargs): ''' Ensure a user is present .. code-block:: yaml ensure example test user 1: splunk.user_present: - realname: 'Example TestUser1' - name: 'exampleuser' - email: 'example@domain.com' ...
python
def present(email, profile="splunk", **kwargs): ''' Ensure a user is present .. code-block:: yaml ensure example test user 1: splunk.user_present: - realname: 'Example TestUser1' - name: 'exampleuser' - email: 'example@domain.com' ...
[ "def", "present", "(", "email", ",", "profile", "=", "\"splunk\"", ",", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", ".", "get", "(", "'name'", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ...
Ensure a user is present .. code-block:: yaml ensure example test user 1: splunk.user_present: - realname: 'Example TestUser1' - name: 'exampleuser' - email: 'example@domain.com' - roles: ['user'] The following parameters are...
[ "Ensure", "a", "user", "is", "present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/splunk.py#L26-L103
train
Ensure a user is present in the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/splunk.py
absent
def absent(email, profile="splunk", **kwargs): ''' Ensure a splunk user is absent .. code-block:: yaml ensure example test user 1: splunk.absent: - email: 'example@domain.com' - name: 'exampleuser' The following parameters are required: email ...
python
def absent(email, profile="splunk", **kwargs): ''' Ensure a splunk user is absent .. code-block:: yaml ensure example test user 1: splunk.absent: - email: 'example@domain.com' - name: 'exampleuser' The following parameters are required: email ...
[ "def", "absent", "(", "email", ",", "profile", "=", "\"splunk\"", ",", "*", "*", "kwargs", ")", ":", "user_identity", "=", "kwargs", ".", "get", "(", "'name'", ")", "ret", "=", "{", "'name'", ":", "user_identity", ",", "'changes'", ":", "{", "}", ","...
Ensure a splunk user is absent .. code-block:: yaml ensure example test user 1: splunk.absent: - email: 'example@domain.com' - name: 'exampleuser' The following parameters are required: email This is the email of the user in splunk name ...
[ "Ensure", "a", "splunk", "user", "is", "absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/splunk.py#L106-L158
train
Ensure a splunk user is absent.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/keyboard.py
system
def system(name): ''' Set the keyboard layout for the system name The keyboard layout to use ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __salt__['keyboard.get_sys']() == name: ret['result'] = True ret['comme...
python
def system(name): ''' Set the keyboard layout for the system name The keyboard layout to use ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __salt__['keyboard.get_sys']() == name: ret['result'] = True ret['comme...
[ "def", "system", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "__salt__", "[", "'keyboard.get_sys'", "]", "(", ")", "==", "name...
Set the keyboard layout for the system name The keyboard layout to use
[ "Set", "the", "keyboard", "layout", "for", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keyboard.py#L32-L58
train
Set the keyboard layout for the system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/keyboard.py
xorg
def xorg(name): ''' Set the keyboard layout for XOrg layout The keyboard layout to use ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __salt__['keyboard.get_x']() == name: ret['result'] = True ret['comment'] = '...
python
def xorg(name): ''' Set the keyboard layout for XOrg layout The keyboard layout to use ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __salt__['keyboard.get_x']() == name: ret['result'] = True ret['comment'] = '...
[ "def", "xorg", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "__salt__", "[", "'keyboard.get_x'", "]", "(", ")", "==", "name", ...
Set the keyboard layout for XOrg layout The keyboard layout to use
[ "Set", "the", "keyboard", "layout", "for", "XOrg" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keyboard.py#L61-L87
train
Set the keyboard layout for XOrg
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
_status_wait
def _status_wait(service_name, end_time, service_states): ''' Helper function that will wait for the status of the service to match the provided status before an end time expires. Used for service stop and start .. versionadded:: 2017.7.9,2018.3.4 Args: service_name (str): The ...
python
def _status_wait(service_name, end_time, service_states): ''' Helper function that will wait for the status of the service to match the provided status before an end time expires. Used for service stop and start .. versionadded:: 2017.7.9,2018.3.4 Args: service_name (str): The ...
[ "def", "_status_wait", "(", "service_name", ",", "end_time", ",", "service_states", ")", ":", "info_results", "=", "info", "(", "service_name", ")", "while", "info_results", "[", "'Status'", "]", "in", "service_states", "and", "time", ".", "time", "(", ")", ...
Helper function that will wait for the status of the service to match the provided status before an end time expires. Used for service stop and start .. versionadded:: 2017.7.9,2018.3.4 Args: service_name (str): The name of the service end_time (float): A future ti...
[ "Helper", "function", "that", "will", "wait", "for", "the", "status", "of", "the", "service", "to", "match", "the", "provided", "status", "before", "an", "end", "time", "expires", ".", "Used", "for", "service", "stop", "and", "start" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L251-L293
train
Helper function that will wait for the status of the service to match the end time. Used for service start and stop.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
_cmd_quote
def _cmd_quote(cmd): r''' Helper function to properly format the path to the binary for the service Must be wrapped in double quotes to account for paths that have spaces. For example: ``"C:\Program Files\Path\to\bin.exe"`` Args: cmd (str): Full path to the binary Returns: ...
python
def _cmd_quote(cmd): r''' Helper function to properly format the path to the binary for the service Must be wrapped in double quotes to account for paths that have spaces. For example: ``"C:\Program Files\Path\to\bin.exe"`` Args: cmd (str): Full path to the binary Returns: ...
[ "def", "_cmd_quote", "(", "cmd", ")", ":", "# Remove all single and double quotes from the beginning and the end", "pattern", "=", "re", ".", "compile", "(", "'^(\\\\\"|\\').*|.*(\\\\\"|\\')$'", ")", "while", "pattern", ".", "match", "(", "cmd", ")", "is", "not", "Non...
r''' Helper function to properly format the path to the binary for the service Must be wrapped in double quotes to account for paths that have spaces. For example: ``"C:\Program Files\Path\to\bin.exe"`` Args: cmd (str): Full path to the binary Returns: str: Properly quoted pat...
[ "r", "Helper", "function", "to", "properly", "format", "the", "path", "to", "the", "binary", "for", "the", "service", "Must", "be", "wrapped", "in", "double", "quotes", "to", "account", "for", "paths", "that", "have", "spaces", ".", "For", "example", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L296-L317
train
r Removes single and double quotes from the command to ensure that the path to the binary is wrapped in double quotes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
get_enabled
def get_enabled(): ''' Return a list of enabled services. Enabled is defined as a service that is marked to Auto Start. Returns: list: A list of enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' raw_services = _get_services() serv...
python
def get_enabled(): ''' Return a list of enabled services. Enabled is defined as a service that is marked to Auto Start. Returns: list: A list of enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' raw_services = _get_services() serv...
[ "def", "get_enabled", "(", ")", ":", "raw_services", "=", "_get_services", "(", ")", "services", "=", "set", "(", ")", "for", "service", "in", "raw_services", ":", "if", "info", "(", "service", "[", "'ServiceName'", "]", ")", "[", "'StartType'", "]", "in...
Return a list of enabled services. Enabled is defined as a service that is marked to Auto Start. Returns: list: A list of enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled
[ "Return", "a", "list", "of", "enabled", "services", ".", "Enabled", "is", "defined", "as", "a", "service", "that", "is", "marked", "to", "Auto", "Start", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L320-L340
train
Return a list of enabled services.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
available
def available(name): ''' Check if a service is available on the system. Args: name (str): The name of the service to check Returns: bool: ``True`` if the service is available, ``False`` otherwise CLI Example: .. code-block:: bash salt '*' service.available <service n...
python
def available(name): ''' Check if a service is available on the system. Args: name (str): The name of the service to check Returns: bool: ``True`` if the service is available, ``False`` otherwise CLI Example: .. code-block:: bash salt '*' service.available <service n...
[ "def", "available", "(", "name", ")", ":", "for", "service", "in", "get_all", "(", ")", ":", "if", "name", ".", "lower", "(", ")", "==", "service", ".", "lower", "(", ")", ":", "return", "True", "return", "False" ]
Check if a service is available on the system. Args: name (str): The name of the service to check Returns: bool: ``True`` if the service is available, ``False`` otherwise CLI Example: .. code-block:: bash salt '*' service.available <service name>
[ "Check", "if", "a", "service", "is", "available", "on", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L366-L386
train
Check if a service is available on the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
_get_services
def _get_services(): ''' Returns a list of all services on the system. ''' handle_scm = win32service.OpenSCManager( None, None, win32service.SC_MANAGER_ENUMERATE_SERVICE) try: services = win32service.EnumServicesStatusEx(handle_scm) except AttributeError: services = win3...
python
def _get_services(): ''' Returns a list of all services on the system. ''' handle_scm = win32service.OpenSCManager( None, None, win32service.SC_MANAGER_ENUMERATE_SERVICE) try: services = win32service.EnumServicesStatusEx(handle_scm) except AttributeError: services = win3...
[ "def", "_get_services", "(", ")", ":", "handle_scm", "=", "win32service", ".", "OpenSCManager", "(", "None", ",", "None", ",", "win32service", ".", "SC_MANAGER_ENUMERATE_SERVICE", ")", "try", ":", "services", "=", "win32service", ".", "EnumServicesStatusEx", "(", ...
Returns a list of all services on the system.
[ "Returns", "a", "list", "of", "all", "services", "on", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L408-L422
train
Returns a list of all services on the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
get_all
def get_all(): ''' Return all installed services Returns: list: Returns a list of all services on the system. CLI Example: .. code-block:: bash salt '*' service.get_all ''' services = _get_services() ret = set() for service in services: ret.add(service['S...
python
def get_all(): ''' Return all installed services Returns: list: Returns a list of all services on the system. CLI Example: .. code-block:: bash salt '*' service.get_all ''' services = _get_services() ret = set() for service in services: ret.add(service['S...
[ "def", "get_all", "(", ")", ":", "services", "=", "_get_services", "(", ")", "ret", "=", "set", "(", ")", "for", "service", "in", "services", ":", "ret", ".", "add", "(", "service", "[", "'ServiceName'", "]", ")", "return", "sorted", "(", "ret", ")" ...
Return all installed services Returns: list: Returns a list of all services on the system. CLI Example: .. code-block:: bash salt '*' service.get_all
[ "Return", "all", "installed", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L425-L444
train
Returns a list of all installed services on the system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
get_service_name
def get_service_name(*args): ''' The Display Name is what is displayed in Windows when services.msc is executed. Each Display Name has an associated Service Name which is the actual name of the service. This function allows you to discover the Service Name by returning a dictionary of Display Name...
python
def get_service_name(*args): ''' The Display Name is what is displayed in Windows when services.msc is executed. Each Display Name has an associated Service Name which is the actual name of the service. This function allows you to discover the Service Name by returning a dictionary of Display Name...
[ "def", "get_service_name", "(", "*", "args", ")", ":", "raw_services", "=", "_get_services", "(", ")", "services", "=", "dict", "(", ")", "for", "raw_service", "in", "raw_services", ":", "if", "args", ":", "if", "raw_service", "[", "'DisplayName'", "]", "i...
The Display Name is what is displayed in Windows when services.msc is executed. Each Display Name has an associated Service Name which is the actual name of the service. This function allows you to discover the Service Name by returning a dictionary of Display Names and Service Names, or filter by add...
[ "The", "Display", "Name", "is", "what", "is", "displayed", "in", "Windows", "when", "services", ".", "msc", "is", "executed", ".", "Each", "Display", "Name", "has", "an", "associated", "Service", "Name", "which", "is", "the", "actual", "name", "of", "the",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L447-L482
train
This function returns a dictionary of Display Names and Service Names.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
info
def info(name): ''' Get information about a service on the system Args: name (str): The name of the service. This is not the display name. Use ``get_service_name`` to find the service name. Returns: dict: A dictionary containing information about the service. CLI Examp...
python
def info(name): ''' Get information about a service on the system Args: name (str): The name of the service. This is not the display name. Use ``get_service_name`` to find the service name. Returns: dict: A dictionary containing information about the service. CLI Examp...
[ "def", "info", "(", "name", ")", ":", "try", ":", "handle_scm", "=", "win32service", ".", "OpenSCManager", "(", "None", ",", "None", ",", "win32service", ".", "SC_MANAGER_CONNECT", ")", "except", "pywintypes", ".", "error", "as", "exc", ":", "raise", "Comm...
Get information about a service on the system Args: name (str): The name of the service. This is not the display name. Use ``get_service_name`` to find the service name. Returns: dict: A dictionary containing information about the service. CLI Example: .. code-block:: bas...
[ "Get", "information", "about", "a", "service", "on", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L485-L591
train
Get information about a service on the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
start
def start(name, timeout=90, with_deps=False, with_parents=False): ''' Start the specified service. .. warning:: You cannot start a disabled service in Windows. If the service is disabled, it will be changed to ``Manual`` start. Args: name (str): The name of the service to start...
python
def start(name, timeout=90, with_deps=False, with_parents=False): ''' Start the specified service. .. warning:: You cannot start a disabled service in Windows. If the service is disabled, it will be changed to ``Manual`` start. Args: name (str): The name of the service to start...
[ "def", "start", "(", "name", ",", "timeout", "=", "90", ",", "with_deps", "=", "False", ",", "with_parents", "=", "False", ")", ":", "# Set the service to manual if disabled", "if", "disabled", "(", "name", ")", ":", "modify", "(", "name", ",", "start_type",...
Start the specified service. .. warning:: You cannot start a disabled service in Windows. If the service is disabled, it will be changed to ``Manual`` start. Args: name (str): The name of the service to start timeout (int): The time in seconds to wait for the servi...
[ "Start", "the", "specified", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L594-L653
train
Start a service in the specified language.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
stop
def stop(name, timeout=90, with_deps=False, with_parents=False): ''' Stop the specified service Args: name (str): The name of the service to stop timeout (int): The time in seconds to wait for the service to stop before returning. Default is 90 seconds ...
python
def stop(name, timeout=90, with_deps=False, with_parents=False): ''' Stop the specified service Args: name (str): The name of the service to stop timeout (int): The time in seconds to wait for the service to stop before returning. Default is 90 seconds ...
[ "def", "stop", "(", "name", ",", "timeout", "=", "90", ",", "with_deps", "=", "False", ",", "with_parents", "=", "False", ")", ":", "ret", "=", "set", "(", ")", "services", "=", "ServiceDependencies", "(", "name", ",", "get_all", ",", "info", ")", "s...
Stop the specified service Args: name (str): The name of the service to stop timeout (int): The time in seconds to wait for the service to stop before returning. Default is 90 seconds .. versionadded:: 2017.7.9,2018.3.4 with_deps (bool): If...
[ "Stop", "the", "specified", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L656-L708
train
Stop a service in the specified language.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
restart
def restart(name, timeout=90, with_deps=False, with_parents=False): ''' Restart the named service. This issues a stop command followed by a start. Args: name: The name of the service to restart. .. note:: If the name passed is ``salt-minion`` a scheduled task is ...
python
def restart(name, timeout=90, with_deps=False, with_parents=False): ''' Restart the named service. This issues a stop command followed by a start. Args: name: The name of the service to restart. .. note:: If the name passed is ``salt-minion`` a scheduled task is ...
[ "def", "restart", "(", "name", ",", "timeout", "=", "90", ",", "with_deps", "=", "False", ",", "with_parents", "=", "False", ")", ":", "if", "'salt-minion'", "in", "name", ":", "create_win_salt_restart_task", "(", ")", "return", "execute_salt_restart_task", "(...
Restart the named service. This issues a stop command followed by a start. Args: name: The name of the service to restart. .. note:: If the name passed is ``salt-minion`` a scheduled task is created and executed to restart the salt-minion service. timeo...
[ "Restart", "the", "named", "service", ".", "This", "issues", "a", "stop", "command", "followed", "by", "a", "start", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L711-L760
train
Restarts the named service.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
create_win_salt_restart_task
def create_win_salt_restart_task(): ''' Create a task in Windows task scheduler to enable restarting the salt-minion Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' service.create_win_salt_restart_task() ''' cmd = 'cmd...
python
def create_win_salt_restart_task(): ''' Create a task in Windows task scheduler to enable restarting the salt-minion Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' service.create_win_salt_restart_task() ''' cmd = 'cmd...
[ "def", "create_win_salt_restart_task", "(", ")", ":", "cmd", "=", "'cmd'", "args", "=", "'/c ping -n 3 127.0.0.1 && net stop salt-minion && net start '", "'salt-minion'", "return", "__salt__", "[", "'task.create_task'", "]", "(", "name", "=", "'restart-salt-minion'", ",", ...
Create a task in Windows task scheduler to enable restarting the salt-minion Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' service.create_win_salt_restart_task()
[ "Create", "a", "task", "in", "Windows", "task", "scheduler", "to", "enable", "restarting", "the", "salt", "-", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L763-L787
train
Create a task in Windows task scheduler to enable restarting the salt - minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
status
def status(name, *args, **kwargs): ''' Return the status for a service. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of th...
python
def status(name, *args, **kwargs): ''' Return the status for a service. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of th...
[ "def", "status", "(", "name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "results", "=", "{", "}", "all_services", "=", "get_all", "(", ")", "contains_globbing", "=", "bool", "(", "re", ".", "search", "(", "r'\\*|\\?|\\[.+\\]'", ",", "name", ...
Return the status for a service. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the service to check Returns: bool: ...
[ "Return", "the", "status", "for", "a", "service", ".", "If", "the", "name", "contains", "globbing", "a", "dict", "mapping", "service", "name", "to", "True", "/", "False", "values", "is", "returned", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L806-L840
train
Return the status for a service.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
modify
def modify(name, bin_path=None, exe_args=None, display_name=None, description=None, service_type=None, start_type=None, start_delayed=None, error_control=None, load_order_group=None, dependencies=None, ...
python
def modify(name, bin_path=None, exe_args=None, display_name=None, description=None, service_type=None, start_type=None, start_delayed=None, error_control=None, load_order_group=None, dependencies=None, ...
[ "def", "modify", "(", "name", ",", "bin_path", "=", "None", ",", "exe_args", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ",", "service_type", "=", "None", ",", "start_type", "=", "None", ",", "start_delayed", "=", "Non...
Modify a service's parameters. Changes will not be made for parameters that are not passed. .. versionadded:: 2016.11.0 Args: name (str): The name of the service. Can be found using the ``service.get_service_name`` function bin_path (str): The path to t...
[ "Modify", "a", "service", "s", "parameters", ".", "Changes", "will", "not", "be", "made", "for", "parameters", "that", "are", "not", "passed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L862-L1100
train
Modify a service s parameters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
enable
def enable(name, start_type='auto', start_delayed=False, **kwargs): ''' Enable the named service to start at boot Args: name (str): The name of the service to enable. start_type (str): Specifies the service start type. Valid options are as follows: - boot: Device d...
python
def enable(name, start_type='auto', start_delayed=False, **kwargs): ''' Enable the named service to start at boot Args: name (str): The name of the service to enable. start_type (str): Specifies the service start type. Valid options are as follows: - boot: Device d...
[ "def", "enable", "(", "name", ",", "start_type", "=", "'auto'", ",", "start_delayed", "=", "False", ",", "*", "*", "kwargs", ")", ":", "modify", "(", "name", ",", "start_type", "=", "start_type", ",", "start_delayed", "=", "start_delayed", ")", "svcstat", ...
Enable the named service to start at boot Args: name (str): The name of the service to enable. start_type (str): Specifies the service start type. Valid options are as follows: - boot: Device driver that is loaded by the boot loader - system: Device driver that...
[ "Enable", "the", "named", "service", "to", "start", "at", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L1103-L1139
train
Enable the named service to start at boot
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
create
def create(name, bin_path, exe_args=None, display_name=None, description=None, service_type='own', start_type='manual', start_delayed=False, error_control='normal', load_order_group=None, dependencies=None, ...
python
def create(name, bin_path, exe_args=None, display_name=None, description=None, service_type='own', start_type='manual', start_delayed=False, error_control='normal', load_order_group=None, dependencies=None, ...
[ "def", "create", "(", "name", ",", "bin_path", ",", "exe_args", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ",", "service_type", "=", "'own'", ",", "start_type", "=", "'manual'", ",", "start_delayed", "=", "False", ",", ...
Create the named service. .. versionadded:: 2015.8.0 Args: name (str): Specifies the service name. This is not the display_name bin_path (str): Specifies the path to the service binary file. Backslashes must be escaped, eg: ``C:\\path\\to\\binary.exe`` ...
[ "Create", "the", "named", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L1200-L1391
train
Create a new service in the service manager.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_service.py
delete
def delete(name, timeout=90): ''' Delete the named service Args: name (str): The name of the service to delete timeout (int): The time in seconds to wait for the service to be deleted before returning. This is necessary because a service must be stopped ...
python
def delete(name, timeout=90): ''' Delete the named service Args: name (str): The name of the service to delete timeout (int): The time in seconds to wait for the service to be deleted before returning. This is necessary because a service must be stopped ...
[ "def", "delete", "(", "name", ",", "timeout", "=", "90", ")", ":", "handle_scm", "=", "win32service", ".", "OpenSCManager", "(", "None", ",", "None", ",", "win32service", ".", "SC_MANAGER_CONNECT", ")", "try", ":", "handle_svc", "=", "win32service", ".", "...
Delete the named service Args: name (str): The name of the service to delete timeout (int): The time in seconds to wait for the service to be deleted before returning. This is necessary because a service must be stopped before it can be deleted. Default is 90 s...
[ "Delete", "the", "named", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_service.py#L1394-L1447
train
Delete the named service in the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_conn
def get_conn(): ''' Return a conn object for the passed VM data ''' driver = get_driver(Provider.CLOUDSTACK) verify_ssl_cert = config.get_cloud_config_value('verify_ssl_cert', get_configured_provider(), __opts__, default=True, search_global=False) ...
python
def get_conn(): ''' Return a conn object for the passed VM data ''' driver = get_driver(Provider.CLOUDSTACK) verify_ssl_cert = config.get_cloud_config_value('verify_ssl_cert', get_configured_provider(), __opts__, default=True, search_global=False) ...
[ "def", "get_conn", "(", ")", ":", "driver", "=", "get_driver", "(", "Provider", ".", "CLOUDSTACK", ")", "verify_ssl_cert", "=", "config", ".", "get_cloud_config_value", "(", "'verify_ssl_cert'", ",", "get_configured_provider", "(", ")", ",", "__opts__", ",", "de...
Return a conn object for the passed VM data
[ "Return", "a", "conn", "object", "for", "the", "passed", "VM", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L112-L156
train
Return a conn object for the passed VM data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_location
def get_location(conn, vm_): ''' Return the node location to use ''' locations = conn.list_locations() # Default to Dallas if not otherwise set loc = config.get_cloud_config_value('location', vm_, __opts__, default=2) for location in locations: if six.text_type(loc) in (six.text_type...
python
def get_location(conn, vm_): ''' Return the node location to use ''' locations = conn.list_locations() # Default to Dallas if not otherwise set loc = config.get_cloud_config_value('location', vm_, __opts__, default=2) for location in locations: if six.text_type(loc) in (six.text_type...
[ "def", "get_location", "(", "conn", ",", "vm_", ")", ":", "locations", "=", "conn", ".", "list_locations", "(", ")", "# Default to Dallas if not otherwise set", "loc", "=", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", ",", "__opts__", ...
Return the node location to use
[ "Return", "the", "node", "location", "to", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L159-L168
train
Return the node location to use
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_security_groups
def get_security_groups(conn, vm_): ''' Return a list of security groups to use, defaulting to ['default'] ''' securitygroup_enabled = config.get_cloud_config_value( 'securitygroup_enabled', vm_, __opts__, default=True ) if securitygroup_enabled: return config.get_cloud_config_va...
python
def get_security_groups(conn, vm_): ''' Return a list of security groups to use, defaulting to ['default'] ''' securitygroup_enabled = config.get_cloud_config_value( 'securitygroup_enabled', vm_, __opts__, default=True ) if securitygroup_enabled: return config.get_cloud_config_va...
[ "def", "get_security_groups", "(", "conn", ",", "vm_", ")", ":", "securitygroup_enabled", "=", "config", ".", "get_cloud_config_value", "(", "'securitygroup_enabled'", ",", "vm_", ",", "__opts__", ",", "default", "=", "True", ")", "if", "securitygroup_enabled", ":...
Return a list of security groups to use, defaulting to ['default']
[ "Return", "a", "list", "of", "security", "groups", "to", "use", "defaulting", "to", "[", "default", "]" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L171-L183
train
Return a list of security groups to use
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_keypair
def get_keypair(vm_): ''' Return the keypair to use ''' keypair = config.get_cloud_config_value('keypair', vm_, __opts__) if keypair: return keypair else: return False
python
def get_keypair(vm_): ''' Return the keypair to use ''' keypair = config.get_cloud_config_value('keypair', vm_, __opts__) if keypair: return keypair else: return False
[ "def", "get_keypair", "(", "vm_", ")", ":", "keypair", "=", "config", ".", "get_cloud_config_value", "(", "'keypair'", ",", "vm_", ",", "__opts__", ")", "if", "keypair", ":", "return", "keypair", "else", ":", "return", "False" ]
Return the keypair to use
[ "Return", "the", "keypair", "to", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L206-L215
train
Return the keypair to use
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_ip
def get_ip(data): ''' Return the IP address of the VM If the VM has public IP as defined by libcloud module then use it Otherwise try to extract the private IP and use that one. ''' try: ip = data.public_ips[0] except Exception: ip = data.private_ips[0] return ip
python
def get_ip(data): ''' Return the IP address of the VM If the VM has public IP as defined by libcloud module then use it Otherwise try to extract the private IP and use that one. ''' try: ip = data.public_ips[0] except Exception: ip = data.private_ips[0] return ip
[ "def", "get_ip", "(", "data", ")", ":", "try", ":", "ip", "=", "data", ".", "public_ips", "[", "0", "]", "except", "Exception", ":", "ip", "=", "data", ".", "private_ips", "[", "0", "]", "return", "ip" ]
Return the IP address of the VM If the VM has public IP as defined by libcloud module then use it Otherwise try to extract the private IP and use that one.
[ "Return", "the", "IP", "address", "of", "the", "VM", "If", "the", "VM", "has", "public", "IP", "as", "defined", "by", "libcloud", "module", "then", "use", "it", "Otherwise", "try", "to", "extract", "the", "private", "IP", "and", "use", "that", "one", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L218-L228
train
Get the IP address of the VM
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_networkid
def get_networkid(vm_): ''' Return the networkid to use, only valid for Advanced Zone ''' networkid = config.get_cloud_config_value('networkid', vm_, __opts__) if networkid is not None: return networkid else: return False
python
def get_networkid(vm_): ''' Return the networkid to use, only valid for Advanced Zone ''' networkid = config.get_cloud_config_value('networkid', vm_, __opts__) if networkid is not None: return networkid else: return False
[ "def", "get_networkid", "(", "vm_", ")", ":", "networkid", "=", "config", ".", "get_cloud_config_value", "(", "'networkid'", ",", "vm_", ",", "__opts__", ")", "if", "networkid", "is", "not", "None", ":", "return", "networkid", "else", ":", "return", "False" ...
Return the networkid to use, only valid for Advanced Zone
[ "Return", "the", "networkid", "to", "use", "only", "valid", "for", "Advanced", "Zone" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L231-L240
train
Return the networkid to use only valid for Advanced Zone
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
get_project
def get_project(conn, vm_): ''' Return the project to use. ''' try: projects = conn.ex_list_projects() except AttributeError: # with versions <0.15 of libcloud this is causing an AttributeError. log.warning('Cannot get projects, you may need to update libcloud to 0.15 or late...
python
def get_project(conn, vm_): ''' Return the project to use. ''' try: projects = conn.ex_list_projects() except AttributeError: # with versions <0.15 of libcloud this is causing an AttributeError. log.warning('Cannot get projects, you may need to update libcloud to 0.15 or late...
[ "def", "get_project", "(", "conn", ",", "vm_", ")", ":", "try", ":", "projects", "=", "conn", ".", "ex_list_projects", "(", ")", "except", "AttributeError", ":", "# with versions <0.15 of libcloud this is causing an AttributeError.", "log", ".", "warning", "(", "'Ca...
Return the project to use.
[ "Return", "the", "project", "to", "use", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L243-L263
train
Return the project to use.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
create
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'clo...
python
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'clo...
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'cloud...
Create a single VM from a data dict
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L266-L431
train
Create a single VM from a data dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/cloudstack.py
destroy
def destroy(name, conn=None, call=None): ''' Delete a single VM, and all of its volumes ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( '...
python
def destroy(name, conn=None, call=None): ''' Delete a single VM, and all of its volumes ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( '...
[ "def", "destroy", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__"...
Delete a single VM, and all of its volumes
[ "Delete", "a", "single", "VM", "and", "all", "of", "its", "volumes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/cloudstack.py#L434-L525
train
Delete a single VM and all of its volumes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/sysrc.py
get
def get(**kwargs): ''' Return system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.get includeDefaults=True ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd += ' -j '+kwargs['jail...
python
def get(**kwargs): ''' Return system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.get includeDefaults=True ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd += ' -j '+kwargs['jail...
[ "def", "get", "(", "*", "*", "kwargs", ")", ":", "cmd", "=", "'sysrc -v'", "if", "'file'", "in", "kwargs", ":", "cmd", "+=", "' -f '", "+", "kwargs", "[", "'file'", "]", "if", "'jail'", "in", "kwargs", ":", "cmd", "+=", "' -j '", "+", "kwargs", "["...
Return system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.get includeDefaults=True
[ "Return", "system", "rc", "configuration", "variables" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysrc.py#L30-L74
train
Return system rc configuration variables
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/sysrc.py
set_
def set_(name, value, **kwargs): ''' Set system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.set name=sshd_flags value="-p 2222" ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd ...
python
def set_(name, value, **kwargs): ''' Set system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.set name=sshd_flags value="-p 2222" ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd ...
[ "def", "set_", "(", "name", ",", "value", ",", "*", "*", "kwargs", ")", ":", "cmd", "=", "'sysrc -v'", "if", "'file'", "in", "kwargs", ":", "cmd", "+=", "' -f '", "+", "kwargs", "[", "'file'", "]", "if", "'jail'", "in", "kwargs", ":", "cmd", "+=", ...
Set system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.set name=sshd_flags value="-p 2222"
[ "Set", "system", "rc", "configuration", "variables" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysrc.py#L77-L123
train
Set system rc configuration variables
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/sysrc.py
remove
def remove(name, **kwargs): ''' Remove system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.remove name=sshd_enable ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd += ' -j '+kwar...
python
def remove(name, **kwargs): ''' Remove system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.remove name=sshd_enable ''' cmd = 'sysrc -v' if 'file' in kwargs: cmd += ' -f '+kwargs['file'] if 'jail' in kwargs: cmd += ' -j '+kwar...
[ "def", "remove", "(", "name", ",", "*", "*", "kwargs", ")", ":", "cmd", "=", "'sysrc -v'", "if", "'file'", "in", "kwargs", ":", "cmd", "+=", "' -f '", "+", "kwargs", "[", "'file'", "]", "if", "'jail'", "in", "kwargs", ":", "cmd", "+=", "' -j '", "+...
Remove system rc configuration variables CLI Example: .. code-block:: bash salt '*' sysrc.remove name=sshd_enable
[ "Remove", "system", "rc", "configuration", "variables" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysrc.py#L126-L151
train
Remove system rc configuration variables
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/dimensiondata.py
create
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured( __opts__, __active_provider_name__ or 'dimensiondata', ...
python
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured( __opts__, __active_provider_name__ or 'dimensiondata', ...
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'dimen...
Create a single VM from a data dict
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/dimensiondata.py#L193-L346
train
Create a single VM from a data dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/dimensiondata.py
create_lb
def create_lb(kwargs=None, call=None): r''' Create a load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f create_lb dimensiondata \ name=dev-lb port=80 protocol=http \ members=w1,w2,w3 algorithm=ROUND_ROBIN ''' conn = get_conn() if ca...
python
def create_lb(kwargs=None, call=None): r''' Create a load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f create_lb dimensiondata \ name=dev-lb port=80 protocol=http \ members=w1,w2,w3 algorithm=ROUND_ROBIN ''' conn = get_conn() if ca...
[ "def", "create_lb", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "conn", "=", "get_conn", "(", ")", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_lb function must be called with -f or --function.'", ")"...
r''' Create a load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f create_lb dimensiondata \ name=dev-lb port=80 protocol=http \ members=w1,w2,w3 algorithm=ROUND_ROBIN
[ "r", "Create", "a", "load", "-", "balancer", "configuration", ".", "CLI", "Example", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/dimensiondata.py#L349-L441
train
r Creates a load - balancer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/dimensiondata.py
stop
def stop(name, call=None): ''' Stop a VM in DimensionData. name: The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name ''' conn = get_conn() node = get_node(conn, name) # pylint: disable=not-callable log.debug('Node of Cloud VM:...
python
def stop(name, call=None): ''' Stop a VM in DimensionData. name: The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name ''' conn = get_conn() node = get_node(conn, name) # pylint: disable=not-callable log.debug('Node of Cloud VM:...
[ "def", "stop", "(", "name", ",", "call", "=", "None", ")", ":", "conn", "=", "get_conn", "(", ")", "node", "=", "get_node", "(", "conn", ",", "name", ")", "# pylint: disable=not-callable", "log", ".", "debug", "(", "'Node of Cloud VM: %s'", ",", "node", ...
Stop a VM in DimensionData. name: The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name
[ "Stop", "a", "VM", "in", "DimensionData", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/dimensiondata.py#L483-L503
train
Stop a VM in DimensionData.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...