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/win_lgpo.py
_load_policy_definitions
def _load_policy_definitions(path='c:\\Windows\\PolicyDefinitions', language='en-US'): ''' helper function to process all ADMX files in the specified policy_def_path and build a single XML doc that we can search/use for ADMX policy processing ''' # Fallback to the System...
python
def _load_policy_definitions(path='c:\\Windows\\PolicyDefinitions', language='en-US'): ''' helper function to process all ADMX files in the specified policy_def_path and build a single XML doc that we can search/use for ADMX policy processing ''' # Fallback to the System...
[ "def", "_load_policy_definitions", "(", "path", "=", "'c:\\\\Windows\\\\PolicyDefinitions'", ",", "language", "=", "'en-US'", ")", ":", "# Fallback to the System Install Language", "display_language_fallback", "=", "INSTALL_LANGUAGE", "t_policy_definitions", "=", "lxml", ".", ...
helper function to process all ADMX files in the specified policy_def_path and build a single XML doc that we can search/use for ADMX policy processing
[ "helper", "function", "to", "process", "all", "ADMX", "files", "in", "the", "specified", "policy_def_path", "and", "build", "a", "single", "XML", "doc", "that", "we", "can", "search", "/", "use", "for", "ADMX", "policy", "processing" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4799-L4944
train
helper function to load all ADMX files in the specified path and build a single XML doc that we can search for the policy definitions in the specified language
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_buildElementNsmap
def _buildElementNsmap(using_elements): ''' build a namespace map for an ADMX element ''' thisMap = {} for e in using_elements: thisMap[e.attrib['prefix']] = e.attrib['namespace'] return thisMap
python
def _buildElementNsmap(using_elements): ''' build a namespace map for an ADMX element ''' thisMap = {} for e in using_elements: thisMap[e.attrib['prefix']] = e.attrib['namespace'] return thisMap
[ "def", "_buildElementNsmap", "(", "using_elements", ")", ":", "thisMap", "=", "{", "}", "for", "e", "in", "using_elements", ":", "thisMap", "[", "e", ".", "attrib", "[", "'prefix'", "]", "]", "=", "e", ".", "attrib", "[", "'namespace'", "]", "return", ...
build a namespace map for an ADMX element
[ "build", "a", "namespace", "map", "for", "an", "ADMX", "element" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4963-L4970
train
build a namespace map for an ADMX element
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_get_audit_defaults
def _get_audit_defaults(option=None): ''' Loads audit.csv defaults into a dict in __context__ called 'lgpo.audit_defaults'. The dictionary includes fieldnames and all configurable policies as keys. The values are used to create/modify the ``audit.csv`` file. The first entry is `fieldnames` used to c...
python
def _get_audit_defaults(option=None): ''' Loads audit.csv defaults into a dict in __context__ called 'lgpo.audit_defaults'. The dictionary includes fieldnames and all configurable policies as keys. The values are used to create/modify the ``audit.csv`` file. The first entry is `fieldnames` used to c...
[ "def", "_get_audit_defaults", "(", "option", "=", "None", ")", ":", "if", "'lgpo.audit_defaults'", "not", "in", "__context__", ":", "# Get available setting names and GUIDs", "# This is used to get the fieldnames and GUIDs for individual policies", "log", ".", "debug", "(", "...
Loads audit.csv defaults into a dict in __context__ called 'lgpo.audit_defaults'. The dictionary includes fieldnames and all configurable policies as keys. The values are used to create/modify the ``audit.csv`` file. The first entry is `fieldnames` used to create the header for the csv file. The rest of...
[ "Loads", "audit", ".", "csv", "defaults", "into", "a", "dict", "in", "__context__", "called", "lgpo", ".", "audit_defaults", ".", "The", "dictionary", "includes", "fieldnames", "and", "all", "configurable", "policies", "as", "keys", ".", "The", "values", "are"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4973-L5056
train
Load audit. csv defaults into a dictionary in the context of the 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/modules/win_lgpo.py
_findOptionValueAdvAudit
def _findOptionValueAdvAudit(option): ''' Get the Advanced Auditing policy as configured in ``C:\\Windows\\Security\\Audit\\audit.csv`` Args: option (str): The name of the setting as it appears in audit.csv Returns: bool: ``True`` if successful, otherwise ``False`` ''' if '...
python
def _findOptionValueAdvAudit(option): ''' Get the Advanced Auditing policy as configured in ``C:\\Windows\\Security\\Audit\\audit.csv`` Args: option (str): The name of the setting as it appears in audit.csv Returns: bool: ``True`` if successful, otherwise ``False`` ''' if '...
[ "def", "_findOptionValueAdvAudit", "(", "option", ")", ":", "if", "'lgpo.adv_audit_data'", "not", "in", "__context__", ":", "system_root", "=", "os", ".", "environ", ".", "get", "(", "'SystemRoot'", ",", "'C:\\\\Windows'", ")", "f_audit", "=", "os", ".", "path...
Get the Advanced Auditing policy as configured in ``C:\\Windows\\Security\\Audit\\audit.csv`` Args: option (str): The name of the setting as it appears in audit.csv Returns: bool: ``True`` if successful, otherwise ``False``
[ "Get", "the", "Advanced", "Auditing", "policy", "as", "configured", "in", "C", ":", "\\\\", "Windows", "\\\\", "Security", "\\\\", "Audit", "\\\\", "audit", ".", "csv" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5059-L5099
train
Find the value of an option as configured in audit. csv and return it as a dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_set_audit_file_data
def _set_audit_file_data(option, value): ''' Helper function that sets the Advanced Audit settings in the two .csv files on Windows. Those files are located at: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv Args: ...
python
def _set_audit_file_data(option, value): ''' Helper function that sets the Advanced Audit settings in the two .csv files on Windows. Those files are located at: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv Args: ...
[ "def", "_set_audit_file_data", "(", "option", ",", "value", ")", ":", "# Set up some paths here", "system_root", "=", "os", ".", "environ", ".", "get", "(", "'SystemRoot'", ",", "'C:\\\\Windows'", ")", "f_audit", "=", "os", ".", "path", ".", "join", "(", "sy...
Helper function that sets the Advanced Audit settings in the two .csv files on Windows. Those files are located at: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv Args: option (str): The name of the option to set ...
[ "Helper", "function", "that", "sets", "the", "Advanced", "Audit", "settings", "in", "the", "two", ".", "csv", "files", "on", "Windows", ".", "Those", "files", "are", "located", "at", ":", "C", ":", "\\\\", "Windows", "\\\\", "Security", "\\\\", "Audit", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5102-L5196
train
Set the Advanced Audit settings in the two. csv files on Windows.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_set_auditpol_data
def _set_auditpol_data(option, value): ''' Helper function that updates the current applied settings to match what has just been set in the audit.csv files. We're doing it this way instead of running `gpupdate` Args: option (str): The name of the option to set value (str): The value...
python
def _set_auditpol_data(option, value): ''' Helper function that updates the current applied settings to match what has just been set in the audit.csv files. We're doing it this way instead of running `gpupdate` Args: option (str): The name of the option to set value (str): The value...
[ "def", "_set_auditpol_data", "(", "option", ",", "value", ")", ":", "auditpol_values", "=", "{", "'None'", ":", "'No Auditing'", ",", "'0'", ":", "'No Auditing'", ",", "'1'", ":", "'Success'", ",", "'2'", ":", "'Failure'", ",", "'3'", ":", "'Success and Fail...
Helper function that updates the current applied settings to match what has just been set in the audit.csv files. We're doing it this way instead of running `gpupdate` Args: option (str): The name of the option to set value (str): The value to set. ['None', '0', '1', '2', '3'] Returns:...
[ "Helper", "function", "that", "updates", "the", "current", "applied", "settings", "to", "match", "what", "has", "just", "been", "set", "in", "the", "audit", ".", "csv", "files", ".", "We", "re", "doing", "it", "this", "way", "instead", "of", "running", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5199-L5220
train
Helper function that updates the current applied settings to match what has just been set in the audit. csv files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_setOptionValueAdvAudit
def _setOptionValueAdvAudit(option, value): ''' Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows ...
python
def _setOptionValueAdvAudit(option, value): ''' Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows ...
[ "def", "_setOptionValueAdvAudit", "(", "option", ",", "value", ")", ":", "# Set the values in both audit.csv files", "if", "not", "_set_audit_file_data", "(", "option", "=", "option", ",", "value", "=", "value", ")", ":", "raise", "CommandExecutionError", "(", "'Fai...
Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv Then it applies those settings...
[ "Helper", "function", "to", "update", "the", "Advanced", "Audit", "policy", "on", "the", "machine", ".", "This", "function", "modifies", "the", "two", "audit", ".", "csv", "files", "in", "the", "following", "locations", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5223-L5261
train
Helper function to set the value of an option in the audit. csv file and the locally set the value of the audit. pol 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/win_lgpo.py
_load_secedit_data
def _load_secedit_data(): ''' Helper function that loads secedit data. It runs `secedit /export /cfg <file_name>` which creates a file that contains the secedit data. Returns: str: The contents of the file generated by the secedit command ''' try: f_exp = os.path.join(__opts__['...
python
def _load_secedit_data(): ''' Helper function that loads secedit data. It runs `secedit /export /cfg <file_name>` which creates a file that contains the secedit data. Returns: str: The contents of the file generated by the secedit command ''' try: f_exp = os.path.join(__opts__['...
[ "def", "_load_secedit_data", "(", ")", ":", "try", ":", "f_exp", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'secedit-{0}.txt'", ".", "format", "(", "UUID", ")", ")", "__salt__", "[", "'cmd.run'", "]", "(", "[", ...
Helper function that loads secedit data. It runs `secedit /export /cfg <file_name>` which creates a file that contains the secedit data. Returns: str: The contents of the file generated by the secedit command
[ "Helper", "function", "that", "loads", "secedit", "data", ".", "It", "runs", "secedit", "/", "export", "/", "cfg", "<file_name", ">", "which", "creates", "a", "file", "that", "contains", "the", "secedit", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5312-L5329
train
Helper function that loads the secedit data. It runs secedit and returns the contents of the file generated by the secedit command
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_get_secedit_value
def _get_secedit_value(option): ''' Helper function that looks for the passed option in the secedit data ''' secedit_data = _get_secedit_data() for _line in secedit_data: if _line.startswith(option): return _line.split('=')[1].strip() return 'Not Defined'
python
def _get_secedit_value(option): ''' Helper function that looks for the passed option in the secedit data ''' secedit_data = _get_secedit_data() for _line in secedit_data: if _line.startswith(option): return _line.split('=')[1].strip() return 'Not Defined'
[ "def", "_get_secedit_value", "(", "option", ")", ":", "secedit_data", "=", "_get_secedit_data", "(", ")", "for", "_line", "in", "secedit_data", ":", "if", "_line", ".", "startswith", "(", "option", ")", ":", "return", "_line", ".", "split", "(", "'='", ")"...
Helper function that looks for the passed option in the secedit data
[ "Helper", "function", "that", "looks", "for", "the", "passed", "option", "in", "the", "secedit", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5346-L5354
train
Helper function that looks for the passed option in the secedit data and returns the value
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_write_secedit_data
def _write_secedit_data(inf_data): ''' Helper function to write secedit data to the database ''' # Set file names f_sdb = os.path.join(__opts__['cachedir'], 'secedit-{0}.sdb'.format(UUID)) f_inf = os.path.join(__opts__['cachedir'], 'secedit-{0}.inf'.format(UUID)) try: # Write the ch...
python
def _write_secedit_data(inf_data): ''' Helper function to write secedit data to the database ''' # Set file names f_sdb = os.path.join(__opts__['cachedir'], 'secedit-{0}.sdb'.format(UUID)) f_inf = os.path.join(__opts__['cachedir'], 'secedit-{0}.inf'.format(UUID)) try: # Write the ch...
[ "def", "_write_secedit_data", "(", "inf_data", ")", ":", "# Set file names", "f_sdb", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'secedit-{0}.sdb'", ".", "format", "(", "UUID", ")", ")", "f_inf", "=", "os", ".", "...
Helper function to write secedit data to the database
[ "Helper", "function", "to", "write", "secedit", "data", "to", "the", "database" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5357-L5383
train
Helper function to write secedit data to the 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
salt/modules/win_lgpo.py
_transform_value
def _transform_value(value, policy, transform_type): ''' helper function to transform the policy value into something that more closely matches how the policy is displayed in the gpedit GUI ''' t_kwargs = {} if 'Transform' in policy: if transform_type in policy['Transform']: ...
python
def _transform_value(value, policy, transform_type): ''' helper function to transform the policy value into something that more closely matches how the policy is displayed in the gpedit GUI ''' t_kwargs = {} if 'Transform' in policy: if transform_type in policy['Transform']: ...
[ "def", "_transform_value", "(", "value", ",", "policy", ",", "transform_type", ")", ":", "t_kwargs", "=", "{", "}", "if", "'Transform'", "in", "policy", ":", "if", "transform_type", "in", "policy", "[", "'Transform'", "]", ":", "_policydata", "=", "_policy_i...
helper function to transform the policy value into something that more closely matches how the policy is displayed in the gpedit GUI
[ "helper", "function", "to", "transform", "the", "policy", "value", "into", "something", "that", "more", "closely", "matches", "how", "the", "policy", "is", "displayed", "in", "the", "gpedit", "GUI" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5386-L5404
train
helper function to transform the value into something that more closely matches how the policy is displayed in the gpedit GUI
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_validateSetting
def _validateSetting(value, policy): ''' helper function to validate specified value is appropriate for the policy if the 'Settings' key is a list, the value will check that it is in the list if the 'Settings' key is a dict we will try to execute the function name from the 'Function' key, passin...
python
def _validateSetting(value, policy): ''' helper function to validate specified value is appropriate for the policy if the 'Settings' key is a list, the value will check that it is in the list if the 'Settings' key is a dict we will try to execute the function name from the 'Function' key, passin...
[ "def", "_validateSetting", "(", "value", ",", "policy", ")", ":", "log", ".", "debug", "(", "'validating %s for policy %s'", ",", "value", ",", "policy", ")", "if", "'Settings'", "in", "policy", ":", "if", "policy", "[", "'Settings'", "]", ":", "if", "isin...
helper function to validate specified value is appropriate for the policy if the 'Settings' key is a list, the value will check that it is in the list if the 'Settings' key is a dict we will try to execute the function name from the 'Function' key, passing the value and additional arguments from ...
[ "helper", "function", "to", "validate", "specified", "value", "is", "appropriate", "for", "the", "policy", "if", "the", "Settings", "key", "is", "a", "list", "the", "value", "will", "check", "that", "it", "is", "in", "the", "list", "if", "the", "Settings",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5407-L5431
train
helper function to validate a value for a specific policy
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_addAccountRights
def _addAccountRights(sidObject, user_right): ''' helper function to add an account right to a user ''' try: if sidObject: _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) user_rights_list = [user_right] _ret = win32security.LsaA...
python
def _addAccountRights(sidObject, user_right): ''' helper function to add an account right to a user ''' try: if sidObject: _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) user_rights_list = [user_right] _ret = win32security.LsaA...
[ "def", "_addAccountRights", "(", "sidObject", ",", "user_right", ")", ":", "try", ":", "if", "sidObject", ":", "_polHandle", "=", "win32security", ".", "LsaOpenPolicy", "(", "None", ",", "win32security", ".", "POLICY_ALL_ACCESS", ")", "user_rights_list", "=", "[...
helper function to add an account right to a user
[ "helper", "function", "to", "add", "an", "account", "right", "to", "a", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5434-L5448
train
helper function to add an account right to 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/win_lgpo.py
_delAccountRights
def _delAccountRights(sidObject, user_right): ''' helper function to remove an account right from a user ''' try: _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) user_rights_list = [user_right] _ret = win32security.LsaRemoveAccountRights(_polHandle...
python
def _delAccountRights(sidObject, user_right): ''' helper function to remove an account right from a user ''' try: _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) user_rights_list = [user_right] _ret = win32security.LsaRemoveAccountRights(_polHandle...
[ "def", "_delAccountRights", "(", "sidObject", ",", "user_right", ")", ":", "try", ":", "_polHandle", "=", "win32security", ".", "LsaOpenPolicy", "(", "None", ",", "win32security", ".", "POLICY_ALL_ACCESS", ")", "user_rights_list", "=", "[", "user_right", "]", "_...
helper function to remove an account right from a user
[ "helper", "function", "to", "remove", "an", "account", "right", "from", "a", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5451-L5462
train
helper function to remove an account right from 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/win_lgpo.py
_getRightsAssignments
def _getRightsAssignments(user_right): ''' helper function to return all the user rights assignments/users ''' sids = [] polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) sids = win32security.LsaEnumerateAccountsWithUserRight(polHandle, user_right) return sids
python
def _getRightsAssignments(user_right): ''' helper function to return all the user rights assignments/users ''' sids = [] polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS) sids = win32security.LsaEnumerateAccountsWithUserRight(polHandle, user_right) return sids
[ "def", "_getRightsAssignments", "(", "user_right", ")", ":", "sids", "=", "[", "]", "polHandle", "=", "win32security", ".", "LsaOpenPolicy", "(", "None", ",", "win32security", ".", "POLICY_ALL_ACCESS", ")", "sids", "=", "win32security", ".", "LsaEnumerateAccountsW...
helper function to return all the user rights assignments/users
[ "helper", "function", "to", "return", "all", "the", "user", "rights", "assignments", "/", "users" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5465-L5472
train
helper function to return all the user rights assignments
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_getAdmlDisplayName
def _getAdmlDisplayName(adml_xml_data, display_name): ''' helper function to take the 'displayName' attribute of an element and find the value from the ADML data adml_xml_data :: XML data of all ADML files to search display_name :: the value of the displayName attribute from the ADMX entry ...
python
def _getAdmlDisplayName(adml_xml_data, display_name): ''' helper function to take the 'displayName' attribute of an element and find the value from the ADML data adml_xml_data :: XML data of all ADML files to search display_name :: the value of the displayName attribute from the ADMX entry ...
[ "def", "_getAdmlDisplayName", "(", "adml_xml_data", ",", "display_name", ")", ":", "if", "display_name", ".", "startswith", "(", "'$('", ")", "and", "display_name", ".", "endswith", "(", "')'", ")", ":", "display_name", "=", "re", ".", "sub", "(", "r'(^\\$\\...
helper function to take the 'displayName' attribute of an element and find the value from the ADML data adml_xml_data :: XML data of all ADML files to search display_name :: the value of the displayName attribute from the ADMX entry to search the ADML data for
[ "helper", "function", "to", "take", "the", "displayName", "attribute", "of", "an", "element", "and", "find", "the", "value", "from", "the", "ADML", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5475-L5496
train
helper function to take the displayName attribute of an element and find the value of the displayName attribute of the element and return the value of the element
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_getAdmlPresentationRefId
def _getAdmlPresentationRefId(adml_data, ref_id): ''' helper function to check for a presentation label for a policy element ''' search_results = adml_data.xpath('//*[@*[local-name() = "refId"] = "{0}"]'.format(ref_id)) prepended_text = '' if search_results: for result in search_results:...
python
def _getAdmlPresentationRefId(adml_data, ref_id): ''' helper function to check for a presentation label for a policy element ''' search_results = adml_data.xpath('//*[@*[local-name() = "refId"] = "{0}"]'.format(ref_id)) prepended_text = '' if search_results: for result in search_results:...
[ "def", "_getAdmlPresentationRefId", "(", "adml_data", ",", "ref_id", ")", ":", "search_results", "=", "adml_data", ".", "xpath", "(", "'//*[@*[local-name() = \"refId\"] = \"{0}\"]'", ".", "format", "(", "ref_id", ")", ")", "prepended_text", "=", "''", "if", "search_...
helper function to check for a presentation label for a policy element
[ "helper", "function", "to", "check", "for", "a", "presentation", "label", "for", "a", "policy", "element" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5499-L5540
train
helper function to check for a presentation label for a policy element
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_regexSearchRegPolData
def _regexSearchRegPolData(search_string, policy_data): ''' helper function to do a search of Policy data from a registry.pol file returns True if the regex search_string is found, otherwise False ''' if policy_data: if search_string: match = re.search(search_string, policy_data,...
python
def _regexSearchRegPolData(search_string, policy_data): ''' helper function to do a search of Policy data from a registry.pol file returns True if the regex search_string is found, otherwise False ''' if policy_data: if search_string: match = re.search(search_string, policy_data,...
[ "def", "_regexSearchRegPolData", "(", "search_string", ",", "policy_data", ")", ":", "if", "policy_data", ":", "if", "search_string", ":", "match", "=", "re", ".", "search", "(", "search_string", ",", "policy_data", ",", "re", ".", "IGNORECASE", ")", "if", "...
helper function to do a search of Policy data from a registry.pol file returns True if the regex search_string is found, otherwise False
[ "helper", "function", "to", "do", "a", "search", "of", "Policy", "data", "from", "a", "registry", ".", "pol", "file", "returns", "True", "if", "the", "regex", "search_string", "is", "found", "otherwise", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5567-L5577
train
helper function to do a search of a regex search_string in a registry. pol file returns True if the regex search_string is found otherwise False
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_getDataFromRegPolData
def _getDataFromRegPolData(search_string, policy_data, return_value_name=False): ''' helper function to do a search of Policy data from a registry.pol file returns the "data" field https://msdn.microsoft.com/en-us/library/aa374407(VS.85).aspx [key;value;type;size;data] ''' value = None v...
python
def _getDataFromRegPolData(search_string, policy_data, return_value_name=False): ''' helper function to do a search of Policy data from a registry.pol file returns the "data" field https://msdn.microsoft.com/en-us/library/aa374407(VS.85).aspx [key;value;type;size;data] ''' value = None v...
[ "def", "_getDataFromRegPolData", "(", "search_string", ",", "policy_data", ",", "return_value_name", "=", "False", ")", ":", "value", "=", "None", "values", "=", "[", "]", "encoded_semicolon", "=", "';'", ".", "encode", "(", "'utf-16-le'", ")", "if", "return_v...
helper function to do a search of Policy data from a registry.pol file returns the "data" field https://msdn.microsoft.com/en-us/library/aa374407(VS.85).aspx [key;value;type;size;data]
[ "helper", "function", "to", "do", "a", "search", "of", "Policy", "data", "from", "a", "registry", ".", "pol", "file", "returns", "the", "data", "field", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5580-L5634
train
helper function to do a search of Policy data from a registry. pol file returns the data field https://msdn.microsoft. com/en - us / library / aa374407 ( VS. 85 ). aspx [ key ; value ; type ; size ; data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_checkListItem
def _checkListItem(policy_element, policy_name, policy_key, xpath_object, policy_file_data, test_items=True): ''' helper function to process an enabled/disabled/true/falseList set if test_items is True, it will determine if the policy is enabled or disabled returning True if all items are configured in...
python
def _checkListItem(policy_element, policy_name, policy_key, xpath_object, policy_file_data, test_items=True): ''' helper function to process an enabled/disabled/true/falseList set if test_items is True, it will determine if the policy is enabled or disabled returning True if all items are configured in...
[ "def", "_checkListItem", "(", "policy_element", ",", "policy_name", ",", "policy_key", ",", "xpath_object", ",", "policy_file_data", ",", "test_items", "=", "True", ")", ":", "xpath_string", "=", "(", "'.//*[local-name() = \"decimal\" or local-name() = \"delete\"'", "' or...
helper function to process an enabled/disabled/true/falseList set if test_items is True, it will determine if the policy is enabled or disabled returning True if all items are configured in the registry.pol file and false if they are not if test_items is False, the expected strings for the items will ...
[ "helper", "function", "to", "process", "an", "enabled", "/", "disabled", "/", "true", "/", "falseList", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5637-L5695
train
helper function to process a list element and check if it is enabled or disabled
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_checkValueItemParent
def _checkValueItemParent(policy_element, policy_name, policy_key, policy_valueName, xpath_object, policy_file_data, check_deleted=False, test_item=True): ''' helper function to process the parent of a value item object if test_item is True, it will determ...
python
def _checkValueItemParent(policy_element, policy_name, policy_key, policy_valueName, xpath_object, policy_file_data, check_deleted=False, test_item=True): ''' helper function to process the parent of a value item object if test_item is True, it will determ...
[ "def", "_checkValueItemParent", "(", "policy_element", ",", "policy_name", ",", "policy_key", ",", "policy_valueName", ",", "xpath_object", ",", "policy_file_data", ",", "check_deleted", "=", "False", ",", "test_item", "=", "True", ")", ":", "for", "element", "in"...
helper function to process the parent of a value item object if test_item is True, it will determine if the policy is enabled/disabled returns True if the value is configured in the registry.pol file, otherwise returns False if test_item is False, the expected search string will be returned value type...
[ "helper", "function", "to", "process", "the", "parent", "of", "a", "value", "item", "object", "if", "test_item", "is", "True", "it", "will", "determine", "if", "the", "policy", "is", "enabled", "/", "disabled", "returns", "True", "if", "the", "value", "is"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5698-L5728
train
helper function to process the parent of a value item
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_buildKnownDataSearchString
def _buildKnownDataSearchString(reg_key, reg_valueName, reg_vtype, reg_data, check_deleted=False): ''' helper function similar to _processValueItem to build a search string for a known key/value/type/data ''' registry = Registry() this_element_value = None exp...
python
def _buildKnownDataSearchString(reg_key, reg_valueName, reg_vtype, reg_data, check_deleted=False): ''' helper function similar to _processValueItem to build a search string for a known key/value/type/data ''' registry = Registry() this_element_value = None exp...
[ "def", "_buildKnownDataSearchString", "(", "reg_key", ",", "reg_valueName", ",", "reg_vtype", ",", "reg_data", ",", "check_deleted", "=", "False", ")", ":", "registry", "=", "Registry", "(", ")", "this_element_value", "=", "None", "expected_string", "=", "b''", ...
helper function similar to _processValueItem to build a search string for a known key/value/type/data
[ "helper", "function", "similar", "to", "_processValueItem", "to", "build", "a", "search", "string", "for", "a", "known", "key", "/", "value", "/", "type", "/", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5731-L5785
train
helper function similar to _processValueItem to build a search string for a resource item that is known to be used by 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/win_lgpo.py
_processValueItem
def _processValueItem(element, reg_key, reg_valuename, policy, parent_element, check_deleted=False, this_element_value=None): ''' helper function to process a value type item and generate the expected string in the Registry.pol file element - the element to process reg_key - t...
python
def _processValueItem(element, reg_key, reg_valuename, policy, parent_element, check_deleted=False, this_element_value=None): ''' helper function to process a value type item and generate the expected string in the Registry.pol file element - the element to process reg_key - t...
[ "def", "_processValueItem", "(", "element", ",", "reg_key", ",", "reg_valuename", ",", "policy", ",", "parent_element", ",", "check_deleted", "=", "False", ",", "this_element_value", "=", "None", ")", ":", "registry", "=", "Registry", "(", ")", "expected_string"...
helper function to process a value type item and generate the expected string in the Registry.pol file element - the element to process reg_key - the registry key associated with the element (some inherit from their parent policy) reg_valuename - the registry valueName associated with the...
[ "helper", "function", "to", "process", "a", "value", "type", "item", "and", "generate", "the", "expected", "string", "in", "the", "Registry", ".", "pol", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L5788-L6047
train
helper function to process a value type item in the Registry. pol file and generate the expected string for the Registry. pol 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/win_lgpo.py
_checkAllAdmxPolicies
def _checkAllAdmxPolicies(policy_class, adml_language='en-US', return_full_policy_names=False, hierarchical_return=False, return_not_configured=False): ''' rewrite of _getAllAdminTemplateSettingsFromRegPolFil...
python
def _checkAllAdmxPolicies(policy_class, adml_language='en-US', return_full_policy_names=False, hierarchical_return=False, return_not_configured=False): ''' rewrite of _getAllAdminTemplateSettingsFromRegPolFil...
[ "def", "_checkAllAdmxPolicies", "(", "policy_class", ",", "adml_language", "=", "'en-US'", ",", "return_full_policy_names", "=", "False", ",", "hierarchical_return", "=", "False", ",", "return_not_configured", "=", "False", ")", ":", "log", ".", "debug", "(", "'PO...
rewrite of _getAllAdminTemplateSettingsFromRegPolFile where instead of looking only at the contents of the file, we're going to loop through every policy and look in the registry.pol file to determine if it is enabled/disabled/not configured
[ "rewrite", "of", "_getAllAdminTemplateSettingsFromRegPolFile", "where", "instead", "of", "looking", "only", "at", "the", "contents", "of", "the", "file", "we", "re", "going", "to", "loop", "through", "every", "policy", "and", "look", "in", "the", "registry", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6050-L6507
train
Internal function to check all the ADC policies in the registry. pol file for all the rules in the specified class.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_build_parent_list
def _build_parent_list(policy_definition, return_full_policy_names, adml_language): ''' helper function to build a list containing parent elements of the ADMX policy ''' parent_list = [] policy_namespace = list(policy_definition.nsmap.keys())[0] ...
python
def _build_parent_list(policy_definition, return_full_policy_names, adml_language): ''' helper function to build a list containing parent elements of the ADMX policy ''' parent_list = [] policy_namespace = list(policy_definition.nsmap.keys())[0] ...
[ "def", "_build_parent_list", "(", "policy_definition", ",", "return_full_policy_names", ",", "adml_language", ")", ":", "parent_list", "=", "[", "]", "policy_namespace", "=", "list", "(", "policy_definition", ".", "nsmap", ".", "keys", "(", ")", ")", "[", "0", ...
helper function to build a list containing parent elements of the ADMX policy
[ "helper", "function", "to", "build", "a", "list", "containing", "parent", "elements", "of", "the", "ADMX", "policy" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6510-L6539
train
helper function to build a list containing parent elements of the ADMX policy containing the current ones of the ADMX element.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_read_regpol_file
def _read_regpol_file(reg_pol_path): ''' helper function to read a reg policy file and return decoded data ''' returndata = None if os.path.exists(reg_pol_path): with salt.utils.files.fopen(reg_pol_path, 'rb') as pol_file: returndata = pol_file.read() return returndata
python
def _read_regpol_file(reg_pol_path): ''' helper function to read a reg policy file and return decoded data ''' returndata = None if os.path.exists(reg_pol_path): with salt.utils.files.fopen(reg_pol_path, 'rb') as pol_file: returndata = pol_file.read() return returndata
[ "def", "_read_regpol_file", "(", "reg_pol_path", ")", ":", "returndata", "=", "None", "if", "os", ".", "path", ".", "exists", "(", "reg_pol_path", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "reg_pol_path", ",", "'rb'", ")", ...
helper function to read a reg policy file and return decoded data
[ "helper", "function", "to", "read", "a", "reg", "policy", "file", "and", "return", "decoded", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6585-L6593
train
helper function to read a reg policy file and return decoded data countryCode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_regexSearchKeyValueCombo
def _regexSearchKeyValueCombo(policy_data, policy_regpath, policy_regkey): ''' helper function to do a search of Policy data from a registry.pol file for a policy_regpath and policy_regkey combo ''' if policy_data: specialValueRegex = salt.utils.stringutils.to_bytes(r'(\*\*Del\.|\*\*DelVals\...
python
def _regexSearchKeyValueCombo(policy_data, policy_regpath, policy_regkey): ''' helper function to do a search of Policy data from a registry.pol file for a policy_regpath and policy_regkey combo ''' if policy_data: specialValueRegex = salt.utils.stringutils.to_bytes(r'(\*\*Del\.|\*\*DelVals\...
[ "def", "_regexSearchKeyValueCombo", "(", "policy_data", ",", "policy_regpath", ",", "policy_regkey", ")", ":", "if", "policy_data", ":", "specialValueRegex", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "r'(\\*\\*Del\\.|\\*\\*DelVals\\.){0,1}'", ...
helper function to do a search of Policy data from a registry.pol file for a policy_regpath and policy_regkey combo
[ "helper", "function", "to", "do", "a", "search", "of", "Policy", "data", "from", "a", "registry", ".", "pol", "file", "for", "a", "policy_regpath", "and", "policy_regkey", "combo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6596-L6615
train
helper function to do a search of a registry. pol file for a policy_regpath and policy_regkey combo
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_write_regpol_data
def _write_regpol_data(data_to_write, policy_file_path, gpt_ini_path, gpt_extension, gpt_extension_guid): ''' helper function to actually write the data to a Registry.pol file also updates/edits the gpt.ini file to ...
python
def _write_regpol_data(data_to_write, policy_file_path, gpt_ini_path, gpt_extension, gpt_extension_guid): ''' helper function to actually write the data to a Registry.pol file also updates/edits the gpt.ini file to ...
[ "def", "_write_regpol_data", "(", "data_to_write", ",", "policy_file_path", ",", "gpt_ini_path", ",", "gpt_extension", ",", "gpt_extension_guid", ")", ":", "try", ":", "reg_pol_header", "=", "u'\\u5250\\u6765\\x01\\x00'", "if", "not", "os", ".", "path", ".", "exists...
helper function to actually write the data to a Registry.pol file also updates/edits the gpt.ini file to include the ADM policy extensions to let the computer know user and/or machine registry policy files need to be processed data_to_write: data to write into the user/machine registry.pol file po...
[ "helper", "function", "to", "actually", "write", "the", "data", "to", "a", "Registry", ".", "pol", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6618-L6719
train
Helper function to actually write the data into a Registry. pol 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/win_lgpo.py
_policyFileReplaceOrAppendList
def _policyFileReplaceOrAppendList(string_list, policy_data): ''' helper function to take a list of strings for registry.pol file data and update existing strings or append the strings ''' if not policy_data: policy_data = b'' # we are going to clean off the special pre-fixes, so we get ...
python
def _policyFileReplaceOrAppendList(string_list, policy_data): ''' helper function to take a list of strings for registry.pol file data and update existing strings or append the strings ''' if not policy_data: policy_data = b'' # we are going to clean off the special pre-fixes, so we get ...
[ "def", "_policyFileReplaceOrAppendList", "(", "string_list", ",", "policy_data", ")", ":", "if", "not", "policy_data", ":", "policy_data", "=", "b''", "# we are going to clean off the special pre-fixes, so we get only the valuename", "specialValueRegex", "=", "salt", ".", "ut...
helper function to take a list of strings for registry.pol file data and update existing strings or append the strings
[ "helper", "function", "to", "take", "a", "list", "of", "strings", "for", "registry", ".", "pol", "file", "data", "and", "update", "existing", "strings", "or", "append", "the", "strings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6722-L6747
train
helper function to take a list of strings for registry. pol file data and update existing strings or append the strings
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_policyFileReplaceOrAppend
def _policyFileReplaceOrAppend(this_string, policy_data, append_only=False): ''' helper function to take a ADMX policy string for registry.pol file data and update existing string or append the string to the data ''' # we are going to clean off the special pre-fixes, so we get only the valuename ...
python
def _policyFileReplaceOrAppend(this_string, policy_data, append_only=False): ''' helper function to take a ADMX policy string for registry.pol file data and update existing string or append the string to the data ''' # we are going to clean off the special pre-fixes, so we get only the valuename ...
[ "def", "_policyFileReplaceOrAppend", "(", "this_string", ",", "policy_data", ",", "append_only", "=", "False", ")", ":", "# we are going to clean off the special pre-fixes, so we get only the valuename", "if", "not", "policy_data", ":", "policy_data", "=", "b''", "specialValu...
helper function to take a ADMX policy string for registry.pol file data and update existing string or append the string to the data
[ "helper", "function", "to", "take", "a", "ADMX", "policy", "string", "for", "registry", ".", "pol", "file", "data", "and", "update", "existing", "string", "or", "append", "the", "string", "to", "the", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6750-L6777
train
helper function to take a string for registry. pol file data and update existing string or append the string to the data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_lgpo.py
_writeAdminTemplateRegPolFile
def _writeAdminTemplateRegPolFile(admtemplate_data, adml_language='en-US', registry_class='Machine'): r''' helper function to prep/write adm template data to the Registry.pol file each file begins with REGFILE_SIGNATURE (u'\u5250\u6765') a...
python
def _writeAdminTemplateRegPolFile(admtemplate_data, adml_language='en-US', registry_class='Machine'): r''' helper function to prep/write adm template data to the Registry.pol file each file begins with REGFILE_SIGNATURE (u'\u5250\u6765') a...
[ "def", "_writeAdminTemplateRegPolFile", "(", "admtemplate_data", ",", "adml_language", "=", "'en-US'", ",", "registry_class", "=", "'Machine'", ")", ":", "existing_data", "=", "b''", "policy_data", "=", "_policy_info", "(", ")", "policySearchXpath", "=", "'//ns1:*[@id...
r''' helper function to prep/write adm template data to the Registry.pol file each file begins with REGFILE_SIGNATURE (u'\u5250\u6765') and REGISTRY_FILE_VERSION (u'\x01\00') https://msdn.microsoft.com/en-us/library/aa374407(VS.85).aspx + https://msdn.microsoft.com/en-us/library/cc232696.aspx ...
[ "r", "helper", "function", "to", "prep", "/", "write", "adm", "template", "data", "to", "the", "Registry", ".", "pol", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L6780-L7114
train
r Write the data to the Registry. pol 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/win_lgpo.py
_getScriptSettingsFromIniFile
def _getScriptSettingsFromIniFile(policy_info): ''' helper function to parse/read a GPO Startup/Shutdown script file psscript.ini and script.ini file definitions are here https://msdn.microsoft.com/en-us/library/ff842529.aspx https://msdn.microsoft.com/en-us/library/dd303238.aspx ''' ...
python
def _getScriptSettingsFromIniFile(policy_info): ''' helper function to parse/read a GPO Startup/Shutdown script file psscript.ini and script.ini file definitions are here https://msdn.microsoft.com/en-us/library/ff842529.aspx https://msdn.microsoft.com/en-us/library/dd303238.aspx ''' ...
[ "def", "_getScriptSettingsFromIniFile", "(", "policy_info", ")", ":", "_existingData", "=", "None", "if", "os", ".", "path", ".", "isfile", "(", "policy_info", "[", "'ScriptIni'", "]", "[", "'IniPath'", "]", ")", ":", "with", "salt", ".", "utils", ".", "fi...
helper function to parse/read a GPO Startup/Shutdown script file psscript.ini and script.ini file definitions are here https://msdn.microsoft.com/en-us/library/ff842529.aspx https://msdn.microsoft.com/en-us/library/dd303238.aspx
[ "helper", "function", "to", "parse", "/", "read", "a", "GPO", "Startup", "/", "Shutdown", "script", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7117-L7148
train
helper function to parse a GPO Startup or Shutdown script file and return a dictionary of 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/win_lgpo.py
_writeGpoScript
def _writeGpoScript(psscript=False): ''' helper function to write local GPO startup/shutdown script scripts are stored in scripts.ini and psscripts.ini files in ``WINDIR\\System32\\GroupPolicy\\Machine|User\\Scripts`` these files have the hidden attribute set files have following format: ...
python
def _writeGpoScript(psscript=False): ''' helper function to write local GPO startup/shutdown script scripts are stored in scripts.ini and psscripts.ini files in ``WINDIR\\System32\\GroupPolicy\\Machine|User\\Scripts`` these files have the hidden attribute set files have following format: ...
[ "def", "_writeGpoScript", "(", "psscript", "=", "False", ")", ":", "_machineScriptPolicyPath", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getenv", "(", "'WINDIR'", ")", ",", "'System32'", ",", "'GroupPolicy'", ",", "'Machine'", ",", "'Scripts'", ...
helper function to write local GPO startup/shutdown script scripts are stored in scripts.ini and psscripts.ini files in ``WINDIR\\System32\\GroupPolicy\\Machine|User\\Scripts`` these files have the hidden attribute set files have following format: empty line [Startup] 0CmdLine...
[ "helper", "function", "to", "write", "local", "GPO", "startup", "/", "shutdown", "script" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7151-L7203
train
helper function to write local GPO startup and shutdown scripts in scripts. ini and psscripts. ini files in the GUI
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_lookup_admin_template
def _lookup_admin_template(policy_name, policy_class, adml_language='en-US'): ''' (success_flag, policy_xml_item, policy_name_list, message) ''' policy_aliases = [] admx_policy_definitions = _get_policy_definitions(language=adml_language) adm...
python
def _lookup_admin_template(policy_name, policy_class, adml_language='en-US'): ''' (success_flag, policy_xml_item, policy_name_list, message) ''' policy_aliases = [] admx_policy_definitions = _get_policy_definitions(language=adml_language) adm...
[ "def", "_lookup_admin_template", "(", "policy_name", ",", "policy_class", ",", "adml_language", "=", "'en-US'", ")", ":", "policy_aliases", "=", "[", "]", "admx_policy_definitions", "=", "_get_policy_definitions", "(", "language", "=", "adml_language", ")", "adml_poli...
(success_flag, policy_xml_item, policy_name_list, message)
[ "(", "success_flag", "policy_xml_item", "policy_name_list", "message", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7206-L7393
train
Internal function to search for an admin template for a specific policy.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
get_policy_info
def get_policy_info(policy_name, policy_class, adml_language='en-US'): r''' Returns information about a specified policy Args: policy_name (str): The name of the policy to lookup policy_class (str): The class of policy, i.e. ma...
python
def get_policy_info(policy_name, policy_class, adml_language='en-US'): r''' Returns information about a specified policy Args: policy_name (str): The name of the policy to lookup policy_class (str): The class of policy, i.e. ma...
[ "def", "get_policy_info", "(", "policy_name", ",", "policy_class", ",", "adml_language", "=", "'en-US'", ")", ":", "# return the possible policy names and element names", "ret", "=", "{", "'policy_name'", ":", "policy_name", ",", "'policy_class'", ":", "policy_class", "...
r''' Returns information about a specified policy Args: policy_name (str): The name of the policy to lookup policy_class (str): The class of policy, i.e. machine, user, both adml_language (str): The ADML language to use for Administrative Template dat...
[ "r", "Returns", "information", "about", "a", "specified", "policy" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7396-L7592
train
r Returns information about a specific policy in a specific state 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/win_lgpo.py
get
def get(policy_class=None, return_full_policy_names=True, hierarchical_return=False, adml_language='en-US', return_not_configured=False): ''' Get a policy value Args: policy_class (str): Some policies are both user and computer, by default all policies will ...
python
def get(policy_class=None, return_full_policy_names=True, hierarchical_return=False, adml_language='en-US', return_not_configured=False): ''' Get a policy value Args: policy_class (str): Some policies are both user and computer, by default all policies will ...
[ "def", "get", "(", "policy_class", "=", "None", ",", "return_full_policy_names", "=", "True", ",", "hierarchical_return", "=", "False", ",", "adml_language", "=", "'en-US'", ",", "return_not_configured", "=", "False", ")", ":", "vals", "=", "{", "}", "modal_re...
Get a policy value Args: policy_class (str): Some policies are both user and computer, by default all policies will be pulled, but this can be used to retrieve only a specific policy class User/USER/user = retrieve user policies Machine/MACHINE/machine/Compu...
[ "Get", "a", "policy", "value" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7595-L7740
train
Get a specific class of a specific policy value
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
set_computer_policy
def set_computer_policy(name, setting, cumulative_rights_assignments=True, adml_language='en-US'): ''' Set a single computer policy Args: name (str): The name of the policy to configure setting (str): ...
python
def set_computer_policy(name, setting, cumulative_rights_assignments=True, adml_language='en-US'): ''' Set a single computer policy Args: name (str): The name of the policy to configure setting (str): ...
[ "def", "set_computer_policy", "(", "name", ",", "setting", ",", "cumulative_rights_assignments", "=", "True", ",", "adml_language", "=", "'en-US'", ")", ":", "pol", "=", "{", "}", "pol", "[", "name", "]", "=", "setting", "ret", "=", "set_", "(", "computer_...
Set a single computer policy Args: name (str): The name of the policy to configure setting (str): The setting to configure the named policy with cumulative_rights_assignments (bool): Determine how user rights assignment policies are configured. If True,...
[ "Set", "a", "single", "computer", "policy" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7743-L7782
train
Set a single computer policy with the specified name and setting.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
set_
def set_(computer_policy=None, user_policy=None, cumulative_rights_assignments=True, adml_language='en-US'): ''' Set a local server policy. Args: computer_policy (dict): A dictionary of "policyname: value" pairs of computer policies to set. 'value...
python
def set_(computer_policy=None, user_policy=None, cumulative_rights_assignments=True, adml_language='en-US'): ''' Set a local server policy. Args: computer_policy (dict): A dictionary of "policyname: value" pairs of computer policies to set. 'value...
[ "def", "set_", "(", "computer_policy", "=", "None", ",", "user_policy", "=", "None", ",", "cumulative_rights_assignments", "=", "True", ",", "adml_language", "=", "'en-US'", ")", ":", "if", "computer_policy", "and", "not", "isinstance", "(", "computer_policy", "...
Set a local server policy. Args: computer_policy (dict): A dictionary of "policyname: value" pairs of computer policies to set. 'value' should be how it is displayed in the gpedit GUI, i.e. if a setting can be 'Enabled'/'Disabled', then that should be passed ...
[ "Set", "a", "local", "server", "policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L7822-L8202
train
This function sets the local server policy.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._seconds_to_days
def _seconds_to_days(cls, val, **kwargs): ''' converts a number of seconds to days ''' zero_value = kwargs.get('zero_value', 0) if val is not None: if val == zero_value: return 0 return val / 86400 else: return 'Not Defi...
python
def _seconds_to_days(cls, val, **kwargs): ''' converts a number of seconds to days ''' zero_value = kwargs.get('zero_value', 0) if val is not None: if val == zero_value: return 0 return val / 86400 else: return 'Not Defi...
[ "def", "_seconds_to_days", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "zero_value", "=", "kwargs", ".", "get", "(", "'zero_value'", ",", "0", ")", "if", "val", "is", "not", "None", ":", "if", "val", "==", "zero_value", ":", "return", ...
converts a number of seconds to days
[ "converts", "a", "number", "of", "seconds", "to", "days" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4369-L4379
train
converts a number of seconds to days
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._days_to_seconds
def _days_to_seconds(cls, val, **kwargs): ''' converts a number of days to seconds ''' zero_value = kwargs.get('zero_value', 0) if val is not None: if val == 0: return zero_value return val * 86400 else: return 'Not Defi...
python
def _days_to_seconds(cls, val, **kwargs): ''' converts a number of days to seconds ''' zero_value = kwargs.get('zero_value', 0) if val is not None: if val == 0: return zero_value return val * 86400 else: return 'Not Defi...
[ "def", "_days_to_seconds", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "zero_value", "=", "kwargs", ".", "get", "(", "'zero_value'", ",", "0", ")", "if", "val", "is", "not", "None", ":", "if", "val", "==", "0", ":", "return", "zero_v...
converts a number of days to seconds
[ "converts", "a", "number", "of", "days", "to", "seconds" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4382-L4392
train
converts a number of days to seconds
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._binary_enable_zero_disable_one_conversion
def _binary_enable_zero_disable_one_conversion(cls, val, **kwargs): ''' converts a binary 0/1 to Disabled/Enabled ''' try: if val is not None: if ord(val) == 0: return 'Disabled' elif ord(val) == 1: retur...
python
def _binary_enable_zero_disable_one_conversion(cls, val, **kwargs): ''' converts a binary 0/1 to Disabled/Enabled ''' try: if val is not None: if ord(val) == 0: return 'Disabled' elif ord(val) == 1: retur...
[ "def", "_binary_enable_zero_disable_one_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "try", ":", "if", "val", "is", "not", "None", ":", "if", "ord", "(", "val", ")", "==", "0", ":", "return", "'Disabled'", "elif", "ord", "(",...
converts a binary 0/1 to Disabled/Enabled
[ "converts", "a", "binary", "0", "/", "1", "to", "Disabled", "/", "Enabled" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4429-L4444
train
Convert a binary 0 / 1 to Disabled or Enabled.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._binary_enable_zero_disable_one_reverse_conversion
def _binary_enable_zero_disable_one_reverse_conversion(cls, val, **kwargs): ''' converts Enabled/Disabled to unicode char to write to a REG_BINARY value ''' if val is not None: if val.upper() == 'DISABLED': return chr(0) elif val.upper() == 'ENABLE...
python
def _binary_enable_zero_disable_one_reverse_conversion(cls, val, **kwargs): ''' converts Enabled/Disabled to unicode char to write to a REG_BINARY value ''' if val is not None: if val.upper() == 'DISABLED': return chr(0) elif val.upper() == 'ENABLE...
[ "def", "_binary_enable_zero_disable_one_reverse_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "val", "is", "not", "None", ":", "if", "val", ".", "upper", "(", ")", "==", "'DISABLED'", ":", "return", "chr", "(", "0", ")", ...
converts Enabled/Disabled to unicode char to write to a REG_BINARY value
[ "converts", "Enabled", "/", "Disabled", "to", "unicode", "char", "to", "write", "to", "a", "REG_BINARY", "value" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4447-L4459
train
Convert Enabled to unicode char to write to a REG_BINARY value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._dasd_conversion
def _dasd_conversion(cls, val, **kwargs): ''' converts 0/1/2 for dasd reg key ''' if val is not None: if val == '0' or val == 0 or val == '': return 'Administrators' elif val == '1' or val == 1: return 'Administrators and Power User...
python
def _dasd_conversion(cls, val, **kwargs): ''' converts 0/1/2 for dasd reg key ''' if val is not None: if val == '0' or val == 0 or val == '': return 'Administrators' elif val == '1' or val == 1: return 'Administrators and Power User...
[ "def", "_dasd_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "val", "is", "not", "None", ":", "if", "val", "==", "'0'", "or", "val", "==", "0", "or", "val", "==", "''", ":", "return", "'Administrators'", "elif", "val"...
converts 0/1/2 for dasd reg key
[ "converts", "0", "/", "1", "/", "2", "for", "dasd", "reg", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4462-L4476
train
Convert a string value to a string for dasd reg 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/win_lgpo.py
_policy_info._dasd_reverse_conversion
def _dasd_reverse_conversion(cls, val, **kwargs): ''' converts DASD String values to the reg_sz value ''' if val is not None: if val.upper() == 'ADMINISTRATORS': # "" also shows 'administrators' in the GUI return '0' elif val.upper(...
python
def _dasd_reverse_conversion(cls, val, **kwargs): ''' converts DASD String values to the reg_sz value ''' if val is not None: if val.upper() == 'ADMINISTRATORS': # "" also shows 'administrators' in the GUI return '0' elif val.upper(...
[ "def", "_dasd_reverse_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "val", "is", "not", "None", ":", "if", "val", ".", "upper", "(", ")", "==", "'ADMINISTRATORS'", ":", "# \"\" also shows 'administrators' in the GUI", "return", ...
converts DASD String values to the reg_sz value
[ "converts", "DASD", "String", "values", "to", "the", "reg_sz", "value" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4479-L4498
train
Convert DASD String values to the reg_sz value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._in_range_inclusive
def _in_range_inclusive(cls, val, **kwargs): ''' checks that a value is in an inclusive range The value for 0 used by Max Password Age is actually 0xffffffff ''' minimum = kwargs.get('min', 0) maximum = kwargs.get('max', 1) zero_value = kwargs.get('zero_value', 0)...
python
def _in_range_inclusive(cls, val, **kwargs): ''' checks that a value is in an inclusive range The value for 0 used by Max Password Age is actually 0xffffffff ''' minimum = kwargs.get('min', 0) maximum = kwargs.get('max', 1) zero_value = kwargs.get('zero_value', 0)...
[ "def", "_in_range_inclusive", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "minimum", "=", "kwargs", ".", "get", "(", "'min'", ",", "0", ")", "maximum", "=", "kwargs", ".", "get", "(", "'max'", ",", "1", ")", "zero_value", "=", "kwarg...
checks that a value is in an inclusive range The value for 0 used by Max Password Age is actually 0xffffffff
[ "checks", "that", "a", "value", "is", "in", "an", "inclusive", "range", "The", "value", "for", "0", "used", "by", "Max", "Password", "Age", "is", "actually", "0xffffffff" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4501-L4524
train
checks that a value is in an inclusive range 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
salt/modules/win_lgpo.py
_policy_info._driver_signing_reg_conversion
def _driver_signing_reg_conversion(cls, val, **kwargs): ''' converts the binary value in the registry for driver signing into the correct string representation ''' log.debug('we have %s for the driver signing value', val) if val is not None: # since this is fr...
python
def _driver_signing_reg_conversion(cls, val, **kwargs): ''' converts the binary value in the registry for driver signing into the correct string representation ''' log.debug('we have %s for the driver signing value', val) if val is not None: # since this is fr...
[ "def", "_driver_signing_reg_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "log", ".", "debug", "(", "'we have %s for the driver signing value'", ",", "val", ")", "if", "val", "is", "not", "None", ":", "# since this is from secedit, it sho...
converts the binary value in the registry for driver signing into the correct string representation
[ "converts", "the", "binary", "value", "in", "the", "registry", "for", "driver", "signing", "into", "the", "correct", "string", "representation" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4527-L4550
train
This function converts the binary value in the driver signing registry into the correct string representation of the driver signing 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/win_lgpo.py
_policy_info._driver_signing_reg_reverse_conversion
def _driver_signing_reg_reverse_conversion(cls, val, **kwargs): ''' converts the string value seen in the GUI to the correct registry value for secedit ''' if val is not None: if val.upper() == 'SILENTLY SUCCEED': return ','.join(['3', '0']) ...
python
def _driver_signing_reg_reverse_conversion(cls, val, **kwargs): ''' converts the string value seen in the GUI to the correct registry value for secedit ''' if val is not None: if val.upper() == 'SILENTLY SUCCEED': return ','.join(['3', '0']) ...
[ "def", "_driver_signing_reg_reverse_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "val", "is", "not", "None", ":", "if", "val", ".", "upper", "(", ")", "==", "'SILENTLY SUCCEED'", ":", "return", "','", ".", "join", "(", ...
converts the string value seen in the GUI to the correct registry value for secedit
[ "converts", "the", "string", "value", "seen", "in", "the", "GUI", "to", "the", "correct", "registry", "value", "for", "secedit" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4553-L4568
train
Converts the string value seen in the GUI to the correct registry value for secedit
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._sidConversion
def _sidConversion(cls, val, **kwargs): ''' converts a list of pysid objects to string representations ''' if isinstance(val, six.string_types): val = val.split(',') usernames = [] for _sid in val: try: userSid = win32security.Looku...
python
def _sidConversion(cls, val, **kwargs): ''' converts a list of pysid objects to string representations ''' if isinstance(val, six.string_types): val = val.split(',') usernames = [] for _sid in val: try: userSid = win32security.Looku...
[ "def", "_sidConversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "val", ",", "six", ".", "string_types", ")", ":", "val", "=", "val", ".", "split", "(", "','", ")", "usernames", "=", "[", "]", "for", "_...
converts a list of pysid objects to string representations
[ "converts", "a", "list", "of", "pysid", "objects", "to", "string", "representations" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4571-L4590
train
Convert a list of pysid objects to string representations
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._usernamesToSidObjects
def _usernamesToSidObjects(cls, val, **kwargs): ''' converts a list of usernames to sid objects ''' if not val: return val if isinstance(val, six.string_types): val = val.split(',') sids = [] for _user in val: try: ...
python
def _usernamesToSidObjects(cls, val, **kwargs): ''' converts a list of usernames to sid objects ''' if not val: return val if isinstance(val, six.string_types): val = val.split(',') sids = [] for _user in val: try: ...
[ "def", "_usernamesToSidObjects", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "not", "val", ":", "return", "val", "if", "isinstance", "(", "val", ",", "six", ".", "string_types", ")", ":", "val", "=", "val", ".", "split", "(", "...
converts a list of usernames to sid objects
[ "converts", "a", "list", "of", "usernames", "to", "sid", "objects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4593-L4613
train
Convert a list of usernames to sid objects
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._powershell_script_order_conversion
def _powershell_script_order_conversion(cls, val, **kwargs): ''' converts true/false/None to the GUI representation of the powershell startup/shutdown script order ''' log.debug('script order value = %s', val) if val is None or val == 'None': return 'Not Confi...
python
def _powershell_script_order_conversion(cls, val, **kwargs): ''' converts true/false/None to the GUI representation of the powershell startup/shutdown script order ''' log.debug('script order value = %s', val) if val is None or val == 'None': return 'Not Confi...
[ "def", "_powershell_script_order_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "log", ".", "debug", "(", "'script order value = %s'", ",", "val", ")", "if", "val", "is", "None", "or", "val", "==", "'None'", ":", "return", "'Not Co...
converts true/false/None to the GUI representation of the powershell startup/shutdown script order
[ "converts", "true", "/", "false", "/", "None", "to", "the", "GUI", "representation", "of", "the", "powershell", "startup", "/", "shutdown", "script", "order" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4616-L4629
train
Convert a string value to the GUI representation of the powershell reservation script order.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._powershell_script_order_reverse_conversion
def _powershell_script_order_reverse_conversion(cls, val, **kwargs): ''' converts powershell script GUI strings representations to True/False/None ''' if val.upper() == 'Run Windows PowerShell scripts first'.upper(): return 'true' elif val.upper() == 'Run Wind...
python
def _powershell_script_order_reverse_conversion(cls, val, **kwargs): ''' converts powershell script GUI strings representations to True/False/None ''' if val.upper() == 'Run Windows PowerShell scripts first'.upper(): return 'true' elif val.upper() == 'Run Wind...
[ "def", "_powershell_script_order_reverse_conversion", "(", "cls", ",", "val", ",", "*", "*", "kwargs", ")", ":", "if", "val", ".", "upper", "(", ")", "==", "'Run Windows PowerShell scripts first'", ".", "upper", "(", ")", ":", "return", "'true'", "elif", "val"...
converts powershell script GUI strings representations to True/False/None
[ "converts", "powershell", "script", "GUI", "strings", "representations", "to", "True", "/", "False", "/", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4632-L4644
train
Convert powershell script GUI strings representations to True False and None to return True False or None to return False or None to return 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_lgpo.py
_policy_info._dict_lookup
def _dict_lookup(cls, item, **kwargs): ''' Retrieves the key or value from a dict based on the item kwarg lookup dict to search for item kwarg value_lookup bool to determine if item should be compared to keys or values ''' log.debug('item == %s', item) val...
python
def _dict_lookup(cls, item, **kwargs): ''' Retrieves the key or value from a dict based on the item kwarg lookup dict to search for item kwarg value_lookup bool to determine if item should be compared to keys or values ''' log.debug('item == %s', item) val...
[ "def", "_dict_lookup", "(", "cls", ",", "item", ",", "*", "*", "kwargs", ")", ":", "log", ".", "debug", "(", "'item == %s'", ",", "item", ")", "value_lookup", "=", "kwargs", ".", "get", "(", "'value_lookup'", ",", "False", ")", "if", "'lookup'", "in", ...
Retrieves the key or value from a dict based on the item kwarg lookup dict to search for item kwarg value_lookup bool to determine if item should be compared to keys or values
[ "Retrieves", "the", "key", "or", "value", "from", "a", "dict", "based", "on", "the", "item", "kwarg", "lookup", "dict", "to", "search", "for", "item", "kwarg", "value_lookup", "bool", "to", "determine", "if", "item", "should", "be", "compared", "to", "keys...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4647-L4666
train
Returns the key or value of the item in a dict based on the item kwarg lookup dict to search for the item COOKIEID kwarg value_lookup bool to determine if the item should be compared to keys COOKIEID or values COOKIEID
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._dict_lookup_bitwise_add
def _dict_lookup_bitwise_add(cls, item, **kwargs): ''' kwarg value_lookup bool to determine if item_list should be compared to keys or values kwarg test_zero is used to determine if 0 should be tested when value_lookup is false lookup should be a dict with integers for keys ...
python
def _dict_lookup_bitwise_add(cls, item, **kwargs): ''' kwarg value_lookup bool to determine if item_list should be compared to keys or values kwarg test_zero is used to determine if 0 should be tested when value_lookup is false lookup should be a dict with integers for keys ...
[ "def", "_dict_lookup_bitwise_add", "(", "cls", ",", "item", ",", "*", "*", "kwargs", ")", ":", "value_lookup", "=", "kwargs", ".", "get", "(", "'value_lookup'", ",", "False", ")", "test_zero", "=", "kwargs", ".", "get", "(", "'test_zero'", ",", "False", ...
kwarg value_lookup bool to determine if item_list should be compared to keys or values kwarg test_zero is used to determine if 0 should be tested when value_lookup is false lookup should be a dict with integers for keys if value_lookup is True, item is expected to be a list ...
[ "kwarg", "value_lookup", "bool", "to", "determine", "if", "item_list", "should", "be", "compared", "to", "keys", "or", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4669-L4710
train
This function will add the items in the item_list to the keys which successfully bitwise and with item
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._multi_string_put_transform
def _multi_string_put_transform(cls, item, **kwargs): ''' transform for a REG_MULTI_SZ to properly handle "Not Defined" ''' if isinstance(item, list): return item elif isinstance(item, six.string_types): if item.lower() == 'not defined': re...
python
def _multi_string_put_transform(cls, item, **kwargs): ''' transform for a REG_MULTI_SZ to properly handle "Not Defined" ''' if isinstance(item, list): return item elif isinstance(item, six.string_types): if item.lower() == 'not defined': re...
[ "def", "_multi_string_put_transform", "(", "cls", ",", "item", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "item", ",", "list", ")", ":", "return", "item", "elif", "isinstance", "(", "item", ",", "six", ".", "string_types", ")", ":", "i...
transform for a REG_MULTI_SZ to properly handle "Not Defined"
[ "transform", "for", "a", "REG_MULTI_SZ", "to", "properly", "handle", "Not", "Defined" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4713-L4725
train
transform for a REG_MULTI_SZ to properly handle Not Defined
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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_lgpo.py
_policy_info._string_put_transform
def _string_put_transform(cls, item, **kwargs): ''' transfrom for a REG_SZ to properly handle "Not Defined" ''' if isinstance(item, six.string_types): if item.lower() == 'not defined': return None else: return item
python
def _string_put_transform(cls, item, **kwargs): ''' transfrom for a REG_SZ to properly handle "Not Defined" ''' if isinstance(item, six.string_types): if item.lower() == 'not defined': return None else: return item
[ "def", "_string_put_transform", "(", "cls", ",", "item", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "item", ",", "six", ".", "string_types", ")", ":", "if", "item", ".", "lower", "(", ")", "==", "'not defined'", ":", "return", "None", ...
transfrom for a REG_SZ to properly handle "Not Defined"
[ "transfrom", "for", "a", "REG_SZ", "to", "properly", "handle", "Not", "Defined" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_lgpo.py#L4728-L4736
train
transfrom for a REG_SZ to properly handle Not Defined
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
_snapshot_to_data
def _snapshot_to_data(snapshot): ''' Returns snapshot data from a D-Bus response. A snapshot D-Bus response is a dbus.Struct containing the information related to a snapshot: [id, type, pre_snapshot, timestamp, user, description, cleanup_algorithm, userdata] id: dbus.UInt32 type: dbu...
python
def _snapshot_to_data(snapshot): ''' Returns snapshot data from a D-Bus response. A snapshot D-Bus response is a dbus.Struct containing the information related to a snapshot: [id, type, pre_snapshot, timestamp, user, description, cleanup_algorithm, userdata] id: dbus.UInt32 type: dbu...
[ "def", "_snapshot_to_data", "(", "snapshot", ")", ":", "data", "=", "{", "}", "data", "[", "'id'", "]", "=", "snapshot", "[", "0", "]", "data", "[", "'type'", "]", "=", "[", "'single'", ",", "'pre'", ",", "'post'", "]", "[", "snapshot", "[", "1", ...
Returns snapshot data from a D-Bus response. A snapshot D-Bus response is a dbus.Struct containing the information related to a snapshot: [id, type, pre_snapshot, timestamp, user, description, cleanup_algorithm, userdata] id: dbus.UInt32 type: dbus.UInt16 pre_snapshot: dbus.UInt32 ti...
[ "Returns", "snapshot", "data", "from", "a", "D", "-", "Bus", "response", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L99-L138
train
Convert a snapshot response to a dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
_dbus_exception_to_reason
def _dbus_exception_to_reason(exc, args): ''' Returns a error message from a snapper DBusException ''' error = exc.get_dbus_name() if error == 'error.unknown_config': return "Unknown configuration '{0}'".format(args['config']) elif error == 'error.illegal_snapshot': return 'Inval...
python
def _dbus_exception_to_reason(exc, args): ''' Returns a error message from a snapper DBusException ''' error = exc.get_dbus_name() if error == 'error.unknown_config': return "Unknown configuration '{0}'".format(args['config']) elif error == 'error.illegal_snapshot': return 'Inval...
[ "def", "_dbus_exception_to_reason", "(", "exc", ",", "args", ")", ":", "error", "=", "exc", ".", "get_dbus_name", "(", ")", "if", "error", "==", "'error.unknown_config'", ":", "return", "\"Unknown configuration '{0}'\"", ".", "format", "(", "args", "[", "'config...
Returns a error message from a snapper DBusException
[ "Returns", "a", "error", "message", "from", "a", "snapper", "DBusException" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L141-L151
train
Returns a message from a snapper DBusException
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
list_snapshots
def list_snapshots(config='root'): ''' List available snapshots CLI example: .. code-block:: bash salt '*' snapper.list_snapshots config=myconfig ''' try: snapshots = snapper.ListSnapshots(config) return [_snapshot_to_data(s) for s in snapshots] except dbus.DBusExc...
python
def list_snapshots(config='root'): ''' List available snapshots CLI example: .. code-block:: bash salt '*' snapper.list_snapshots config=myconfig ''' try: snapshots = snapper.ListSnapshots(config) return [_snapshot_to_data(s) for s in snapshots] except dbus.DBusExc...
[ "def", "list_snapshots", "(", "config", "=", "'root'", ")", ":", "try", ":", "snapshots", "=", "snapper", ".", "ListSnapshots", "(", "config", ")", "return", "[", "_snapshot_to_data", "(", "s", ")", "for", "s", "in", "snapshots", "]", "except", "dbus", "...
List available snapshots CLI example: .. code-block:: bash salt '*' snapper.list_snapshots config=myconfig
[ "List", "available", "snapshots" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L154-L171
train
List available snapshots in a node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/snapper.py
get_snapshot
def get_snapshot(number=0, config='root'): ''' Get detailed information about a given snapshot CLI example: .. code-block:: bash salt '*' snapper.get_snapshot 1 ''' try: snapshot = snapper.GetSnapshot(config, int(number)) return _snapshot_to_data(snapshot) except d...
python
def get_snapshot(number=0, config='root'): ''' Get detailed information about a given snapshot CLI example: .. code-block:: bash salt '*' snapper.get_snapshot 1 ''' try: snapshot = snapper.GetSnapshot(config, int(number)) return _snapshot_to_data(snapshot) except d...
[ "def", "get_snapshot", "(", "number", "=", "0", ",", "config", "=", "'root'", ")", ":", "try", ":", "snapshot", "=", "snapper", ".", "GetSnapshot", "(", "config", ",", "int", "(", "number", ")", ")", "return", "_snapshot_to_data", "(", "snapshot", ")", ...
Get detailed information about a given snapshot CLI example: .. code-block:: bash salt '*' snapper.get_snapshot 1
[ "Get", "detailed", "information", "about", "a", "given", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L174-L191
train
Get detailed information about a given 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/modules/snapper.py
list_configs
def list_configs(): ''' List all available configs CLI example: .. code-block:: bash salt '*' snapper.list_configs ''' try: configs = snapper.ListConfigs() return dict((config[0], config[2]) for config in configs) except dbus.DBusException as exc: raise Com...
python
def list_configs(): ''' List all available configs CLI example: .. code-block:: bash salt '*' snapper.list_configs ''' try: configs = snapper.ListConfigs() return dict((config[0], config[2]) for config in configs) except dbus.DBusException as exc: raise Com...
[ "def", "list_configs", "(", ")", ":", "try", ":", "configs", "=", "snapper", ".", "ListConfigs", "(", ")", "return", "dict", "(", "(", "config", "[", "0", "]", ",", "config", "[", "2", "]", ")", "for", "config", "in", "configs", ")", "except", "dbu...
List all available configs CLI example: .. code-block:: bash salt '*' snapper.list_configs
[ "List", "all", "available", "configs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L194-L211
train
List all available configs
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
set_config
def set_config(name='root', **kwargs): ''' Set configuration values CLI example: .. code-block:: bash salt '*' snapper.set_config SYNC_ACL=True Keys are case insensitive as they will be always uppercased to snapper convention. The above example is equivalent to: .. code-block:: ...
python
def set_config(name='root', **kwargs): ''' Set configuration values CLI example: .. code-block:: bash salt '*' snapper.set_config SYNC_ACL=True Keys are case insensitive as they will be always uppercased to snapper convention. The above example is equivalent to: .. code-block:: ...
[ "def", "set_config", "(", "name", "=", "'root'", ",", "*", "*", "kwargs", ")", ":", "try", ":", "data", "=", "dict", "(", "(", "k", ".", "upper", "(", ")", ",", "_config_filter", "(", "v", ")", ")", "for", "k", ",", "v", "in", "kwargs", ".", ...
Set configuration values CLI example: .. code-block:: bash salt '*' snapper.set_config SYNC_ACL=True Keys are case insensitive as they will be always uppercased to snapper convention. The above example is equivalent to: .. code-block:: bash salt '*' snapper.set_config sync_acl=...
[ "Set", "configuration", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L220-L246
train
Set the configuration values for the current 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/snapper.py
_get_last_snapshot
def _get_last_snapshot(config='root'): ''' Returns the last existing created snapshot ''' snapshot_list = sorted(list_snapshots(config), key=lambda x: x['id']) return snapshot_list[-1]
python
def _get_last_snapshot(config='root'): ''' Returns the last existing created snapshot ''' snapshot_list = sorted(list_snapshots(config), key=lambda x: x['id']) return snapshot_list[-1]
[ "def", "_get_last_snapshot", "(", "config", "=", "'root'", ")", ":", "snapshot_list", "=", "sorted", "(", "list_snapshots", "(", "config", ")", ",", "key", "=", "lambda", "x", ":", "x", "[", "'id'", "]", ")", "return", "snapshot_list", "[", "-", "1", "...
Returns the last existing created snapshot
[ "Returns", "the", "last", "existing", "created", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L249-L254
train
Returns the last existing snapshot in the availabe node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/snapper.py
status_to_string
def status_to_string(dbus_status): ''' Converts a numeric dbus snapper status into a string CLI Example: .. code-block:: bash salt '*' snapper.status_to_string <dbus_status> ''' status_tuple = ( dbus_status & 0b000000001, dbus_status & 0b000000010, dbus_status & 0b000000100, ...
python
def status_to_string(dbus_status): ''' Converts a numeric dbus snapper status into a string CLI Example: .. code-block:: bash salt '*' snapper.status_to_string <dbus_status> ''' status_tuple = ( dbus_status & 0b000000001, dbus_status & 0b000000010, dbus_status & 0b000000100, ...
[ "def", "status_to_string", "(", "dbus_status", ")", ":", "status_tuple", "=", "(", "dbus_status", "&", "0b000000001", ",", "dbus_status", "&", "0b000000010", ",", "dbus_status", "&", "0b000000100", ",", "dbus_status", "&", "0b000001000", ",", "dbus_status", "&", ...
Converts a numeric dbus snapper status into a string CLI Example: .. code-block:: bash salt '*' snapper.status_to_string <dbus_status>
[ "Converts", "a", "numeric", "dbus", "snapper", "status", "into", "a", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L257-L273
train
Converts a numeric dbus snapper status into a string
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
get_config
def get_config(name='root'): ''' Retrieves all values from a given configuration CLI example: .. code-block:: bash salt '*' snapper.get_config ''' try: config = snapper.GetConfig(name) return config except dbus.DBusException as exc: raise CommandExecutionErro...
python
def get_config(name='root'): ''' Retrieves all values from a given configuration CLI example: .. code-block:: bash salt '*' snapper.get_config ''' try: config = snapper.GetConfig(name) return config except dbus.DBusException as exc: raise CommandExecutionErro...
[ "def", "get_config", "(", "name", "=", "'root'", ")", ":", "try", ":", "config", "=", "snapper", ".", "GetConfig", "(", "name", ")", "return", "config", "except", "dbus", ".", "DBusException", "as", "exc", ":", "raise", "CommandExecutionError", "(", "'Erro...
Retrieves all values from a given configuration CLI example: .. code-block:: bash salt '*' snapper.get_config
[ "Retrieves", "all", "values", "from", "a", "given", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L276-L293
train
Retrieves all values from a given configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/snapper.py
create_config
def create_config(name=None, subvolume=None, fstype=None, template=None, extra_opts=None): ''' Creates a new Snapper configuration name Name of the new Snapper configuration. subvolume Path to the related subvolume....
python
def create_config(name=None, subvolume=None, fstype=None, template=None, extra_opts=None): ''' Creates a new Snapper configuration name Name of the new Snapper configuration. subvolume Path to the related subvolume....
[ "def", "create_config", "(", "name", "=", "None", ",", "subvolume", "=", "None", ",", "fstype", "=", "None", ",", "template", "=", "None", ",", "extra_opts", "=", "None", ")", ":", "def", "raise_arg_error", "(", "argname", ")", ":", "raise", "CommandExec...
Creates a new Snapper configuration name Name of the new Snapper configuration. subvolume Path to the related subvolume. fstype Filesystem type of the subvolume. template Configuration template to use. (Default: default) extra_opts Extra Snapper configuration...
[ "Creates", "a", "new", "Snapper", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L296-L347
train
Creates a new configuration for a specific subvolume.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
create_snapshot
def create_snapshot(config='root', snapshot_type='single', pre_number=None, description=None, cleanup_algorithm='number', userdata=None, **kwargs): ''' Creates an snapshot config Configuration name. snapshot_type Specifies the type of the new snap...
python
def create_snapshot(config='root', snapshot_type='single', pre_number=None, description=None, cleanup_algorithm='number', userdata=None, **kwargs): ''' Creates an snapshot config Configuration name. snapshot_type Specifies the type of the new snap...
[ "def", "create_snapshot", "(", "config", "=", "'root'", ",", "snapshot_type", "=", "'single'", ",", "pre_number", "=", "None", ",", "description", "=", "None", ",", "cleanup_algorithm", "=", "'number'", ",", "userdata", "=", "None", ",", "*", "*", "kwargs", ...
Creates an snapshot config Configuration name. snapshot_type Specifies the type of the new snapshot. Possible values are single, pre and post. pre_number For post snapshots the number of the pre snapshot must be provided. description Description for the s...
[ "Creates", "an", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L350-L421
train
Creates a new snapshot in the salt - job system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/snapper.py
delete_snapshot
def delete_snapshot(snapshots_ids=None, config="root"): ''' Deletes an snapshot config Configuration name. (Default: root) snapshots_ids List of the snapshots IDs to be deleted. CLI example: .. code-block:: bash salt '*' snapper.delete_snapshot 54 salt '*' sn...
python
def delete_snapshot(snapshots_ids=None, config="root"): ''' Deletes an snapshot config Configuration name. (Default: root) snapshots_ids List of the snapshots IDs to be deleted. CLI example: .. code-block:: bash salt '*' snapper.delete_snapshot 54 salt '*' sn...
[ "def", "delete_snapshot", "(", "snapshots_ids", "=", "None", ",", "config", "=", "\"root\"", ")", ":", "if", "not", "snapshots_ids", ":", "raise", "CommandExecutionError", "(", "'Error: No snapshot ID has been provided'", ")", "try", ":", "current_snapshots_ids", "=",...
Deletes an snapshot config Configuration name. (Default: root) snapshots_ids List of the snapshots IDs to be deleted. CLI example: .. code-block:: bash salt '*' snapper.delete_snapshot 54 salt '*' snapper.delete_snapshot config=root 54 salt '*' snapper.delete...
[ "Deletes", "an", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L424-L457
train
Deletes a snapshot from the specified list of snapshots.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
modify_snapshot
def modify_snapshot(snapshot_id=None, description=None, userdata=None, cleanup=None, config="root"): ''' Modify attributes of an existing snapshot. config Configuration name. (Default: root) snapshot_id ID ...
python
def modify_snapshot(snapshot_id=None, description=None, userdata=None, cleanup=None, config="root"): ''' Modify attributes of an existing snapshot. config Configuration name. (Default: root) snapshot_id ID ...
[ "def", "modify_snapshot", "(", "snapshot_id", "=", "None", ",", "description", "=", "None", ",", "userdata", "=", "None", ",", "cleanup", "=", "None", ",", "config", "=", "\"root\"", ")", ":", "if", "not", "snapshot_id", ":", "raise", "CommandExecutionError"...
Modify attributes of an existing snapshot. config Configuration name. (Default: root) snapshot_id ID of the snapshot to be modified. cleanup Change the cleanup method of the snapshot. (str) description Change the description of the snapshot. (str) userdata ...
[ "Modify", "attributes", "of", "an", "existing", "snapshot", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L460-L510
train
Modify attributes of an existing 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/modules/snapper.py
_get_num_interval
def _get_num_interval(config, num_pre, num_post): ''' Returns numerical interval based on optionals num_pre, num_post values ''' post = int(num_post) if num_post else 0 pre = int(num_pre) if num_pre is not None else _get_last_snapshot(config)['id'] return pre, post
python
def _get_num_interval(config, num_pre, num_post): ''' Returns numerical interval based on optionals num_pre, num_post values ''' post = int(num_post) if num_post else 0 pre = int(num_pre) if num_pre is not None else _get_last_snapshot(config)['id'] return pre, post
[ "def", "_get_num_interval", "(", "config", ",", "num_pre", ",", "num_post", ")", ":", "post", "=", "int", "(", "num_post", ")", "if", "num_post", "else", "0", "pre", "=", "int", "(", "num_pre", ")", "if", "num_pre", "is", "not", "None", "else", "_get_l...
Returns numerical interval based on optionals num_pre, num_post values
[ "Returns", "numerical", "interval", "based", "on", "optionals", "num_pre", "num_post", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L513-L519
train
Returns numerical interval based on optionals num_pre num_post values
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
_is_text_file
def _is_text_file(filename): ''' Checks if a file is a text file ''' type_of_file = os.popen('file -bi {0}'.format(filename), 'r').read() return type_of_file.startswith('text')
python
def _is_text_file(filename): ''' Checks if a file is a text file ''' type_of_file = os.popen('file -bi {0}'.format(filename), 'r').read() return type_of_file.startswith('text')
[ "def", "_is_text_file", "(", "filename", ")", ":", "type_of_file", "=", "os", ".", "popen", "(", "'file -bi {0}'", ".", "format", "(", "filename", ")", ",", "'r'", ")", ".", "read", "(", ")", "return", "type_of_file", ".", "startswith", "(", "'text'", ")...
Checks if a file is a text file
[ "Checks", "if", "a", "file", "is", "a", "text", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L522-L527
train
Checks if a file is a text 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/snapper.py
run
def run(function, *args, **kwargs): ''' Runs a function from an execution module creating pre and post snapshots and associating the salt job id with those snapshots for easy undo and cleanup. function Salt function to call. config Configuration name. (default: "root") des...
python
def run(function, *args, **kwargs): ''' Runs a function from an execution module creating pre and post snapshots and associating the salt job id with those snapshots for easy undo and cleanup. function Salt function to call. config Configuration name. (default: "root") des...
[ "def", "run", "(", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "config", "=", "kwargs", ".", "pop", "(", "\"config\"", ",", "\"root\"", ")", "description", "=", "kwargs", ".", "pop", "(", "\"description\"", ",", "\"snapper.run[{0}]\"...
Runs a function from an execution module creating pre and post snapshots and associating the salt job id with those snapshots for easy undo and cleanup. function Salt function to call. config Configuration name. (default: "root") description A description for the snapshots...
[ "Runs", "a", "function", "from", "an", "execution", "module", "creating", "pre", "and", "post", "snapshots", "and", "associating", "the", "salt", "job", "id", "with", "those", "snapshots", "for", "easy", "undo", "and", "cleanup", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L530-L604
train
Runs a function from an execution module creating pre and post snapshots and associates the salt job id with those snapshots.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
status
def status(config='root', num_pre=None, num_post=None): ''' Returns a comparison between two snapshots config Configuration name. num_pre first snapshot ID to compare. Default is last snapshot num_post last snapshot ID to compare. Default is 0 (current state) CLI exam...
python
def status(config='root', num_pre=None, num_post=None): ''' Returns a comparison between two snapshots config Configuration name. num_pre first snapshot ID to compare. Default is last snapshot num_post last snapshot ID to compare. Default is 0 (current state) CLI exam...
[ "def", "status", "(", "config", "=", "'root'", ",", "num_pre", "=", "None", ",", "num_post", "=", "None", ")", ":", "try", ":", "pre", ",", "post", "=", "_get_num_interval", "(", "config", ",", "num_pre", ",", "num_post", ")", "snapper", ".", "CreateCo...
Returns a comparison between two snapshots config Configuration name. num_pre first snapshot ID to compare. Default is last snapshot num_post last snapshot ID to compare. Default is 0 (current state) CLI example: .. code-block:: bash salt '*' snapper.status ...
[ "Returns", "a", "comparison", "between", "two", "snapshots" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L607-L643
train
Returns a comparison between two snapshots 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
salt/modules/snapper.py
undo
def undo(config='root', files=None, num_pre=None, num_post=None): ''' Undo all file changes that happened between num_pre and num_post, leaving the files into the state of num_pre. .. warning:: If one of the files has changes after num_post, they will be overwritten The snapshots are us...
python
def undo(config='root', files=None, num_pre=None, num_post=None): ''' Undo all file changes that happened between num_pre and num_post, leaving the files into the state of num_pre. .. warning:: If one of the files has changes after num_post, they will be overwritten The snapshots are us...
[ "def", "undo", "(", "config", "=", "'root'", ",", "files", "=", "None", ",", "num_pre", "=", "None", ",", "num_post", "=", "None", ")", ":", "pre", ",", "post", "=", "_get_num_interval", "(", "config", ",", "num_pre", ",", "num_post", ")", "changes", ...
Undo all file changes that happened between num_pre and num_post, leaving the files into the state of num_pre. .. warning:: If one of the files has changes after num_post, they will be overwritten The snapshots are used to determine the file list, but the current version of the files wi...
[ "Undo", "all", "file", "changes", "that", "happened", "between", "num_pre", "and", "num_post", "leaving", "the", "files", "into", "the", "state", "of", "num_pre", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L669-L711
train
Undo all file changes between num_pre and num_post.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
_get_jid_snapshots
def _get_jid_snapshots(jid, config='root'): ''' Returns pre/post snapshots made by a given Salt jid Looks for 'salt_jid' entries into snapshots userdata which are created when 'snapper.run' is executed. ''' jid_snapshots = [x for x in list_snapshots(config) if x['userdata'].get("salt_jid") == j...
python
def _get_jid_snapshots(jid, config='root'): ''' Returns pre/post snapshots made by a given Salt jid Looks for 'salt_jid' entries into snapshots userdata which are created when 'snapper.run' is executed. ''' jid_snapshots = [x for x in list_snapshots(config) if x['userdata'].get("salt_jid") == j...
[ "def", "_get_jid_snapshots", "(", "jid", ",", "config", "=", "'root'", ")", ":", "jid_snapshots", "=", "[", "x", "for", "x", "in", "list_snapshots", "(", "config", ")", "if", "x", "[", "'userdata'", "]", ".", "get", "(", "\"salt_jid\"", ")", "==", "jid...
Returns pre/post snapshots made by a given Salt jid Looks for 'salt_jid' entries into snapshots userdata which are created when 'snapper.run' is executed.
[ "Returns", "pre", "/", "post", "snapshots", "made", "by", "a", "given", "Salt", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L714-L731
train
Returns pre and post snapshots made by a given jid
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
undo_jid
def undo_jid(jid, config='root'): ''' Undo the changes applied by a salt job jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.undo_jid jid=20160607130930720112 ''' pre_snapshot, post_snapshot = _get_jid_sn...
python
def undo_jid(jid, config='root'): ''' Undo the changes applied by a salt job jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.undo_jid jid=20160607130930720112 ''' pre_snapshot, post_snapshot = _get_jid_sn...
[ "def", "undo_jid", "(", "jid", ",", "config", "=", "'root'", ")", ":", "pre_snapshot", ",", "post_snapshot", "=", "_get_jid_snapshots", "(", "jid", ",", "config", "=", "config", ")", "return", "undo", "(", "config", ",", "num_pre", "=", "pre_snapshot", ","...
Undo the changes applied by a salt job jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.undo_jid jid=20160607130930720112
[ "Undo", "the", "changes", "applied", "by", "a", "salt", "job" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L734-L751
train
Undo the changes applied by a salt job jid
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
diff
def diff(config='root', filename=None, num_pre=None, num_post=None): ''' Returns the differences between two snapshots config Configuration name. filename if not provided the showing differences between snapshots for all "text" files num_pre first snapshot ID to co...
python
def diff(config='root', filename=None, num_pre=None, num_post=None): ''' Returns the differences between two snapshots config Configuration name. filename if not provided the showing differences between snapshots for all "text" files num_pre first snapshot ID to co...
[ "def", "diff", "(", "config", "=", "'root'", ",", "filename", "=", "None", ",", "num_pre", "=", "None", ",", "num_post", "=", "None", ")", ":", "try", ":", "pre", ",", "post", "=", "_get_num_interval", "(", "config", ",", "num_pre", ",", "num_post", ...
Returns the differences between two snapshots config Configuration name. filename if not provided the showing differences between snapshots for all "text" files num_pre first snapshot ID to compare. Default is last snapshot num_post last snapshot ID to compare...
[ "Returns", "the", "differences", "between", "two", "snapshots" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L754-L852
train
Return the differences between two snapshots for a specific configuration name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
diff_jid
def diff_jid(jid, config='root'): ''' Returns the changes applied by a `jid` jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.diff_jid jid=20160607130930720112 ''' pre_snapshot, post_snapshot = _get_jid_sn...
python
def diff_jid(jid, config='root'): ''' Returns the changes applied by a `jid` jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.diff_jid jid=20160607130930720112 ''' pre_snapshot, post_snapshot = _get_jid_sn...
[ "def", "diff_jid", "(", "jid", ",", "config", "=", "'root'", ")", ":", "pre_snapshot", ",", "post_snapshot", "=", "_get_jid_snapshots", "(", "jid", ",", "config", "=", "config", ")", "return", "diff", "(", "config", ",", "num_pre", "=", "pre_snapshot", ","...
Returns the changes applied by a `jid` jid The job id to lookup config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.diff_jid jid=20160607130930720112
[ "Returns", "the", "changes", "applied", "by", "a", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L855-L872
train
Returns the changes applied by a jid
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/snapper.py
create_baseline
def create_baseline(tag="baseline", config='root'): ''' Creates a snapshot marked as baseline tag Tag name for the baseline config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.create_baseline salt '*' snapper.create_baseline my_custo...
python
def create_baseline(tag="baseline", config='root'): ''' Creates a snapshot marked as baseline tag Tag name for the baseline config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.create_baseline salt '*' snapper.create_baseline my_custo...
[ "def", "create_baseline", "(", "tag", "=", "\"baseline\"", ",", "config", "=", "'root'", ")", ":", "return", "__salt__", "[", "'snapper.create_snapshot'", "]", "(", "config", "=", "config", ",", "snapshot_type", "=", "'single'", ",", "description", "=", "\"bas...
Creates a snapshot marked as baseline tag Tag name for the baseline config Configuration name. CLI Example: .. code-block:: bash salt '*' snapper.create_baseline salt '*' snapper.create_baseline my_custom_baseline
[ "Creates", "a", "snapshot", "marked", "as", "baseline" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snapper.py#L875-L896
train
Creates a baseline 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/environ.py
setenv
def setenv(name, value, false_unsets=False, clear_all=False, update_minion=False, permanent=False): ''' Set the salt process environment variables. name The environment key to set. Must be a string. value Either a string or dict. W...
python
def setenv(name, value, false_unsets=False, clear_all=False, update_minion=False, permanent=False): ''' Set the salt process environment variables. name The environment key to set. Must be a string. value Either a string or dict. W...
[ "def", "setenv", "(", "name", ",", "value", ",", "false_unsets", "=", "False", ",", "clear_all", "=", "False", ",", "update_minion", "=", "False", ",", "permanent", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", ...
Set the salt process environment variables. name The environment key to set. Must be a string. value Either a string or dict. When string, it will be the value set for the environment key of 'name' above. When a dict, each key/value pair represents an environment variab...
[ "Set", "the", "salt", "process", "environment", "variables", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/environ.py#L34-L184
train
Set the salt process environment variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/znc.py
_makepass
def _makepass(password, hasher='sha256'): ''' Create a znc compatible hashed password ''' # Setup the hasher if hasher == 'sha256': h = hashlib.sha256(password) elif hasher == 'md5': h = hashlib.md5(password) else: return NotImplemented c = "abcdefghijklmnopqrstu...
python
def _makepass(password, hasher='sha256'): ''' Create a znc compatible hashed password ''' # Setup the hasher if hasher == 'sha256': h = hashlib.sha256(password) elif hasher == 'md5': h = hashlib.md5(password) else: return NotImplemented c = "abcdefghijklmnopqrstu...
[ "def", "_makepass", "(", "password", ",", "hasher", "=", "'sha256'", ")", ":", "# Setup the hasher", "if", "hasher", "==", "'sha256'", ":", "h", "=", "hashlib", ".", "sha256", "(", "password", ")", "elif", "hasher", "==", "'md5'", ":", "h", "=", "hashlib...
Create a znc compatible hashed password
[ "Create", "a", "znc", "compatible", "hashed", "password" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/znc.py#L34-L58
train
Create a znc compatible hashed 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/znc.py
buildmod
def buildmod(*modules): ''' Build module using znc-buildmod CLI Example: .. code-block:: bash salt '*' znc.buildmod module.cpp [...] ''' # Check if module files are missing missing = [module for module in modules if not os.path.exists(module)] if missing: return 'Error...
python
def buildmod(*modules): ''' Build module using znc-buildmod CLI Example: .. code-block:: bash salt '*' znc.buildmod module.cpp [...] ''' # Check if module files are missing missing = [module for module in modules if not os.path.exists(module)] if missing: return 'Error...
[ "def", "buildmod", "(", "*", "modules", ")", ":", "# Check if module files are missing", "missing", "=", "[", "module", "for", "module", "in", "modules", "if", "not", "os", ".", "path", ".", "exists", "(", "module", ")", "]", "if", "missing", ":", "return"...
Build module using znc-buildmod CLI Example: .. code-block:: bash salt '*' znc.buildmod module.cpp [...]
[ "Build", "module", "using", "znc", "-", "buildmod" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/znc.py#L61-L79
train
Build a single or multiple modules using znc - buildmod
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/znc.py
version
def version(): ''' Return server version from znc --version CLI Example: .. code-block:: bash salt '*' znc.version ''' cmd = ['znc', '--version'] out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() ret = out[0].split(' - ') return ret[0]
python
def version(): ''' Return server version from znc --version CLI Example: .. code-block:: bash salt '*' znc.version ''' cmd = ['znc', '--version'] out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() ret = out[0].split(' - ') return ret[0]
[ "def", "version", "(", ")", ":", "cmd", "=", "[", "'znc'", ",", "'--version'", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "splitlines", "(", ")", "ret", "=", "out", "[", "0", "]", ...
Return server version from znc --version CLI Example: .. code-block:: bash salt '*' znc.version
[ "Return", "server", "version", "from", "znc", "--", "version" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/znc.py#L108-L121
train
Return server version from znc -- version 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/returners/odbc.py
_get_conn
def _get_conn(ret=None): ''' Return a MSSQL connection. ''' _options = _get_options(ret) dsn = _options.get('dsn') user = _options.get('user') passwd = _options.get('passwd') return pyodbc.connect('DSN={0};UID={1};PWD={2}'.format( dsn, user, passwd))
python
def _get_conn(ret=None): ''' Return a MSSQL connection. ''' _options = _get_options(ret) dsn = _options.get('dsn') user = _options.get('user') passwd = _options.get('passwd') return pyodbc.connect('DSN={0};UID={1};PWD={2}'.format( dsn, user, passwd))
[ "def", "_get_conn", "(", "ret", "=", "None", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "dsn", "=", "_options", ".", "get", "(", "'dsn'", ")", "user", "=", "_options", ".", "get", "(", "'user'", ")", "passwd", "=", "_options", ".", ...
Return a MSSQL connection.
[ "Return", "a", "MSSQL", "connection", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/odbc.py#L169-L181
train
Return a MSSQL connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/odbc.py
returner
def returner(ret): ''' Return data to an odbc server ''' conn = _get_conn(ret) cur = conn.cursor() sql = '''INSERT INTO salt_returns (fun, jid, retval, id, success, full_ret) VALUES (?, ?, ?, ?, ?, ?)''' cur.execute( sql, ( ret['fun'], ...
python
def returner(ret): ''' Return data to an odbc server ''' conn = _get_conn(ret) cur = conn.cursor() sql = '''INSERT INTO salt_returns (fun, jid, retval, id, success, full_ret) VALUES (?, ?, ?, ?, ?, ?)''' cur.execute( sql, ( ret['fun'], ...
[ "def", "returner", "(", "ret", ")", ":", "conn", "=", "_get_conn", "(", "ret", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''INSERT INTO salt_returns\n (fun, jid, retval, id, success, full_ret)\n VALUES (?, ?, ?, ?, ?, ?)'''", "cu...
Return data to an odbc server
[ "Return", "data", "to", "an", "odbc", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/odbc.py#L192-L211
train
Return data to an odbc 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/returners/odbc.py
get_jid
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT id, full_ret FROM salt_returns WHERE jid = ?''' cur.execute(sql, (jid,)) data = cur.fetchall() ret = {} if data: ...
python
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT id, full_ret FROM salt_returns WHERE jid = ?''' cur.execute(sql, (jid,)) data = cur.fetchall() ret = {} if data: ...
[ "def", "get_jid", "(", "jid", ")", ":", "conn", "=", "_get_conn", "(", "ret", "=", "None", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT id, full_ret FROM salt_returns WHERE jid = ?'''", "cur", ".", "execute", "(", "sql", ",", "(...
Return the information returned when the specified job id was executed
[ "Return", "the", "information", "returned", "when", "the", "specified", "job", "id", "was", "executed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/odbc.py#L249-L264
train
Return the information returned when the specified job id was executed
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/odbc.py
get_fun
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT s.id,s.jid, s.full_ret FROM salt_returns s JOIN ( SELECT MAX(jid) AS jid FROM salt_returns GROUP BY fun, id) max ...
python
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT s.id,s.jid, s.full_ret FROM salt_returns s JOIN ( SELECT MAX(jid) AS jid FROM salt_returns GROUP BY fun, id) max ...
[ "def", "get_fun", "(", "fun", ")", ":", "conn", "=", "_get_conn", "(", "ret", "=", "None", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT s.id,s.jid, s.full_ret\n FROM salt_returns s\n JOIN ( SELECT MAX(jid) AS jid FROM sa...
Return a dict of the last function called for all minions
[ "Return", "a", "dict", "of", "the", "last", "function", "called", "for", "all", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/odbc.py#L267-L288
train
Return a dict of the last function called for all minions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/odbc.py
get_jids
def get_jids(): ''' Return a list of all job ids ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT distinct jid, load FROM jids''' cur.execute(sql) data = cur.fetchall() ret = {} for jid, load in data: ret[jid] = salt.utils.jid.format_jid_instance(jid, s...
python
def get_jids(): ''' Return a list of all job ids ''' conn = _get_conn(ret=None) cur = conn.cursor() sql = '''SELECT distinct jid, load FROM jids''' cur.execute(sql) data = cur.fetchall() ret = {} for jid, load in data: ret[jid] = salt.utils.jid.format_jid_instance(jid, s...
[ "def", "get_jids", "(", ")", ":", "conn", "=", "_get_conn", "(", "ret", "=", "None", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT distinct jid, load FROM jids'''", "cur", ".", "execute", "(", "sql", ")", "data", "=", "cur", ...
Return a list of all job ids
[ "Return", "a", "list", "of", "all", "job", "ids" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/odbc.py#L291-L305
train
Return a list of all job ids
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
_load_config
def _load_config(): ''' Loads and parses /usbkey/config ''' config = {} if os.path.isfile('/usbkey/config'): with salt.utils.files.fopen('/usbkey/config', 'r') as config_file: for optval in config_file: optval = salt.utils.stringutils.to_unicode(optval) ...
python
def _load_config(): ''' Loads and parses /usbkey/config ''' config = {} if os.path.isfile('/usbkey/config'): with salt.utils.files.fopen('/usbkey/config', 'r') as config_file: for optval in config_file: optval = salt.utils.stringutils.to_unicode(optval) ...
[ "def", "_load_config", "(", ")", ":", "config", "=", "{", "}", "if", "os", ".", "path", ".", "isfile", "(", "'/usbkey/config'", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/usbkey/config'", ",", "'r'", ")", "as", "confi...
Loads and parses /usbkey/config
[ "Loads", "and", "parses", "/", "usbkey", "/", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L185-L202
train
Loads and parses the config file for the current 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/smartos.py
_write_config
def _write_config(config): ''' writes /usbkey/config ''' try: with salt.utils.atomicfile.atomic_open('/usbkey/config', 'w') as config_file: config_file.write("#\n# This file was generated by salt\n#\n") for prop in salt.utils.odict.OrderedDict(sorted(config.items())): ...
python
def _write_config(config): ''' writes /usbkey/config ''' try: with salt.utils.atomicfile.atomic_open('/usbkey/config', 'w') as config_file: config_file.write("#\n# This file was generated by salt\n#\n") for prop in salt.utils.odict.OrderedDict(sorted(config.items())): ...
[ "def", "_write_config", "(", "config", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "atomicfile", ".", "atomic_open", "(", "'/usbkey/config'", ",", "'w'", ")", "as", "config_file", ":", "config_file", ".", "write", "(", "\"#\\n# This file was gener...
writes /usbkey/config
[ "writes", "/", "usbkey", "/", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L205-L225
train
Writes the given config dictionary to the config file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/smartos.py
_parse_vmconfig
def _parse_vmconfig(config, instances): ''' Parse vm_present vm config ''' vmconfig = None if isinstance(config, (salt.utils.odict.OrderedDict)): vmconfig = salt.utils.odict.OrderedDict() for prop in config: if prop not in instances: vmconfig[prop] = conf...
python
def _parse_vmconfig(config, instances): ''' Parse vm_present vm config ''' vmconfig = None if isinstance(config, (salt.utils.odict.OrderedDict)): vmconfig = salt.utils.odict.OrderedDict() for prop in config: if prop not in instances: vmconfig[prop] = conf...
[ "def", "_parse_vmconfig", "(", "config", ",", "instances", ")", ":", "vmconfig", "=", "None", "if", "isinstance", "(", "config", ",", "(", "salt", ".", "utils", ".", "odict", ".", "OrderedDict", ")", ")", ":", "vmconfig", "=", "salt", ".", "utils", "."...
Parse vm_present vm config
[ "Parse", "vm_present", "vm", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L228-L253
train
Parse vm_present vm 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/states/smartos.py
_get_instance_changes
def _get_instance_changes(current, state): ''' get modified properties ''' # get keys current_keys = set(current.keys()) state_keys = set(state.keys()) # compare configs changed = salt.utils.data.compare_dicts(current, state) for change in salt.utils.data.compare_dicts(current, stat...
python
def _get_instance_changes(current, state): ''' get modified properties ''' # get keys current_keys = set(current.keys()) state_keys = set(state.keys()) # compare configs changed = salt.utils.data.compare_dicts(current, state) for change in salt.utils.data.compare_dicts(current, stat...
[ "def", "_get_instance_changes", "(", "current", ",", "state", ")", ":", "# get keys", "current_keys", "=", "set", "(", "current", ".", "keys", "(", ")", ")", "state_keys", "=", "set", "(", "state", ".", "keys", "(", ")", ")", "# compare configs", "changed"...
get modified properties
[ "get", "modified", "properties" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L256-L272
train
Get the changes in the current state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/smartos.py
config_present
def config_present(name, value): ''' Ensure configuration property is set to value in /usbkey/config name : string name of property value : string value of property ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, ...
python
def config_present(name, value): ''' Ensure configuration property is set to value in /usbkey/config name : string name of property value : string value of property ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, ...
[ "def", "config_present", "(", "name", ",", "value", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "#...
Ensure configuration property is set to value in /usbkey/config name : string name of property value : string value of property
[ "Ensure", "configuration", "property", "is", "set", "to", "value", "in", "/", "usbkey", "/", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L329-L376
train
Ensure that the specified configuration property is present in the given USB key hierarchy.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
config_absent
def config_absent(name): ''' Ensure configuration property is absent in /usbkey/config name : string name of property ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} # load configuration config = _load...
python
def config_absent(name): ''' Ensure configuration property is absent in /usbkey/config name : string name of property ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} # load configuration config = _load...
[ "def", "config_absent", "(", "name", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "# load configuration...
Ensure configuration property is absent in /usbkey/config name : string name of property
[ "Ensure", "configuration", "property", "is", "absent", "in", "/", "usbkey", "/", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L379-L411
train
Ensure configuration property is absent in / usbkey / 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/states/smartos.py
source_present
def source_present(name, source_type='imgapi'): ''' Ensure an image source is present on the computenode name : string source url source_type : string source type (imgapi or docker) ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment...
python
def source_present(name, source_type='imgapi'): ''' Ensure an image source is present on the computenode name : string source url source_type : string source type (imgapi or docker) ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment...
[ "def", "source_present", "(", "name", ",", "source_type", "=", "'imgapi'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "name", "in", "__salt_...
Ensure an image source is present on the computenode name : string source url source_type : string source type (imgapi or docker)
[ "Ensure", "an", "image", "source", "is", "present", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L414-L449
train
Ensure an image source is present on the computenode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
source_absent
def source_absent(name): ''' Ensure an image source is absent on the computenode name : string source url ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if name not in __salt__['imgadm.sources'](): # source is absent ...
python
def source_absent(name): ''' Ensure an image source is absent on the computenode name : string source url ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if name not in __salt__['imgadm.sources'](): # source is absent ...
[ "def", "source_absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "name", "not", "in", "__salt__", "[", "'imgadm.sources'", "]...
Ensure an image source is absent on the computenode name : string source url
[ "Ensure", "an", "image", "source", "is", "absent", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L452-L485
train
Ensure an image source is absent on the computenode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
image_present
def image_present(name): ''' Ensure image is present on the computenode name : string uuid of image ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if _is_docker_uuid(name) and __salt__['imgadm.docker_to_uuid'](name): # do...
python
def image_present(name): ''' Ensure image is present on the computenode name : string uuid of image ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if _is_docker_uuid(name) and __salt__['imgadm.docker_to_uuid'](name): # do...
[ "def", "image_present", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "_is_docker_uuid", "(", "name", ")", "and", "__salt__", "[",...
Ensure image is present on the computenode name : string uuid of image
[ "Ensure", "image", "is", "present", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L488-L542
train
Ensure image is present on the computenode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
image_absent
def image_absent(name): ''' Ensure image is absent on the computenode name : string uuid of image .. note:: computenode.image_absent will only remove the image if it is not used by a vm. ''' ret = {'name': name, 'changes': {}, 'result': None, ...
python
def image_absent(name): ''' Ensure image is absent on the computenode name : string uuid of image .. note:: computenode.image_absent will only remove the image if it is not used by a vm. ''' ret = {'name': name, 'changes': {}, 'result': None, ...
[ "def", "image_absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "uuid", "=", "None", "if", "_is_uuid", "(", "name", ")", ":", "...
Ensure image is absent on the computenode name : string uuid of image .. note:: computenode.image_absent will only remove the image if it is not used by a vm.
[ "Ensure", "image", "is", "absent", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L545-L604
train
Ensure image is absent on the computenode and remove it if it is not used by a vm.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/smartos.py
image_vacuum
def image_vacuum(name): ''' Delete images not in use or installed via image_present .. warning:: Only image_present states that are included via the top file will be detected. ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, ...
python
def image_vacuum(name): ''' Delete images not in use or installed via image_present .. warning:: Only image_present states that are included via the top file will be detected. ''' name = name.lower() ret = {'name': name, 'changes': {}, 'result': None, ...
[ "def", "image_vacuum", "(", "name", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "# list of images to k...
Delete images not in use or installed via image_present .. warning:: Only image_present states that are included via the top file will be detected.
[ "Delete", "images", "not", "in", "use", "or", "installed", "via", "image_present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L607-L685
train
Delete images not in use or installed via image_present .. warning:: Only images installed via image_present states that are included via the top file will be detected.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
vm_present
def vm_present(name, vmconfig, config=None): ''' Ensure vm is present on the computenode name : string hostname of vm vmconfig : dict options to set for the vm config : dict fine grain control over vm_present .. note:: The following configuration properties can...
python
def vm_present(name, vmconfig, config=None): ''' Ensure vm is present on the computenode name : string hostname of vm vmconfig : dict options to set for the vm config : dict fine grain control over vm_present .. note:: The following configuration properties can...
[ "def", "vm_present", "(", "name", ",", "vmconfig", ",", "config", "=", "None", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'co...
Ensure vm is present on the computenode name : string hostname of vm vmconfig : dict options to set for the vm config : dict fine grain control over vm_present .. note:: The following configuration properties can be toggled in the config parameter. - kvm_rebo...
[ "Ensure", "vm", "is", "present", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L688-L1120
train
Ensure vm is present on the computenode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/smartos.py
vm_absent
def vm_absent(name, archive=False): ''' Ensure vm is absent on the computenode name : string hostname of vm archive : boolean toggle archiving of vm on removal .. note:: State ID is used as hostname. Hostnames must be unique. ''' name = name.lower() ret = {'na...
python
def vm_absent(name, archive=False): ''' Ensure vm is absent on the computenode name : string hostname of vm archive : boolean toggle archiving of vm on removal .. note:: State ID is used as hostname. Hostnames must be unique. ''' name = name.lower() ret = {'na...
[ "def", "vm_absent", "(", "name", ",", "archive", "=", "False", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "'...
Ensure vm is absent on the computenode name : string hostname of vm archive : boolean toggle archiving of vm on removal .. note:: State ID is used as hostname. Hostnames must be unique.
[ "Ensure", "vm", "is", "absent", "on", "the", "computenode" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smartos.py#L1123-L1165
train
Ensure vm is absent on the computenode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...