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/states/file.py
managed
def managed(name, source=None, source_hash='', source_hash_name=None, keep_source=True, user=None, group=None, mode=None, attrs=None, template=None, makedirs=False, dir_mode=None, ...
python
def managed(name, source=None, source_hash='', source_hash_name=None, keep_source=True, user=None, group=None, mode=None, attrs=None, template=None, makedirs=False, dir_mode=None, ...
[ "def", "managed", "(", "name", ",", "source", "=", "None", ",", "source_hash", "=", "''", ",", "source_hash_name", "=", "None", ",", "keep_source", "=", "True", ",", "user", "=", "None", ",", "group", "=", "None", ",", "mode", "=", "None", ",", "attr...
r''' Manage a given file, this function allows for a file to be downloaded from the salt master and potentially run through a templating system. name The location of the file to manage, as an absolute path. source The source file to download to the minion, this source file can be ...
[ "r", "Manage", "a", "given", "file", "this", "function", "allows", "for", "a", "file", "to", "be", "downloaded", "from", "the", "salt", "master", "and", "potentially", "run", "through", "a", "templating", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L1945-L3062
train
r Manage a file from a Salt master and a 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/states/file.py
_get_recurse_set
def _get_recurse_set(recurse): ''' Converse *recurse* definition to a set of strings. Raises TypeError or ValueError when *recurse* has wrong structure. ''' if not recurse: return set() if not isinstance(recurse, list): raise TypeError('"recurse" must be formed as a list of stri...
python
def _get_recurse_set(recurse): ''' Converse *recurse* definition to a set of strings. Raises TypeError or ValueError when *recurse* has wrong structure. ''' if not recurse: return set() if not isinstance(recurse, list): raise TypeError('"recurse" must be formed as a list of stri...
[ "def", "_get_recurse_set", "(", "recurse", ")", ":", "if", "not", "recurse", ":", "return", "set", "(", ")", "if", "not", "isinstance", "(", "recurse", ",", "list", ")", ":", "raise", "TypeError", "(", "'\"recurse\" must be formed as a list of strings'", ")", ...
Converse *recurse* definition to a set of strings. Raises TypeError or ValueError when *recurse* has wrong structure.
[ "Converse", "*", "recurse", "*", "definition", "to", "a", "set", "of", "strings", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L3068-L3088
train
Returns a set of strings that can be used to search for the tree root.
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/file.py
_depth_limited_walk
def _depth_limited_walk(top, max_depth=None): ''' Walk the directory tree under root up till reaching max_depth. With max_depth=None (default), do not limit depth. ''' for root, dirs, files in salt.utils.path.os_walk(top): if max_depth is not None: rel_depth = root.count(os.path....
python
def _depth_limited_walk(top, max_depth=None): ''' Walk the directory tree under root up till reaching max_depth. With max_depth=None (default), do not limit depth. ''' for root, dirs, files in salt.utils.path.os_walk(top): if max_depth is not None: rel_depth = root.count(os.path....
[ "def", "_depth_limited_walk", "(", "top", ",", "max_depth", "=", "None", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "salt", ".", "utils", ".", "path", ".", "os_walk", "(", "top", ")", ":", "if", "max_depth", "is", "not", "None", ":", ...
Walk the directory tree under root up till reaching max_depth. With max_depth=None (default), do not limit depth.
[ "Walk", "the", "directory", "tree", "under", "root", "up", "till", "reaching", "max_depth", ".", "With", "max_depth", "=", "None", "(", "default", ")", "do", "not", "limit", "depth", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L3091-L3101
train
Walk the directory tree up till reaching max_depth.
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/file.py
directory
def directory(name, user=None, group=None, recurse=None, max_depth=None, dir_mode=None, file_mode=None, makedirs=False, clean=False, require=None, exclude_pat=None, f...
python
def directory(name, user=None, group=None, recurse=None, max_depth=None, dir_mode=None, file_mode=None, makedirs=False, clean=False, require=None, exclude_pat=None, f...
[ "def", "directory", "(", "name", ",", "user", "=", "None", ",", "group", "=", "None", ",", "recurse", "=", "None", ",", "max_depth", "=", "None", ",", "dir_mode", "=", "None", ",", "file_mode", "=", "None", ",", "makedirs", "=", "False", ",", "clean"...
r''' Ensure that a named directory is present and has the right perms name The location to create or manage a directory, as an absolute path user The user to own the directory; this defaults to the user salt is running as on the minion group The group ownership set for...
[ "r", "Ensure", "that", "a", "named", "directory", "is", "present", "and", "has", "the", "right", "perms" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L3104-L3638
train
r Creates a new directory with the specified name user group and recurse.
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/file.py
recurse
def recurse(name, source, keep_source=True, clean=False, require=None, user=None, group=None, dir_mode=None, file_mode=None, sym_mode=None, template=None, context=None, replace...
python
def recurse(name, source, keep_source=True, clean=False, require=None, user=None, group=None, dir_mode=None, file_mode=None, sym_mode=None, template=None, context=None, replace...
[ "def", "recurse", "(", "name", ",", "source", ",", "keep_source", "=", "True", ",", "clean", "=", "False", ",", "require", "=", "None", ",", "user", "=", "None", ",", "group", "=", "None", ",", "dir_mode", "=", "None", ",", "file_mode", "=", "None", ...
Recurse through a subdirectory on the master and copy said subdirectory over to the specified path. name The directory to set the recursion in source The source directory, this directory is located on the salt master file server and is specified with the salt:// protocol. If the di...
[ "Recurse", "through", "a", "subdirectory", "on", "the", "master", "and", "copy", "said", "subdirectory", "over", "to", "the", "specified", "path", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L3641-L4111
train
This function recursively copies the source file into a subdirectory of the master 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/states/file.py
retention_schedule
def retention_schedule(name, retain, strptime_format=None, timezone=None): ''' Apply retention scheduling to backup storage directory. .. versionadded:: 2016.11.0 :param name: The filesystem path to the directory containing backups to be managed. :param retain: Delete the backups,...
python
def retention_schedule(name, retain, strptime_format=None, timezone=None): ''' Apply retention scheduling to backup storage directory. .. versionadded:: 2016.11.0 :param name: The filesystem path to the directory containing backups to be managed. :param retain: Delete the backups,...
[ "def", "retention_schedule", "(", "name", ",", "retain", ",", "strptime_format", "=", "None", ",", "timezone", "=", "None", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'...
Apply retention scheduling to backup storage directory. .. versionadded:: 2016.11.0 :param name: The filesystem path to the directory containing backups to be managed. :param retain: Delete the backups, except for the ones we want to keep. The N below should be an integer but may ...
[ "Apply", "retention", "scheduling", "to", "backup", "storage", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L4114-L4303
train
This function applies the retention scheduling to the backup storage 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/states/file.py
line
def line(name, content=None, match=None, mode=None, location=None, before=None, after=None, show_changes=True, backup=False, quiet=False, indent=True, create=False, user=None, group=None, file_mode=None): ''' Line-based editing of a file. .. versionadded:: 2015.8.0 :param na...
python
def line(name, content=None, match=None, mode=None, location=None, before=None, after=None, show_changes=True, backup=False, quiet=False, indent=True, create=False, user=None, group=None, file_mode=None): ''' Line-based editing of a file. .. versionadded:: 2015.8.0 :param na...
[ "def", "line", "(", "name", ",", "content", "=", "None", ",", "match", "=", "None", ",", "mode", "=", "None", ",", "location", "=", "None", ",", "before", "=", "None", ",", "after", "=", "None", ",", "show_changes", "=", "True", ",", "backup", "=",...
Line-based editing of a file. .. versionadded:: 2015.8.0 :param name: Filesystem path to the file to be edited. :param content: Content of the line. Allowed to be empty if mode=delete. :param match: Match the target line for an action by a fragment of a string or regu...
[ "Line", "-", "based", "editing", "of", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L4306-L4475
train
Edit a line in 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/states/file.py
replace
def replace(name, pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, backup='.bak', show_changes=True, ignore_if_mis...
python
def replace(name, pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, backup='.bak', show_changes=True, ignore_if_mis...
[ "def", "replace", "(", "name", ",", "pattern", ",", "repl", ",", "count", "=", "0", ",", "flags", "=", "8", ",", "bufsize", "=", "1", ",", "append_if_not_found", "=", "False", ",", "prepend_if_not_found", "=", "False", ",", "not_found_content", "=", "Non...
r''' Maintain an edit in a file. .. versionadded:: 0.17.0 name Filesystem path to the file to be edited. If a symlink is specified, it will be resolved to its target. pattern A regular expression, to be matched using Python's :py:func:`re.search`. .. note:: ...
[ "r", "Maintain", "an", "edit", "in", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L4478-L4676
train
r Replaces the contents of a file with a new version 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/states/file.py
keyvalue
def keyvalue( name, key=None, value=None, key_values=None, separator="=", append_if_not_found=False, prepend_if_not_found=False, search_only=False, show_changes=True, ignore_if_missing=False, count=1, uncomment=None, ...
python
def keyvalue( name, key=None, value=None, key_values=None, separator="=", append_if_not_found=False, prepend_if_not_found=False, search_only=False, show_changes=True, ignore_if_missing=False, count=1, uncomment=None, ...
[ "def", "keyvalue", "(", "name", ",", "key", "=", "None", ",", "value", "=", "None", ",", "key_values", "=", "None", ",", "separator", "=", "\"=\"", ",", "append_if_not_found", "=", "False", ",", "prepend_if_not_found", "=", "False", ",", "search_only", "="...
Key/Value based editing of a file. .. versionadded:: Neon This function differs from ``file.replace`` in that it is able to search for keys, followed by a customizable separator, and replace the value with the given value. Should the value be the same as the one already in the file, no changes wil...
[ "Key", "/", "Value", "based", "editing", "of", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L4679-L5036
train
This function returns a key value based editing 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/states/file.py
blockreplace
def blockreplace( name, marker_start='#-- start managed zone --', marker_end='#-- end managed zone --', source=None, source_hash=None, template='jinja', sources=None, source_hashes=None, defaults=None, context=None, content='', ...
python
def blockreplace( name, marker_start='#-- start managed zone --', marker_end='#-- end managed zone --', source=None, source_hash=None, template='jinja', sources=None, source_hashes=None, defaults=None, context=None, content='', ...
[ "def", "blockreplace", "(", "name", ",", "marker_start", "=", "'#-- start managed zone --'", ",", "marker_end", "=", "'#-- end managed zone --'", ",", "source", "=", "None", ",", "source_hash", "=", "None", ",", "template", "=", "'jinja'", ",", "sources", "=", "...
Maintain an edit in a file in a zone delimited by two line markers .. versionadded:: 2014.1.0 .. versionchanged:: 2017.7.5,2018.3.1 ``append_newline`` argument added. Additionally, to improve idempotence, if the string represented by ``marker_end`` is found in the middle of the line, th...
[ "Maintain", "an", "edit", "in", "a", "file", "in", "a", "zone", "delimited", "by", "two", "line", "markers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L5039-L5352
train
Replace the contents of a file in a managed zone with a new version.
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/file.py
comment
def comment(name, regex, char='#', backup='.bak'): ''' Comment out specified lines in a file. name The full path to the file to be edited regex A regular expression used to find the lines that are to be commented; this pattern will be wrapped in parenthesis and will move any ...
python
def comment(name, regex, char='#', backup='.bak'): ''' Comment out specified lines in a file. name The full path to the file to be edited regex A regular expression used to find the lines that are to be commented; this pattern will be wrapped in parenthesis and will move any ...
[ "def", "comment", "(", "name", ",", "regex", ",", "char", "=", "'#'", ",", "backup", "=", "'.bak'", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{",...
Comment out specified lines in a file. name The full path to the file to be edited regex A regular expression used to find the lines that are to be commented; this pattern will be wrapped in parenthesis and will move any preceding/trailing ``^`` or ``$`` characters outside the p...
[ "Comment", "out", "specified", "lines", "in", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L5355-L5456
train
Comment out specified lines in 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/states/file.py
uncomment
def uncomment(name, regex, char='#', backup='.bak'): ''' Uncomment specified commented lines in a file name The full path to the file to be edited regex A regular expression used to find the lines that are to be uncommented. This regex should not include the comment character. A...
python
def uncomment(name, regex, char='#', backup='.bak'): ''' Uncomment specified commented lines in a file name The full path to the file to be edited regex A regular expression used to find the lines that are to be uncommented. This regex should not include the comment character. A...
[ "def", "uncomment", "(", "name", ",", "regex", ",", "char", "=", "'#'", ",", "backup", "=", "'.bak'", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{...
Uncomment specified commented lines in a file name The full path to the file to be edited regex A regular expression used to find the lines that are to be uncommented. This regex should not include the comment character. A leading ``^`` character will be stripped for convenience...
[ "Uncomment", "specified", "commented", "lines", "in", "a", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L5459-L5561
train
Uncomment specified commented lines in 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/states/file.py
append
def append(name, text=None, makedirs=False, source=None, source_hash=None, template='jinja', sources=None, source_hashes=None, defaults=None, context=None, ignore_whitespace=True): ''' Ensure that some ...
python
def append(name, text=None, makedirs=False, source=None, source_hash=None, template='jinja', sources=None, source_hashes=None, defaults=None, context=None, ignore_whitespace=True): ''' Ensure that some ...
[ "def", "append", "(", "name", ",", "text", "=", "None", ",", "makedirs", "=", "False", ",", "source", "=", "None", ",", "source_hash", "=", "None", ",", "template", "=", "'jinja'", ",", "sources", "=", "None", ",", "source_hashes", "=", "None", ",", ...
Ensure that some text appears at the end of a file. The text will not be appended if it already exists in the file. A single string of text or a list of strings may be appended. name The location of the file to append to. text The text to be appended, which can be a single string or a...
[ "Ensure", "that", "some", "text", "appears", "at", "the", "end", "of", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L5564-L5836
train
Append a new entry to the end 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/states/file.py
patch
def patch(name, source=None, source_hash=None, source_hash_name=None, skip_verify=False, template=None, context=None, defaults=None, options='', reject_file=None, strip=None, saltenv=None, **kwargs): ...
python
def patch(name, source=None, source_hash=None, source_hash_name=None, skip_verify=False, template=None, context=None, defaults=None, options='', reject_file=None, strip=None, saltenv=None, **kwargs): ...
[ "def", "patch", "(", "name", ",", "source", "=", "None", ",", "source_hash", "=", "None", ",", "source_hash_name", "=", "None", ",", "skip_verify", "=", "False", ",", "template", "=", "None", ",", "context", "=", "None", ",", "defaults", "=", "None", "...
Ensure that a patch has been applied to the specified file or directory .. versionchanged:: 2019.2.0 The ``hash`` and ``dry_run_first`` options are now ignored, as the logic which determines whether or not the patch has already been applied no longer requires them. Additionally, this state ...
[ "Ensure", "that", "a", "patch", "has", "been", "applied", "to", "the", "specified", "file", "or", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L6145-L6566
train
This state performs a patch on the specified file or 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/states/file.py
touch
def touch(name, atime=None, mtime=None, makedirs=False): ''' Replicate the 'nix "touch" command to create a new empty file or update the atime and mtime of an existing file. Note that if you just want to create a file and don't care about atime or mtime, you should use ``file.managed`` instead, as ...
python
def touch(name, atime=None, mtime=None, makedirs=False): ''' Replicate the 'nix "touch" command to create a new empty file or update the atime and mtime of an existing file. Note that if you just want to create a file and don't care about atime or mtime, you should use ``file.managed`` instead, as ...
[ "def", "touch", "(", "name", ",", "atime", "=", "None", ",", "mtime", "=", "None", ",", "makedirs", "=", "False", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'change...
Replicate the 'nix "touch" command to create a new empty file or update the atime and mtime of an existing file. Note that if you just want to create a file and don't care about atime or mtime, you should use ``file.managed`` instead, as it is more feature-complete. (Just leave out the ``source``/``te...
[ "Replicate", "the", "nix", "touch", "command", "to", "create", "a", "new", "empty", "file", "or", "update", "the", "atime", "and", "mtime", "of", "an", "existing", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L6569-L6641
train
Create a new empty file or update the atime and mtime of an existing 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/states/file.py
copy_
def copy_(name, source, force=False, makedirs=False, preserve=False, user=None, group=None, mode=None, subdir=False, **kwargs): ''' If the file defined by the ``source`` option exists on the minion, copy it to the name...
python
def copy_(name, source, force=False, makedirs=False, preserve=False, user=None, group=None, mode=None, subdir=False, **kwargs): ''' If the file defined by the ``source`` option exists on the minion, copy it to the name...
[ "def", "copy_", "(", "name", ",", "source", ",", "force", "=", "False", ",", "makedirs", "=", "False", ",", "preserve", "=", "False", ",", "user", "=", "None", ",", "group", "=", "None", ",", "mode", "=", "None", ",", "subdir", "=", "False", ",", ...
If the file defined by the ``source`` option exists on the minion, copy it to the named path. The file will not be overwritten if it already exists, unless the ``force`` option is set to ``True``. .. note:: This state only copies files from one location on a minion to another location on th...
[ "If", "the", "file", "defined", "by", "the", "source", "option", "exists", "on", "the", "minion", "copy", "it", "to", "the", "named", "path", ".", "The", "file", "will", "not", "be", "overwritten", "if", "it", "already", "exists", "unless", "the", "force...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L6644-L6849
train
Copy a file from one location to another 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/states/file.py
rename
def rename(name, source, force=False, makedirs=False, **kwargs): ''' If the source file exists on the system, rename it to the named file. The named file will not be overwritten if it already exists unless the force option is set to True. name The location of the file to rename to sour...
python
def rename(name, source, force=False, makedirs=False, **kwargs): ''' If the source file exists on the system, rename it to the named file. The named file will not be overwritten if it already exists unless the force option is set to True. name The location of the file to rename to sour...
[ "def", "rename", "(", "name", ",", "source", ",", "force", "=", "False", ",", "makedirs", "=", "False", ",", "*", "*", "kwargs", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name", ")", "source", "=", "os", ".", "path", ".",...
If the source file exists on the system, rename it to the named file. The named file will not be overwritten if it already exists unless the force option is set to True. name The location of the file to rename to source The location of the file to move to the location specified with na...
[ "If", "the", "source", "file", "exists", "on", "the", "system", "rename", "it", "to", "the", "named", "file", ".", "The", "named", "file", "will", "not", "be", "overwritten", "if", "it", "already", "exists", "unless", "the", "force", "option", "is", "set...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L6852-L6942
train
Rename a file 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/states/file.py
accumulated
def accumulated(name, filename, text, **kwargs): ''' Prepare accumulator which can be used in template in file.managed state. Accumulator dictionary becomes available in template. It can also be used in file.blockreplace. name Accumulator name filename Filename which would rece...
python
def accumulated(name, filename, text, **kwargs): ''' Prepare accumulator which can be used in template in file.managed state. Accumulator dictionary becomes available in template. It can also be used in file.blockreplace. name Accumulator name filename Filename which would rece...
[ "def", "accumulated", "(", "name", ",", "filename", ",", "text", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "if", "no...
Prepare accumulator which can be used in template in file.managed state. Accumulator dictionary becomes available in template. It can also be used in file.blockreplace. name Accumulator name filename Filename which would receive this accumulator (see file.managed state document...
[ "Prepare", "accumulator", "which", "can", "be", "used", "in", "template", "in", "file", ".", "managed", "state", ".", "Accumulator", "dictionary", "becomes", "available", "in", "template", ".", "It", "can", "also", "be", "used", "in", "file", ".", "blockrepl...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L6945-L7046
train
Return a dictionary that can be used in template in file. managed state.
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/file.py
serialize
def serialize(name, dataset=None, dataset_pillar=None, user=None, group=None, mode=None, backup='', makedirs=False, show_changes=True, create=True, merge_if_exists=False, ...
python
def serialize(name, dataset=None, dataset_pillar=None, user=None, group=None, mode=None, backup='', makedirs=False, show_changes=True, create=True, merge_if_exists=False, ...
[ "def", "serialize", "(", "name", ",", "dataset", "=", "None", ",", "dataset_pillar", "=", "None", ",", "user", "=", "None", ",", "group", "=", "None", ",", "mode", "=", "None", ",", "backup", "=", "''", ",", "makedirs", "=", "False", ",", "show_chang...
Serializes dataset and store it into managed file. Useful for sharing simple configuration files. name The location of the file to create dataset The dataset that will be serialized dataset_pillar Operates like ``dataset``, but draws from a value stored in pillar, usin...
[ "Serializes", "dataset", "and", "store", "it", "into", "managed", "file", ".", "Useful", "for", "sharing", "simple", "configuration", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L7049-L7426
train
Serializes a single entry into a managed 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/states/file.py
mknod
def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode='0600'): ''' Create a special file similar to the 'nix mknod command. The supported device types are ``p`` (fifo pipe), ``c`` (character device), and ``b`` (block device). Provide the major and minor numbers when specifying a chara...
python
def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode='0600'): ''' Create a special file similar to the 'nix mknod command. The supported device types are ``p`` (fifo pipe), ``c`` (character device), and ``b`` (block device). Provide the major and minor numbers when specifying a chara...
[ "def", "mknod", "(", "name", ",", "ntype", ",", "major", "=", "0", ",", "minor", "=", "0", ",", "user", "=", "None", ",", "group", "=", "None", ",", "mode", "=", "'0600'", ")", ":", "name", "=", "os", ".", "path", ".", "expanduser", "(", "name"...
Create a special file similar to the 'nix mknod command. The supported device types are ``p`` (fifo pipe), ``c`` (character device), and ``b`` (block device). Provide the major and minor numbers when specifying a character device or block device. A fifo pipe does not require this information. The comman...
[ "Create", "a", "special", "file", "similar", "to", "the", "nix", "mknod", "command", ".", "The", "supported", "device", "types", "are", "p", "(", "fifo", "pipe", ")", "c", "(", "character", "device", ")", "and", "b", "(", "block", "device", ")", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L7429-L7640
train
Create a special file that is a root node of the specified type.
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/file.py
mod_run_check_cmd
def mod_run_check_cmd(cmd, filename, **check_cmd_opts): ''' Execute the check_cmd logic. Return a result dict if ``check_cmd`` succeeds (check_cmd == 0) otherwise return True ''' log.debug('running our check_cmd') _cmd = '{0} {1}'.format(cmd, filename) cret = __salt__['cmd.run_all'](_c...
python
def mod_run_check_cmd(cmd, filename, **check_cmd_opts): ''' Execute the check_cmd logic. Return a result dict if ``check_cmd`` succeeds (check_cmd == 0) otherwise return True ''' log.debug('running our check_cmd') _cmd = '{0} {1}'.format(cmd, filename) cret = __salt__['cmd.run_all'](_c...
[ "def", "mod_run_check_cmd", "(", "cmd", ",", "filename", ",", "*", "*", "check_cmd_opts", ")", ":", "log", ".", "debug", "(", "'running our check_cmd'", ")", "_cmd", "=", "'{0} {1}'", ".", "format", "(", "cmd", ",", "filename", ")", "cret", "=", "__salt__"...
Execute the check_cmd logic. Return a result dict if ``check_cmd`` succeeds (check_cmd == 0) otherwise return True
[ "Execute", "the", "check_cmd", "logic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L7643-L7667
train
Execute the check_cmd logic.
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/file.py
decode
def decode(name, encoded_data=None, contents_pillar=None, encoding_type='base64', checksum='md5'): ''' Decode an encoded file and write it to disk .. versionadded:: 2016.3.0 name Path of the file to be written. encoded_data The encoded file. Either t...
python
def decode(name, encoded_data=None, contents_pillar=None, encoding_type='base64', checksum='md5'): ''' Decode an encoded file and write it to disk .. versionadded:: 2016.3.0 name Path of the file to be written. encoded_data The encoded file. Either t...
[ "def", "decode", "(", "name", ",", "encoded_data", "=", "None", ",", "contents_pillar", "=", "None", ",", "encoding_type", "=", "'base64'", ",", "checksum", "=", "'md5'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}"...
Decode an encoded file and write it to disk .. versionadded:: 2016.3.0 name Path of the file to be written. encoded_data The encoded file. Either this option or ``contents_pillar`` must be specified. contents_pillar A Pillar path to the encoded file. Uses the same path ...
[ "Decode", "an", "encoded", "file", "and", "write", "it", "to", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L7670-L7779
train
Decode an encoded file and write it 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/states/file.py
shortcut
def shortcut( name, target, arguments=None, working_dir=None, description=None, icon_location=None, force=False, backupname=None, makedirs=False, user=None, **kwargs): ''' Create a Windows shortcut If the file already e...
python
def shortcut( name, target, arguments=None, working_dir=None, description=None, icon_location=None, force=False, backupname=None, makedirs=False, user=None, **kwargs): ''' Create a Windows shortcut If the file already e...
[ "def", "shortcut", "(", "name", ",", "target", ",", "arguments", "=", "None", ",", "working_dir", "=", "None", ",", "description", "=", "None", ",", "icon_location", "=", "None", ",", "force", "=", "False", ",", "backupname", "=", "None", ",", "makedirs"...
Create a Windows shortcut If the file already exists and is a shortcut pointing to any location other than the specified target, the shortcut will be replaced. If it is a regular file or directory then the state will return False. If the regular file or directory is desired to be replaced with a shortc...
[ "Create", "a", "Windows", "shortcut" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L7782-L8035
train
Create a Windows shortcut
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/file.py
cached
def cached(name, source_hash='', source_hash_name=None, skip_verify=False, saltenv='base'): ''' .. versionadded:: 2017.7.3 Ensures that a file is saved to the minion's cache. This state is primarily invoked by other states to ensure that we do not re-download...
python
def cached(name, source_hash='', source_hash_name=None, skip_verify=False, saltenv='base'): ''' .. versionadded:: 2017.7.3 Ensures that a file is saved to the minion's cache. This state is primarily invoked by other states to ensure that we do not re-download...
[ "def", "cached", "(", "name", ",", "source_hash", "=", "''", ",", "source_hash_name", "=", "None", ",", "skip_verify", "=", "False", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",...
.. versionadded:: 2017.7.3 Ensures that a file is saved to the minion's cache. This state is primarily invoked by other states to ensure that we do not re-download a source file if we do not need to. name The URL of the file to be cached. To cache a file from an environment other than ...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "3" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L8038-L8313
train
Return a copy of a file from the cache
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/file.py
not_cached
def not_cached(name, saltenv='base'): ''' .. versionadded:: 2017.7.3 Ensures that a file is not present in the minion's cache, deleting it if found. This state is primarily invoked by other states to ensure that a fresh copy is fetched. name The URL of the file to be removed from cache...
python
def not_cached(name, saltenv='base'): ''' .. versionadded:: 2017.7.3 Ensures that a file is not present in the minion's cache, deleting it if found. This state is primarily invoked by other states to ensure that a fresh copy is fetched. name The URL of the file to be removed from cache...
[ "def", "not_cached", "(", "name", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'name'", ":", "name", ",", "'result'", ":", "False", "}", "try", ":", "parsed", "=", "_urlpar...
.. versionadded:: 2017.7.3 Ensures that a file is not present in the minion's cache, deleting it if found. This state is primarily invoked by other states to ensure that a fresh copy is fetched. name The URL of the file to be removed from cache. To remove a file from cache in an enviro...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "3" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/file.py#L8316-L8375
train
Ensures that a file is not cached in the cache.
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/cloud.py
__render_script
def __render_script(path, vm_=None, opts=None, minion=''): ''' Return the rendered script ''' log.info('Rendering deploy script: %s', path) try: with salt.utils.files.fopen(path, 'r') as fp_: template = Template(salt.utils.stringutils.to_unicode(fp_.read())) return si...
python
def __render_script(path, vm_=None, opts=None, minion=''): ''' Return the rendered script ''' log.info('Rendering deploy script: %s', path) try: with salt.utils.files.fopen(path, 'r') as fp_: template = Template(salt.utils.stringutils.to_unicode(fp_.read())) return si...
[ "def", "__render_script", "(", "path", ",", "vm_", "=", "None", ",", "opts", "=", "None", ",", "minion", "=", "''", ")", ":", "log", ".", "info", "(", "'Rendering deploy script: %s'", ",", "path", ")", "try", ":", "with", "salt", ".", "utils", ".", "...
Return the rendered script
[ "Return", "the", "rendered", "script" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L128-L140
train
Render a script from 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/utils/cloud.py
__ssh_gateway_config_dict
def __ssh_gateway_config_dict(gateway): ''' Return a dictionary with gateway options. The result is used to provide arguments to __ssh_gateway_arguments method. ''' extended_kwargs = {} if gateway: extended_kwargs['ssh_gateway'] = gateway['ssh_gateway'] extended_kwargs['ssh_gatew...
python
def __ssh_gateway_config_dict(gateway): ''' Return a dictionary with gateway options. The result is used to provide arguments to __ssh_gateway_arguments method. ''' extended_kwargs = {} if gateway: extended_kwargs['ssh_gateway'] = gateway['ssh_gateway'] extended_kwargs['ssh_gatew...
[ "def", "__ssh_gateway_config_dict", "(", "gateway", ")", ":", "extended_kwargs", "=", "{", "}", "if", "gateway", ":", "extended_kwargs", "[", "'ssh_gateway'", "]", "=", "gateway", "[", "'ssh_gateway'", "]", "extended_kwargs", "[", "'ssh_gateway_key'", "]", "=", ...
Return a dictionary with gateway options. The result is used to provide arguments to __ssh_gateway_arguments method.
[ "Return", "a", "dictionary", "with", "gateway", "options", ".", "The", "result", "is", "used", "to", "provide", "arguments", "to", "__ssh_gateway_arguments", "method", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L143-L154
train
Return a dictionary with gateway options. The result is used to provide arguments to __ssh_gateway_arguments method.
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/cloud.py
__ssh_gateway_arguments
def __ssh_gateway_arguments(kwargs): ''' Return ProxyCommand configuration string for ssh/scp command. All gateway options should not include quotes (' or "). To support future user configuration, please make sure to update the dictionary from __ssh_gateway_config_dict and get_ssh_gateway_config (e...
python
def __ssh_gateway_arguments(kwargs): ''' Return ProxyCommand configuration string for ssh/scp command. All gateway options should not include quotes (' or "). To support future user configuration, please make sure to update the dictionary from __ssh_gateway_config_dict and get_ssh_gateway_config (e...
[ "def", "__ssh_gateway_arguments", "(", "kwargs", ")", ":", "extended_arguments", "=", "\"\"", "ssh_gateway", "=", "kwargs", ".", "get", "(", "'ssh_gateway'", ",", "''", ")", "ssh_gateway_port", "=", "22", "if", "':'", "in", "ssh_gateway", ":", "ssh_gateway", "...
Return ProxyCommand configuration string for ssh/scp command. All gateway options should not include quotes (' or "). To support future user configuration, please make sure to update the dictionary from __ssh_gateway_config_dict and get_ssh_gateway_config (ec2.py)
[ "Return", "ProxyCommand", "configuration", "string", "for", "ssh", "/", "scp", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L157-L198
train
Return the SSH command line for the SSH gateway.
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/cloud.py
os_script
def os_script(os_, vm_=None, opts=None, minion=''): ''' Return the script as a string for the specific os ''' if minion: minion = salt_config_to_yaml(minion) if os.path.isabs(os_): # The user provided an absolute path to the deploy script, let's use it return __render_script...
python
def os_script(os_, vm_=None, opts=None, minion=''): ''' Return the script as a string for the specific os ''' if minion: minion = salt_config_to_yaml(minion) if os.path.isabs(os_): # The user provided an absolute path to the deploy script, let's use it return __render_script...
[ "def", "os_script", "(", "os_", ",", "vm_", "=", "None", ",", "opts", "=", "None", ",", "minion", "=", "''", ")", ":", "if", "minion", ":", "minion", "=", "salt_config_to_yaml", "(", "minion", ")", "if", "os", ".", "path", ".", "isabs", "(", "os_",...
Return the script as a string for the specific os
[ "Return", "the", "script", "as", "a", "string", "for", "the", "specific", "os" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L208-L236
train
Return the script as a string for the specific os
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/cloud.py
gen_keys
def gen_keys(keysize=2048): ''' Generate Salt minion keys and return them as PEM file strings ''' # Mandate that keys are at least 2048 in size if keysize < 2048: keysize = 2048 tdir = tempfile.mkdtemp() salt.crypt.gen_keys(tdir, 'minion', keysize) priv_path = os.path.join(tdir,...
python
def gen_keys(keysize=2048): ''' Generate Salt minion keys and return them as PEM file strings ''' # Mandate that keys are at least 2048 in size if keysize < 2048: keysize = 2048 tdir = tempfile.mkdtemp() salt.crypt.gen_keys(tdir, 'minion', keysize) priv_path = os.path.join(tdir,...
[ "def", "gen_keys", "(", "keysize", "=", "2048", ")", ":", "# Mandate that keys are at least 2048 in size", "if", "keysize", "<", "2048", ":", "keysize", "=", "2048", "tdir", "=", "tempfile", ".", "mkdtemp", "(", ")", "salt", ".", "crypt", ".", "gen_keys", "(...
Generate Salt minion keys and return them as PEM file strings
[ "Generate", "Salt", "minion", "keys", "and", "return", "them", "as", "PEM", "file", "strings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L239-L256
train
Generate Salt minion keys and return them as PEM file strings
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/cloud.py
accept_key
def accept_key(pki_dir, pub, id_): ''' If the master config was available then we will have a pki_dir key in the opts directory, this method places the pub key in the accepted keys dir and removes it from the unaccepted keys dir if that is the case. ''' for key_dir in 'minions', 'minions_pre', '...
python
def accept_key(pki_dir, pub, id_): ''' If the master config was available then we will have a pki_dir key in the opts directory, this method places the pub key in the accepted keys dir and removes it from the unaccepted keys dir if that is the case. ''' for key_dir in 'minions', 'minions_pre', '...
[ "def", "accept_key", "(", "pki_dir", ",", "pub", ",", "id_", ")", ":", "for", "key_dir", "in", "'minions'", ",", "'minions_pre'", ",", "'minions_rejected'", ":", "key_path", "=", "os", ".", "path", ".", "join", "(", "pki_dir", ",", "key_dir", ")", "if", ...
If the master config was available then we will have a pki_dir key in the opts directory, this method places the pub key in the accepted keys dir and removes it from the unaccepted keys dir if that is the case.
[ "If", "the", "master", "config", "was", "available", "then", "we", "will", "have", "a", "pki_dir", "key", "in", "the", "opts", "directory", "this", "method", "places", "the", "pub", "key", "in", "the", "accepted", "keys", "dir", "and", "removes", "it", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L259-L278
train
Accept a key from the master config
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/cloud.py
remove_key
def remove_key(pki_dir, id_): ''' This method removes a specified key from the accepted keys dir ''' key = os.path.join(pki_dir, 'minions', id_) if os.path.isfile(key): os.remove(key) log.debug('Deleted \'%s\'', key)
python
def remove_key(pki_dir, id_): ''' This method removes a specified key from the accepted keys dir ''' key = os.path.join(pki_dir, 'minions', id_) if os.path.isfile(key): os.remove(key) log.debug('Deleted \'%s\'', key)
[ "def", "remove_key", "(", "pki_dir", ",", "id_", ")", ":", "key", "=", "os", ".", "path", ".", "join", "(", "pki_dir", ",", "'minions'", ",", "id_", ")", "if", "os", ".", "path", ".", "isfile", "(", "key", ")", ":", "os", ".", "remove", "(", "k...
This method removes a specified key from the accepted keys dir
[ "This", "method", "removes", "a", "specified", "key", "from", "the", "accepted", "keys", "dir" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L281-L288
train
This method removes a specified key from the accepted keys dir
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/cloud.py
rename_key
def rename_key(pki_dir, id_, new_id): ''' Rename a key, when an instance has also been renamed ''' oldkey = os.path.join(pki_dir, 'minions', id_) newkey = os.path.join(pki_dir, 'minions', new_id) if os.path.isfile(oldkey): os.rename(oldkey, newkey)
python
def rename_key(pki_dir, id_, new_id): ''' Rename a key, when an instance has also been renamed ''' oldkey = os.path.join(pki_dir, 'minions', id_) newkey = os.path.join(pki_dir, 'minions', new_id) if os.path.isfile(oldkey): os.rename(oldkey, newkey)
[ "def", "rename_key", "(", "pki_dir", ",", "id_", ",", "new_id", ")", ":", "oldkey", "=", "os", ".", "path", ".", "join", "(", "pki_dir", ",", "'minions'", ",", "id_", ")", "newkey", "=", "os", ".", "path", ".", "join", "(", "pki_dir", ",", "'minion...
Rename a key, when an instance has also been renamed
[ "Rename", "a", "key", "when", "an", "instance", "has", "also", "been", "renamed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L291-L298
train
Rename a key when an instance has also been renamed
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/cloud.py
minion_config
def minion_config(opts, vm_): ''' Return a minion's configuration for the provided options and VM ''' # Don't start with a copy of the default minion opts; they're not always # what we need. Some default options are Null, let's set a reasonable default minion = { 'master': 'salt', ...
python
def minion_config(opts, vm_): ''' Return a minion's configuration for the provided options and VM ''' # Don't start with a copy of the default minion opts; they're not always # what we need. Some default options are Null, let's set a reasonable default minion = { 'master': 'salt', ...
[ "def", "minion_config", "(", "opts", ",", "vm_", ")", ":", "# Don't start with a copy of the default minion opts; they're not always", "# what we need. Some default options are Null, let's set a reasonable default", "minion", "=", "{", "'master'", ":", "'salt'", ",", "'log_level'",...
Return a minion's configuration for the provided options and VM
[ "Return", "a", "minion", "s", "configuration", "for", "the", "provided", "options", "and", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L301-L344
train
Return a minion s configuration for the provided options and 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/utils/cloud.py
master_config
def master_config(opts, vm_): ''' Return a master's configuration for the provided options and VM ''' # Let's get a copy of the salt master default options master = copy.deepcopy(salt.config.DEFAULT_MASTER_OPTS) # Some default options are Null, let's set a reasonable default master.update( ...
python
def master_config(opts, vm_): ''' Return a master's configuration for the provided options and VM ''' # Let's get a copy of the salt master default options master = copy.deepcopy(salt.config.DEFAULT_MASTER_OPTS) # Some default options are Null, let's set a reasonable default master.update( ...
[ "def", "master_config", "(", "opts", ",", "vm_", ")", ":", "# Let's get a copy of the salt master default options", "master", "=", "copy", ".", "deepcopy", "(", "salt", ".", "config", ".", "DEFAULT_MASTER_OPTS", ")", "# Some default options are Null, let's set a reasonable ...
Return a master's configuration for the provided options and VM
[ "Return", "a", "master", "s", "configuration", "for", "the", "provided", "options", "and", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L347-L369
train
Return a master s configuration for the provided options and 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/utils/cloud.py
salt_config_to_yaml
def salt_config_to_yaml(configuration, line_break='\n'): ''' Return a salt configuration dictionary, master or minion, as a yaml dump ''' return salt.utils.yaml.safe_dump( configuration, line_break=line_break, default_flow_style=False)
python
def salt_config_to_yaml(configuration, line_break='\n'): ''' Return a salt configuration dictionary, master or minion, as a yaml dump ''' return salt.utils.yaml.safe_dump( configuration, line_break=line_break, default_flow_style=False)
[ "def", "salt_config_to_yaml", "(", "configuration", ",", "line_break", "=", "'\\n'", ")", ":", "return", "salt", ".", "utils", ".", "yaml", ".", "safe_dump", "(", "configuration", ",", "line_break", "=", "line_break", ",", "default_flow_style", "=", "False", "...
Return a salt configuration dictionary, master or minion, as a yaml dump
[ "Return", "a", "salt", "configuration", "dictionary", "master", "or", "minion", "as", "a", "yaml", "dump" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L372-L379
train
Return a salt configuration dictionary master or minion as a yaml dump
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/cloud.py
ssh_usernames
def ssh_usernames(vm_, opts, default_users=None): ''' Return the ssh_usernames. Defaults to a built-in list of users for trying. ''' if default_users is None: default_users = ['root'] usernames = salt.config.get_cloud_config_value( 'ssh_username', vm_, opts ) if not isinsta...
python
def ssh_usernames(vm_, opts, default_users=None): ''' Return the ssh_usernames. Defaults to a built-in list of users for trying. ''' if default_users is None: default_users = ['root'] usernames = salt.config.get_cloud_config_value( 'ssh_username', vm_, opts ) if not isinsta...
[ "def", "ssh_usernames", "(", "vm_", ",", "opts", ",", "default_users", "=", "None", ")", ":", "if", "default_users", "is", "None", ":", "default_users", "=", "[", "'root'", "]", "usernames", "=", "salt", ".", "config", ".", "get_cloud_config_value", "(", "...
Return the ssh_usernames. Defaults to a built-in list of users for trying.
[ "Return", "the", "ssh_usernames", ".", "Defaults", "to", "a", "built", "-", "in", "list", "of", "users", "for", "trying", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L671-L699
train
Return the ssh_usernames. Defaults to a built - in list of users for trying.
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/cloud.py
wait_for_fun
def wait_for_fun(fun, timeout=900, **kwargs): ''' Wait until a function finishes, or times out ''' start = time.time() log.debug('Attempting function %s', fun) trycount = 0 while True: trycount += 1 try: response = fun(**kwargs) if not isinstance(respo...
python
def wait_for_fun(fun, timeout=900, **kwargs): ''' Wait until a function finishes, or times out ''' start = time.time() log.debug('Attempting function %s', fun) trycount = 0 while True: trycount += 1 try: response = fun(**kwargs) if not isinstance(respo...
[ "def", "wait_for_fun", "(", "fun", ",", "timeout", "=", "900", ",", "*", "*", "kwargs", ")", ":", "start", "=", "time", ".", "time", "(", ")", "log", ".", "debug", "(", "'Attempting function %s'", ",", "fun", ")", "trycount", "=", "0", "while", "True...
Wait until a function finishes, or times out
[ "Wait", "until", "a", "function", "finishes", "or", "times", "out" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L702-L721
train
Wait until a function finishes or times out.
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/cloud.py
wait_for_port
def wait_for_port(host, port=22, timeout=900, gateway=None): ''' Wait until a connection to the specified port can be made on a specified host. This is usually port 22 (for SSH), but in the case of Windows installations, it might be port 445 (for psexec). It may also be an alternate port for SSH, de...
python
def wait_for_port(host, port=22, timeout=900, gateway=None): ''' Wait until a connection to the specified port can be made on a specified host. This is usually port 22 (for SSH), but in the case of Windows installations, it might be port 445 (for psexec). It may also be an alternate port for SSH, de...
[ "def", "wait_for_port", "(", "host", ",", "port", "=", "22", ",", "timeout", "=", "900", ",", "gateway", "=", "None", ")", ":", "start", "=", "time", ".", "time", "(", ")", "# Assign test ports because if a gateway is defined", "# we first want to test the gateway...
Wait until a connection to the specified port can be made on a specified host. This is usually port 22 (for SSH), but in the case of Windows installations, it might be port 445 (for psexec). It may also be an alternate port for SSH, depending on the base image.
[ "Wait", "until", "a", "connection", "to", "the", "specified", "port", "can", "be", "made", "on", "a", "specified", "host", ".", "This", "is", "usually", "port", "22", "(", "for", "SSH", ")", "but", "in", "the", "case", "of", "Windows", "installations", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L724-L860
train
Wait until a connection to the specified port is made on a specified host.
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/cloud.py
run_winexe_command
def run_winexe_command(cmd, args, host, username, password, port=445): ''' Run a command remotly via the winexe executable ''' creds = "-U '{0}%{1}' //{2}".format( username, password, host ) logging_creds = "-U '{0}%XXX-REDACTED-XXX' //{1}".format( username, ...
python
def run_winexe_command(cmd, args, host, username, password, port=445): ''' Run a command remotly via the winexe executable ''' creds = "-U '{0}%{1}' //{2}".format( username, password, host ) logging_creds = "-U '{0}%XXX-REDACTED-XXX' //{1}".format( username, ...
[ "def", "run_winexe_command", "(", "cmd", ",", "args", ",", "host", ",", "username", ",", "password", ",", "port", "=", "445", ")", ":", "creds", "=", "\"-U '{0}%{1}' //{2}\"", ".", "format", "(", "username", ",", "password", ",", "host", ")", "logging_cred...
Run a command remotly via the winexe executable
[ "Run", "a", "command", "remotly", "via", "the", "winexe", "executable" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L938-L953
train
Run a command remotly via the winexe executable
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/cloud.py
run_psexec_command
def run_psexec_command(cmd, args, host, username, password, port=445): ''' Run a command remotly using the psexec protocol ''' if has_winexe() and not HAS_PSEXEC: ret_code = run_winexe_command(cmd, args, host, username, password, port) return None, None, ret_code service_name = 'PS-E...
python
def run_psexec_command(cmd, args, host, username, password, port=445): ''' Run a command remotly using the psexec protocol ''' if has_winexe() and not HAS_PSEXEC: ret_code = run_winexe_command(cmd, args, host, username, password, port) return None, None, ret_code service_name = 'PS-E...
[ "def", "run_psexec_command", "(", "cmd", ",", "args", ",", "host", ",", "username", ",", "password", ",", "port", "=", "445", ")", ":", "if", "has_winexe", "(", ")", "and", "not", "HAS_PSEXEC", ":", "ret_code", "=", "run_winexe_command", "(", "cmd", ",",...
Run a command remotly using the psexec protocol
[ "Run", "a", "command", "remotly", "using", "the", "psexec", "protocol" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L956-L973
train
Run a command remotly using the psexec protocol
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/cloud.py
wait_for_winexe
def wait_for_winexe(host, port, username, password, timeout=900): ''' Wait until winexe connection can be established. ''' start = time.time() log.debug( 'Attempting winexe connection to host %s on port %s', host, port ) try_count = 0 while True: try_count += 1 ...
python
def wait_for_winexe(host, port, username, password, timeout=900): ''' Wait until winexe connection can be established. ''' start = time.time() log.debug( 'Attempting winexe connection to host %s on port %s', host, port ) try_count = 0 while True: try_count += 1 ...
[ "def", "wait_for_winexe", "(", "host", ",", "port", ",", "username", ",", "password", ",", "timeout", "=", "900", ")", ":", "start", "=", "time", ".", "time", "(", ")", "log", ".", "debug", "(", "'Attempting winexe connection to host %s on port %s'", ",", "h...
Wait until winexe connection can be established.
[ "Wait", "until", "winexe", "connection", "can", "be", "established", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L976-L1002
train
Wait until winexe connection is established.
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/cloud.py
wait_for_psexecsvc
def wait_for_psexecsvc(host, port, username, password, timeout=900): ''' Wait until psexec connection can be established. ''' if has_winexe() and not HAS_PSEXEC: return wait_for_winexe(host, port, username, password, timeout) start = time.time() try_count = 0 while True: try_...
python
def wait_for_psexecsvc(host, port, username, password, timeout=900): ''' Wait until psexec connection can be established. ''' if has_winexe() and not HAS_PSEXEC: return wait_for_winexe(host, port, username, password, timeout) start = time.time() try_count = 0 while True: try_...
[ "def", "wait_for_psexecsvc", "(", "host", ",", "port", ",", "username", ",", "password", ",", "timeout", "=", "900", ")", ":", "if", "has_winexe", "(", ")", "and", "not", "HAS_PSEXEC", ":", "return", "wait_for_winexe", "(", "host", ",", "port", ",", "use...
Wait until psexec connection can be established.
[ "Wait", "until", "psexec", "connection", "can", "be", "established", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1005-L1031
train
Wait until psexec connection can be established.
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/cloud.py
wait_for_winrm
def wait_for_winrm(host, port, username, password, timeout=900, use_ssl=True, verify=True): ''' Wait until WinRM connection can be established. ''' # Ensure the winrm service is listening before attempting to connect wait_for_port(host=host, port=port, timeout=timeout) start = time.time() l...
python
def wait_for_winrm(host, port, username, password, timeout=900, use_ssl=True, verify=True): ''' Wait until WinRM connection can be established. ''' # Ensure the winrm service is listening before attempting to connect wait_for_port(host=host, port=port, timeout=timeout) start = time.time() l...
[ "def", "wait_for_winrm", "(", "host", ",", "port", ",", "username", ",", "password", ",", "timeout", "=", "900", ",", "use_ssl", "=", "True", ",", "verify", "=", "True", ")", ":", "# Ensure the winrm service is listening before attempting to connect", "wait_for_port...
Wait until WinRM connection can be established.
[ "Wait", "until", "WinRM", "connection", "can", "be", "established", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1034-L1096
train
Wait until a WinRM connection is established.
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/cloud.py
validate_windows_cred_winexe
def validate_windows_cred_winexe(host, username='Administrator', password=None, retries=10, retry_delay=1): ''' Check if the windows credentials are valid ''' cmd = "winexe -U '{0}%{1}' //{2} \"hostna...
python
def validate_windows_cred_winexe(host, username='Administrator', password=None, retries=10, retry_delay=1): ''' Check if the windows credentials are valid ''' cmd = "winexe -U '{0}%{1}' //{2} \"hostna...
[ "def", "validate_windows_cred_winexe", "(", "host", ",", "username", "=", "'Administrator'", ",", "password", "=", "None", ",", "retries", "=", "10", ",", "retry_delay", "=", "1", ")", ":", "cmd", "=", "\"winexe -U '{0}%{1}' //{2} \\\"hostname\\\"\"", ".", "format...
Check if the windows credentials are valid
[ "Check", "if", "the", "windows", "credentials", "are", "valid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1099-L1121
train
Checks if the windows credentials are valid
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/cloud.py
validate_windows_cred
def validate_windows_cred(host, username='Administrator', password=None, retries=10, retry_delay=1): ''' Check if the windows credentials are valid ''' for i in range(retries): ret_code = 1 ...
python
def validate_windows_cred(host, username='Administrator', password=None, retries=10, retry_delay=1): ''' Check if the windows credentials are valid ''' for i in range(retries): ret_code = 1 ...
[ "def", "validate_windows_cred", "(", "host", ",", "username", "=", "'Administrator'", ",", "password", "=", "None", ",", "retries", "=", "10", ",", "retry_delay", "=", "1", ")", ":", "for", "i", "in", "range", "(", "retries", ")", ":", "ret_code", "=", ...
Check if the windows credentials are valid
[ "Check", "if", "the", "windows", "credentials", "are", "valid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1124-L1143
train
Check if the windows credentials are valid
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/cloud.py
wait_for_passwd
def wait_for_passwd(host, port=22, ssh_timeout=15, username='root', password=None, key_filename=None, maxtries=15, trysleep=1, display_ssh_output=True, gateway=None, known_hosts_file='/dev/null', hard_timeout=None): ''' Wait until ssh connection can be...
python
def wait_for_passwd(host, port=22, ssh_timeout=15, username='root', password=None, key_filename=None, maxtries=15, trysleep=1, display_ssh_output=True, gateway=None, known_hosts_file='/dev/null', hard_timeout=None): ''' Wait until ssh connection can be...
[ "def", "wait_for_passwd", "(", "host", ",", "port", "=", "22", ",", "ssh_timeout", "=", "15", ",", "username", "=", "'root'", ",", "password", "=", "None", ",", "key_filename", "=", "None", ",", "maxtries", "=", "15", ",", "trysleep", "=", "1", ",", ...
Wait until ssh connection can be accessed via password or ssh key
[ "Wait", "until", "ssh", "connection", "can", "be", "accessed", "via", "password", "or", "ssh", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1146-L1204
train
Wait until ssh connection can be accessed via password or ssh key_filename
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/cloud.py
deploy_windows
def deploy_windows(host, port=445, timeout=900, username='Administrator', password=None, name=None, sock_dir=None, conf_file=None, start_action=None, ...
python
def deploy_windows(host, port=445, timeout=900, username='Administrator', password=None, name=None, sock_dir=None, conf_file=None, start_action=None, ...
[ "def", "deploy_windows", "(", "host", ",", "port", "=", "445", ",", "timeout", "=", "900", ",", "username", "=", "'Administrator'", ",", "password", "=", "None", ",", "name", "=", "None", ",", "sock_dir", "=", "None", ",", "conf_file", "=", "None", ","...
Copy the install files to a remote Windows box, and execute them
[ "Copy", "the", "install", "files", "to", "a", "remote", "Windows", "box", "and", "execute", "them" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1207-L1408
train
Deploy the specified files to a remote Windows box.
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/cloud.py
deploy_script
def deploy_script(host, port=22, timeout=900, username='root', password=None, key_filename=None, script=None, name=None, sock_dir=None, provider=None, ...
python
def deploy_script(host, port=22, timeout=900, username='root', password=None, key_filename=None, script=None, name=None, sock_dir=None, provider=None, ...
[ "def", "deploy_script", "(", "host", ",", "port", "=", "22", ",", "timeout", "=", "900", ",", "username", "=", "'root'", ",", "password", "=", "None", ",", "key_filename", "=", "None", ",", "script", "=", "None", ",", "name", "=", "None", ",", "sock_...
Copy a deploy script to a remote server, execute it, and remove it
[ "Copy", "a", "deploy", "script", "to", "a", "remote", "server", "execute", "it", "and", "remove", "it" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1411-L1887
train
Deploy a script to a remote server.
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/cloud.py
run_inline_script
def run_inline_script(host, name=None, port=22, timeout=900, username='root', key_filename=None, inline_script=None, ssh_timeout=15, display_ssh...
python
def run_inline_script(host, name=None, port=22, timeout=900, username='root', key_filename=None, inline_script=None, ssh_timeout=15, display_ssh...
[ "def", "run_inline_script", "(", "host", ",", "name", "=", "None", ",", "port", "=", "22", ",", "timeout", "=", "900", ",", "username", "=", "'root'", ",", "key_filename", "=", "None", ",", "inline_script", "=", "None", ",", "ssh_timeout", "=", "15", "...
Run the inline script commands, one by one :**kwargs: catch all other things we may get but don't actually need/use
[ "Run", "the", "inline", "script", "commands", "one", "by", "one", ":", "**", "kwargs", ":", "catch", "all", "other", "things", "we", "may", "get", "but", "don", "t", "actually", "need", "/", "use" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1890-L1961
train
Run the inline script command
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/cloud.py
filter_event
def filter_event(tag, data, defaults): ''' Accept a tag, a dict and a list of default keys to return from the dict, and check them against the cloud configuration for that tag ''' ret = {} keys = [] use_defaults = True for ktag in __opts__.get('filter_events', {}): if tag != kta...
python
def filter_event(tag, data, defaults): ''' Accept a tag, a dict and a list of default keys to return from the dict, and check them against the cloud configuration for that tag ''' ret = {} keys = [] use_defaults = True for ktag in __opts__.get('filter_events', {}): if tag != kta...
[ "def", "filter_event", "(", "tag", ",", "data", ",", "defaults", ")", ":", "ret", "=", "{", "}", "keys", "=", "[", "]", "use_defaults", "=", "True", "for", "ktag", "in", "__opts__", ".", "get", "(", "'filter_events'", ",", "{", "}", ")", ":", "if",...
Accept a tag, a dict and a list of default keys to return from the dict, and check them against the cloud configuration for that tag
[ "Accept", "a", "tag", "a", "dict", "and", "a", "list", "of", "default", "keys", "to", "return", "from", "the", "dict", "and", "check", "them", "against", "the", "cloud", "configuration", "for", "that", "tag" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1964-L1994
train
Accept a tag a dict and a list of default keys to return from the dict and a list of default keys to return from the dict and the cloud configuration for that tag.
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/cloud.py
fire_event
def fire_event(key, msg, tag, sock_dir, args=None, transport='zeromq'): ''' Fire deploy action ''' event = salt.utils.event.get_event( 'master', sock_dir, transport, listen=False) try: event.fire_event(msg, tag) except ValueError: # We're using at...
python
def fire_event(key, msg, tag, sock_dir, args=None, transport='zeromq'): ''' Fire deploy action ''' event = salt.utils.event.get_event( 'master', sock_dir, transport, listen=False) try: event.fire_event(msg, tag) except ValueError: # We're using at...
[ "def", "fire_event", "(", "key", ",", "msg", ",", "tag", ",", "sock_dir", ",", "args", "=", "None", ",", "transport", "=", "'zeromq'", ")", ":", "event", "=", "salt", ".", "utils", ".", "event", ".", "get_event", "(", "'master'", ",", "sock_dir", ","...
Fire deploy action
[ "Fire", "deploy", "action" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L1997-L2019
train
Fire an event from the master and return the object.
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/cloud.py
scp_file
def scp_file(dest_path, contents=None, kwargs=None, local_file=None): ''' Use scp or sftp to copy a file to a server ''' file_to_upload = None try: if contents is not None: try: tmpfd, file_to_upload = tempfile.mkstemp() os.write(tmpfd, contents) ...
python
def scp_file(dest_path, contents=None, kwargs=None, local_file=None): ''' Use scp or sftp to copy a file to a server ''' file_to_upload = None try: if contents is not None: try: tmpfd, file_to_upload = tempfile.mkstemp() os.write(tmpfd, contents) ...
[ "def", "scp_file", "(", "dest_path", ",", "contents", "=", "None", ",", "kwargs", "=", "None", ",", "local_file", "=", "None", ")", ":", "file_to_upload", "=", "None", "try", ":", "if", "contents", "is", "not", "None", ":", "try", ":", "tmpfd", ",", ...
Use scp or sftp to copy a file to a server
[ "Use", "scp", "or", "sftp", "to", "copy", "a", "file", "to", "a", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2077-L2164
train
Copy a file to a server using scp or sftp.
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/cloud.py
ssh_file
def ssh_file(opts, dest_path, contents=None, kwargs=None, local_file=None): ''' Copies a file to the remote SSH target using either sftp or scp, as configured. ''' if opts.get('file_transport', 'sftp') == 'sftp': return sftp_file(dest_path, contents, kwargs, local_file) return scp_file(d...
python
def ssh_file(opts, dest_path, contents=None, kwargs=None, local_file=None): ''' Copies a file to the remote SSH target using either sftp or scp, as configured. ''' if opts.get('file_transport', 'sftp') == 'sftp': return sftp_file(dest_path, contents, kwargs, local_file) return scp_file(d...
[ "def", "ssh_file", "(", "opts", ",", "dest_path", ",", "contents", "=", "None", ",", "kwargs", "=", "None", ",", "local_file", "=", "None", ")", ":", "if", "opts", ".", "get", "(", "'file_transport'", ",", "'sftp'", ")", "==", "'sftp'", ":", "return", ...
Copies a file to the remote SSH target using either sftp or scp, as configured.
[ "Copies", "a", "file", "to", "the", "remote", "SSH", "target", "using", "either", "sftp", "or", "scp", "as", "configured", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2167-L2174
train
Copy a file to the remote SSH target using either sftp or scp.
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/cloud.py
win_cmd
def win_cmd(command, **kwargs): ''' Wrapper for commands to be run against Windows boxes ''' logging_command = kwargs.get('logging_command', None) try: proc = NonBlockingPopen( command, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIP...
python
def win_cmd(command, **kwargs): ''' Wrapper for commands to be run against Windows boxes ''' logging_command = kwargs.get('logging_command', None) try: proc = NonBlockingPopen( command, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIP...
[ "def", "win_cmd", "(", "command", ",", "*", "*", "kwargs", ")", ":", "logging_command", "=", "kwargs", ".", "get", "(", "'logging_command'", ",", "None", ")", "try", ":", "proc", "=", "NonBlockingPopen", "(", "command", ",", "shell", "=", "True", ",", ...
Wrapper for commands to be run against Windows boxes
[ "Wrapper", "for", "commands", "to", "be", "run", "against", "Windows", "boxes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2269-L2302
train
Wrapper for commands to be run against Windows boxes Formula
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/cloud.py
winrm_cmd
def winrm_cmd(session, command, flags, **kwargs): ''' Wrapper for commands to be run against Windows boxes using WinRM. ''' log.debug('Executing WinRM command: %s %s', command, flags) # rebuild the session to ensure we haven't timed out session.protocol.transport.build_session() r = session....
python
def winrm_cmd(session, command, flags, **kwargs): ''' Wrapper for commands to be run against Windows boxes using WinRM. ''' log.debug('Executing WinRM command: %s %s', command, flags) # rebuild the session to ensure we haven't timed out session.protocol.transport.build_session() r = session....
[ "def", "winrm_cmd", "(", "session", ",", "command", ",", "flags", ",", "*", "*", "kwargs", ")", ":", "log", ".", "debug", "(", "'Executing WinRM command: %s %s'", ",", "command", ",", "flags", ")", "# rebuild the session to ensure we haven't timed out", "session", ...
Wrapper for commands to be run against Windows boxes using WinRM.
[ "Wrapper", "for", "commands", "to", "be", "run", "against", "Windows", "boxes", "using", "WinRM", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2305-L2313
train
Wrapper for commands to be run against Windows boxes using WinRM.
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/cloud.py
root_cmd
def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): ''' Wrapper for commands to be run as root ''' logging_command = command sudo_password = kwargs.get('sudo_password', None) if sudo: if sudo_password is None: command = 'sudo {0}'.format(command) log...
python
def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): ''' Wrapper for commands to be run as root ''' logging_command = command sudo_password = kwargs.get('sudo_password', None) if sudo: if sudo_password is None: command = 'sudo {0}'.format(command) log...
[ "def", "root_cmd", "(", "command", ",", "tty", ",", "sudo", ",", "allow_failure", "=", "False", ",", "*", "*", "kwargs", ")", ":", "logging_command", "=", "command", "sudo_password", "=", "kwargs", ".", "get", "(", "'sudo_password'", ",", "None", ")", "i...
Wrapper for commands to be run as root
[ "Wrapper", "for", "commands", "to", "be", "run", "as", "root" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2316-L2392
train
Wrapper for command to be run as root
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/cloud.py
check_auth
def check_auth(name, sock_dir=None, queue=None, timeout=300): ''' This function is called from a multiprocess instance, to wait for a minion to become available to receive salt commands ''' event = salt.utils.event.SaltEvent('master', sock_dir, listen=True) starttime = time.mktime(time.localtime...
python
def check_auth(name, sock_dir=None, queue=None, timeout=300): ''' This function is called from a multiprocess instance, to wait for a minion to become available to receive salt commands ''' event = salt.utils.event.SaltEvent('master', sock_dir, listen=True) starttime = time.mktime(time.localtime...
[ "def", "check_auth", "(", "name", ",", "sock_dir", "=", "None", ",", "queue", "=", "None", ",", "timeout", "=", "300", ")", ":", "event", "=", "salt", ".", "utils", ".", "event", ".", "SaltEvent", "(", "'master'", ",", "sock_dir", ",", "listen", "=",...
This function is called from a multiprocess instance, to wait for a minion to become available to receive salt commands
[ "This", "function", "is", "called", "from", "a", "multiprocess", "instance", "to", "wait", "for", "a", "minion", "to", "become", "available", "to", "receive", "salt", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2395-L2412
train
This function is called from a multiprocess instance to check if a minion has been established and if so send the salt commands to the queue.
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/cloud.py
ip_to_int
def ip_to_int(ip): ''' Converts an IP address to an integer ''' ret = 0 for octet in ip.split('.'): ret = ret * 256 + int(octet) return ret
python
def ip_to_int(ip): ''' Converts an IP address to an integer ''' ret = 0 for octet in ip.split('.'): ret = ret * 256 + int(octet) return ret
[ "def", "ip_to_int", "(", "ip", ")", ":", "ret", "=", "0", "for", "octet", "in", "ip", ".", "split", "(", "'.'", ")", ":", "ret", "=", "ret", "*", "256", "+", "int", "(", "octet", ")", "return", "ret" ]
Converts an IP address to an integer
[ "Converts", "an", "IP", "address", "to", "an", "integer" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2415-L2422
train
Converts an IP address to an integer
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/cloud.py
is_public_ip
def is_public_ip(ip): ''' Determines whether an IP address falls within one of the private IP ranges ''' if ':' in ip: # ipv6 if ip.startswith('fe80:'): # ipv6 link local return False return True addr = ip_to_int(ip) if 167772160 < addr < 184549375...
python
def is_public_ip(ip): ''' Determines whether an IP address falls within one of the private IP ranges ''' if ':' in ip: # ipv6 if ip.startswith('fe80:'): # ipv6 link local return False return True addr = ip_to_int(ip) if 167772160 < addr < 184549375...
[ "def", "is_public_ip", "(", "ip", ")", ":", "if", "':'", "in", "ip", ":", "# ipv6", "if", "ip", ".", "startswith", "(", "'fe80:'", ")", ":", "# ipv6 link local", "return", "False", "return", "True", "addr", "=", "ip_to_int", "(", "ip", ")", "if", "1677...
Determines whether an IP address falls within one of the private IP ranges
[ "Determines", "whether", "an", "IP", "address", "falls", "within", "one", "of", "the", "private", "IP", "ranges" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2425-L2448
train
Determines whether an IP address falls within one of the private IP ranges.
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/cloud.py
check_name
def check_name(name, safe_chars): ''' Check whether the specified name contains invalid characters ''' regexp = re.compile('[^{0}]'.format(safe_chars)) if regexp.search(name): raise SaltCloudException( '{0} contains characters not supported by this cloud provider. ' '...
python
def check_name(name, safe_chars): ''' Check whether the specified name contains invalid characters ''' regexp = re.compile('[^{0}]'.format(safe_chars)) if regexp.search(name): raise SaltCloudException( '{0} contains characters not supported by this cloud provider. ' '...
[ "def", "check_name", "(", "name", ",", "safe_chars", ")", ":", "regexp", "=", "re", ".", "compile", "(", "'[^{0}]'", ".", "format", "(", "safe_chars", ")", ")", "if", "regexp", ".", "search", "(", "name", ")", ":", "raise", "SaltCloudException", "(", "...
Check whether the specified name contains invalid characters
[ "Check", "whether", "the", "specified", "name", "contains", "invalid", "characters" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2451-L2462
train
Check whether the specified name contains invalid characters.
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/cloud.py
remove_sshkey
def remove_sshkey(host, known_hosts=None): ''' Remove a host from the known_hosts file ''' if known_hosts is None: if 'HOME' in os.environ: known_hosts = '{0}/.ssh/known_hosts'.format(os.environ['HOME']) else: try: known_hosts = '{0}/.ssh/known_hos...
python
def remove_sshkey(host, known_hosts=None): ''' Remove a host from the known_hosts file ''' if known_hosts is None: if 'HOME' in os.environ: known_hosts = '{0}/.ssh/known_hosts'.format(os.environ['HOME']) else: try: known_hosts = '{0}/.ssh/known_hos...
[ "def", "remove_sshkey", "(", "host", ",", "known_hosts", "=", "None", ")", ":", "if", "known_hosts", "is", "None", ":", "if", "'HOME'", "in", "os", ".", "environ", ":", "known_hosts", "=", "'{0}/.ssh/known_hosts'", ".", "format", "(", "os", ".", "environ",...
Remove a host from the known_hosts file
[ "Remove", "a", "host", "from", "the", "known_hosts", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2465-L2489
train
Remove a host from the known_hosts 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/utils/cloud.py
list_nodes_select
def list_nodes_select(nodes, selection, call=None): ''' Return a list of the VMs that are on the provider, with select fields ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select function must be called ' 'with -f or --function.' ) if 'e...
python
def list_nodes_select(nodes, selection, call=None): ''' Return a list of the VMs that are on the provider, with select fields ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select function must be called ' 'with -f or --function.' ) if 'e...
[ "def", "list_nodes_select", "(", "nodes", ",", "selection", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_select function must be called '", "'with -f or --function.'", ")", "if", "'error...
Return a list of the VMs that are on the provider, with select fields
[ "Return", "a", "list", "of", "the", "VMs", "that", "are", "on", "the", "provider", "with", "select", "fields" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2565-L2592
train
Return a list of the VMs that are on the provider with select fields
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/cloud.py
lock_file
def lock_file(filename, interval=.5, timeout=15): ''' Lock a file; if it is already locked, then wait for it to become available before locking it. Note that these locks are only recognized by Salt Cloud, and not other programs or platforms. ''' log.trace('Attempting to obtain lock for %s',...
python
def lock_file(filename, interval=.5, timeout=15): ''' Lock a file; if it is already locked, then wait for it to become available before locking it. Note that these locks are only recognized by Salt Cloud, and not other programs or platforms. ''' log.trace('Attempting to obtain lock for %s',...
[ "def", "lock_file", "(", "filename", ",", "interval", "=", ".5", ",", "timeout", "=", "15", ")", ":", "log", ".", "trace", "(", "'Attempting to obtain lock for %s'", ",", "filename", ")", "lock", "=", "filename", "+", "'.lock'", "start", "=", "time", ".", ...
Lock a file; if it is already locked, then wait for it to become available before locking it. Note that these locks are only recognized by Salt Cloud, and not other programs or platforms.
[ "Lock", "a", "file", ";", "if", "it", "is", "already", "locked", "then", "wait", "for", "it", "to", "become", "available", "before", "locking", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2595-L2616
train
Lock a file and return the ID 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/utils/cloud.py
unlock_file
def unlock_file(filename): ''' Unlock a locked file Note that these locks are only recognized by Salt Cloud, and not other programs or platforms. ''' log.trace('Removing lock for %s', filename) lock = filename + '.lock' try: os.remove(lock) except OSError as exc: log...
python
def unlock_file(filename): ''' Unlock a locked file Note that these locks are only recognized by Salt Cloud, and not other programs or platforms. ''' log.trace('Removing lock for %s', filename) lock = filename + '.lock' try: os.remove(lock) except OSError as exc: log...
[ "def", "unlock_file", "(", "filename", ")", ":", "log", ".", "trace", "(", "'Removing lock for %s'", ",", "filename", ")", "lock", "=", "filename", "+", "'.lock'", "try", ":", "os", ".", "remove", "(", "lock", ")", "except", "OSError", "as", "exc", ":", ...
Unlock a locked file Note that these locks are only recognized by Salt Cloud, and not other programs or platforms.
[ "Unlock", "a", "locked", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2619-L2631
train
Unlock a locked file in a node s cluster.
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/cloud.py
cachedir_index_add
def cachedir_index_add(minion_id, profile, driver, provider, base=None): ''' Add an entry to the cachedir index. This generally only needs to happen when a new instance is created. This entry should contain: .. code-block:: yaml - minion_id - profile used to create the instance ...
python
def cachedir_index_add(minion_id, profile, driver, provider, base=None): ''' Add an entry to the cachedir index. This generally only needs to happen when a new instance is created. This entry should contain: .. code-block:: yaml - minion_id - profile used to create the instance ...
[ "def", "cachedir_index_add", "(", "minion_id", ",", "profile", ",", "driver", ",", "provider", ",", "base", "=", "None", ")", ":", "base", "=", "init_cachedir", "(", "base", ")", "index_file", "=", "os", ".", "path", ".", "join", "(", "base", ",", "'in...
Add an entry to the cachedir index. This generally only needs to happen when a new instance is created. This entry should contain: .. code-block:: yaml - minion_id - profile used to create the instance - provider and driver name The intent of this function is to speed up lookups f...
[ "Add", "an", "entry", "to", "the", "cachedir", "index", ".", "This", "generally", "only", "needs", "to", "happen", "when", "a", "new", "instance", "is", "created", ".", "This", "entry", "should", "contain", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2634-L2677
train
Add an entry to the cachedir index.
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/cloud.py
cachedir_index_del
def cachedir_index_del(minion_id, base=None): ''' Delete an entry from the cachedir index. This generally only needs to happen when an instance is deleted. ''' base = init_cachedir(base) index_file = os.path.join(base, 'index.p') lock_file(index_file) if os.path.exists(index_file): ...
python
def cachedir_index_del(minion_id, base=None): ''' Delete an entry from the cachedir index. This generally only needs to happen when an instance is deleted. ''' base = init_cachedir(base) index_file = os.path.join(base, 'index.p') lock_file(index_file) if os.path.exists(index_file): ...
[ "def", "cachedir_index_del", "(", "minion_id", ",", "base", "=", "None", ")", ":", "base", "=", "init_cachedir", "(", "base", ")", "index_file", "=", "os", ".", "path", ".", "join", "(", "base", ",", "'index.p'", ")", "lock_file", "(", "index_file", ")",...
Delete an entry from the cachedir index. This generally only needs to happen when an instance is deleted.
[ "Delete", "an", "entry", "from", "the", "cachedir", "index", ".", "This", "generally", "only", "needs", "to", "happen", "when", "an", "instance", "is", "deleted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2680-L2704
train
Delete an entry from the cachedir index.
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/cloud.py
init_cachedir
def init_cachedir(base=None): ''' Initialize the cachedir needed for Salt Cloud to keep track of minions ''' if base is None: base = __opts__['cachedir'] needed_dirs = (base, os.path.join(base, 'requested'), os.path.join(base, 'active')) for dir_ in ...
python
def init_cachedir(base=None): ''' Initialize the cachedir needed for Salt Cloud to keep track of minions ''' if base is None: base = __opts__['cachedir'] needed_dirs = (base, os.path.join(base, 'requested'), os.path.join(base, 'active')) for dir_ in ...
[ "def", "init_cachedir", "(", "base", "=", "None", ")", ":", "if", "base", "is", "None", ":", "base", "=", "__opts__", "[", "'cachedir'", "]", "needed_dirs", "=", "(", "base", ",", "os", ".", "path", ".", "join", "(", "base", ",", "'requested'", ")", ...
Initialize the cachedir needed for Salt Cloud to keep track of minions
[ "Initialize", "the", "cachedir", "needed", "for", "Salt", "Cloud", "to", "keep", "track", "of", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2707-L2721
train
Initialize the cachedir needed for salt cloud to keep track of 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/cloud.py
request_minion_cachedir
def request_minion_cachedir( minion_id, opts=None, fingerprint='', pubkey=None, provider=None, base=None, ): ''' Creates an entry in the requested/ cachedir. This means that Salt Cloud has made a request to a cloud provider to create an instance, but it has no...
python
def request_minion_cachedir( minion_id, opts=None, fingerprint='', pubkey=None, provider=None, base=None, ): ''' Creates an entry in the requested/ cachedir. This means that Salt Cloud has made a request to a cloud provider to create an instance, but it has no...
[ "def", "request_minion_cachedir", "(", "minion_id", ",", "opts", "=", "None", ",", "fingerprint", "=", "''", ",", "pubkey", "=", "None", ",", "provider", "=", "None", ",", "base", "=", "None", ",", ")", ":", "if", "base", "is", "None", ":", "base", "...
Creates an entry in the requested/ cachedir. This means that Salt Cloud has made a request to a cloud provider to create an instance, but it has not yet verified that the instance properly exists. If the fingerprint is unknown, a raw pubkey can be passed in, and a fingerprint will be calculated. If bot...
[ "Creates", "an", "entry", "in", "the", "requested", "/", "cachedir", ".", "This", "means", "that", "Salt", "Cloud", "has", "made", "a", "request", "to", "a", "cloud", "provider", "to", "create", "an", "instance", "but", "it", "has", "not", "yet", "verifi...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2725-L2760
train
Request a new entry in the requested cacheir.
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/cloud.py
change_minion_cachedir
def change_minion_cachedir( minion_id, cachedir, data=None, base=None, ): ''' Changes the info inside a minion's cachedir entry. The type of cachedir must be specified (i.e., 'requested' or 'active'). A dict is also passed in which contains the data to be changed. Ex...
python
def change_minion_cachedir( minion_id, cachedir, data=None, base=None, ): ''' Changes the info inside a minion's cachedir entry. The type of cachedir must be specified (i.e., 'requested' or 'active'). A dict is also passed in which contains the data to be changed. Ex...
[ "def", "change_minion_cachedir", "(", "minion_id", ",", "cachedir", ",", "data", "=", "None", ",", "base", "=", "None", ",", ")", ":", "if", "not", "isinstance", "(", "data", ",", "dict", ")", ":", "return", "False", "if", "base", "is", "None", ":", ...
Changes the info inside a minion's cachedir entry. The type of cachedir must be specified (i.e., 'requested' or 'active'). A dict is also passed in which contains the data to be changed. Example: change_minion_cachedir( 'myminion', 'requested', {'fingerprint': '...
[ "Changes", "the", "info", "inside", "a", "minion", "s", "cachedir", "entry", ".", "The", "type", "of", "cachedir", "must", "be", "specified", "(", "i", ".", "e", ".", "requested", "or", "active", ")", ".", "A", "dict", "is", "also", "passed", "in", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2763-L2798
train
Changes the info inside a minion s cachedir entry.
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/cloud.py
activate_minion_cachedir
def activate_minion_cachedir(minion_id, base=None): ''' Moves a minion from the requested/ cachedir into the active/ cachedir. This means that Salt Cloud has verified that a requested instance properly exists, and should be expected to exist from here on out. ''' if base is None: base = ...
python
def activate_minion_cachedir(minion_id, base=None): ''' Moves a minion from the requested/ cachedir into the active/ cachedir. This means that Salt Cloud has verified that a requested instance properly exists, and should be expected to exist from here on out. ''' if base is None: base = ...
[ "def", "activate_minion_cachedir", "(", "minion_id", ",", "base", "=", "None", ")", ":", "if", "base", "is", "None", ":", "base", "=", "__opts__", "[", "'cachedir'", "]", "fname", "=", "'{0}.p'", ".", "format", "(", "minion_id", ")", "src", "=", "os", ...
Moves a minion from the requested/ cachedir into the active/ cachedir. This means that Salt Cloud has verified that a requested instance properly exists, and should be expected to exist from here on out.
[ "Moves", "a", "minion", "from", "the", "requested", "/", "cachedir", "into", "the", "active", "/", "cachedir", ".", "This", "means", "that", "Salt", "Cloud", "has", "verified", "that", "a", "requested", "instance", "properly", "exists", "and", "should", "be"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2801-L2813
train
Activates a minion from the requested cacheir into the active cacheir.
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/cloud.py
delete_minion_cachedir
def delete_minion_cachedir(minion_id, provider, opts, base=None): ''' Deletes a minion's entry from the cloud cachedir. It will search through all cachedirs to find the minion's cache file. Needs `update_cachedir` set to True. ''' if isinstance(opts, dict): __opts__.update(opts) if ...
python
def delete_minion_cachedir(minion_id, provider, opts, base=None): ''' Deletes a minion's entry from the cloud cachedir. It will search through all cachedirs to find the minion's cache file. Needs `update_cachedir` set to True. ''' if isinstance(opts, dict): __opts__.update(opts) if ...
[ "def", "delete_minion_cachedir", "(", "minion_id", ",", "provider", ",", "opts", ",", "base", "=", "None", ")", ":", "if", "isinstance", "(", "opts", ",", "dict", ")", ":", "__opts__", ".", "update", "(", "opts", ")", "if", "__opts__", ".", "get", "(",...
Deletes a minion's entry from the cloud cachedir. It will search through all cachedirs to find the minion's cache file. Needs `update_cachedir` set to True.
[ "Deletes", "a", "minion", "s", "entry", "from", "the", "cloud", "cachedir", ".", "It", "will", "search", "through", "all", "cachedirs", "to", "find", "the", "minion", "s", "cache", "file", ".", "Needs", "update_cachedir", "set", "to", "True", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2816-L2837
train
Deletes a minion s entry from the cloud cachedir.
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/cloud.py
list_cache_nodes_full
def list_cache_nodes_full(opts=None, provider=None, base=None): ''' Return a list of minion data from the cloud cache, rather from the cloud providers themselves. This is the cloud cache version of list_nodes_full(). ''' if opts is None: opts = __opts__ if opts.get('update_cachedir', Fal...
python
def list_cache_nodes_full(opts=None, provider=None, base=None): ''' Return a list of minion data from the cloud cache, rather from the cloud providers themselves. This is the cloud cache version of list_nodes_full(). ''' if opts is None: opts = __opts__ if opts.get('update_cachedir', Fal...
[ "def", "list_cache_nodes_full", "(", "opts", "=", "None", ",", "provider", "=", "None", ",", "base", "=", "None", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "__opts__", "if", "opts", ".", "get", "(", "'update_cachedir'", ",", "False", ")",...
Return a list of minion data from the cloud cache, rather from the cloud providers themselves. This is the cloud cache version of list_nodes_full().
[ "Return", "a", "list", "of", "minion", "data", "from", "the", "cloud", "cache", "rather", "from", "the", "cloud", "providers", "themselves", ".", "This", "is", "the", "cloud", "cache", "version", "of", "list_nodes_full", "()", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2840-L2875
train
Return a list of minion data from the cloud cache rather from the cloud cache providers themselves. This is the cloud cache version of list_nodes_full.
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/cloud.py
update_bootstrap
def update_bootstrap(config, url=None): ''' Update the salt-bootstrap script url can be one of: - The URL to fetch the bootstrap script from - The absolute path to the bootstrap - The content of the bootstrap script ''' default_url = config.get('bootstrap_script_url', ...
python
def update_bootstrap(config, url=None): ''' Update the salt-bootstrap script url can be one of: - The URL to fetch the bootstrap script from - The absolute path to the bootstrap - The content of the bootstrap script ''' default_url = config.get('bootstrap_script_url', ...
[ "def", "update_bootstrap", "(", "config", ",", "url", "=", "None", ")", ":", "default_url", "=", "config", ".", "get", "(", "'bootstrap_script_url'", ",", "'https://bootstrap.saltstack.com'", ")", "if", "not", "url", ":", "url", "=", "default_url", "if", "not"...
Update the salt-bootstrap script url can be one of: - The URL to fetch the bootstrap script from - The absolute path to the bootstrap - The content of the bootstrap script
[ "Update", "the", "salt", "-", "bootstrap", "script" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L2878-L3007
train
Update the salt - bootstrap script with the latest version of the bootstrap script
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/cloud.py
cache_node_list
def cache_node_list(nodes, provider, opts): ''' If configured to do so, update the cloud cachedir with the current list of nodes. Also fires configured events pertaining to the node list. .. versionadded:: 2014.7.0 ''' if 'update_cachedir' not in opts or not opts['update_cachedir']: ret...
python
def cache_node_list(nodes, provider, opts): ''' If configured to do so, update the cloud cachedir with the current list of nodes. Also fires configured events pertaining to the node list. .. versionadded:: 2014.7.0 ''' if 'update_cachedir' not in opts or not opts['update_cachedir']: ret...
[ "def", "cache_node_list", "(", "nodes", ",", "provider", ",", "opts", ")", ":", "if", "'update_cachedir'", "not", "in", "opts", "or", "not", "opts", "[", "'update_cachedir'", "]", ":", "return", "base", "=", "os", ".", "path", ".", "join", "(", "init_cac...
If configured to do so, update the cloud cachedir with the current list of nodes. Also fires configured events pertaining to the node list. .. versionadded:: 2014.7.0
[ "If", "configured", "to", "do", "so", "update", "the", "cloud", "cachedir", "with", "the", "current", "list", "of", "nodes", ".", "Also", "fires", "configured", "events", "pertaining", "to", "the", "node", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3010-L3034
train
Update the cloud cachedir with the list of nodes.
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/cloud.py
cache_node
def cache_node(node, provider, opts): ''' Cache node individually .. versionadded:: 2014.7.0 ''' if isinstance(opts, dict): __opts__.update(opts) if 'update_cachedir' not in __opts__ or not __opts__['update_cachedir']: return if not os.path.exists(os.path.join(__opts__['ca...
python
def cache_node(node, provider, opts): ''' Cache node individually .. versionadded:: 2014.7.0 ''' if isinstance(opts, dict): __opts__.update(opts) if 'update_cachedir' not in __opts__ or not __opts__['update_cachedir']: return if not os.path.exists(os.path.join(__opts__['ca...
[ "def", "cache_node", "(", "node", ",", "provider", ",", "opts", ")", ":", "if", "isinstance", "(", "opts", ",", "dict", ")", ":", "__opts__", ".", "update", "(", "opts", ")", "if", "'update_cachedir'", "not", "in", "__opts__", "or", "not", "__opts__", ...
Cache node individually .. versionadded:: 2014.7.0
[ "Cache", "node", "individually" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3037-L3060
train
Cache node individually
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/cloud.py
missing_node_cache
def missing_node_cache(prov_dir, node_list, provider, opts): ''' Check list of nodes to see if any nodes which were previously known about in the cache have been removed from the node list. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/s...
python
def missing_node_cache(prov_dir, node_list, provider, opts): ''' Check list of nodes to see if any nodes which were previously known about in the cache have been removed from the node list. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/s...
[ "def", "missing_node_cache", "(", "prov_dir", ",", "node_list", ",", "provider", ",", "opts", ")", ":", "cached_nodes", "=", "[", "]", "for", "node", "in", "os", ".", "listdir", "(", "prov_dir", ")", ":", "cached_nodes", ".", "append", "(", "os", ".", ...
Check list of nodes to see if any nodes which were previously known about in the cache have been removed from the node list. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/salt/cloud). .. code-block:: yaml diff_cache_events: True ...
[ "Check", "list", "of", "nodes", "to", "see", "if", "any", "nodes", "which", "were", "previously", "known", "about", "in", "the", "cache", "have", "been", "removed", "from", "the", "node", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3063-L3094
train
Check list of nodes to see if any nodes which are not in the cache have been removed from the node 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/utils/cloud.py
diff_node_cache
def diff_node_cache(prov_dir, node, new_data, opts): ''' Check new node data against current cache. If data differ, fire an event which consists of the new node data. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/salt/cloud). .. cod...
python
def diff_node_cache(prov_dir, node, new_data, opts): ''' Check new node data against current cache. If data differ, fire an event which consists of the new node data. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/salt/cloud). .. cod...
[ "def", "diff_node_cache", "(", "prov_dir", ",", "node", ",", "new_data", ",", "opts", ")", ":", "if", "'diff_cache_events'", "not", "in", "opts", "or", "not", "opts", "[", "'diff_cache_events'", "]", ":", "return", "if", "node", "is", "None", ":", "return"...
Check new node data against current cache. If data differ, fire an event which consists of the new node data. This function will only run if configured to do so in the main Salt Cloud configuration file (normally /etc/salt/cloud). .. code-block:: yaml diff_cache_events: True .. versionad...
[ "Check", "new", "node", "data", "against", "current", "cache", ".", "If", "data", "differ", "fire", "an", "event", "which", "consists", "of", "the", "new", "node", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3097-L3158
train
Compare the new data against the current cache.
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/cloud.py
_strip_cache_events
def _strip_cache_events(data, opts): ''' Strip out user-configured sensitive event data. The fields to be stripped are configured in the main Salt Cloud configuration file, usually ``/etc/salt/cloud``. .. code-block: yaml cache_event_strip_fields: - password - priv_key ...
python
def _strip_cache_events(data, opts): ''' Strip out user-configured sensitive event data. The fields to be stripped are configured in the main Salt Cloud configuration file, usually ``/etc/salt/cloud``. .. code-block: yaml cache_event_strip_fields: - password - priv_key ...
[ "def", "_strip_cache_events", "(", "data", ",", "opts", ")", ":", "event_data", "=", "copy", ".", "deepcopy", "(", "data", ")", "strip_fields", "=", "opts", ".", "get", "(", "'cache_event_strip_fields'", ",", "[", "]", ")", "for", "field", "in", "strip_fie...
Strip out user-configured sensitive event data. The fields to be stripped are configured in the main Salt Cloud configuration file, usually ``/etc/salt/cloud``. .. code-block: yaml cache_event_strip_fields: - password - priv_key .. versionadded:: 2014.7.0
[ "Strip", "out", "user", "-", "configured", "sensitive", "event", "data", ".", "The", "fields", "to", "be", "stripped", "are", "configured", "in", "the", "main", "Salt", "Cloud", "configuration", "file", "usually", "/", "etc", "/", "salt", "/", "cloud", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3161-L3181
train
Strip out user - configured sensitive event 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/utils/cloud.py
_salt_cloud_force_ascii
def _salt_cloud_force_ascii(exc): ''' Helper method to try its best to convert any Unicode text into ASCII without stack tracing since salt internally does not handle Unicode strings This method is not supposed to be used directly. Once `py:module: salt.utils.cloud` is imported this method register...
python
def _salt_cloud_force_ascii(exc): ''' Helper method to try its best to convert any Unicode text into ASCII without stack tracing since salt internally does not handle Unicode strings This method is not supposed to be used directly. Once `py:module: salt.utils.cloud` is imported this method register...
[ "def", "_salt_cloud_force_ascii", "(", "exc", ")", ":", "if", "not", "isinstance", "(", "exc", ",", "(", "UnicodeEncodeError", ",", "UnicodeTranslateError", ")", ")", ":", "raise", "TypeError", "(", "'Can\\'t handle {0}'", ".", "format", "(", "exc", ")", ")", ...
Helper method to try its best to convert any Unicode text into ASCII without stack tracing since salt internally does not handle Unicode strings This method is not supposed to be used directly. Once `py:module: salt.utils.cloud` is imported this method register's with python's codecs module for proper ...
[ "Helper", "method", "to", "try", "its", "best", "to", "convert", "any", "Unicode", "text", "into", "ASCII", "without", "stack", "tracing", "since", "salt", "internally", "does", "not", "handle", "Unicode", "strings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3184-L3208
train
Helper method to try to convert any Unicode text into ASCII without stack tracing since salt internally does not handle Unicode strings
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/cloud.py
retrieve_password_from_keyring
def retrieve_password_from_keyring(credential_id, username): ''' Retrieve particular user's password for a specified credential set from system keyring. ''' try: import keyring # pylint: disable=import-error return keyring.get_password(credential_id, username) except ImportError: ...
python
def retrieve_password_from_keyring(credential_id, username): ''' Retrieve particular user's password for a specified credential set from system keyring. ''' try: import keyring # pylint: disable=import-error return keyring.get_password(credential_id, username) except ImportError: ...
[ "def", "retrieve_password_from_keyring", "(", "credential_id", ",", "username", ")", ":", "try", ":", "import", "keyring", "# pylint: disable=import-error", "return", "keyring", ".", "get_password", "(", "credential_id", ",", "username", ")", "except", "ImportError", ...
Retrieve particular user's password for a specified credential set from system keyring.
[ "Retrieve", "particular", "user", "s", "password", "for", "a", "specified", "credential", "set", "from", "system", "keyring", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3214-L3223
train
Retrieve particular user s password for a specified credential set from system keyring.
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/cloud.py
_save_password_in_keyring
def _save_password_in_keyring(credential_id, username, password): ''' Saves provider password in system keyring ''' try: import keyring # pylint: disable=import-error return keyring.set_password(credential_id, username, password) except ImportError: log.error('Tried to store...
python
def _save_password_in_keyring(credential_id, username, password): ''' Saves provider password in system keyring ''' try: import keyring # pylint: disable=import-error return keyring.set_password(credential_id, username, password) except ImportError: log.error('Tried to store...
[ "def", "_save_password_in_keyring", "(", "credential_id", ",", "username", ",", "password", ")", ":", "try", ":", "import", "keyring", "# pylint: disable=import-error", "return", "keyring", ".", "set_password", "(", "credential_id", ",", "username", ",", "password", ...
Saves provider password in system keyring
[ "Saves", "provider", "password", "in", "system", "keyring" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3226-L3235
train
Saves provider password in system keyring
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/cloud.py
store_password_in_keyring
def store_password_in_keyring(credential_id, username, password=None): ''' Interactively prompts user for a password and stores it in system keyring ''' try: # pylint: disable=import-error import keyring import keyring.errors # pylint: enable=import-error if passw...
python
def store_password_in_keyring(credential_id, username, password=None): ''' Interactively prompts user for a password and stores it in system keyring ''' try: # pylint: disable=import-error import keyring import keyring.errors # pylint: enable=import-error if passw...
[ "def", "store_password_in_keyring", "(", "credential_id", ",", "username", ",", "password", "=", "None", ")", ":", "try", ":", "# pylint: disable=import-error", "import", "keyring", "import", "keyring", ".", "errors", "# pylint: enable=import-error", "if", "password", ...
Interactively prompts user for a password and stores it in system keyring
[ "Interactively", "prompts", "user", "for", "a", "password", "and", "stores", "it", "in", "system", "keyring" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3238-L3265
train
Interactively prompts user for a password and stores it in system keyring.
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/cloud.py
_unwrap_dict
def _unwrap_dict(dictionary, index_string): ''' Accepts index in form of a string Returns final value Example: dictionary = {'a': {'b': {'c': 'foobar'}}} index_string = 'a,b,c' returns 'foobar' ''' index = index_string.split(',') for k in index: dictionary =...
python
def _unwrap_dict(dictionary, index_string): ''' Accepts index in form of a string Returns final value Example: dictionary = {'a': {'b': {'c': 'foobar'}}} index_string = 'a,b,c' returns 'foobar' ''' index = index_string.split(',') for k in index: dictionary =...
[ "def", "_unwrap_dict", "(", "dictionary", ",", "index_string", ")", ":", "index", "=", "index_string", ".", "split", "(", "','", ")", "for", "k", "in", "index", ":", "dictionary", "=", "dictionary", "[", "k", "]", "return", "dictionary" ]
Accepts index in form of a string Returns final value Example: dictionary = {'a': {'b': {'c': 'foobar'}}} index_string = 'a,b,c' returns 'foobar'
[ "Accepts", "index", "in", "form", "of", "a", "string", "Returns", "final", "value", "Example", ":", "dictionary", "=", "{", "a", ":", "{", "b", ":", "{", "c", ":", "foobar", "}}}", "index_string", "=", "a", "b", "c", "returns", "foobar" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3268-L3279
train
Unwraps a dictionary into a dictionary that can be used to create a new object.
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/cloud.py
run_func_until_ret_arg
def run_func_until_ret_arg(fun, kwargs, fun_call=None, argument_being_watched=None, required_argument_response=None): ''' Waits until the function retrieves some required argument. NOTE: Tested with ec2 describe_volumes and describe_snapshots only. ''' status = None wh...
python
def run_func_until_ret_arg(fun, kwargs, fun_call=None, argument_being_watched=None, required_argument_response=None): ''' Waits until the function retrieves some required argument. NOTE: Tested with ec2 describe_volumes and describe_snapshots only. ''' status = None wh...
[ "def", "run_func_until_ret_arg", "(", "fun", ",", "kwargs", ",", "fun_call", "=", "None", ",", "argument_being_watched", "=", "None", ",", "required_argument_response", "=", "None", ")", ":", "status", "=", "None", "while", "status", "!=", "required_argument_respo...
Waits until the function retrieves some required argument. NOTE: Tested with ec2 describe_volumes and describe_snapshots only.
[ "Waits", "until", "the", "function", "retrieves", "some", "required", "argument", ".", "NOTE", ":", "Tested", "with", "ec2", "describe_volumes", "and", "describe_snapshots", "only", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3282-L3305
train
Runs the function until the function returns some required argument.
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/cloud.py
get_salt_interface
def get_salt_interface(vm_, opts): ''' Return the salt_interface type to connect to. Either 'public_ips' (default) or 'private_ips'. ''' salt_host = salt.config.get_cloud_config_value( 'salt_interface', vm_, opts, default=False, search_global=False ) if salt_host is False: ...
python
def get_salt_interface(vm_, opts): ''' Return the salt_interface type to connect to. Either 'public_ips' (default) or 'private_ips'. ''' salt_host = salt.config.get_cloud_config_value( 'salt_interface', vm_, opts, default=False, search_global=False ) if salt_host is False: ...
[ "def", "get_salt_interface", "(", "vm_", ",", "opts", ")", ":", "salt_host", "=", "salt", ".", "config", ".", "get_cloud_config_value", "(", "'salt_interface'", ",", "vm_", ",", "opts", ",", "default", "=", "False", ",", "search_global", "=", "False", ")", ...
Return the salt_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
[ "Return", "the", "salt_interface", "type", "to", "connect", "to", ".", "Either", "public_ips", "(", "default", ")", "or", "private_ips", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3308-L3324
train
Return the salt_interface type to connect to. Either public_ips or private_ips. Either public_ips or private_ips. Either private_ips or public_ips. Either public_ips or private_ips. Either private_ips or public_ips.
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/cloud.py
check_key_path_and_mode
def check_key_path_and_mode(provider, key_path): ''' Checks that the key_path exists and the key_mode is either 0400 or 0600. Returns True or False. .. versionadded:: 2016.3.0 provider The provider name that the key_path to check belongs to. key_path The key_path to ensure th...
python
def check_key_path_and_mode(provider, key_path): ''' Checks that the key_path exists and the key_mode is either 0400 or 0600. Returns True or False. .. versionadded:: 2016.3.0 provider The provider name that the key_path to check belongs to. key_path The key_path to ensure th...
[ "def", "check_key_path_and_mode", "(", "provider", ",", "key_path", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "key_path", ")", ":", "log", ".", "error", "(", "'The key file \\'%s\\' used in the \\'%s\\' provider configuration '", "'does not exist.\...
Checks that the key_path exists and the key_mode is either 0400 or 0600. Returns True or False. .. versionadded:: 2016.3.0 provider The provider name that the key_path to check belongs to. key_path The key_path to ensure that it exists and to check adequate permissions agains...
[ "Checks", "that", "the", "key_path", "exists", "and", "the", "key_mode", "is", "either", "0400", "or", "0600", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3327-L3357
train
Checks that the key_path exists and the key_mode is either 0400 or 0600.
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/cloud.py
userdata_template
def userdata_template(opts, vm_, userdata): ''' Use the configured templating engine to template the userdata file ''' # No userdata, no need to template anything if userdata is None: return userdata userdata_template = salt.config.get_cloud_config_value( 'userdata_template', vm...
python
def userdata_template(opts, vm_, userdata): ''' Use the configured templating engine to template the userdata file ''' # No userdata, no need to template anything if userdata is None: return userdata userdata_template = salt.config.get_cloud_config_value( 'userdata_template', vm...
[ "def", "userdata_template", "(", "opts", ",", "vm_", ",", "userdata", ")", ":", "# No userdata, no need to template anything", "if", "userdata", "is", "None", ":", "return", "userdata", "userdata_template", "=", "salt", ".", "config", ".", "get_cloud_config_value", ...
Use the configured templating engine to template the userdata file
[ "Use", "the", "configured", "templating", "engine", "to", "template", "the", "userdata", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L3360-L3405
train
Return the userdata template
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/cloud.py
Client.remove_service
def remove_service(self, wait_timeout=10, sleep_wait=1): ''' Removes the PAExec service and executable that was created as part of the create_service function. This does not remove any older executables or services from previous runs, use cleanup() instead for that purpose. ''' ...
python
def remove_service(self, wait_timeout=10, sleep_wait=1): ''' Removes the PAExec service and executable that was created as part of the create_service function. This does not remove any older executables or services from previous runs, use cleanup() instead for that purpose. ''' ...
[ "def", "remove_service", "(", "self", ",", "wait_timeout", "=", "10", ",", "sleep_wait", "=", "1", ")", ":", "# Stops/remove the PAExec service and removes the executable", "log", ".", "debug", "(", "\"Deleting PAExec service at the end of the process\"", ")", "wait_start",...
Removes the PAExec service and executable that was created as part of the create_service function. This does not remove any older executables or services from previous runs, use cleanup() instead for that purpose.
[ "Removes", "the", "PAExec", "service", "and", "executable", "that", "was", "created", "as", "part", "of", "the", "create_service", "function", ".", "This", "does", "not", "remove", "any", "older", "executables", "or", "services", "from", "previous", "runs", "u...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/cloud.py#L893-L935
train
Removes the PAExec service and executable that was created as part of .
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/crypt.py
dropfile
def dropfile(cachedir, user=None): ''' Set an AES dropfile to request the master update the publish session key ''' dfn = os.path.join(cachedir, '.dfn') # set a mask (to avoid a race condition on file creation) and store original. with salt.utils.files.set_umask(0o277): log.info('Rotatin...
python
def dropfile(cachedir, user=None): ''' Set an AES dropfile to request the master update the publish session key ''' dfn = os.path.join(cachedir, '.dfn') # set a mask (to avoid a race condition on file creation) and store original. with salt.utils.files.set_umask(0o277): log.info('Rotatin...
[ "def", "dropfile", "(", "cachedir", ",", "user", "=", "None", ")", ":", "dfn", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "'.dfn'", ")", "# set a mask (to avoid a race condition on file creation) and store original.", "with", "salt", ".", "utils", ...
Set an AES dropfile to request the master update the publish session key
[ "Set", "an", "AES", "dropfile", "to", "request", "the", "master", "update", "the", "publish", "session", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L82-L105
train
Drop an AES dropfile to request the master update the publish session 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/crypt.py
gen_keys
def gen_keys(keydir, keyname, keysize, user=None, passphrase=None): ''' Generate a RSA public keypair for use with salt :param str keydir: The directory to write the keypair to :param str keyname: The type of salt server for whom this key should be written. (i.e. 'master' or 'minion') :param int ke...
python
def gen_keys(keydir, keyname, keysize, user=None, passphrase=None): ''' Generate a RSA public keypair for use with salt :param str keydir: The directory to write the keypair to :param str keyname: The type of salt server for whom this key should be written. (i.e. 'master' or 'minion') :param int ke...
[ "def", "gen_keys", "(", "keydir", ",", "keyname", ",", "keysize", ",", "user", "=", "None", ",", "passphrase", "=", "None", ")", ":", "base", "=", "os", ".", "path", ".", "join", "(", "keydir", ",", "keyname", ")", "priv", "=", "'{0}.pem'", ".", "f...
Generate a RSA public keypair for use with salt :param str keydir: The directory to write the keypair to :param str keyname: The type of salt server for whom this key should be written. (i.e. 'master' or 'minion') :param int keysize: The number of bits in the key :param str user: The user on the system...
[ "Generate", "a", "RSA", "public", "keypair", "for", "use", "with", "salt" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L108-L168
train
Generate a private keypair for use with salt.
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/crypt.py
_get_key_with_evict
def _get_key_with_evict(path, timestamp, passphrase): ''' Load a private key from disk. `timestamp` above is intended to be the timestamp of the file's last modification. This fn is memoized so if it is called with the same path and timestamp (the file's last modified time) the second time the resu...
python
def _get_key_with_evict(path, timestamp, passphrase): ''' Load a private key from disk. `timestamp` above is intended to be the timestamp of the file's last modification. This fn is memoized so if it is called with the same path and timestamp (the file's last modified time) the second time the resu...
[ "def", "_get_key_with_evict", "(", "path", ",", "timestamp", ",", "passphrase", ")", ":", "log", ".", "debug", "(", "'salt.crypt._get_key_with_evict: Loading private key'", ")", "if", "HAS_M2", ":", "key", "=", "RSA", ".", "load_key", "(", "path", ",", "lambda",...
Load a private key from disk. `timestamp` above is intended to be the timestamp of the file's last modification. This fn is memoized so if it is called with the same path and timestamp (the file's last modified time) the second time the result is returned from the memoiziation. If the file gets modifi...
[ "Load", "a", "private", "key", "from", "disk", ".", "timestamp", "above", "is", "intended", "to", "be", "the", "timestamp", "of", "the", "file", "s", "last", "modification", ".", "This", "fn", "is", "memoized", "so", "if", "it", "is", "called", "with", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L172-L186
train
Load a private key 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/crypt.py
get_rsa_key
def get_rsa_key(path, passphrase): ''' Read a private key off the disk. Poor man's simple cache in effect here, we memoize the result of calling _get_rsa_with_evict. This means the first time _get_key_with_evict is called with a path and a timestamp the result is cached. If the file (the private ...
python
def get_rsa_key(path, passphrase): ''' Read a private key off the disk. Poor man's simple cache in effect here, we memoize the result of calling _get_rsa_with_evict. This means the first time _get_key_with_evict is called with a path and a timestamp the result is cached. If the file (the private ...
[ "def", "get_rsa_key", "(", "path", ",", "passphrase", ")", ":", "log", ".", "debug", "(", "'salt.crypt.get_rsa_key: Loading private key'", ")", "return", "_get_key_with_evict", "(", "path", ",", "six", ".", "text_type", "(", "os", ".", "path", ".", "getmtime", ...
Read a private key off the disk. Poor man's simple cache in effect here, we memoize the result of calling _get_rsa_with_evict. This means the first time _get_key_with_evict is called with a path and a timestamp the result is cached. If the file (the private key) does not change then its timestamp wil...
[ "Read", "a", "private", "key", "off", "the", "disk", ".", "Poor", "man", "s", "simple", "cache", "in", "effect", "here", "we", "memoize", "the", "result", "of", "calling", "_get_rsa_with_evict", ".", "This", "means", "the", "first", "time", "_get_key_with_ev...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L189-L201
train
Read a private key 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/crypt.py
get_rsa_pub_key
def get_rsa_pub_key(path): ''' Read a public key off the disk. ''' log.debug('salt.crypt.get_rsa_pub_key: Loading public key') if HAS_M2: with salt.utils.files.fopen(path, 'rb') as f: data = f.read().replace(b'RSA ', b'') bio = BIO.MemoryBuffer(data) key = RSA.loa...
python
def get_rsa_pub_key(path): ''' Read a public key off the disk. ''' log.debug('salt.crypt.get_rsa_pub_key: Loading public key') if HAS_M2: with salt.utils.files.fopen(path, 'rb') as f: data = f.read().replace(b'RSA ', b'') bio = BIO.MemoryBuffer(data) key = RSA.loa...
[ "def", "get_rsa_pub_key", "(", "path", ")", ":", "log", ".", "debug", "(", "'salt.crypt.get_rsa_pub_key: Loading public key'", ")", "if", "HAS_M2", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'rb'", ")", "as", "f", ":"...
Read a public key off the disk.
[ "Read", "a", "public", "key", "off", "the", "disk", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L204-L217
train
Read a public key off the 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/crypt.py
sign_message
def sign_message(privkey_path, message, passphrase=None): ''' Use Crypto.Signature.PKCS1_v1_5 to sign a message. Returns the signature. ''' key = get_rsa_key(privkey_path, passphrase) log.debug('salt.crypt.sign_message: Signing message.') if HAS_M2: md = EVP.MessageDigest('sha1') ...
python
def sign_message(privkey_path, message, passphrase=None): ''' Use Crypto.Signature.PKCS1_v1_5 to sign a message. Returns the signature. ''' key = get_rsa_key(privkey_path, passphrase) log.debug('salt.crypt.sign_message: Signing message.') if HAS_M2: md = EVP.MessageDigest('sha1') ...
[ "def", "sign_message", "(", "privkey_path", ",", "message", ",", "passphrase", "=", "None", ")", ":", "key", "=", "get_rsa_key", "(", "privkey_path", ",", "passphrase", ")", "log", ".", "debug", "(", "'salt.crypt.sign_message: Signing message.'", ")", "if", "HAS...
Use Crypto.Signature.PKCS1_v1_5 to sign a message. Returns the signature.
[ "Use", "Crypto", ".", "Signature", ".", "PKCS1_v1_5", "to", "sign", "a", "message", ".", "Returns", "the", "signature", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L220-L233
train
Sign a message using the specified private 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/crypt.py
verify_signature
def verify_signature(pubkey_path, message, signature): ''' Use Crypto.Signature.PKCS1_v1_5 to verify the signature on a message. Returns True for valid signature. ''' log.debug('salt.crypt.verify_signature: Loading public key') pubkey = get_rsa_pub_key(pubkey_path) log.debug('salt.crypt.veri...
python
def verify_signature(pubkey_path, message, signature): ''' Use Crypto.Signature.PKCS1_v1_5 to verify the signature on a message. Returns True for valid signature. ''' log.debug('salt.crypt.verify_signature: Loading public key') pubkey = get_rsa_pub_key(pubkey_path) log.debug('salt.crypt.veri...
[ "def", "verify_signature", "(", "pubkey_path", ",", "message", ",", "signature", ")", ":", "log", ".", "debug", "(", "'salt.crypt.verify_signature: Loading public key'", ")", "pubkey", "=", "get_rsa_pub_key", "(", "pubkey_path", ")", "log", ".", "debug", "(", "'sa...
Use Crypto.Signature.PKCS1_v1_5 to verify the signature on a message. Returns True for valid signature.
[ "Use", "Crypto", ".", "Signature", ".", "PKCS1_v1_5", "to", "verify", "the", "signature", "on", "a", "message", ".", "Returns", "True", "for", "valid", "signature", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L236-L251
train
Verify a message signature on a node.
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/crypt.py
gen_signature
def gen_signature(priv_path, pub_path, sign_path, passphrase=None): ''' creates a signature for the given public-key with the given private key and writes it to sign_path ''' with salt.utils.files.fopen(pub_path) as fp_: mpub_64 = fp_.read() mpub_sig = sign_message(priv_path, mpub_64, ...
python
def gen_signature(priv_path, pub_path, sign_path, passphrase=None): ''' creates a signature for the given public-key with the given private key and writes it to sign_path ''' with salt.utils.files.fopen(pub_path) as fp_: mpub_64 = fp_.read() mpub_sig = sign_message(priv_path, mpub_64, ...
[ "def", "gen_signature", "(", "priv_path", ",", "pub_path", ",", "sign_path", ",", "passphrase", "=", "None", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "pub_path", ")", "as", "fp_", ":", "mpub_64", "=", "fp_", ".", "read",...
creates a signature for the given public-key with the given private key and writes it to sign_path
[ "creates", "a", "signature", "for", "the", "given", "public", "-", "key", "with", "the", "given", "private", "key", "and", "writes", "it", "to", "sign_path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L254-L281
train
Generates a signature for the given public - key and writes it to sign_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/crypt.py
private_encrypt
def private_encrypt(key, message): ''' Generate an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA key object :param str message: The message to sign :rtype: str :return: The signature, or an empty string if the signature operation failed ''' if HAS_M2: ...
python
def private_encrypt(key, message): ''' Generate an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA key object :param str message: The message to sign :rtype: str :return: The signature, or an empty string if the signature operation failed ''' if HAS_M2: ...
[ "def", "private_encrypt", "(", "key", ",", "message", ")", ":", "if", "HAS_M2", ":", "return", "key", ".", "private_encrypt", "(", "message", ",", "salt", ".", "utils", ".", "rsax931", ".", "RSA_X931_PADDING", ")", "else", ":", "signer", "=", "salt", "."...
Generate an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA key object :param str message: The message to sign :rtype: str :return: The signature, or an empty string if the signature operation failed
[ "Generate", "an", "M2Crypto", "-", "compatible", "signature" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L284-L297
train
Generate an M2Crypto - compatible signature of a message.
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/crypt.py
public_decrypt
def public_decrypt(pub, message): ''' Verify an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA public key object :param str message: The signed message to verify :rtype: str :return: The message (or digest) recovered from the signature, or an empty string...
python
def public_decrypt(pub, message): ''' Verify an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA public key object :param str message: The signed message to verify :rtype: str :return: The message (or digest) recovered from the signature, or an empty string...
[ "def", "public_decrypt", "(", "pub", ",", "message", ")", ":", "if", "HAS_M2", ":", "return", "pub", ".", "public_decrypt", "(", "message", ",", "salt", ".", "utils", ".", "rsax931", ".", "RSA_X931_PADDING", ")", "else", ":", "verifier", "=", "salt", "."...
Verify an M2Crypto-compatible signature :param Crypto.PublicKey.RSA._RSAobj key: The RSA public key object :param str message: The signed message to verify :rtype: str :return: The message (or digest) recovered from the signature, or an empty string if the verification failed
[ "Verify", "an", "M2Crypto", "-", "compatible", "signature" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L300-L314
train
Verify an M2Crypto - compatible signature and return the message or digest
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/crypt.py
MasterKeys.__get_keys
def __get_keys(self, name='master', passphrase=None): ''' Returns a key object for a key in the pki-dir ''' path = os.path.join(self.opts['pki_dir'], name + '.pem') if not os.path.exists(path): log.info('Generating %s keys: %s', name, self....
python
def __get_keys(self, name='master', passphrase=None): ''' Returns a key object for a key in the pki-dir ''' path = os.path.join(self.opts['pki_dir'], name + '.pem') if not os.path.exists(path): log.info('Generating %s keys: %s', name, self....
[ "def", "__get_keys", "(", "self", ",", "name", "=", "'master'", ",", "passphrase", "=", "None", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'pki_dir'", "]", ",", "name", "+", "'.pem'", ")", "if", "not", ...
Returns a key object for a key in the pki-dir
[ "Returns", "a", "key", "object", "for", "a", "key", "in", "the", "pki", "-", "dir" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L383-L407
train
Returns a key object for a key in the pki - dir containing the master 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...