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/modules/drac.py
change_password
def change_password(username, password, uid=None): ''' Change users password CLI Example: .. code-block:: bash salt dell drac.change_password [USERNAME] [PASSWORD] [UID - optional] salt dell drac.change_password diana secret ''' if uid is None: user = list_users() ...
python
def change_password(username, password, uid=None): ''' Change users password CLI Example: .. code-block:: bash salt dell drac.change_password [USERNAME] [PASSWORD] [UID - optional] salt dell drac.change_password diana secret ''' if uid is None: user = list_users() ...
[ "def", "change_password", "(", "username", ",", "password", ",", "uid", "=", "None", ")", ":", "if", "uid", "is", "None", ":", "user", "=", "list_users", "(", ")", "uid", "=", "user", "[", "username", "]", "[", "'index'", "]", "if", "uid", ":", "re...
Change users password CLI Example: .. code-block:: bash salt dell drac.change_password [USERNAME] [PASSWORD] [UID - optional] salt dell drac.change_password diana secret
[ "Change", "users", "password" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L227-L249
train
Change users password
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/drac.py
create_user
def create_user(username, password, permissions, users=None): ''' Create user accounts CLI Example: .. code-block:: bash salt dell drac.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell drac.create_user diana secret login,test_alerts,clear_logs DRAC Privileges * logi...
python
def create_user(username, password, permissions, users=None): ''' Create user accounts CLI Example: .. code-block:: bash salt dell drac.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell drac.create_user diana secret login,test_alerts,clear_logs DRAC Privileges * logi...
[ "def", "create_user", "(", "username", ",", "password", ",", "permissions", ",", "users", "=", "None", ")", ":", "_uids", "=", "set", "(", ")", "if", "users", "is", "None", ":", "users", "=", "list_users", "(", ")", "if", "username", "in", "users", "...
Create user accounts CLI Example: .. code-block:: bash salt dell drac.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell drac.create_user diana secret login,test_alerts,clear_logs DRAC Privileges * login : Login to iDRAC * drac : Con...
[ "Create", "user", "accounts" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L252-L312
train
Create user account and admin accounts and return the user 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/modules/drac.py
set_permissions
def set_permissions(username, permissions, uid=None): ''' Configure users permissions CLI Example: .. code-block:: bash salt dell drac.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell drac.set_permissions diana login,test_alerts,clear_logs 4 DRAC Privileg...
python
def set_permissions(username, permissions, uid=None): ''' Configure users permissions CLI Example: .. code-block:: bash salt dell drac.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell drac.set_permissions diana login,test_alerts,clear_logs 4 DRAC Privileg...
[ "def", "set_permissions", "(", "username", ",", "permissions", ",", "uid", "=", "None", ")", ":", "privileges", "=", "{", "'login'", ":", "'0x0000001'", ",", "'drac'", ":", "'0x0000002'", ",", "'user_management'", ":", "'0x0000004'", ",", "'clear_logs'", ":", ...
Configure users permissions CLI Example: .. code-block:: bash salt dell drac.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell drac.set_permissions diana login,test_alerts,clear_logs 4 DRAC Privileges * login : Login to iDRAC * drac ...
[ "Configure", "users", "permissions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L315-L362
train
Configure users permissions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/drac.py
server_pxe
def server_pxe(): ''' Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell drac.server_pxe ''' if __execute_cmd('config -g cfgServerInfo -o \ cfgServerFirstBootDevice PXE'): if __execute_cmd('config -g cfgServerInfo -o cfgS...
python
def server_pxe(): ''' Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell drac.server_pxe ''' if __execute_cmd('config -g cfgServerInfo -o \ cfgServerFirstBootDevice PXE'): if __execute_cmd('config -g cfgServerInfo -o cfgS...
[ "def", "server_pxe", "(", ")", ":", "if", "__execute_cmd", "(", "'config -g cfgServerInfo -o \\\n cfgServerFirstBootDevice PXE'", ")", ":", "if", "__execute_cmd", "(", "'config -g cfgServerInfo -o cfgServerBootOnce 1'", ")", ":", "return", "server_reboot", "else", ...
Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell drac.server_pxe
[ "Configure", "server", "to", "PXE", "perform", "a", "one", "off", "PXE", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L450-L469
train
Configure server to PXE perform a one off PXE boot AttributeNames CLI Example : bash AttributeNames salt dell drac. server_pxe AttributeNames
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
scripts/suse/yum/plugins/yumnotify.py
_get_mtime
def _get_mtime(): """ Get the modified time of the RPM Database. Returns: Unix ticks """ return os.path.exists(RPM_PATH) and int(os.path.getmtime(RPM_PATH)) or 0
python
def _get_mtime(): """ Get the modified time of the RPM Database. Returns: Unix ticks """ return os.path.exists(RPM_PATH) and int(os.path.getmtime(RPM_PATH)) or 0
[ "def", "_get_mtime", "(", ")", ":", "return", "os", ".", "path", ".", "exists", "(", "RPM_PATH", ")", "and", "int", "(", "os", ".", "path", ".", "getmtime", "(", "RPM_PATH", ")", ")", "or", "0" ]
Get the modified time of the RPM Database. Returns: Unix ticks
[ "Get", "the", "modified", "time", "of", "the", "RPM", "Database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/scripts/suse/yum/plugins/yumnotify.py#L18-L25
train
Get the modified time of the RPM Database.
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
scripts/suse/yum/plugins/yumnotify.py
_get_checksum
def _get_checksum(): """ Get the checksum of the RPM Database. Returns: hexdigest """ digest = hashlib.sha256() with open(RPM_PATH, "rb") as rpm_db_fh: while True: buff = rpm_db_fh.read(0x1000) if not buff: break digest.update(...
python
def _get_checksum(): """ Get the checksum of the RPM Database. Returns: hexdigest """ digest = hashlib.sha256() with open(RPM_PATH, "rb") as rpm_db_fh: while True: buff = rpm_db_fh.read(0x1000) if not buff: break digest.update(...
[ "def", "_get_checksum", "(", ")", ":", "digest", "=", "hashlib", ".", "sha256", "(", ")", "with", "open", "(", "RPM_PATH", ",", "\"rb\"", ")", "as", "rpm_db_fh", ":", "while", "True", ":", "buff", "=", "rpm_db_fh", ".", "read", "(", "0x1000", ")", "i...
Get the checksum of the RPM Database. Returns: hexdigest
[ "Get", "the", "checksum", "of", "the", "RPM", "Database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/scripts/suse/yum/plugins/yumnotify.py#L28-L42
train
Get the checksum of the RPM Database.
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
scripts/suse/yum/plugins/yumnotify.py
posttrans_hook
def posttrans_hook(conduit): """ Hook after the package installation transaction. :param conduit: :return: """ # Integrate Yum with Salt if 'SALT_RUNNING' not in os.environ: with open(CK_PATH, 'w') as ck_fh: ck_fh.write('{chksum} {mtime}\n'.format(chksum=_get_checksum(),...
python
def posttrans_hook(conduit): """ Hook after the package installation transaction. :param conduit: :return: """ # Integrate Yum with Salt if 'SALT_RUNNING' not in os.environ: with open(CK_PATH, 'w') as ck_fh: ck_fh.write('{chksum} {mtime}\n'.format(chksum=_get_checksum(),...
[ "def", "posttrans_hook", "(", "conduit", ")", ":", "# Integrate Yum with Salt", "if", "'SALT_RUNNING'", "not", "in", "os", ".", "environ", ":", "with", "open", "(", "CK_PATH", ",", "'w'", ")", "as", "ck_fh", ":", "ck_fh", ".", "write", "(", "'{chksum} {mtime...
Hook after the package installation transaction. :param conduit: :return:
[ "Hook", "after", "the", "package", "installation", "transaction", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/scripts/suse/yum/plugins/yumnotify.py#L45-L55
train
Hook after the package installation transaction.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
_parse_master
def _parse_master(path=MASTER_CF): ''' Parse the master.cf file. This file is essentially a whitespace-delimited columnar file. The columns are: service, type, private (yes), unpriv (yes), chroot (yes), wakeup (never), maxproc (100), command + args. This function parses out the columns, leaving emp...
python
def _parse_master(path=MASTER_CF): ''' Parse the master.cf file. This file is essentially a whitespace-delimited columnar file. The columns are: service, type, private (yes), unpriv (yes), chroot (yes), wakeup (never), maxproc (100), command + args. This function parses out the columns, leaving emp...
[ "def", "_parse_master", "(", "path", "=", "MASTER_CF", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r'", ")", "as", "fh_", ":", "full_conf", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", ...
Parse the master.cf file. This file is essentially a whitespace-delimited columnar file. The columns are: service, type, private (yes), unpriv (yes), chroot (yes), wakeup (never), maxproc (100), command + args. This function parses out the columns, leaving empty lines and comments intact. Where the val...
[ "Parse", "the", "master", ".", "cf", "file", ".", "This", "file", "is", "essentially", "a", "whitespace", "-", "delimited", "columnar", "file", ".", "The", "columns", "are", ":", "service", "type", "private", "(", "yes", ")", "unpriv", "(", "yes", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L45-L84
train
Parse the master. cf file and return a dict of active config lines and a list of all active config lines.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
set_master
def set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path=MASTER_CF): ''' Set a single config value in...
python
def set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path=MASTER_CF): ''' Set a single config value in...
[ "def", "set_master", "(", "service", ",", "conn_type", ",", "private", "=", "'y'", ",", "unpriv", "=", "'y'", ",", "chroot", "=", "'y'", ",", "wakeup", "=", "'n'", ",", "maxproc", "=", "'100'", ",", "command", "=", "''", ",", "write_conf", "=", "True...
Set a single config value in the master.cf file. If the value does not already exist, it will be appended to the end. Because of shell parsing issues, '-' cannot be set as a value, as is normal in the master.cf file; either 'y', 'n' or a number should be used when calling this function from the command...
[ "Set", "a", "single", "config", "value", "in", "the", "master", ".", "cf", "file", ".", "If", "the", "value", "does", "not", "already", "exist", "it", "will", "be", "appended", "to", "the", "end", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L104-L169
train
Set the master. cf file with the specified settings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
_format_master
def _format_master(service, conn_type, private, unpriv, chroot, wakeup, maxproc, command): ''' Format the given values into the style of line normally used in the master.cf fi...
python
def _format_master(service, conn_type, private, unpriv, chroot, wakeup, maxproc, command): ''' Format the given values into the style of line normally used in the master.cf fi...
[ "def", "_format_master", "(", "service", ",", "conn_type", ",", "private", ",", "unpriv", ",", "chroot", ",", "wakeup", ",", "maxproc", ",", "command", ")", ":", "#==========================================================================", "#service type private unpriv c...
Format the given values into the style of line normally used in the master.cf file.
[ "Format", "the", "given", "values", "into", "the", "style", "of", "line", "normally", "used", "in", "the", "master", ".", "cf", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L172-L216
train
Format the given values into the style of line normally used in the master. cf file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
_parse_main
def _parse_main(path=MAIN_CF): ''' Parse files in the style of main.cf. This is not just a "name = value" file; there are other rules: * Comments start with # * Any whitespace at the beginning of a line denotes that that line is a continuation from the previous line. * The whitespace ru...
python
def _parse_main(path=MAIN_CF): ''' Parse files in the style of main.cf. This is not just a "name = value" file; there are other rules: * Comments start with # * Any whitespace at the beginning of a line denotes that that line is a continuation from the previous line. * The whitespace ru...
[ "def", "_parse_main", "(", "path", "=", "MAIN_CF", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r'", ")", "as", "fh_", ":", "full_conf", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(",...
Parse files in the style of main.cf. This is not just a "name = value" file; there are other rules: * Comments start with # * Any whitespace at the beginning of a line denotes that that line is a continuation from the previous line. * The whitespace rule applies to comments. * Keys defined ...
[ "Parse", "files", "in", "the", "style", "of", "main", ".", "cf", ".", "This", "is", "not", "just", "a", "name", "=", "value", "file", ";", "there", "are", "other", "rules", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L219-L264
train
Parse the main. cf file and return a list of key = value pairs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
set_main
def set_main(key, value, path=MAIN_CF): ''' Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end. CLI Example: salt <minion> postfix.set_main mailq_path /usr/bin/mailq ''' pairs, conf_list = _parse_main(path) new_conf =...
python
def set_main(key, value, path=MAIN_CF): ''' Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end. CLI Example: salt <minion> postfix.set_main mailq_path /usr/bin/mailq ''' pairs, conf_list = _parse_main(path) new_conf =...
[ "def", "set_main", "(", "key", ",", "value", ",", "path", "=", "MAIN_CF", ")", ":", "pairs", ",", "conf_list", "=", "_parse_main", "(", "path", ")", "new_conf", "=", "[", "]", "key_line_match", "=", "re", ".", "compile", "(", "\"^{0}([\\\\s=]|$)\"", ".",...
Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end. CLI Example: salt <minion> postfix.set_main mailq_path /usr/bin/mailq
[ "Set", "a", "single", "config", "value", "in", "the", "main", ".", "cf", "file", ".", "If", "the", "value", "does", "not", "already", "exist", "it", "will", "be", "appended", "to", "the", "end", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L284-L308
train
Set a single config value in the main. cf file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
_write_conf
def _write_conf(conf, path=MAIN_CF): ''' Write out configuration file. ''' with salt.utils.files.fopen(path, 'w') as fh_: for line in conf: line = salt.utils.stringutils.to_str(line) if isinstance(line, dict): fh_.write(' '.join(line)) else: ...
python
def _write_conf(conf, path=MAIN_CF): ''' Write out configuration file. ''' with salt.utils.files.fopen(path, 'w') as fh_: for line in conf: line = salt.utils.stringutils.to_str(line) if isinstance(line, dict): fh_.write(' '.join(line)) else: ...
[ "def", "_write_conf", "(", "conf", ",", "path", "=", "MAIN_CF", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'w'", ")", "as", "fh_", ":", "for", "line", "in", "conf", ":", "line", "=", "salt", ".", "utils...
Write out configuration file.
[ "Write", "out", "configuration", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L311-L322
train
Write out the configuration file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
show_queue
def show_queue(): ''' Show contents of the mail queue CLI Example: .. code-block:: bash salt '*' postfix.show_queue ''' cmd = 'mailq' out = __salt__['cmd.run'](cmd).splitlines() queue = [] queue_pattern = re.compile(r"(?P<queue_id>^[A-Z0-9]+)\s+(?P<size>\d+)\s(?P<timesta...
python
def show_queue(): ''' Show contents of the mail queue CLI Example: .. code-block:: bash salt '*' postfix.show_queue ''' cmd = 'mailq' out = __salt__['cmd.run'](cmd).splitlines() queue = [] queue_pattern = re.compile(r"(?P<queue_id>^[A-Z0-9]+)\s+(?P<size>\d+)\s(?P<timesta...
[ "def", "show_queue", "(", ")", ":", "cmd", "=", "'mailq'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "queue", "=", "[", "]", "queue_pattern", "=", "re", ".", "compile", "(", "r\"(?P<queue_id>^[A-Z0-9]+)\...
Show contents of the mail queue CLI Example: .. code-block:: bash salt '*' postfix.show_queue
[ "Show", "contents", "of", "the", "mail", "queue" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L325-L357
train
Show contents of the mail queue VIRTUALELEMENT.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/postfix.py
delete
def delete(queue_id): ''' Delete message(s) from the mail queue CLI Example: .. code-block:: bash salt '*' postfix.delete 5C33CA0DEA salt '*' postfix.delete ALL ''' ret = {'message': '', 'result': True } if not queue_id: log.error('Require...
python
def delete(queue_id): ''' Delete message(s) from the mail queue CLI Example: .. code-block:: bash salt '*' postfix.delete 5C33CA0DEA salt '*' postfix.delete ALL ''' ret = {'message': '', 'result': True } if not queue_id: log.error('Require...
[ "def", "delete", "(", "queue_id", ")", ":", "ret", "=", "{", "'message'", ":", "''", ",", "'result'", ":", "True", "}", "if", "not", "queue_id", ":", "log", ".", "error", "(", "'Require argument queue_id'", ")", "if", "not", "queue_id", "==", "'ALL'", ...
Delete message(s) from the mail queue CLI Example: .. code-block:: bash salt '*' postfix.delete 5C33CA0DEA salt '*' postfix.delete ALL
[ "Delete", "message", "(", "s", ")", "from", "the", "mail", "queue" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postfix.py#L360-L406
train
Delete all messages from the mail 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/modules/solrcloud.py
collection_get_options
def collection_get_options(collection_name, **kwargs): ''' Get collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query CLI Example: .. code-block:: bash salt '*' solrcloud.collection_get_options collection_name ''' cluster = cluster_st...
python
def collection_get_options(collection_name, **kwargs): ''' Get collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query CLI Example: .. code-block:: bash salt '*' solrcloud.collection_get_options collection_name ''' cluster = cluster_st...
[ "def", "collection_get_options", "(", "collection_name", ",", "*", "*", "kwargs", ")", ":", "cluster", "=", "cluster_status", "(", "*", "*", "kwargs", ")", "options", "=", "{", "\"collection.configName\"", ":", "cluster", "[", "\"collections\"", "]", "[", "col...
Get collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query CLI Example: .. code-block:: bash salt '*' solrcloud.collection_get_options collection_name
[ "Get", "collection", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solrcloud.py#L445-L473
train
Get collection options
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solrcloud.py
collection_set_options
def collection_set_options(collection_name, options, **kwargs): ''' Change collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query Note that not every parameter can be changed after collection creation CLI Example: .. code-block:: bash sal...
python
def collection_set_options(collection_name, options, **kwargs): ''' Change collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query Note that not every parameter can be changed after collection creation CLI Example: .. code-block:: bash sal...
[ "def", "collection_set_options", "(", "collection_name", ",", "options", ",", "*", "*", "kwargs", ")", ":", "for", "option", "in", "list", "(", "options", ".", "keys", "(", ")", ")", ":", "if", "option", "not", "in", "CREATION_ONLY_OPTION", ":", "raise", ...
Change collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query Note that not every parameter can be changed after collection creation CLI Example: .. code-block:: bash salt '*' solrcloud.collection_set_options collection_name options={"replication...
[ "Change", "collection", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solrcloud.py#L476-L497
train
Change collection options
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/keystore.py
list
def list(keystore, passphrase, alias=None, return_cert=False): ''' Lists certificates in a keytool managed keystore. :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore :param alias: (Optional) If found, displays details on only t...
python
def list(keystore, passphrase, alias=None, return_cert=False): ''' Lists certificates in a keytool managed keystore. :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore :param alias: (Optional) If found, displays details on only t...
[ "def", "list", "(", "keystore", ",", "passphrase", ",", "alias", "=", "None", ",", "return_cert", "=", "False", ")", ":", "ASN1", "=", "OpenSSL", ".", "crypto", ".", "FILETYPE_ASN1", "PEM", "=", "OpenSSL", ".", "crypto", ".", "FILETYPE_PEM", "decoded_certs...
Lists certificates in a keytool managed keystore. :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore :param alias: (Optional) If found, displays details on only this key :param return_certs: (Optional) Also return certificate PEM. ...
[ "Lists", "certificates", "in", "a", "keytool", "managed", "keystore", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystore.py#L63-L121
train
Lists certificates in a keytool managed keystore.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/keystore.py
add
def add(name, keystore, passphrase, certificate, private_key=None): ''' Adds certificates to an existing keystore or creates a new one if necesssary. :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the...
python
def add(name, keystore, passphrase, certificate, private_key=None): ''' Adds certificates to an existing keystore or creates a new one if necesssary. :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the...
[ "def", "add", "(", "name", ",", "keystore", ",", "passphrase", ",", "certificate", ",", "private_key", "=", "None", ")", ":", "ASN1", "=", "OpenSSL", ".", "crypto", ".", "FILETYPE_ASN1", "PEM", "=", "OpenSSL", ".", "crypto", ".", "FILETYPE_PEM", "certs_lis...
Adds certificates to an existing keystore or creates a new one if necesssary. :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore :param certificate: The PEM public certificate to add to keystore....
[ "Adds", "certificates", "to", "an", "existing", "keystore", "or", "creates", "a", "new", "one", "if", "necesssary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystore.py#L124-L172
train
Adds certificates to an existing keystore or creates a new one if necesssary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/keystore.py
remove
def remove(name, keystore, passphrase): ''' Removes a certificate from an existing keystore. Returns True if remove was successful, otherwise False :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode t...
python
def remove(name, keystore, passphrase): ''' Removes a certificate from an existing keystore. Returns True if remove was successful, otherwise False :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode t...
[ "def", "remove", "(", "name", ",", "keystore", ",", "passphrase", ")", ":", "certs_list", "=", "[", "]", "keystore_object", "=", "jks", ".", "KeyStore", ".", "load", "(", "keystore", ",", "passphrase", ")", "for", "alias", ",", "loaded_cert", "in", "keys...
Removes a certificate from an existing keystore. Returns True if remove was successful, otherwise False :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore CLI Example: .. code-block:: b...
[ "Removes", "a", "certificate", "from", "an", "existing", "keystore", ".", "Returns", "True", "if", "remove", "was", "successful", "otherwise", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystore.py#L175-L203
train
Removes a certificate from an existing keystore
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/cache/localfs.py
store
def store(bank, key, data, cachedir): ''' Store information in a file. ''' base = os.path.join(cachedir, os.path.normpath(bank)) try: os.makedirs(base) except OSError as exc: if exc.errno != errno.EEXIST: raise SaltCacheError( 'The cache directory, {0}...
python
def store(bank, key, data, cachedir): ''' Store information in a file. ''' base = os.path.join(cachedir, os.path.normpath(bank)) try: os.makedirs(base) except OSError as exc: if exc.errno != errno.EEXIST: raise SaltCacheError( 'The cache directory, {0}...
[ "def", "store", "(", "bank", ",", "key", ",", "data", ",", "cachedir", ")", ":", "base", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "os", ".", "path", ".", "normpath", "(", "bank", ")", ")", "try", ":", "os", ".", "makedirs", "(...
Store information in a file.
[ "Store", "information", "in", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L44-L72
train
Store information 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/cache/localfs.py
fetch
def fetch(bank, key, cachedir): ''' Fetch information from a file. ''' inkey = False key_file = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key)) if not os.path.isfile(key_file): # The bank includes the full filename, and the key is inside the file key_file = os...
python
def fetch(bank, key, cachedir): ''' Fetch information from a file. ''' inkey = False key_file = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key)) if not os.path.isfile(key_file): # The bank includes the full filename, and the key is inside the file key_file = os...
[ "def", "fetch", "(", "bank", ",", "key", ",", "cachedir", ")", ":", "inkey", "=", "False", "key_file", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "os", ".", "path", ".", "normpath", "(", "bank", ")", ",", "'{0}.p'", ".", "format", ...
Fetch information from a file.
[ "Fetch", "information", "from", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L75-L100
train
Fetch information 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/cache/localfs.py
updated
def updated(bank, key, cachedir): ''' Return the epoch of the mtime for this cache file ''' key_file = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key)) if not os.path.isfile(key_file): log.warning('Cache file "%s" does not exist', key_file) return None try: ...
python
def updated(bank, key, cachedir): ''' Return the epoch of the mtime for this cache file ''' key_file = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key)) if not os.path.isfile(key_file): log.warning('Cache file "%s" does not exist', key_file) return None try: ...
[ "def", "updated", "(", "bank", ",", "key", ",", "cachedir", ")", ":", "key_file", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "os", ".", "path", ".", "normpath", "(", "bank", ")", ",", "'{0}.p'", ".", "format", "(", "key", ")", ")"...
Return the epoch of the mtime for this cache file
[ "Return", "the", "epoch", "of", "the", "mtime", "for", "this", "cache", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L103-L118
train
Return the epoch of the mtime for this cache 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/cache/localfs.py
flush
def flush(bank, key=None, cachedir=None): ''' Remove the key from the cache bank with all the key content. ''' if cachedir is None: cachedir = __cachedir() try: if key is None: target = os.path.join(cachedir, os.path.normpath(bank)) if not os.path.isdir(targe...
python
def flush(bank, key=None, cachedir=None): ''' Remove the key from the cache bank with all the key content. ''' if cachedir is None: cachedir = __cachedir() try: if key is None: target = os.path.join(cachedir, os.path.normpath(bank)) if not os.path.isdir(targe...
[ "def", "flush", "(", "bank", ",", "key", "=", "None", ",", "cachedir", "=", "None", ")", ":", "if", "cachedir", "is", "None", ":", "cachedir", "=", "__cachedir", "(", ")", "try", ":", "if", "key", "is", "None", ":", "target", "=", "os", ".", "pat...
Remove the key from the cache bank with all the key content.
[ "Remove", "the", "key", "from", "the", "cache", "bank", "with", "all", "the", "key", "content", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L121-L145
train
Remove the key from the cache bank with all the key content.
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/cache/localfs.py
list_
def list_(bank, cachedir): ''' Return an iterable object containing all entries stored in the specified bank. ''' base = os.path.join(cachedir, os.path.normpath(bank)) if not os.path.isdir(base): return [] try: items = os.listdir(base) except OSError as exc: raise Sal...
python
def list_(bank, cachedir): ''' Return an iterable object containing all entries stored in the specified bank. ''' base = os.path.join(cachedir, os.path.normpath(bank)) if not os.path.isdir(base): return [] try: items = os.listdir(base) except OSError as exc: raise Sal...
[ "def", "list_", "(", "bank", ",", "cachedir", ")", ":", "base", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "os", ".", "path", ".", "normpath", "(", "bank", ")", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "base", ")"...
Return an iterable object containing all entries stored in the specified bank.
[ "Return", "an", "iterable", "object", "containing", "all", "entries", "stored", "in", "the", "specified", "bank", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L148-L169
train
Return an iterable object containing all entries stored in the specified bank.
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/cache/localfs.py
contains
def contains(bank, key, cachedir): ''' Checks if the specified bank contains the specified key. ''' if key is None: base = os.path.join(cachedir, os.path.normpath(bank)) return os.path.isdir(base) else: keyfile = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(k...
python
def contains(bank, key, cachedir): ''' Checks if the specified bank contains the specified key. ''' if key is None: base = os.path.join(cachedir, os.path.normpath(bank)) return os.path.isdir(base) else: keyfile = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(k...
[ "def", "contains", "(", "bank", ",", "key", ",", "cachedir", ")", ":", "if", "key", "is", "None", ":", "base", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "os", ".", "path", ".", "normpath", "(", "bank", ")", ")", "return", "os", ...
Checks if the specified bank contains the specified key.
[ "Checks", "if", "the", "specified", "bank", "contains", "the", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/localfs.py#L172-L181
train
Checks if the specified bank contains the specified key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/win_reg.py
key_exists
def key_exists(hive, key, use_32bit_registry=False): ''' Check that the key is found in the registry. This refers to keys and not value/data pairs. To check value/data pairs, use ``value_exists`` Args: hive (str): The hive to connect to key (str): The key to check use_32bit_r...
python
def key_exists(hive, key, use_32bit_registry=False): ''' Check that the key is found in the registry. This refers to keys and not value/data pairs. To check value/data pairs, use ``value_exists`` Args: hive (str): The hive to connect to key (str): The key to check use_32bit_r...
[ "def", "key_exists", "(", "hive", ",", "key", ",", "use_32bit_registry", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "registry", "=", "Registry", "(", ")", "try", ":", "hke...
Check that the key is found in the registry. This refers to keys and not value/data pairs. To check value/data pairs, use ``value_exists`` Args: hive (str): The hive to connect to key (str): The key to check use_32bit_registry (bool): Look in the 32bit portion of the registry Re...
[ "Check", "that", "the", "key", "is", "found", "in", "the", "registry", ".", "This", "refers", "to", "keys", "and", "not", "value", "/", "data", "pairs", ".", "To", "check", "value", "/", "data", "pairs", "use", "value_exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L162-L205
train
Check that the key exists in the registry.
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/win_reg.py
value_exists
def value_exists(hive, key, vname, use_32bit_registry=False): ''' Check that the value/data pair is found in the registry. .. version-added:: 2018.3.4 Args: hive (str): The hive to connect to key (str): The key to check in vname (str): The name of the value/data pair you're ...
python
def value_exists(hive, key, vname, use_32bit_registry=False): ''' Check that the value/data pair is found in the registry. .. version-added:: 2018.3.4 Args: hive (str): The hive to connect to key (str): The key to check in vname (str): The name of the value/data pair you're ...
[ "def", "value_exists", "(", "hive", ",", "key", ",", "vname", ",", "use_32bit_registry", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "local_vname", "=", "_to_unicode", "(", "...
Check that the value/data pair is found in the registry. .. version-added:: 2018.3.4 Args: hive (str): The hive to connect to key (str): The key to check in vname (str): The name of the value/data pair you're checking use_32bit_registry (bool): Look in the 32bit portion of ...
[ "Check", "that", "the", "value", "/", "data", "pair", "is", "found", "in", "the", "registry", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L208-L266
train
Check that a value/data pair exists in the registry.
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/win_reg.py
broadcast_change
def broadcast_change(): ''' Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: .. code-block:: python ...
python
def broadcast_change(): ''' Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: .. code-block:: python ...
[ "def", "broadcast_change", "(", ")", ":", "# https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952(v=vs.85).aspx", "_", ",", "res", "=", "win32gui", ".", "SendMessageTimeout", "(", "win32con", ".", "HWND_BROADCAST", ",", "win32con", ".", "WM_SETTINGCHANGE", ",",...
Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: .. code-block:: python import salt.utils.win_reg ...
[ "Refresh", "the", "windows", "environment", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L269-L291
train
Broadcasts a change to the Windows environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/win_reg.py
list_keys
def list_keys(hive, key=None, use_32bit_registry=False): ''' Enumerates the subkeys in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU -...
python
def list_keys(hive, key=None, use_32bit_registry=False): ''' Enumerates the subkeys in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU -...
[ "def", "list_keys", "(", "hive", ",", "key", "=", "None", ",", "use_32bit_registry", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "registry", "=", "Registry", "(", ")", "try...
Enumerates the subkeys in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU - HKEY_USERS or HKU - HKEY_CLASSES_ROOT or HKCR ...
[ "Enumerates", "the", "subkeys", "in", "a", "registry", "key", "or", "hive", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L294-L357
train
Return a list of all keys under the given hive or key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/win_reg.py
list_values
def list_values(hive, key=None, use_32bit_registry=False, include_default=True): ''' Enumerates the values in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER o...
python
def list_values(hive, key=None, use_32bit_registry=False, include_default=True): ''' Enumerates the values in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER o...
[ "def", "list_values", "(", "hive", ",", "key", "=", "None", ",", "use_32bit_registry", "=", "False", ",", "include_default", "=", "True", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "regis...
Enumerates the values in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU - HKEY_USER or HKU - HKEY_CLASSES_ROOT or HKCR ...
[ "Enumerates", "the", "values", "in", "a", "registry", "key", "or", "hive", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L360-L438
train
Return a list of values under the given hive or key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/win_reg.py
read_value
def read_value(hive, key, vname=None, use_32bit_registry=False): r''' Reads a registry value entry or the default value for a key. To read the default value, don't pass ``vname`` Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM ...
python
def read_value(hive, key, vname=None, use_32bit_registry=False): r''' Reads a registry value entry or the default value for a key. To read the default value, don't pass ``vname`` Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM ...
[ "def", "read_value", "(", "hive", ",", "key", ",", "vname", "=", "None", ",", "use_32bit_registry", "=", "False", ")", ":", "# If no name is passed, the default value of the key will be returned", "# The value name is Default", "# Setup the return array", "local_hive", "=", ...
r''' Reads a registry value entry or the default value for a key. To read the default value, don't pass ``vname`` Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU - HKEY_USER or HKU ...
[ "r", "Reads", "a", "registry", "value", "entry", "or", "the", "default", "value", "for", "a", "key", ".", "To", "read", "the", "default", "value", "don", "t", "pass", "vname" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L441-L555
train
r Reads a value from the registry entry or the default value for a key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/win_reg.py
set_value
def set_value(hive, key, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False, volatile=False): ''' Sets a value in the registry. If ``vname`` is passed, it will be the value for that value name, otherwise it wil...
python
def set_value(hive, key, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False, volatile=False): ''' Sets a value in the registry. If ``vname`` is passed, it will be the value for that value name, otherwise it wil...
[ "def", "set_value", "(", "hive", ",", "key", ",", "vname", "=", "None", ",", "vdata", "=", "None", ",", "vtype", "=", "'REG_SZ'", ",", "use_32bit_registry", "=", "False", ",", "volatile", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "...
Sets a value in the registry. If ``vname`` is passed, it will be the value for that value name, otherwise it will be the default value for the specified key Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM ...
[ "Sets", "a", "value", "in", "the", "registry", ".", "If", "vname", "is", "passed", "it", "will", "be", "the", "value", "for", "that", "value", "name", "otherwise", "it", "will", "be", "the", "default", "value", "for", "the", "specified", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L558-L719
train
Sets a value in the registry.
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/win_reg.py
cast_vdata
def cast_vdata(vdata=None, vtype='REG_SZ'): ''' Cast the ``vdata` value to the appropriate data type for the registry type specified in ``vtype`` Args: vdata (str, int, list, bytes): The data to cast vtype (str): The type of data to be written to the registry. Must be one ...
python
def cast_vdata(vdata=None, vtype='REG_SZ'): ''' Cast the ``vdata` value to the appropriate data type for the registry type specified in ``vtype`` Args: vdata (str, int, list, bytes): The data to cast vtype (str): The type of data to be written to the registry. Must be one ...
[ "def", "cast_vdata", "(", "vdata", "=", "None", ",", "vtype", "=", "'REG_SZ'", ")", ":", "# Check data type and cast to expected type", "# int will automatically become long on 64bit numbers", "# https://www.python.org/dev/peps/pep-0237/", "registry", "=", "Registry", "(", ")",...
Cast the ``vdata` value to the appropriate data type for the registry type specified in ``vtype`` Args: vdata (str, int, list, bytes): The data to cast vtype (str): The type of data to be written to the registry. Must be one of the following: - REG_BIN...
[ "Cast", "the", "vdata", "value", "to", "the", "appropriate", "data", "type", "for", "the", "registry", "type", "specified", "in", "vtype" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L722-L777
train
Cast the vdata value to the appropriate data type for the registry type specified in vtype.
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/win_reg.py
delete_key_recursive
def delete_key_recursive(hive, key, use_32bit_registry=False): ''' .. versionadded:: 2015.5.4 Delete a registry key to include all subkeys and value/data pairs. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM ...
python
def delete_key_recursive(hive, key, use_32bit_registry=False): ''' .. versionadded:: 2015.5.4 Delete a registry key to include all subkeys and value/data pairs. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM ...
[ "def", "delete_key_recursive", "(", "hive", ",", "key", ",", "use_32bit_registry", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "# Instantiate the registry object", "registry", "=", ...
.. versionadded:: 2015.5.4 Delete a registry key to include all subkeys and value/data pairs. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU - HKEY_USER or HKU ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "4" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L780-L887
train
Delete a key in a registry recursively.
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/win_reg.py
delete_value
def delete_value(hive, key, vname=None, use_32bit_registry=False): ''' Delete a registry value entry or the default value for a key. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or ...
python
def delete_value(hive, key, vname=None, use_32bit_registry=False): ''' Delete a registry value entry or the default value for a key. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or ...
[ "def", "delete_value", "(", "hive", ",", "key", ",", "vname", "=", "None", ",", "use_32bit_registry", "=", "False", ")", ":", "local_hive", "=", "_to_unicode", "(", "hive", ")", "local_key", "=", "_to_unicode", "(", "key", ")", "local_vname", "=", "_to_uni...
Delete a registry value entry or the default value for a key. Args: hive (str): The name of the hive. Can be one of the following - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU - HKEY_USER or HKU - HKEY_CLASSES_ROOT or ...
[ "Delete", "a", "registry", "value", "entry", "or", "the", "default", "value", "for", "a", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_reg.py#L890-L955
train
Delete a value from the registry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at_solaris.py
atq
def atq(tag=None): ''' List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ''' jobs = [] res = __salt__['cmd.run_all']('atq') if res['r...
python
def atq(tag=None): ''' List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ''' jobs = [] res = __salt__['cmd.run_all']('atq') if res['r...
[ "def", "atq", "(", "tag", "=", "None", ")", ":", "jobs", "=", "[", "]", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'atq'", ")", "if", "res", "[", "'retcode'", "]", ">", "0", ":", "return", "{", "'error'", ":", "res", "[", "'stderr'"...
List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number]
[ "List", "all", "queued", "and", "running", "jobs", "or", "only", "those", "with", "an", "optional", "tag", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at_solaris.py#L50-L121
train
Return all queued and running jobs or only those with optional 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/modules/at_solaris.py
atrm
def atrm(*args): ''' Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag] ''' if not args: return {'jobs': {'removed': [], 'tag': None}} if args[0] == 'al...
python
def atrm(*args): ''' Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag] ''' if not args: return {'jobs': {'removed': [], 'tag': None}} if args[0] == 'al...
[ "def", "atrm", "(", "*", "args", ")", ":", "if", "not", "args", ":", "return", "{", "'jobs'", ":", "{", "'removed'", ":", "[", "]", ",", "'tag'", ":", "None", "}", "}", "if", "args", "[", "0", "]", "==", "'all'", ":", "if", "len", "(", "args"...
Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag]
[ "Remove", "jobs", "from", "the", "queue", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at_solaris.py#L124-L167
train
Remove jobs from 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/modules/at_solaris.py
at
def at(*args, **kwargs): # pylint: disable=C0103 ''' Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' ...
python
def at(*args, **kwargs): # pylint: disable=C0103 ''' Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' ...
[ "def", "at", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0103", "# check args", "if", "len", "(", "args", ")", "<", "2", ":", "return", "{", "'jobs'", ":", "[", "]", "}", "# build job", "if", "'tag'", "in", "kwargs", ":",...
Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' tag=reboot salt '*' at.at '3:05am +3 days' 'bin/myscri...
[ "Add", "a", "job", "to", "the", "queue", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at_solaris.py#L170-L211
train
Add a job to the
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at_solaris.py
atc
def atc(jobid): ''' Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid> ''' atjob_file = '/var/spool/cron/atjobs/{job}'.format( job=jobid ...
python
def atc(jobid): ''' Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid> ''' atjob_file = '/var/spool/cron/atjobs/{job}'.format( job=jobid ...
[ "def", "atc", "(", "jobid", ")", ":", "atjob_file", "=", "'/var/spool/cron/atjobs/{job}'", ".", "format", "(", "job", "=", "jobid", ")", "if", "__salt__", "[", "'file.file_exists'", "]", "(", "atjob_file", ")", ":", "with", "salt", ".", "utils", ".", "file...
Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid>
[ "Print", "the", "at", "(", "1", ")", "script", "that", "will", "run", "for", "the", "passed", "job", "id", ".", "This", "is", "mostly", "for", "debugging", "so", "the", "output", "will", "just", "be", "text", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at_solaris.py#L214-L235
train
Print the atc script that will run for the passed jobid. This is mostly for debugging so the output will be text.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_refine_enc
def _refine_enc(enc): ''' Return the properly formatted ssh value for the authorized encryption key type. ecdsa defaults to 256 bits, must give full ecdsa enc schema string if using higher enc. If the type is not found, raise CommandExecutionError. ''' rsa = ['r', 'rsa', 'ssh-rsa'] dss = ['...
python
def _refine_enc(enc): ''' Return the properly formatted ssh value for the authorized encryption key type. ecdsa defaults to 256 bits, must give full ecdsa enc schema string if using higher enc. If the type is not found, raise CommandExecutionError. ''' rsa = ['r', 'rsa', 'ssh-rsa'] dss = ['...
[ "def", "_refine_enc", "(", "enc", ")", ":", "rsa", "=", "[", "'r'", ",", "'rsa'", ",", "'ssh-rsa'", "]", "dss", "=", "[", "'d'", ",", "'dsa'", ",", "'dss'", ",", "'ssh-dss'", "]", "ecdsa", "=", "[", "'e'", ",", "'ecdsa'", ",", "'ecdsa-sha2-nistp521'"...
Return the properly formatted ssh value for the authorized encryption key type. ecdsa defaults to 256 bits, must give full ecdsa enc schema string if using higher enc. If the type is not found, raise CommandExecutionError.
[ "Return", "the", "properly", "formatted", "ssh", "value", "for", "the", "authorized", "encryption", "key", "type", ".", "ecdsa", "defaults", "to", "256", "bits", "must", "give", "full", "ecdsa", "enc", "schema", "string", "if", "using", "higher", "enc", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L52-L80
train
Return the properly formatted ssh value for the authorized encryption key enc.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_format_auth_line
def _format_auth_line(key, enc, comment, options): ''' Properly format user input. ''' line = '' if options: line += '{0} '.format(','.join(options)) line += '{0} {1} {2}\n'.format(enc, key, comment) return line
python
def _format_auth_line(key, enc, comment, options): ''' Properly format user input. ''' line = '' if options: line += '{0} '.format(','.join(options)) line += '{0} {1} {2}\n'.format(enc, key, comment) return line
[ "def", "_format_auth_line", "(", "key", ",", "enc", ",", "comment", ",", "options", ")", ":", "line", "=", "''", "if", "options", ":", "line", "+=", "'{0} '", ".", "format", "(", "','", ".", "join", "(", "options", ")", ")", "line", "+=", "'{0} {1} {...
Properly format user input.
[ "Properly", "format", "user", "input", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L83-L91
train
Format auth line.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_expand_authorized_keys_path
def _expand_authorized_keys_path(path, user, home): ''' Expand the AuthorizedKeysFile expression. Defined in man sshd_config(5) ''' converted_path = '' had_escape = False for char in path: if had_escape: had_escape = False if char == '%': converted...
python
def _expand_authorized_keys_path(path, user, home): ''' Expand the AuthorizedKeysFile expression. Defined in man sshd_config(5) ''' converted_path = '' had_escape = False for char in path: if had_escape: had_escape = False if char == '%': converted...
[ "def", "_expand_authorized_keys_path", "(", "path", ",", "user", ",", "home", ")", ":", "converted_path", "=", "''", "had_escape", "=", "False", "for", "char", "in", "path", ":", "if", "had_escape", ":", "had_escape", "=", "False", "if", "char", "==", "'%'...
Expand the AuthorizedKeysFile expression. Defined in man sshd_config(5)
[ "Expand", "the", "AuthorizedKeysFile", "expression", ".", "Defined", "in", "man", "sshd_config", "(", "5", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L94-L120
train
Expand the AuthorizedKeysFile expression. Defined in man sshd_config ( 5 )
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_get_config_file
def _get_config_file(user, config): ''' Get absolute path to a user's ssh_config. ''' uinfo = __salt__['user.info'](user) if not uinfo: raise CommandExecutionError('User \'{0}\' does not exist'.format(user)) home = uinfo['home'] config = _expand_authorized_keys_path(config, user, hom...
python
def _get_config_file(user, config): ''' Get absolute path to a user's ssh_config. ''' uinfo = __salt__['user.info'](user) if not uinfo: raise CommandExecutionError('User \'{0}\' does not exist'.format(user)) home = uinfo['home'] config = _expand_authorized_keys_path(config, user, hom...
[ "def", "_get_config_file", "(", "user", ",", "config", ")", ":", "uinfo", "=", "__salt__", "[", "'user.info'", "]", "(", "user", ")", "if", "not", "uinfo", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "user...
Get absolute path to a user's ssh_config.
[ "Get", "absolute", "path", "to", "a", "user", "s", "ssh_config", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L123-L134
train
Get absolute path to a user s ssh_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/modules/ssh.py
_replace_auth_key
def _replace_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys'): ''' Replace an existing key ''' auth_line = _format_auth_line(key, enc, comment, options or []) lines = [] full = _get_config_file(user, co...
python
def _replace_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys'): ''' Replace an existing key ''' auth_line = _format_auth_line(key, enc, comment, options or []) lines = [] full = _get_config_file(user, co...
[ "def", "_replace_auth_key", "(", "user", ",", "key", ",", "enc", "=", "'ssh-rsa'", ",", "comment", "=", "''", ",", "options", "=", "None", ",", "config", "=", "'.ssh/authorized_keys'", ")", ":", "auth_line", "=", "_format_auth_line", "(", "key", ",", "enc"...
Replace an existing key
[ "Replace", "an", "existing", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L137-L181
train
Replace an existing authorized key in the specified user s key file with a new one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_validate_keys
def _validate_keys(key_file, fingerprint_hash_type): ''' Return a dict containing validated keys in the passed file ''' ret = {} linere = re.compile(r'^(.*?)\s?((?:ssh\-|ecds)[\w-]+\s.+)$') try: with salt.utils.files.fopen(key_file, 'r') as _fh: for line in _fh: ...
python
def _validate_keys(key_file, fingerprint_hash_type): ''' Return a dict containing validated keys in the passed file ''' ret = {} linere = re.compile(r'^(.*?)\s?((?:ssh\-|ecds)[\w-]+\s.+)$') try: with salt.utils.files.fopen(key_file, 'r') as _fh: for line in _fh: ...
[ "def", "_validate_keys", "(", "key_file", ",", "fingerprint_hash_type", ")", ":", "ret", "=", "{", "}", "linere", "=", "re", ".", "compile", "(", "r'^(.*?)\\s?((?:ssh\\-|ecds)[\\w-]+\\s.+)$'", ")", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", ...
Return a dict containing validated keys in the passed file
[ "Return", "a", "dict", "containing", "validated", "keys", "in", "the", "passed", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L184-L239
train
Validate the keys in the passed file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_fingerprint
def _fingerprint(public_key, fingerprint_hash_type): ''' Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None ...
python
def _fingerprint(public_key, fingerprint_hash_type): ''' Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None ...
[ "def", "_fingerprint", "(", "public_key", ",", "fingerprint_hash_type", ")", ":", "if", "fingerprint_hash_type", ":", "hash_type", "=", "fingerprint_hash_type", ".", "lower", "(", ")", "else", ":", "hash_type", "=", "'sha256'", "try", ":", "hash_func", "=", "get...
Return a public key fingerprint based on its base64-encoded representation The fingerprint string is formatted according to RFC 4716 (ch.4), that is, in the form "xx:xx:...:xx" If the key is invalid (incorrect base64 string), return None public_key The public key to return the fingerprint for...
[ "Return", "a", "public", "key", "fingerprint", "based", "on", "its", "base64", "-", "encoded", "representation" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L242-L287
train
Returns a public key fingerprint based on its base64 - encoded representation of the public 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/modules/ssh.py
host_keys
def host_keys(keydir=None, private=True, certs=True): ''' Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/e...
python
def host_keys(keydir=None, private=True, certs=True): ''' Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/e...
[ "def", "host_keys", "(", "keydir", "=", "None", ",", "private", "=", "True", ",", "certs", "=", "True", ")", ":", "# TODO: support parsing sshd_config for the key directory", "if", "not", "keydir", ":", "if", "__grains__", "[", "'kernel'", "]", "==", "'Linux'", ...
Return the minion's host keys CLI Example: .. code-block:: bash salt '*' ssh.host_keys salt '*' ssh.host_keys keydir=/etc/ssh salt '*' ssh.host_keys keydir=/etc/ssh private=False salt '*' ssh.host_keys keydir=/etc/ssh certs=False
[ "Return", "the", "minion", "s", "host", "keys" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L314-L370
train
Return the minion s host keys
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
auth_keys
def auth_keys(user=None, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root ...
python
def auth_keys(user=None, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root ...
[ "def", "auth_keys", "(", "user", "=", "None", ",", "config", "=", "'.ssh/authorized_keys'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if", "not", "user", ":", "user", "=", "__salt__", "[", "'user.list_users'", "]", "(", ")", "old_output_when_one_us...
Return the authorized keys for users CLI Example: .. code-block:: bash salt '*' ssh.auth_keys salt '*' ssh.auth_keys root salt '*' ssh.auth_keys user=root salt '*' ssh.auth_keys user="[user1, user2]"
[ "Return", "the", "authorized", "keys", "for", "users" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L373-L413
train
Return the authorized keys for users
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
check_key_file
def check_key_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: ....
python
def check_key_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: ....
[ "def", "check_key_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "keyfile", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", ...
Check a keyfile from a source destination against the local keys and return the keys to change CLI Example: .. code-block:: bash salt '*' ssh.check_key_file root salt://ssh/keyfile
[ "Check", "a", "keyfile", "from", "a", "source", "destination", "against", "the", "local", "keys", "and", "return", "the", "keys", "to", "change" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L416-L452
train
Check a keyfile from a source destination against the local keys and return the keys to change Taxonomy CLI Example
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
check_key
def check_key(user, key, enc, comment, options, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Check to see if a key needs updating, returns "update", "add" or "exists" CLI Ex...
python
def check_key(user, key, enc, comment, options, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Check to see if a key needs updating, returns "update", "add" or "exists" CLI Ex...
[ "def", "check_key", "(", "user", ",", "key", ",", "enc", ",", "comment", ",", "options", ",", "config", "=", "'.ssh/authorized_keys'", ",", "cache_keys", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if", "cache_keys", "is", "None", ":...
Check to see if a key needs updating, returns "update", "add" or "exists" CLI Example: .. code-block:: bash salt '*' ssh.check_key <user> <key> <enc> <comment> <options>
[ "Check", "to", "see", "if", "a", "key", "needs", "updating", "returns", "update", "add", "or", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L455-L502
train
Check if a key needs updating returns update add or exists
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
rm_auth_key_from_file
def rm_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file, using a file...
python
def rm_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file, using a file...
[ "def", "rm_auth_key_from_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "lfile", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ...
Remove an authorized key from the specified user's authorized key file, using a file as source CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key_from_file <user> salt://ssh_keys/<user>.id_rsa.pub
[ "Remove", "an", "authorized", "key", "from", "the", "specified", "user", "s", "authorized", "key", "file", "using", "a", "file", "as", "source" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L505-L554
train
Remove an authorized key 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/modules/ssh.py
rm_auth_key
def rm_auth_key(user, key, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key> ''' ...
python
def rm_auth_key(user, key, config='.ssh/authorized_keys', fingerprint_hash_type=None): ''' Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key> ''' ...
[ "def", "rm_auth_key", "(", "user", ",", "key", ",", "config", "=", "'.ssh/authorized_keys'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "current", "=", "auth_keys", "(", "user", ",", "config", "=", "config", ",", "fingerprint_hash_type", "=", "finger...
Remove an authorized key from the specified user's authorized key file CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key <user> <key>
[ "Remove", "an", "authorized", "key", "from", "the", "specified", "user", "s", "authorized", "key", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L557-L631
train
Remove an authorized key from the specified user s authorized key file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
set_auth_key_from_file
def set_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Add a key to the authorized_keys file, using a file as the source. CLI Example...
python
def set_auth_key_from_file(user, source, config='.ssh/authorized_keys', saltenv='base', fingerprint_hash_type=None): ''' Add a key to the authorized_keys file, using a file as the source. CLI Example...
[ "def", "set_auth_key_from_file", "(", "user", ",", "source", ",", "config", "=", "'.ssh/authorized_keys'", ",", "saltenv", "=", "'base'", ",", "fingerprint_hash_type", "=", "None", ")", ":", "# TODO: add support for pulling keys from other file sources as well", "lfile", ...
Add a key to the authorized_keys file, using a file as the source. CLI Example: .. code-block:: bash salt '*' ssh.set_auth_key_from_file <user> salt://ssh_keys/<user>.id_rsa.pub
[ "Add", "a", "key", "to", "the", "authorized_keys", "file", "using", "a", "file", "as", "the", "source", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L634-L689
train
Set an authorized_keys file for a user
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
set_auth_key
def set_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Add a key to the authorized_keys file. The "key" parameter must only be the string of text th...
python
def set_auth_key( user, key, enc='ssh-rsa', comment='', options=None, config='.ssh/authorized_keys', cache_keys=None, fingerprint_hash_type=None): ''' Add a key to the authorized_keys file. The "key" parameter must only be the string of text th...
[ "def", "set_auth_key", "(", "user", ",", "key", ",", "enc", "=", "'ssh-rsa'", ",", "comment", "=", "''", ",", "options", "=", "None", ",", "config", "=", "'.ssh/authorized_keys'", ",", "cache_keys", "=", "None", ",", "fingerprint_hash_type", "=", "None", "...
Add a key to the authorized_keys file. The "key" parameter must only be the string of text that is the encoded key. If the key begins with "ssh-rsa" or ends with user@host, remove those from the key before passing it to this function. CLI Example: .. code-block:: bash salt '*' ssh.set_aut...
[ "Add", "a", "key", "to", "the", "authorized_keys", "file", ".", "The", "key", "parameter", "must", "only", "be", "the", "string", "of", "text", "that", "is", "the", "encoded", "key", ".", "If", "the", "key", "begins", "with", "ssh", "-", "rsa", "or", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L692-L796
train
Set the authorized_keys file for the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_get_matched_host_line_numbers
def _get_matched_host_line_numbers(lines, enc): ''' Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one. ''' enc = enc if enc else "rsa" for i, line in enumerate(lines): if i % 2 == ...
python
def _get_matched_host_line_numbers(lines, enc): ''' Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one. ''' enc = enc if enc else "rsa" for i, line in enumerate(lines): if i % 2 == ...
[ "def", "_get_matched_host_line_numbers", "(", "lines", ",", "enc", ")", ":", "enc", "=", "enc", "if", "enc", "else", "\"rsa\"", "for", "i", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "i", "%", "2", "==", "0", ":", "line_no", "=", ...
Helper function which parses ssh-keygen -F function output and yield line number of known_hosts entries with encryption key type matching enc, one by one.
[ "Helper", "function", "which", "parses", "ssh", "-", "keygen", "-", "F", "function", "output", "and", "yield", "line", "number", "of", "known_hosts", "entries", "with", "encryption", "key", "type", "matching", "enc", "one", "by", "one", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L799-L812
train
Helper function which parses ssh - keygen - F function output and yield line numbers of known_hosts entries with encryption key type matching enc.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
_parse_openssh_output
def _parse_openssh_output(lines, fingerprint_hash_type=None): ''' Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one. ''' for line in lines: # We don't need any whitespace-only containing lines or arbitrary doubled newl...
python
def _parse_openssh_output(lines, fingerprint_hash_type=None): ''' Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one. ''' for line in lines: # We don't need any whitespace-only containing lines or arbitrary doubled newl...
[ "def", "_parse_openssh_output", "(", "lines", ",", "fingerprint_hash_type", "=", "None", ")", ":", "for", "line", "in", "lines", ":", "# We don't need any whitespace-only containing lines or arbitrary doubled newlines", "line", "=", "line", ".", "strip", "(", ")", "if",...
Helper function which parses ssh-keygen -F and ssh-keyscan function output and yield dict with keys information, one by one.
[ "Helper", "function", "which", "parses", "ssh", "-", "keygen", "-", "F", "and", "ssh", "-", "keyscan", "function", "output", "and", "yield", "dict", "with", "keys", "information", "one", "by", "one", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L815-L838
train
Helper function which parses the output of ssh - keygen - F and ssh - keyscan - F and yields dict with keys information one by one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
get_known_host_entries
def get_known_host_entries(user, hostname, config=None, port=None, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any....
python
def get_known_host_entries(user, hostname, config=None, port=None, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any....
[ "def", "get_known_host_entries", "(", "user", ",", "hostname", ",", "config", "=", "None", ",", "port", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "full", "=", "_get_known_hosts_file", "(", "config", "=", "config", ",", "user", "=", ...
.. versionadded:: 2018.3.0 Return information about known host entries from the configfile, if any. If there are no entries for a matching hostname, return None. CLI Example: .. code-block:: bash salt '*' ssh.get_known_host_entries <user> <hostname>
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L842-L873
train
Return information about known host entries for a given hostname.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/ssh.py
recv_known_host_entries
def recv_known_host_entries(hostname, enc=None, port=None, hash_known_hosts=True, timeout=5, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Retrieve infor...
python
def recv_known_host_entries(hostname, enc=None, port=None, hash_known_hosts=True, timeout=5, fingerprint_hash_type=None): ''' .. versionadded:: 2018.3.0 Retrieve infor...
[ "def", "recv_known_host_entries", "(", "hostname", ",", "enc", "=", "None", ",", "port", "=", "None", ",", "hash_known_hosts", "=", "True", ",", "timeout", "=", "5", ",", "fingerprint_hash_type", "=", "None", ")", ":", "# The following list of OSes have an old ver...
.. versionadded:: 2018.3.0 Retrieve information about host public keys from remote server hostname The name of the remote host (e.g. "github.com") enc Defines what type of key is being used, can be ed25519, ecdsa ssh-rsa or ssh-dss port Optional parameter, denoting th...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L877-L963
train
Return a list of known host entries from the 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/modules/ssh.py
check_known_host
def check_known_host(user=None, hostname=None, key=None, fingerprint=None, config=None, port=None, fingerprint_hash_type=None): ''' Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up ...
python
def check_known_host(user=None, hostname=None, key=None, fingerprint=None, config=None, port=None, fingerprint_hash_type=None): ''' Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up ...
[ "def", "check_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "key", "=", "None", ",", "fingerprint", "=", "None", ",", "config", "=", "None", ",", "port", "=", "None", ",", "fingerprint_hash_type", "=", "None", ")", ":", "if"...
Check the record in known_hosts file, either by its value or by fingerprint (it's enough to set up either key or fingerprint, you don't need to set up both). If provided key or fingerprint doesn't match with stored value, return "update", if no value is found for a given host, return "add", otherwise ...
[ "Check", "the", "record", "in", "known_hosts", "file", "either", "by", "its", "value", "or", "by", "fingerprint", "(", "it", "s", "enough", "to", "set", "up", "either", "key", "or", "fingerprint", "you", "don", "t", "need", "to", "set", "up", "both", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L966-L1010
train
Check the record in 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/modules/ssh.py
rm_known_host
def rm_known_host(user=None, hostname=None, config=None, port=None): ''' Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname> ''' if not hostname: return {'status': 'error', ...
python
def rm_known_host(user=None, hostname=None, config=None, port=None): ''' Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname> ''' if not hostname: return {'status': 'error', ...
[ "def", "rm_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "config", "=", "None", ",", "port", "=", "None", ")", ":", "if", "not", "hostname", ":", "return", "{", "'status'", ":", "'error'", ",", "'error'", ":", "'hostname arg...
Remove all keys belonging to hostname from a known_hosts file. CLI Example: .. code-block:: bash salt '*' ssh.rm_known_host <user> <hostname>
[ "Remove", "all", "keys", "belonging", "to", "hostname", "from", "a", "known_hosts", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L1013-L1044
train
Remove all keys belonging to hostname from a 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/modules/ssh.py
set_known_host
def set_known_host(user=None, hostname=None, fingerprint=None, key=None, port=None, enc=None, config=None, hash_known_hosts=True, timeout=5, fingerpr...
python
def set_known_host(user=None, hostname=None, fingerprint=None, key=None, port=None, enc=None, config=None, hash_known_hosts=True, timeout=5, fingerpr...
[ "def", "set_known_host", "(", "user", "=", "None", ",", "hostname", "=", "None", ",", "fingerprint", "=", "None", ",", "key", "=", "None", ",", "port", "=", "None", ",", "enc", "=", "None", ",", "config", "=", "None", ",", "hash_known_hosts", "=", "T...
Download SSH public key from remote host "hostname", optionally validate its fingerprint against "fingerprint" variable and save the record in the known_hosts file. If such a record does already exists in there, do nothing. user The user who owns the ssh authorized keys file to modify hos...
[ "Download", "SSH", "public", "key", "from", "remote", "host", "hostname", "optionally", "validate", "its", "fingerprint", "against", "fingerprint", "variable", "and", "save", "the", "record", "in", "the", "known_hosts", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ssh.py#L1047-L1260
train
Download SSH public key from remote host hostname validate it and save it in 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/boto3mod.py
_option
def _option(value): ''' Look up the value for an option. ''' if value in __opts__: return __opts__[value] master_opts = __pillar__.get('master', {}) if value in master_opts: return master_opts[value] if value in __pillar__: return __pillar__[value]
python
def _option(value): ''' Look up the value for an option. ''' if value in __opts__: return __opts__[value] master_opts = __pillar__.get('master', {}) if value in master_opts: return master_opts[value] if value in __pillar__: return __pillar__[value]
[ "def", "_option", "(", "value", ")", ":", "if", "value", "in", "__opts__", ":", "return", "__opts__", "[", "value", "]", "master_opts", "=", "__pillar__", ".", "get", "(", "'master'", ",", "{", "}", ")", "if", "value", "in", "master_opts", ":", "return...
Look up the value for an option.
[ "Look", "up", "the", "value", "for", "an", "option", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L83-L93
train
Look up the value for an option.
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/boto3mod.py
get_connection
def get_connection(service, module=None, region=None, key=None, keyid=None, profile=None): ''' Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile') ''' module = module or service c...
python
def get_connection(service, module=None, region=None, key=None, keyid=None, profile=None): ''' Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile') ''' module = module or service c...
[ "def", "get_connection", "(", "service", ",", "module", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "module", "=", "module", "or", "service", "cxkey", ",", "regio...
Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile')
[ "Return", "a", "boto", "connection", "for", "the", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L181-L216
train
Return a boto connection to the specified service.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/boto3mod.py
get_region
def get_region(service, region, profile): """ Retrieve the region for a particular AWS service based on configured region and/or profile. """ _, region, _, _ = _get_profile(service, region, None, None, profile) return region
python
def get_region(service, region, profile): """ Retrieve the region for a particular AWS service based on configured region and/or profile. """ _, region, _, _ = _get_profile(service, region, None, None, profile) return region
[ "def", "get_region", "(", "service", ",", "region", ",", "profile", ")", ":", "_", ",", "region", ",", "_", ",", "_", "=", "_get_profile", "(", "service", ",", "region", ",", "None", ",", "None", ",", "profile", ")", "return", "region" ]
Retrieve the region for a particular AWS service based on configured region and/or profile.
[ "Retrieve", "the", "region", "for", "a", "particular", "AWS", "service", "based", "on", "configured", "region", "and", "/", "or", "profile", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L231-L237
train
Retrieve the region for a particular AWS service based on configured region and profile.
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/boto3mod.py
assign_funcs
def assign_funcs(modname, service, module=None, get_conn_funcname='_get_conn', cache_id_funcname='_cache_id', exactly_one_funcname='_exactly_one'): ''' Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partial...
python
def assign_funcs(modname, service, module=None, get_conn_funcname='_get_conn', cache_id_funcname='_cache_id', exactly_one_funcname='_exactly_one'): ''' Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partial...
[ "def", "assign_funcs", "(", "modname", ",", "service", ",", "module", "=", "None", ",", "get_conn_funcname", "=", "'_get_conn'", ",", "cache_id_funcname", "=", "'_cache_id'", ",", "exactly_one_funcname", "=", "'_exactly_one'", ")", ":", "mod", "=", "sys", ".", ...
Assign _get_conn and _cache_id functions to the named module. .. code-block:: python _utils__['boto.assign_partials'](__name__, 'ec2')
[ "Assign", "_get_conn", "and", "_cache_id", "functions", "to", "the", "named", "module", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L284-L301
train
Assign functions to the named module.
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/boto3mod.py
paged_call
def paged_call(function, *args, **kwargs): """Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained. """ marker_flag = kwargs.pop('marker_flag', 'NextMarker') marker_arg = kwargs.pop('marker_arg', 'Marker') while True: ret =...
python
def paged_call(function, *args, **kwargs): """Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained. """ marker_flag = kwargs.pop('marker_flag', 'NextMarker') marker_arg = kwargs.pop('marker_arg', 'Marker') while True: ret =...
[ "def", "paged_call", "(", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "marker_flag", "=", "kwargs", ".", "pop", "(", "'marker_flag'", ",", "'NextMarker'", ")", "marker_arg", "=", "kwargs", ".", "pop", "(", "'marker_arg'", ",", "'Mark...
Retrieve full set of values from a boto3 API call that may truncate its results, yielding each page as it is obtained.
[ "Retrieve", "full", "set", "of", "values", "from", "a", "boto3", "API", "call", "that", "may", "truncate", "its", "results", "yielding", "each", "page", "as", "it", "is", "obtained", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/boto3mod.py#L304-L316
train
A generator that returns all the values from a boto3 API call that may truncate its results yielding each page as it is obtained.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_path.py
_normalize_dir
def _normalize_dir(string_): ''' Normalize the directory to make comparison possible ''' return os.path.normpath(salt.utils.stringutils.to_unicode(string_))
python
def _normalize_dir(string_): ''' Normalize the directory to make comparison possible ''' return os.path.normpath(salt.utils.stringutils.to_unicode(string_))
[ "def", "_normalize_dir", "(", "string_", ")", ":", "return", "os", ".", "path", ".", "normpath", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "string_", ")", ")" ]
Normalize the directory to make comparison possible
[ "Normalize", "the", "directory", "to", "make", "comparison", "possible" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L48-L52
train
Normalize the directory to make comparison possible
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_path.py
get_path
def get_path(): ''' Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path ''' ret = salt.utils.stringutils.to_unicode( __utils__['reg.read_value']( 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Contr...
python
def get_path(): ''' Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path ''' ret = salt.utils.stringutils.to_unicode( __utils__['reg.read_value']( 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Contr...
[ "def", "get_path", "(", ")", ":", "ret", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "__utils__", "[", "'reg.read_value'", "]", "(", "'HKEY_LOCAL_MACHINE'", ",", "'SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment'", ","...
Returns a list of items in the SYSTEM path CLI Example: .. code-block:: bash salt '*' win_path.get_path
[ "Returns", "a", "list", "of", "items", "in", "the", "SYSTEM", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L76-L94
train
Return a list of items in the SYSTEM 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/modules/win_path.py
exists
def exists(path): ''' Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path...
python
def exists(path): ''' Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path...
[ "def", "exists", "(", "path", ")", ":", "path", "=", "_normalize_dir", "(", "path", ")", "sysPath", "=", "get_path", "(", ")", "return", "path", ".", "lower", "(", ")", "in", "(", "x", ".", "lower", "(", ")", "for", "x", "in", "sysPath", ")" ]
Check if the directory is configured in the SYSTEM path Case-insensitive and ignores trailing backslash Returns: boolean True if path exists, False if not CLI Example: .. code-block:: bash salt '*' win_path.exists 'c:\\python27' salt '*' win_path.exists 'c:\\python27\\' ...
[ "Check", "if", "the", "directory", "is", "configured", "in", "the", "SYSTEM", "path", "Case", "-", "insensitive", "and", "ignores", "trailing", "backslash" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L97-L116
train
Check if the directory exists in the SYSTEM path Case - insensitive and ignores trailing backslash
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_path.py
add
def add(path, index=None, **kwargs): ''' Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If t...
python
def add(path, index=None, **kwargs): ''' Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If t...
[ "def", "add", "(", "path", ",", "index", "=", "None", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "rehash_", "=", "kwargs", ".", "pop", "(", "'rehash'", "...
Add the directory to the SYSTEM path in the index location. Returns ``True`` if successful, otherwise ``False``. path Directory to add to path index Optionally specify an index at which to insert the directory rehash : True If the registry was updated, and this value is set to...
[ "Add", "the", "directory", "to", "the", "SYSTEM", "path", "in", "the", "index", "location", ".", "Returns", "True", "if", "successful", "otherwise", "False", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L123-L285
train
Adds a directory to the system 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/modules/win_path.py
remove
def remove(path, **kwargs): r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment vari...
python
def remove(path, **kwargs): r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment vari...
[ "def", "remove", "(", "path", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "rehash_", "=", "kwargs", ".", "pop", "(", "'rehash'", ",", "True", ")", "if", "...
r''' Remove the directory from the SYSTEM path Returns: boolean True if successful, False if unsuccessful rehash : True If the registry was updated, and this value is set to ``True``, sends a WM_SETTINGCHANGE broadcast to refresh the environment variables. Set this to ``Fal...
[ "r", "Remove", "the", "directory", "from", "the", "SYSTEM", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_path.py#L288-L361
train
r Removes the directory from the system 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/output/table_out.py
output
def output(ret, **kwargs): ''' Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: chara...
python
def output(ret, **kwargs): ''' Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: chara...
[ "def", "output", "(", "ret", ",", "*", "*", "kwargs", ")", ":", "# to facilitate re-use", "if", "'opts'", "in", "kwargs", ":", "global", "__opts__", "# pylint: disable=W0601", "__opts__", "=", "kwargs", ".", "pop", "(", "'opts'", ")", "# Prefer kwargs before opt...
Display the output as table. Args: * nested_indent: integer, specify the left alignment. * has_header: boolean specifying if header should be displayed. Default: True. * row_delimiter: character to separate rows. Default: ``_``. * delim: character to separate columns. Default: ``" ...
[ "Display", "the", "output", "as", "table", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L309-L370
train
Display the output as a table.
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/output/table_out.py
TableDisplay.ustring
def ustring(self, indent, color, msg, prefix='', suffix='', endc=None): '''Build the unicode string to be displayed.''' if endc is None: endc = self.ENDC # pylint: disable=no-member inde...
python
def ustring(self, indent, color, msg, prefix='', suffix='', endc=None): '''Build the unicode string to be displayed.''' if endc is None: endc = self.ENDC # pylint: disable=no-member inde...
[ "def", "ustring", "(", "self", ",", "indent", ",", "color", ",", "msg", ",", "prefix", "=", "''", ",", "suffix", "=", "''", ",", "endc", "=", "None", ")", ":", "if", "endc", "is", "None", ":", "endc", "=", "self", ".", "ENDC", "# pylint: disable=no...
Build the unicode string to be displayed.
[ "Build", "the", "unicode", "string", "to", "be", "displayed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L102-L119
train
Build the unicode string to be displayed.
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/output/table_out.py
TableDisplay.wrap_onspace
def wrap_onspace(self, text): ''' When the text inside the column is longer then the width, will split by space and continue on the next line.''' def _truncate(line, word): return '{line}{part}{word}'.format( line=line, part=' \n'[(le...
python
def wrap_onspace(self, text): ''' When the text inside the column is longer then the width, will split by space and continue on the next line.''' def _truncate(line, word): return '{line}{part}{word}'.format( line=line, part=' \n'[(le...
[ "def", "wrap_onspace", "(", "self", ",", "text", ")", ":", "def", "_truncate", "(", "line", ",", "word", ")", ":", "return", "'{line}{part}{word}'", ".", "format", "(", "line", "=", "line", ",", "part", "=", "' \\n'", "[", "(", "len", "(", "line", "[...
When the text inside the column is longer then the width, will split by space and continue on the next line.
[ "When", "the", "text", "inside", "the", "column", "is", "longer", "then", "the", "width", "will", "split", "by", "space", "and", "continue", "on", "the", "next", "line", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L121-L133
train
Wraps the given text in a space - separated line.
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/output/table_out.py
TableDisplay.prepare_rows
def prepare_rows(self, rows, indent, has_header): '''Prepare rows content to be displayed.''' out = [] def row_wrapper(row): new_rows = [ self.wrapfunc(item).split('\n') for item in row ...
python
def prepare_rows(self, rows, indent, has_header): '''Prepare rows content to be displayed.''' out = [] def row_wrapper(row): new_rows = [ self.wrapfunc(item).split('\n') for item in row ...
[ "def", "prepare_rows", "(", "self", ",", "rows", ",", "indent", ",", "has_header", ")", ":", "out", "=", "[", "]", "def", "row_wrapper", "(", "row", ")", ":", "new_rows", "=", "[", "self", ".", "wrapfunc", "(", "item", ")", ".", "split", "(", "'\\n...
Prepare rows content to be displayed.
[ "Prepare", "rows", "content", "to", "be", "displayed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L135-L204
train
Prepare rows content to be displayed.
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/output/table_out.py
TableDisplay.display_rows
def display_rows(self, rows, labels, indent): '''Prepares row content and displays.''' out = [] if not rows: return out first_row_type = type(rows[0]) # all rows must have the same datatype con...
python
def display_rows(self, rows, labels, indent): '''Prepares row content and displays.''' out = [] if not rows: return out first_row_type = type(rows[0]) # all rows must have the same datatype con...
[ "def", "display_rows", "(", "self", ",", "rows", ",", "labels", ",", "indent", ")", ":", "out", "=", "[", "]", "if", "not", "rows", ":", "return", "out", "first_row_type", "=", "type", "(", "rows", "[", "0", "]", ")", "# all rows must have the same datat...
Prepares row content and displays.
[ "Prepares", "row", "content", "and", "displays", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L206-L250
train
Prepares row content and displays.
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/output/table_out.py
TableDisplay.display
def display(self, ret, indent, out, rows_key=None, labels_key=None): '''Display table(s).''' rows = [] labels = None if isinstance(ret, dict): if not rows_key or (rows_key and rows_key in list(...
python
def display(self, ret, indent, out, rows_key=None, labels_key=None): '''Display table(s).''' rows = [] labels = None if isinstance(ret, dict): if not rows_key or (rows_key and rows_key in list(...
[ "def", "display", "(", "self", ",", "ret", ",", "indent", ",", "out", ",", "rows_key", "=", "None", ",", "labels_key", "=", "None", ")", ":", "rows", "=", "[", "]", "labels", "=", "None", "if", "isinstance", "(", "ret", ",", "dict", ")", ":", "if...
Display table(s).
[ "Display", "table", "(", "s", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/table_out.py#L252-L306
train
Display the contents of a table.
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/zfs.py
_absent
def _absent(name, dataset_type, force=False, recursive=False, recursive_all=False): ''' internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder ...
python
def _absent(name, dataset_type, force=False, recursive=False, recursive_all=False): ''' internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder ...
[ "def", "_absent", "(", "name", ",", "dataset_type", ",", "force", "=", "False", ",", "recursive", "=", "False", ",", "recursive_all", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":...
internal shared function for *_absent name : string name of dataset dataset_type : string [filesystem, volume, snapshot, or bookmark] type of dataset to remove force : boolean try harder to destroy the dataset recursive : boolean also destroy all the child datasets r...
[ "internal", "shared", "function", "for", "*", "_absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L77-L135
train
Internal function to remove a node from the cluster tree.
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/zfs.py
filesystem_absent
def filesystem_absent(name, force=False, recursive=False): ''' ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -...
python
def filesystem_absent(name, force=False, recursive=False): ''' ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -...
[ "def", "filesystem_absent", "(", "name", ",", "force", "=", "False", ",", "recursive", "=", "False", ")", ":", "if", "not", "__utils__", "[", "'zfs.is_dataset'", "]", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":",...
ensure filesystem is absent on the system name : string name of filesystem force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -r) .. warning:: If a volume with ``name`` exists, this st...
[ "ensure", "filesystem", "is", "absent", "on", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L138-L162
train
ensure filesystem is absent 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/zfs.py
snapshot_absent
def snapshot_absent(name, force=False, recursive=False, recursive_all=False): ''' ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets...
python
def snapshot_absent(name, force=False, recursive=False, recursive_all=False): ''' ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets...
[ "def", "snapshot_absent", "(", "name", ",", "force", "=", "False", ",", "recursive", "=", "False", ",", "recursive_all", "=", "False", ")", ":", "if", "not", "__utils__", "[", "'zfs.is_snapshot'", "]", "(", "name", ")", ":", "ret", "=", "{", "'name'", ...
ensure snapshot is absent on the system name : string name of snapshot force : boolean try harder to destroy the dataset (zfs destroy -f) recursive : boolean also destroy all the child datasets (zfs destroy -r) recursive_all : boolean recursively destroy all dependents, ...
[ "ensure", "snapshot", "is", "absent", "on", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L192-L214
train
ensure snapshot is absent 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/zfs.py
hold_absent
def hold_absent(name, snapshot, recursive=False): ''' ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems. ''...
python
def hold_absent(name, snapshot, recursive=False): ''' ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems. ''...
[ "def", "hold_absent", "(", "name", ",", "snapshot", ",", "recursive", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## log configuration...
ensure hold is absent on the system name : string name of hold snapshot : string name of snapshot recursive : boolean recursively releases a hold with the given tag on the snapshots of all descendent file systems.
[ "ensure", "hold", "is", "absent", "on", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L239-L306
train
ensure hold is absent 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/zfs.py
_dataset_present
def _dataset_present(dataset_type, name, volume_size=None, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string ...
python
def _dataset_present(dataset_type, name, volume_size=None, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string ...
[ "def", "_dataset_present", "(", "dataset_type", ",", "name", ",", "volume_size", "=", "None", ",", "sparse", "=", "False", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "ret", "=", "{", "'n...
internal handler for filesystem_present/volume_present dataset_type : string volume or filesystem name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_parent : boolean creates all the non-existing paren...
[ "internal", "handler", "for", "filesystem_present", "/", "volume_present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L382-L557
train
Internal function to check if a dataset is present in the state file 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/zfs.py
filesystem_present
def filesystem_present(name, create_parent=False, properties=None, cloned_from=None): ''' ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command ...
python
def filesystem_present(name, create_parent=False, properties=None, cloned_from=None): ''' ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command ...
[ "def", "filesystem_present", "(", "name", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "return", "_dataset_present", "(", "'filesystem'", ",", "name", ",", "create_parent", "=", "create_parent", ...
ensure filesystem exists and has properties set name : string name of filesystem create_parent : boolean creates all the non-existing parent datasets. any property specified on the command line using the -o option is ignored. cloned_from : string name of snapshot to clone ...
[ "ensure", "filesystem", "exists", "and", "has", "properties", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L560-L589
train
Ensure that the named filesystem exists and has properties set.
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/zfs.py
volume_present
def volume_present(name, volume_size, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_pare...
python
def volume_present(name, volume_size, sparse=False, create_parent=False, properties=None, cloned_from=None): ''' ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_pare...
[ "def", "volume_present", "(", "name", ",", "volume_size", ",", "sparse", "=", "False", ",", "create_parent", "=", "False", ",", "properties", "=", "None", ",", "cloned_from", "=", "None", ")", ":", "return", "_dataset_present", "(", "'volume'", ",", "name", ...
ensure volume exists and has properties set name : string name of volume volume_size : string size of volume sparse : boolean create sparse volume create_parent : boolean creates all the non-existing parent datasets. any property specified on the command line usi...
[ "ensure", "volume", "exists", "and", "has", "properties", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L592-L633
train
Ensure that the named volume exists and has properties set.
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/zfs.py
bookmark_present
def bookmark_present(name, snapshot): ''' ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} ## log configuration log.debug('zf...
python
def bookmark_present(name, snapshot): ''' ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} ## log configuration log.debug('zf...
[ "def", "bookmark_present", "(", "name", ",", "snapshot", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## log configuration", "log", ".", "debug", "("...
ensure bookmark exists name : string name of bookmark snapshot : string name of snapshot
[ "ensure", "bookmark", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L636-L693
train
ensure that the bookmark exists for the given name and snapshot is present
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/zfs.py
snapshot_present
def snapshot_present(name, recursive=False, properties=None): ''' ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .....
python
def snapshot_present(name, recursive=False, properties=None): ''' ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .....
[ "def", "snapshot_present", "(", "name", ",", "recursive", "=", "False", ",", "properties", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}",...
ensure snapshot exists and has properties set name : string name of snapshot recursive : boolean recursively create snapshots of all descendent datasets properties : dict additional zfs properties (-o) .. note: Properties are only set at creation time
[ "ensure", "snapshot", "exists", "and", "has", "properties", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L696-L754
train
ensure that the named snapshot is present
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/zfs.py
promoted
def promoted(name): ''' ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset ''' ret = {'name': name, 'changes': {...
python
def promoted(name): ''' ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset ''' ret = {'name': name, 'changes': {...
[ "def", "promoted", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "## check we if we have a valid dataset name", "if", "not", "__utils__", "[",...
ensure a dataset is not a clone name : string name of fileset or volume .. warning:: only one dataset can be the origin, if you promote a clone the original will now point to the promoted dataset
[ "ensure", "a", "dataset", "is", "not", "a", "clone" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L757-L807
train
ensure a dataset is not a clone and is not the primary instance of the dataset
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/zfs.py
_schedule_snapshot_retrieve
def _schedule_snapshot_retrieve(dataset, prefix, snapshots): ''' Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots...
python
def _schedule_snapshot_retrieve(dataset, prefix, snapshots): ''' Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots...
[ "def", "_schedule_snapshot_retrieve", "(", "dataset", ",", "prefix", ",", "snapshots", ")", ":", "## NOTE: retrieve all snapshots for the dataset", "for", "snap", "in", "sorted", "(", "__salt__", "[", "'zfs.list'", "]", "(", "dataset", ",", "*", "*", "{", "'recurs...
Update snapshots dict with current snapshots dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots : OrderedDict preseeded OrderedDict with configuration
[ "Update", "snapshots", "dict", "with", "current", "snapshots" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L810-L847
train
Retrieve all snapshots for a given dataset and prefix
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/zfs.py
_schedule_snapshot_prepare
def _schedule_snapshot_prepare(dataset, prefix, snapshots): ''' Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snap...
python
def _schedule_snapshot_prepare(dataset, prefix, snapshots): ''' Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snap...
[ "def", "_schedule_snapshot_prepare", "(", "dataset", ",", "prefix", ",", "snapshots", ")", ":", "## NOTE: generate new snapshot name", "snapshot_create_name", "=", "'{dataset}@{prefix}-{timestamp}'", ".", "format", "(", "dataset", "=", "dataset", ",", "prefix", "=", "pr...
Update snapshots dict with info for a new snapshot dataset: string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' snapshots : OrderedDict preseeded OrderedDict with configuration
[ "Update", "snapshots", "dict", "with", "info", "for", "a", "new", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L850-L906
train
Prepare the new snapshot for the next snapshot.
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/zfs.py
scheduled_snapshot
def scheduled_snapshot(name, prefix, recursive=True, schedule=None): ''' maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' ...
python
def scheduled_snapshot(name, prefix, recursive=True, schedule=None): ''' maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' ...
[ "def", "scheduled_snapshot", "(", "name", ",", "prefix", ",", "recursive", "=", "True", ",", "schedule", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", "...
maintain a set of snapshots based on a schedule name : string name of filesystem or volume prefix : string prefix for the snapshots e.g. 'test' will result in snapshots being named 'test-yyyymmdd_hhmm' recursive : boolean create snapshots for all children also schedule :...
[ "maintain", "a", "set", "of", "snapshots", "based", "on", "a", "schedule" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zfs.py#L909-L1085
train
Create a scheduled snapshot of a specific type of dataset
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
_getUserSid
def _getUserSid(user): ''' return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None ''' ret = {} sid_pattern = r'^S-1(-\d+){1,}$' if user and re.match(sid_pattern, user, re.I): try: sid = win32security.GetBina...
python
def _getUserSid(user): ''' return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None ''' ret = {} sid_pattern = r'^S-1(-\d+){1,}$' if user and re.match(sid_pattern, user, re.I): try: sid = win32security.GetBina...
[ "def", "_getUserSid", "(", "user", ")", ":", "ret", "=", "{", "}", "sid_pattern", "=", "r'^S-1(-\\d+){1,}$'", "if", "user", "and", "re", ".", "match", "(", "sid_pattern", ",", "user", ",", "re", ".", "I", ")", ":", "try", ":", "sid", "=", "win32secur...
return a state error dictionary, with 'sid' as a field if it could be returned if user is None, sid will also be None
[ "return", "a", "state", "error", "dictionary", "with", "sid", "as", "a", "field", "if", "it", "could", "be", "returned", "if", "user", "is", "None", "sid", "will", "also", "be", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L304-L338
train
Returns a state error dictionary with sid as a field and result set to True if the user is not None sid will also be None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
_get_dacl
def _get_dacl(path, objectType): ''' Gets the DACL of a path ''' try: dacl = win32security.GetNamedSecurityInfo( path, objectType, win32security.DACL_SECURITY_INFORMATION ).GetSecurityDescriptorDacl() except Exception: dacl = None return dacl
python
def _get_dacl(path, objectType): ''' Gets the DACL of a path ''' try: dacl = win32security.GetNamedSecurityInfo( path, objectType, win32security.DACL_SECURITY_INFORMATION ).GetSecurityDescriptorDacl() except Exception: dacl = None return dacl
[ "def", "_get_dacl", "(", "path", ",", "objectType", ")", ":", "try", ":", "dacl", "=", "win32security", ".", "GetNamedSecurityInfo", "(", "path", ",", "objectType", ",", "win32security", ".", "DACL_SECURITY_INFORMATION", ")", ".", "GetSecurityDescriptorDacl", "(",...
Gets the DACL of a path
[ "Gets", "the", "DACL", "of", "a", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L350-L360
train
Gets the DACL of a path and object 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/modules/win_dacl.py
get
def get(path, objectType, user=None): ''' Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the A...
python
def get(path, objectType, user=None): ''' Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the A...
[ "def", "get", "(", "path", ",", "objectType", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'Path'", ":", "path", ",", "'ACLs'", ":", "[", "]", "}", "sidRet", "=", "_getUserSid", "(", "user", ")", "if", "path", "and", "objectType", ":", "...
Get the ACL of an object. Will filter by user if one is provided. Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) user: A user name to filter by Returns (dict): A dictionary containing the ACL CLI Example: .. code-block:: bash ...
[ "Get", "the", "ACL", "of", "an", "object", ".", "Will", "filter", "by", "user", "if", "one", "is", "provided", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L363-L395
train
Get the ACL of an object. Will filter by user if one is provided.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
add_ace
def add_ace(path, objectType, user, permission, acetype, propagation): r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permissio...
python
def add_ace(path, objectType, user, permission, acetype, propagation): r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permissio...
[ "def", "add_ace", "(", "path", ",", "objectType", ",", "user", ",", "permission", ",", "acetype", ",", "propagation", ")", ":", "ret", "=", "{", "'result'", ":", "None", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "if", "(", ...
r''' add an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user acetype: either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for Regist...
[ "r", "add", "an", "ace", "to", "an", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L398-L467
train
r Adds an ace to an 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/modules/win_dacl.py
rm_ace
def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=None): r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny fo...
python
def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=None): r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny fo...
[ "def", "rm_ace", "(", "path", ",", "objectType", ",", "user", ",", "permission", "=", "None", ",", "acetype", "=", "None", ",", "propagation", "=", "None", ")", ":", "ret", "=", "{", "'result'", ":", "None", ",", "'changes'", ":", "{", "}", ",", "'...
r''' remove an ace to an object path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to remove permission: permissions for the user acetypes: either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for...
[ "r", "remove", "an", "ace", "to", "an", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L470-L540
train
r Removes an ACE from the object tree
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
_ace_to_text
def _ace_to_text(ace, objectType): ''' helper function to convert an ace to a textual representation ''' dc = daclConstants() objectType = dc.getObjectTypeBit(objectType) try: userSid = win32security.LookupAccountSid('', ace[2]) if userSid[1]: userSid = '{1}\\{0}'.for...
python
def _ace_to_text(ace, objectType): ''' helper function to convert an ace to a textual representation ''' dc = daclConstants() objectType = dc.getObjectTypeBit(objectType) try: userSid = win32security.LookupAccountSid('', ace[2]) if userSid[1]: userSid = '{1}\\{0}'.for...
[ "def", "_ace_to_text", "(", "ace", ",", "objectType", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "try", ":", "userSid", "=", "win32security", ".", "LookupAccountSid", "(", "''", ...
helper function to convert an ace to a textual representation
[ "helper", "function", "to", "convert", "an", "ace", "to", "a", "textual", "representation" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L543-L578
train
helper function to convert an ace to a textual representation
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
_set_dacl_inheritance
def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=False): ''' helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables cop...
python
def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=False): ''' helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables cop...
[ "def", "_set_dacl_inheritance", "(", "path", ",", "objectType", ",", "inheritance", "=", "True", ",", "copy", "=", "True", ",", "clear", "=", "False", ")", ":", "ret", "=", "{", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", "...
helper function to set the inheritance Args: path (str): The path to the object objectType (str): The type of object inheritance (bool): True enables inheritance, False disables copy (bool): Copy inherited ACEs to the DACL before disabling inheritance clear (bool...
[ "helper", "function", "to", "set", "the", "inheritance", "Args", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L581-L650
train
helper function to set the inheritance of the object in the DACL
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dacl.py
enable_inheritance
def enable_inheritance(path, objectType, clear=False): ''' enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary ...
python
def enable_inheritance(path, objectType, clear=False): ''' enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary ...
[ "def", "enable_inheritance", "(", "path", ",", "objectType", ",", "clear", "=", "False", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "path", "=", "dc", ".", "processPath", "(", ...
enable/disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) clear: True will remove non-Inherited ACEs from the ACL Returns (dict): A dictionary containing the results CLI Example: .. code-block:: bash ...
[ "enable", "/", "disable", "inheritance", "on", "an", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L653-L674
train
Enables or disables inheritance on an 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/modules/win_dacl.py
disable_inheritance
def disable_inheritance(path, objectType, copy=True): ''' Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dic...
python
def disable_inheritance(path, objectType, copy=True): ''' Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dic...
[ "def", "disable_inheritance", "(", "path", ",", "objectType", ",", "copy", "=", "True", ")", ":", "dc", "=", "daclConstants", "(", ")", "objectType", "=", "dc", ".", "getObjectTypeBit", "(", "objectType", ")", "path", "=", "dc", ".", "processPath", "(", ...
Disable inheritance on an object Args: path: The path to the object objectType: The type of object (FILE, DIRECTORY, REGISTRY) copy: True will copy the Inherited ACEs to the DACL before disabling inheritance Returns (dict): A dictionary containing the results CLI Example: .. ...
[ "Disable", "inheritance", "on", "an", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L677-L698
train
Disables inheritance on an 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...