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_dacl.py | check_inheritance | def check_inheritance(path, objectType, user=None):
'''
Check a specified path to verify if inheritance is enabled
Args:
path: path of the registry key or file system object to check
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
user: if provided, will consider only the... | python | def check_inheritance(path, objectType, user=None):
'''
Check a specified path to verify if inheritance is enabled
Args:
path: path of the registry key or file system object to check
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
user: if provided, will consider only the... | [
"def",
"check_inheritance",
"(",
"path",
",",
"objectType",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'Inheritance'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"sidRet",
"=",
"_getUserSid",
"(",
"user",
... | Check a specified path to verify if inheritance is enabled
Args:
path: path of the registry key or file system object to check
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
user: if provided, will consider only the ACEs for that user
Returns (bool): 'Inheritance' of True/F... | [
"Check",
"a",
"specified",
"path",
"to",
"verify",
"if",
"inheritance",
"is",
"enabled"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L701-L745 | train | Check a specified path to verify if inheritance is 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_dacl.py | check_ace | def check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False):
'''
Checks a path to verify the ACE (access control entry) specified exists
Args:
path: path to the file/reg key
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
... | python | def check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False):
'''
Checks a path to verify the ACE (access control entry) specified exists
Args:
path: path to the file/reg key
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
... | [
"def",
"check_ace",
"(",
"path",
",",
"objectType",
",",
"user",
",",
"permission",
"=",
"None",
",",
"acetype",
"=",
"None",
",",
"propagation",
"=",
"None",
",",
"exactPermissionMatch",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",... | Checks a path to verify the ACE (access control entry) specified exists
Args:
path: path to the file/reg key
objectType: The type of object (FILE, DIRECTORY, REGISTRY)
user: user that the ACL is for
permission: permission to test for (READ, FULLCONTROL, etc)
acetype: the... | [
"Checks",
"a",
"path",
"to",
"verify",
"the",
"ACE",
"(",
"access",
"control",
"entry",
")",
"specified",
"exists"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L748-L810 | train | Checks a path to verify the ACE exists and if it does not exist returns a dictionary with the result = True and the key - value pairs for the ACE specified exists Returns False if the ACE does not exist Returns True if the ACE exists False otherwise | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_dacl.py | daclConstants.getObjectTypeBit | def getObjectTypeBit(self, t):
'''
returns the bit value of the string object type
'''
if isinstance(t, string_types):
t = t.upper()
try:
return self.objectType[t]
except KeyError:
raise CommandExecutionError((
... | python | def getObjectTypeBit(self, t):
'''
returns the bit value of the string object type
'''
if isinstance(t, string_types):
t = t.upper()
try:
return self.objectType[t]
except KeyError:
raise CommandExecutionError((
... | [
"def",
"getObjectTypeBit",
"(",
"self",
",",
"t",
")",
":",
"if",
"isinstance",
"(",
"t",
",",
"string_types",
")",
":",
"t",
"=",
"t",
".",
"upper",
"(",
")",
"try",
":",
"return",
"self",
".",
"objectType",
"[",
"t",
"]",
"except",
"KeyError",
":... | returns the bit value of the string object type | [
"returns",
"the",
"bit",
"value",
"of",
"the",
"string",
"object",
"type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L193-L206 | train | Returns the bit value of the string object type
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_dacl.py | daclConstants.getSecurityHkey | def getSecurityHkey(self, s):
'''
returns the necessary string value for an HKEY for the win32security module
'''
try:
return self.hkeys_security[s]
except KeyError:
raise CommandExecutionError((
'No HKEY named "{0}". It should be one of t... | python | def getSecurityHkey(self, s):
'''
returns the necessary string value for an HKEY for the win32security module
'''
try:
return self.hkeys_security[s]
except KeyError:
raise CommandExecutionError((
'No HKEY named "{0}". It should be one of t... | [
"def",
"getSecurityHkey",
"(",
"self",
",",
"s",
")",
":",
"try",
":",
"return",
"self",
".",
"hkeys_security",
"[",
"s",
"]",
"except",
"KeyError",
":",
"raise",
"CommandExecutionError",
"(",
"(",
"'No HKEY named \"{0}\". It should be one of the following: {1}'",
... | returns the necessary string value for an HKEY for the win32security module | [
"returns",
"the",
"necessary",
"string",
"value",
"for",
"an",
"HKEY",
"for",
"the",
"win32security",
"module"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L208-L217 | train | Returns the necessary string value for an HKEY for the win32security 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_dacl.py | daclConstants.getPermissionBit | def getPermissionBit(self, t, m):
'''
returns a permission bit of the string permission value for the specified object type
'''
try:
if isinstance(m, string_types):
return self.rights[t][m]['BITS']
else:
return m
except KeyE... | python | def getPermissionBit(self, t, m):
'''
returns a permission bit of the string permission value for the specified object type
'''
try:
if isinstance(m, string_types):
return self.rights[t][m]['BITS']
else:
return m
except KeyE... | [
"def",
"getPermissionBit",
"(",
"self",
",",
"t",
",",
"m",
")",
":",
"try",
":",
"if",
"isinstance",
"(",
"m",
",",
"string_types",
")",
":",
"return",
"self",
".",
"rights",
"[",
"t",
"]",
"[",
"m",
"]",
"[",
"'BITS'",
"]",
"else",
":",
"return... | returns a permission bit of the string permission value for the specified object type | [
"returns",
"a",
"permission",
"bit",
"of",
"the",
"string",
"permission",
"value",
"for",
"the",
"specified",
"object",
"type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L219-L231 | train | Returns a permission bit value for the specified object type and permission value for the specified object type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_dacl.py | daclConstants.getPermissionText | def getPermissionText(self, t, m):
'''
returns the permission textual representation of a specified permission bit/object type
'''
try:
return self.rights[t][m]['TEXT']
except KeyError:
raise CommandExecutionError((
'No right "{0}". It sho... | python | def getPermissionText(self, t, m):
'''
returns the permission textual representation of a specified permission bit/object type
'''
try:
return self.rights[t][m]['TEXT']
except KeyError:
raise CommandExecutionError((
'No right "{0}". It sho... | [
"def",
"getPermissionText",
"(",
"self",
",",
"t",
",",
"m",
")",
":",
"try",
":",
"return",
"self",
".",
"rights",
"[",
"t",
"]",
"[",
"m",
"]",
"[",
"'TEXT'",
"]",
"except",
"KeyError",
":",
"raise",
"CommandExecutionError",
"(",
"(",
"'No right \"{0... | returns the permission textual representation of a specified permission bit/object type | [
"returns",
"the",
"permission",
"textual",
"representation",
"of",
"a",
"specified",
"permission",
"bit",
"/",
"object",
"type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L233-L242 | train | Returns the textual representation of a specified permission bit or object type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_dacl.py | daclConstants.getAceTypeBit | def getAceTypeBit(self, t):
'''
returns the acetype bit of a text value
'''
try:
return self.validAceTypes[t]['BITS']
except KeyError:
raise CommandExecutionError((
'No ACE type "{0}". It should be one of the following: {1}'
... | python | def getAceTypeBit(self, t):
'''
returns the acetype bit of a text value
'''
try:
return self.validAceTypes[t]['BITS']
except KeyError:
raise CommandExecutionError((
'No ACE type "{0}". It should be one of the following: {1}'
... | [
"def",
"getAceTypeBit",
"(",
"self",
",",
"t",
")",
":",
"try",
":",
"return",
"self",
".",
"validAceTypes",
"[",
"t",
"]",
"[",
"'BITS'",
"]",
"except",
"KeyError",
":",
"raise",
"CommandExecutionError",
"(",
"(",
"'No ACE type \"{0}\". It should be one of the... | returns the acetype bit of a text value | [
"returns",
"the",
"acetype",
"bit",
"of",
"a",
"text",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L244-L253 | train | returns the acetype bit of a text 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_dacl.py | daclConstants.getAceTypeText | def getAceTypeText(self, t):
'''
returns the textual representation of a acetype bit
'''
try:
return self.validAceTypes[t]['TEXT']
except KeyError:
raise CommandExecutionError((
'No ACE type "{0}". It should be one of the following: {1}'
... | python | def getAceTypeText(self, t):
'''
returns the textual representation of a acetype bit
'''
try:
return self.validAceTypes[t]['TEXT']
except KeyError:
raise CommandExecutionError((
'No ACE type "{0}". It should be one of the following: {1}'
... | [
"def",
"getAceTypeText",
"(",
"self",
",",
"t",
")",
":",
"try",
":",
"return",
"self",
".",
"validAceTypes",
"[",
"t",
"]",
"[",
"'TEXT'",
"]",
"except",
"KeyError",
":",
"raise",
"CommandExecutionError",
"(",
"(",
"'No ACE type \"{0}\". It should be one of th... | returns the textual representation of a acetype bit | [
"returns",
"the",
"textual",
"representation",
"of",
"a",
"acetype",
"bit"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L255-L264 | train | returns the textual representation of a acetype bit
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_dacl.py | daclConstants.getPropagationBit | def getPropagationBit(self, t, p):
'''
returns the propagation bit of a text value
'''
try:
return self.validPropagations[t][p]['BITS']
except KeyError:
raise CommandExecutionError((
'No propagation type of "{0}". It should be one of the f... | python | def getPropagationBit(self, t, p):
'''
returns the propagation bit of a text value
'''
try:
return self.validPropagations[t][p]['BITS']
except KeyError:
raise CommandExecutionError((
'No propagation type of "{0}". It should be one of the f... | [
"def",
"getPropagationBit",
"(",
"self",
",",
"t",
",",
"p",
")",
":",
"try",
":",
"return",
"self",
".",
"validPropagations",
"[",
"t",
"]",
"[",
"p",
"]",
"[",
"'BITS'",
"]",
"except",
"KeyError",
":",
"raise",
"CommandExecutionError",
"(",
"(",
"'No... | returns the propagation bit of a text value | [
"returns",
"the",
"propagation",
"bit",
"of",
"a",
"text",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L266-L275 | train | Returns the propagation bit of a text 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_dacl.py | daclConstants.processPath | def processPath(self, path, objectType):
'''
processes a path/object type combo and returns:
registry types with the correct HKEY text representation
files/directories with environment variables expanded
'''
if objectType == win32security.SE_REGISTRY_KEY:
... | python | def processPath(self, path, objectType):
'''
processes a path/object type combo and returns:
registry types with the correct HKEY text representation
files/directories with environment variables expanded
'''
if objectType == win32security.SE_REGISTRY_KEY:
... | [
"def",
"processPath",
"(",
"self",
",",
"path",
",",
"objectType",
")",
":",
"if",
"objectType",
"==",
"win32security",
".",
"SE_REGISTRY_KEY",
":",
"splt",
"=",
"path",
".",
"split",
"(",
"\"\\\\\"",
")",
"hive",
"=",
"self",
".",
"getSecurityHkey",
"(",
... | processes a path/object type combo and returns:
registry types with the correct HKEY text representation
files/directories with environment variables expanded | [
"processes",
"a",
"path",
"/",
"object",
"type",
"combo",
"and",
"returns",
":",
"registry",
"types",
"with",
"the",
"correct",
"HKEY",
"text",
"representation",
"files",
"/",
"directories",
"with",
"environment",
"variables",
"expanded"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dacl.py#L288-L301 | train | Processes a path and returns a registry type with the correct HKEY text representation
files and directories with environment variables expanded
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/neutron_subnet.py | present | def present(name, auth=None, **kwargs):
'''
Ensure a subnet exists and is up-to-date
name
Name of the subnet
network_name_or_id
The unique name or ID of the attached network.
If a non-unique name is supplied, an exception is raised.
allocation_pools
A list of dicti... | python | def present(name, auth=None, **kwargs):
'''
Ensure a subnet exists and is up-to-date
name
Name of the subnet
network_name_or_id
The unique name or ID of the attached network.
If a non-unique name is supplied, an exception is raised.
allocation_pools
A list of dicti... | [
"def",
"present",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
... | Ensure a subnet exists and is up-to-date
name
Name of the subnet
network_name_or_id
The unique name or ID of the attached network.
If a non-unique name is supplied, an exception is raised.
allocation_pools
A list of dictionaries of the start and end addresses
for t... | [
"Ensure",
"a",
"subnet",
"exists",
"and",
"is",
"up",
"-",
"to",
"-",
"date"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_subnet.py#L62-L139 | train | Ensure a subnet exists and is up - to - date and is up - to - date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/neutron_subnet.py | absent | def absent(name, auth=None):
'''
Ensure a subnet does not exists
name
Name of the subnet
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
__salt__['neutronng.setup_clouds'](auth)
subnet = __salt__['neutronng.subnet_get'](name... | python | def absent(name, auth=None):
'''
Ensure a subnet does not exists
name
Name of the subnet
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
__salt__['neutronng.setup_clouds'](auth)
subnet = __salt__['neutronng.subnet_get'](name... | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"__salt__",
"[",
"'neutronng.setup_clouds'",
"]... | Ensure a subnet does not exists
name
Name of the subnet | [
"Ensure",
"a",
"subnet",
"does",
"not",
"exists"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_subnet.py#L142-L170 | train | Ensure a subnet does not exists | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/virt.py | _determine_host | def _determine_host(data, omit=''):
'''
Determine what the most resource free host is based on the given data
'''
# This is just checking for the host with the most free ram, this needs
# to be much more complicated.
host = ''
bestmem = 0
for hv_, comps in six.iteritems(data):
if... | python | def _determine_host(data, omit=''):
'''
Determine what the most resource free host is based on the given data
'''
# This is just checking for the host with the most free ram, this needs
# to be much more complicated.
host = ''
bestmem = 0
for hv_, comps in six.iteritems(data):
if... | [
"def",
"_determine_host",
"(",
"data",
",",
"omit",
"=",
"''",
")",
":",
"# This is just checking for the host with the most free ram, this needs",
"# to be much more complicated.",
"host",
"=",
"''",
"bestmem",
"=",
"0",
"for",
"hv_",
",",
"comps",
"in",
"six",
".",
... | Determine what the most resource free host is based on the given data | [
"Determine",
"what",
"the",
"most",
"resource",
"free",
"host",
"is",
"based",
"on",
"the",
"given",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L25-L41 | train | Determine what the most resource free host is based on the given 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/runners/virt.py | _find_vm | def _find_vm(name, data, quiet=False):
'''
Scan the query data for the named VM
'''
for hv_ in data:
# Check if data is a dict, and not '"virt.full_info" is not available.'
if not isinstance(data[hv_], dict):
continue
if name in data[hv_].get('vm_info', {}):
... | python | def _find_vm(name, data, quiet=False):
'''
Scan the query data for the named VM
'''
for hv_ in data:
# Check if data is a dict, and not '"virt.full_info" is not available.'
if not isinstance(data[hv_], dict):
continue
if name in data[hv_].get('vm_info', {}):
... | [
"def",
"_find_vm",
"(",
"name",
",",
"data",
",",
"quiet",
"=",
"False",
")",
":",
"for",
"hv_",
"in",
"data",
":",
"# Check if data is a dict, and not '\"virt.full_info\" is not available.'",
"if",
"not",
"isinstance",
"(",
"data",
"[",
"hv_",
"]",
",",
"dict",... | Scan the query data for the named VM | [
"Scan",
"the",
"query",
"data",
"for",
"the",
"named",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L44-L57 | train | Find VM by name in the query 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/runners/virt.py | query | def query(host=None, quiet=False):
'''
Query the virtual machines. When called without options all hosts
are detected and a full query is returned. A single host can be
passed in to specify an individual host to query.
'''
if quiet:
log.warning("'quiet' is deprecated. Please migrate to -... | python | def query(host=None, quiet=False):
'''
Query the virtual machines. When called without options all hosts
are detected and a full query is returned. A single host can be
passed in to specify an individual host to query.
'''
if quiet:
log.warning("'quiet' is deprecated. Please migrate to -... | [
"def",
"query",
"(",
"host",
"=",
"None",
",",
"quiet",
"=",
"False",
")",
":",
"if",
"quiet",
":",
"log",
".",
"warning",
"(",
"\"'quiet' is deprecated. Please migrate to --quiet\"",
")",
"ret",
"=",
"{",
"}",
"client",
"=",
"salt",
".",
"client",
".",
... | Query the virtual machines. When called without options all hosts
are detected and a full query is returned. A single host can be
passed in to specify an individual host to query. | [
"Query",
"the",
"virtual",
"machines",
".",
"When",
"called",
"without",
"options",
"all",
"hosts",
"are",
"detected",
"and",
"a",
"full",
"query",
"is",
"returned",
".",
"A",
"single",
"host",
"can",
"be",
"passed",
"in",
"to",
"specify",
"an",
"individua... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L60-L94 | train | Query the virtual machines. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/virt.py | list | def list(host=None, quiet=False, hyper=None): # pylint: disable=redefined-builtin
'''
List the virtual machines on each host, this is a simplified query,
showing only the virtual machine names belonging to each host.
A single host can be passed in to specify an individual host
to list.
'''
... | python | def list(host=None, quiet=False, hyper=None): # pylint: disable=redefined-builtin
'''
List the virtual machines on each host, this is a simplified query,
showing only the virtual machine names belonging to each host.
A single host can be passed in to specify an individual host
to list.
'''
... | [
"def",
"list",
"(",
"host",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"hyper",
"=",
"None",
")",
":",
"# pylint: disable=redefined-builtin",
"if",
"quiet",
":",
"log",
".",
"warning",
"(",
"\"'quiet' is deprecated. Please migrate to --quiet\"",
")",
"ret",
"... | List the virtual machines on each host, this is a simplified query,
showing only the virtual machine names belonging to each host.
A single host can be passed in to specify an individual host
to list. | [
"List",
"the",
"virtual",
"machines",
"on",
"each",
"host",
"this",
"is",
"a",
"simplified",
"query",
"showing",
"only",
"the",
"virtual",
"machine",
"names",
"belonging",
"to",
"each",
"host",
".",
"A",
"single",
"host",
"can",
"be",
"passed",
"in",
"to",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L97-L136 | train | List virtual machines on each host | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/virt.py | host_info | def host_info(host=None):
'''
Return information about the host connected to this master
'''
data = query(host, quiet=True)
for id_ in data:
if 'vm_info' in data[id_]:
data[id_].pop('vm_info')
__jid_event__.fire_event({'data': data, 'outputter': 'nested'}, 'progress')
ret... | python | def host_info(host=None):
'''
Return information about the host connected to this master
'''
data = query(host, quiet=True)
for id_ in data:
if 'vm_info' in data[id_]:
data[id_].pop('vm_info')
__jid_event__.fire_event({'data': data, 'outputter': 'nested'}, 'progress')
ret... | [
"def",
"host_info",
"(",
"host",
"=",
"None",
")",
":",
"data",
"=",
"query",
"(",
"host",
",",
"quiet",
"=",
"True",
")",
"for",
"id_",
"in",
"data",
":",
"if",
"'vm_info'",
"in",
"data",
"[",
"id_",
"]",
":",
"data",
"[",
"id_",
"]",
".",
"po... | Return information about the host connected to this master | [
"Return",
"information",
"about",
"the",
"host",
"connected",
"to",
"this",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L150-L159 | train | Return information about the host connected to this master
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/virt.py | init | def init(
name,
cpu,
mem,
image,
hypervisor='kvm',
host=None,
seed=True,
nic='default',
install=True,
start=True,
disk='default',
saltenv='base',
enable_vnc=False,
seed_cmd='seed.apply',
enable_qcow=F... | python | def init(
name,
cpu,
mem,
image,
hypervisor='kvm',
host=None,
seed=True,
nic='default',
install=True,
start=True,
disk='default',
saltenv='base',
enable_vnc=False,
seed_cmd='seed.apply',
enable_qcow=F... | [
"def",
"init",
"(",
"name",
",",
"cpu",
",",
"mem",
",",
"image",
",",
"hypervisor",
"=",
"'kvm'",
",",
"host",
"=",
"None",
",",
"seed",
"=",
"True",
",",
"nic",
"=",
"'default'",
",",
"install",
"=",
"True",
",",
"start",
"=",
"True",
",",
"dis... | This routine is used to create a new virtual machine. This routines takes
a number of options to determine what the newly created virtual machine
will look like.
name
The mandatory name of the new virtual machine. The name option is
also the minion id, all minions must have an id.
cpu
... | [
"This",
"routine",
"is",
"used",
"to",
"create",
"a",
"new",
"virtual",
"machine",
".",
"This",
"routines",
"takes",
"a",
"number",
"of",
"options",
"to",
"determine",
"what",
"the",
"newly",
"created",
"virtual",
"machine",
"will",
"look",
"like",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L162-L317 | train | This routine initializes a new virtual machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/virt.py | vm_info | def vm_info(name, quiet=False):
'''
Return the information on the named VM
'''
data = query(quiet=True)
return _find_vm(name, data, quiet) | python | def vm_info(name, quiet=False):
'''
Return the information on the named VM
'''
data = query(quiet=True)
return _find_vm(name, data, quiet) | [
"def",
"vm_info",
"(",
"name",
",",
"quiet",
"=",
"False",
")",
":",
"data",
"=",
"query",
"(",
"quiet",
"=",
"True",
")",
"return",
"_find_vm",
"(",
"name",
",",
"data",
",",
"quiet",
")"
] | Return the information on the named VM | [
"Return",
"the",
"information",
"on",
"the",
"named",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L320-L325 | train | Return the information on the named 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/runners/virt.py | reset | def reset(name):
'''
Force power down and restart an existing VM
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
data = vm_info(name, quiet=True)
if not data:
__jid_event__.fire_event({'message': 'Failed to find VM {0} to reset'.format(name)}, 'progress')
... | python | def reset(name):
'''
Force power down and restart an existing VM
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
data = vm_info(name, quiet=True)
if not data:
__jid_event__.fire_event({'message': 'Failed to find VM {0} to reset'.format(name)}, 'progress')
... | [
"def",
"reset",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"}",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"data",
"=",
"vm_info",
"(",
"name",
",",
"quiet",
"=",
"True",
")",
"if",
"n... | Force power down and restart an existing VM | [
"Force",
"power",
"down",
"and",
"restart",
"an",
"existing",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L328-L350 | train | Force power down and restart an existing 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/runners/virt.py | purge | def purge(name, delete_key=True):
'''
Destroy the named VM
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
data = vm_info(name, quiet=True)
if not data:
__jid_event__.fire_event({'error': 'Failed to find VM {0} to purge'.format(name)}, 'progress')
re... | python | def purge(name, delete_key=True):
'''
Destroy the named VM
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
data = vm_info(name, quiet=True)
if not data:
__jid_event__.fire_event({'error': 'Failed to find VM {0} to purge'.format(name)}, 'progress')
re... | [
"def",
"purge",
"(",
"name",
",",
"delete_key",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"}",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"data",
"=",
"vm_info",
"(",
"name",
",",
"quie... | Destroy the named VM | [
"Destroy",
"the",
"named",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L409-L437 | train | Purge the named 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/runners/virt.py | migrate | def migrate(name, target=''):
'''
Migrate a VM from one host to another. This routine will just start
the migration and display information on how to look up the progress.
'''
client = salt.client.get_local_client(__opts__['conf_file'])
data = query(quiet=True)
origin_data = _find_vm(name, d... | python | def migrate(name, target=''):
'''
Migrate a VM from one host to another. This routine will just start
the migration and display information on how to look up the progress.
'''
client = salt.client.get_local_client(__opts__['conf_file'])
data = query(quiet=True)
origin_data = _find_vm(name, d... | [
"def",
"migrate",
"(",
"name",
",",
"target",
"=",
"''",
")",
":",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"data",
"=",
"query",
"(",
"quiet",
"=",
"True",
")",
"origin_data",
"=",
... | Migrate a VM from one host to another. This routine will just start
the migration and display information on how to look up the progress. | [
"Migrate",
"a",
"VM",
"from",
"one",
"host",
"to",
"another",
".",
"This",
"routine",
"will",
"just",
"start",
"the",
"migration",
"and",
"display",
"information",
"on",
"how",
"to",
"look",
"up",
"the",
"progress",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/virt.py#L497-L531 | train | This routine will migrate a VM from one host to another. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_keychain.py | install | def install(cert,
password,
keychain="/Library/Keychains/System.keychain",
allow_any=False,
keychain_password=None):
'''
Install a certificate
cert
The certificate to install
password
The password for the certificate being installed forma... | python | def install(cert,
password,
keychain="/Library/Keychains/System.keychain",
allow_any=False,
keychain_password=None):
'''
Install a certificate
cert
The certificate to install
password
The password for the certificate being installed forma... | [
"def",
"install",
"(",
"cert",
",",
"password",
",",
"keychain",
"=",
"\"/Library/Keychains/System.keychain\"",
",",
"allow_any",
"=",
"False",
",",
"keychain_password",
"=",
"None",
")",
":",
"if",
"keychain_password",
"is",
"not",
"None",
":",
"unlock_keychain",... | Install a certificate
cert
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMENTS section.
Note: The password given here will show up as plaintext in the job returned
... | [
"Install",
"a",
"certificate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L44-L88 | train | Install a certificate to the keychain and return the certificate s 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/mac_keychain.py | uninstall | def uninstall(cert_name,
keychain="/Library/Keychains/System.keychain",
keychain_password=None):
'''
Uninstall a certificate from a keychain
cert_name
The name of the certificate to remove
keychain
The keychain to install the certificate to, this defaults to... | python | def uninstall(cert_name,
keychain="/Library/Keychains/System.keychain",
keychain_password=None):
'''
Uninstall a certificate from a keychain
cert_name
The name of the certificate to remove
keychain
The keychain to install the certificate to, this defaults to... | [
"def",
"uninstall",
"(",
"cert_name",
",",
"keychain",
"=",
"\"/Library/Keychains/System.keychain\"",
",",
"keychain_password",
"=",
"None",
")",
":",
"if",
"keychain_password",
"is",
"not",
"None",
":",
"unlock_keychain",
"(",
"keychain",
",",
"keychain_password",
... | Uninstall a certificate from a keychain
cert_name
The name of the certificate to remove
keychain
The keychain to install the certificate to, this defaults to
/Library/Keychains/System.keychain
keychain_password
If your keychain is likely to be locked pass the password and ... | [
"Uninstall",
"a",
"certificate",
"from",
"a",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L91-L121 | train | Uninstall a certificate from a keychain | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_keychain.py | list_certs | def list_certs(keychain="/Library/Keychains/System.keychain"):
'''
List all of the installed certificates
keychain
The keychain to install the certificate to, this defaults to
/Library/Keychains/System.keychain
CLI Example:
.. code-block:: bash
salt '*' keychain.list_cert... | python | def list_certs(keychain="/Library/Keychains/System.keychain"):
'''
List all of the installed certificates
keychain
The keychain to install the certificate to, this defaults to
/Library/Keychains/System.keychain
CLI Example:
.. code-block:: bash
salt '*' keychain.list_cert... | [
"def",
"list_certs",
"(",
"keychain",
"=",
"\"/Library/Keychains/System.keychain\"",
")",
":",
"cmd",
"=",
"'security find-certificate -a {0} | grep -o \"alis\".*\\\\\" | '",
"'grep -o \\'\\\\\"[-A-Za-z0-9.:() ]*\\\\\"\\''",
".",
"format",
"(",
"_quote",
"(",
"keychain",
")",
"... | List all of the installed certificates
keychain
The keychain to install the certificate to, this defaults to
/Library/Keychains/System.keychain
CLI Example:
.. code-block:: bash
salt '*' keychain.list_certs | [
"List",
"all",
"of",
"the",
"installed",
"certificates"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L124-L141 | train | List all of the installed certificates in the keychain | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_keychain.py | get_friendly_name | def get_friendly_name(cert, password):
'''
Get the friendly name of the given certificate
cert
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMENTS section
N... | python | def get_friendly_name(cert, password):
'''
Get the friendly name of the given certificate
cert
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMENTS section
N... | [
"def",
"get_friendly_name",
"(",
"cert",
",",
"password",
")",
":",
"cmd",
"=",
"'openssl pkcs12 -in {0} -passin pass:{1} -info -nodes -nokeys 2> /dev/null | '",
"'grep friendlyName:'",
".",
"format",
"(",
"_quote",
"(",
"cert",
")",
",",
"_quote",
"(",
"password",
")",... | Get the friendly name of the given certificate
cert
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMENTS section
Note: The password given here will show up as plaint... | [
"Get",
"the",
"friendly",
"name",
"of",
"the",
"given",
"certificate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L144-L167 | train | Get the friendly name of the certificate and 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/mac_keychain.py | get_default_keychain | def get_default_keychain(user=None, domain="user"):
'''
Get the default keychain
user
The user to check the default keychain of
domain
The domain to use valid values are user|system|common|dynamic, the default is user
CLI Example:
.. code-block:: bash
salt '*' keycha... | python | def get_default_keychain(user=None, domain="user"):
'''
Get the default keychain
user
The user to check the default keychain of
domain
The domain to use valid values are user|system|common|dynamic, the default is user
CLI Example:
.. code-block:: bash
salt '*' keycha... | [
"def",
"get_default_keychain",
"(",
"user",
"=",
"None",
",",
"domain",
"=",
"\"user\"",
")",
":",
"cmd",
"=",
"\"security default-keychain -d {0}\"",
".",
"format",
"(",
"domain",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"runas",
"... | Get the default keychain
user
The user to check the default keychain of
domain
The domain to use valid values are user|system|common|dynamic, the default is user
CLI Example:
.. code-block:: bash
salt '*' keychain.get_default_keychain | [
"Get",
"the",
"default",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L170-L187 | train | Get the default keychain for a user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_keychain.py | set_default_keychain | def set_default_keychain(keychain, domain="user", user=None):
'''
Set the default keychain
keychain
The location of the keychain to set as default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to set the default key... | python | def set_default_keychain(keychain, domain="user", user=None):
'''
Set the default keychain
keychain
The location of the keychain to set as default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to set the default key... | [
"def",
"set_default_keychain",
"(",
"keychain",
",",
"domain",
"=",
"\"user\"",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"\"security default-keychain -d {0} -s {1}\"",
".",
"format",
"(",
"domain",
",",
"keychain",
")",
"return",
"__salt__",
"[",
"'cmd.ru... | Set the default keychain
keychain
The location of the keychain to set as default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to set the default keychain as
CLI Example:
.. code-block:: bash
salt '*' key... | [
"Set",
"the",
"default",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L190-L210 | train | Set the default keychain for the specified 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/mac_keychain.py | get_hash | def get_hash(name, password=None):
'''
Returns the hash of a certificate in the keychain.
name
The name of the certificate (which you can get from keychain.get_friendly_name) or the
location of a p12 file.
password
The password that is used in the certificate. Only required if ... | python | def get_hash(name, password=None):
'''
Returns the hash of a certificate in the keychain.
name
The name of the certificate (which you can get from keychain.get_friendly_name) or the
location of a p12 file.
password
The password that is used in the certificate. Only required if ... | [
"def",
"get_hash",
"(",
"name",
",",
"password",
"=",
"None",
")",
":",
"if",
"'.p12'",
"in",
"name",
"[",
"-",
"4",
":",
"]",
":",
"cmd",
"=",
"'openssl pkcs12 -in {0} -passin pass:{1} -passout pass:{1}'",
".",
"format",
"(",
"name",
",",
"password",
")",
... | Returns the hash of a certificate in the keychain.
name
The name of the certificate (which you can get from keychain.get_friendly_name) or the
location of a p12 file.
password
The password that is used in the certificate. Only required if your passing a p12 file.
Note: This wil... | [
"Returns",
"the",
"hash",
"of",
"a",
"certificate",
"in",
"the",
"keychain",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_keychain.py#L236-L265 | train | Get the hash of a certificate in the keychain. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/aws_sqs.py | exists | def exists(
name,
region,
user=None,
opts=False):
'''
Ensure the SQS queue exists.
name
Name of the SQS queue.
region
Region to create the queue
user
Name of the user performing the SQS operations
opts
Include additional argumen... | python | def exists(
name,
region,
user=None,
opts=False):
'''
Ensure the SQS queue exists.
name
Name of the SQS queue.
region
Region to create the queue
user
Name of the user performing the SQS operations
opts
Include additional argumen... | [
"def",
"exists",
"(",
"name",
",",
"region",
",",
"user",
"=",
"None",
",",
"opts",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | Ensure the SQS queue exists.
name
Name of the SQS queue.
region
Region to create the queue
user
Name of the user performing the SQS operations
opts
Include additional arguments and options to the aws command line | [
"Ensure",
"the",
"SQS",
"queue",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/aws_sqs.py#L30-L70 | train | Ensure the SQS queue exists in the specified region and user are in the specified region. Returns a dictionary with the keys name region user and opts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/aws_sqs.py | absent | def absent(
name,
region,
user=None,
opts=False):
'''
Remove the named SQS queue if it exists.
name
Name of the SQS queue.
region
Region to remove the queue from
user
Name of the user performing the SQS operations
opts
Include a... | python | def absent(
name,
region,
user=None,
opts=False):
'''
Remove the named SQS queue if it exists.
name
Name of the SQS queue.
region
Region to remove the queue from
user
Name of the user performing the SQS operations
opts
Include a... | [
"def",
"absent",
"(",
"name",
",",
"region",
",",
"user",
"=",
"None",
",",
"opts",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | Remove the named SQS queue if it exists.
name
Name of the SQS queue.
region
Region to remove the queue from
user
Name of the user performing the SQS operations
opts
Include additional arguments and options to the aws command line | [
"Remove",
"the",
"named",
"SQS",
"queue",
"if",
"it",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/aws_sqs.py#L73-L112 | train | Ensure that the named SQS queue is absent in the specified region. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | setup.py | _parse_op | def _parse_op(op):
'''
>>> _parse_op('>')
'gt'
>>> _parse_op('>=')
'ge'
>>> _parse_op('=>')
'ge'
>>> _parse_op('=> ')
'ge'
>>> _parse_op('<')
'lt'
>>> _parse_op('<=')
'le'
>>> _parse_op('==')
'eq'
>>> _parse_op(' <= ')
'le'
'''
op = op.strip()
... | python | def _parse_op(op):
'''
>>> _parse_op('>')
'gt'
>>> _parse_op('>=')
'ge'
>>> _parse_op('=>')
'ge'
>>> _parse_op('=> ')
'ge'
>>> _parse_op('<')
'lt'
>>> _parse_op('<=')
'le'
>>> _parse_op('==')
'eq'
>>> _parse_op(' <= ')
'le'
'''
op = op.strip()
... | [
"def",
"_parse_op",
"(",
"op",
")",
":",
"op",
"=",
"op",
".",
"strip",
"(",
")",
"if",
"'>'",
"in",
"op",
":",
"if",
"'='",
"in",
"op",
":",
"return",
"'ge'",
"else",
":",
"return",
"'gt'",
"elif",
"'<'",
"in",
"op",
":",
"if",
"'='",
"in",
... | >>> _parse_op('>')
'gt'
>>> _parse_op('>=')
'ge'
>>> _parse_op('=>')
'ge'
>>> _parse_op('=> ')
'ge'
>>> _parse_op('<')
'lt'
>>> _parse_op('<=')
'le'
>>> _parse_op('==')
'eq'
>>> _parse_op(' <= ')
'le' | [
">>>",
"_parse_op",
"(",
">",
")",
"gt",
">>>",
"_parse_op",
"(",
">",
"=",
")",
"ge",
">>>",
"_parse_op",
"(",
"=",
">",
")",
"ge",
">>>",
"_parse_op",
"(",
"=",
">",
")",
"ge",
">>>",
"_parse_op",
"(",
"<",
")",
"lt",
">>>",
"_parse_op",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L142-L175 | train | Parse an operation in the sequence of tokens. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | setup.py | _parse_ver | def _parse_ver(ver):
'''
>>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4")
'3.4'
>>> _parse_ver('"3.4"')
'3.4'
>>> _parse_ver('"2.6.17"')
'2.6.17'
'''
if '#' in ver:
ver, _ = ver.split('#', 1)
ver = ver.strip()
return ver.strip('\'').st... | python | def _parse_ver(ver):
'''
>>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4")
'3.4'
>>> _parse_ver('"3.4"')
'3.4'
>>> _parse_ver('"2.6.17"')
'2.6.17'
'''
if '#' in ver:
ver, _ = ver.split('#', 1)
ver = ver.strip()
return ver.strip('\'').st... | [
"def",
"_parse_ver",
"(",
"ver",
")",
":",
"if",
"'#'",
"in",
"ver",
":",
"ver",
",",
"_",
"=",
"ver",
".",
"split",
"(",
"'#'",
",",
"1",
")",
"ver",
"=",
"ver",
".",
"strip",
"(",
")",
"return",
"ver",
".",
"strip",
"(",
"'\\''",
")",
".",
... | >>> _parse_ver("'3.4' # pyzmq 17.1.0 stopped building wheels for python3.4")
'3.4'
>>> _parse_ver('"3.4"')
'3.4'
>>> _parse_ver('"2.6.17"')
'2.6.17' | [
">>>",
"_parse_ver",
"(",
"3",
".",
"4",
"#",
"pyzmq",
"17",
".",
"1",
".",
"0",
"stopped",
"building",
"wheels",
"for",
"python3",
".",
"4",
")",
"3",
".",
"4",
">>>",
"_parse_ver",
"(",
"3",
".",
"4",
")",
"3",
".",
"4",
">>>",
"_parse_ver",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L178-L190 | train | Parse version 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 | setup.py | _check_ver | def _check_ver(pyver, op, wanted):
'''
>>> _check_ver('2.7.15', 'gt', '2.7')
True
>>> _check_ver('2.7.15', 'gt', '2.7.15')
False
>>> _check_ver('2.7.15', 'ge', '2.7.15')
True
>>> _check_ver('2.7.15', 'eq', '2.7.15')
True
'''
pyver = distutils.version.LooseVersion(pyver)
w... | python | def _check_ver(pyver, op, wanted):
'''
>>> _check_ver('2.7.15', 'gt', '2.7')
True
>>> _check_ver('2.7.15', 'gt', '2.7.15')
False
>>> _check_ver('2.7.15', 'ge', '2.7.15')
True
>>> _check_ver('2.7.15', 'eq', '2.7.15')
True
'''
pyver = distutils.version.LooseVersion(pyver)
w... | [
"def",
"_check_ver",
"(",
"pyver",
",",
"op",
",",
"wanted",
")",
":",
"pyver",
"=",
"distutils",
".",
"version",
".",
"LooseVersion",
"(",
"pyver",
")",
"wanted",
"=",
"distutils",
".",
"version",
".",
"LooseVersion",
"(",
"wanted",
")",
"return",
"geta... | >>> _check_ver('2.7.15', 'gt', '2.7')
True
>>> _check_ver('2.7.15', 'gt', '2.7.15')
False
>>> _check_ver('2.7.15', 'ge', '2.7.15')
True
>>> _check_ver('2.7.15', 'eq', '2.7.15')
True | [
">>>",
"_check_ver",
"(",
"2",
".",
"7",
".",
"15",
"gt",
"2",
".",
"7",
")",
"True",
">>>",
"_check_ver",
"(",
"2",
".",
"7",
".",
"15",
"gt",
"2",
".",
"7",
".",
"15",
")",
"False",
">>>",
"_check_ver",
"(",
"2",
".",
"7",
".",
"15",
"ge"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/setup.py#L193-L206 | train | Check if version is compatible with operator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_portspkg.py | list_pkgs | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# 'removed', 'p... | python | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# 'removed', 'p... | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# 'removed', 'purge_desired' not yet implemented or not applicable"... | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | [
"List",
"the",
"packages",
"currently",
"installed",
"in",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L87-L129 | train | List the packages currently installed in 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/mac_portspkg.py | remove | def remove(name=None, pkgs=None, **kwargs):
'''
Removes packages with ``port uninstall``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if th... | python | def remove(name=None, pkgs=None, **kwargs):
'''
Removes packages with ``port uninstall``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if th... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
",",
"*",
"*",
"kwargs",
")",
"[",
"0",
"]",
... | Removes packages with ``port uninstall``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this option is passed.
.. versionadded:: 0.16.0
... | [
"Removes",
"packages",
"with",
"port",
"uninstall",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L187-L240 | train | Removes the specified packages from the available packages. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_portspkg.py | install | def install(name=None, refresh=False, pkgs=None, **kwargs):
'''
Install the passed package(s) with ``port install``
name
The name of the formula to be installed. Note that this parameter is
ignored if "pkgs" is passed.
CLI Example:
.. code-block:: bash
salt '*... | python | def install(name=None, refresh=False, pkgs=None, **kwargs):
'''
Install the passed package(s) with ``port install``
name
The name of the formula to be installed. Note that this parameter is
ignored if "pkgs" is passed.
CLI Example:
.. code-block:: bash
salt '*... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pkg_params",
",",
"pkg_type",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
"... | Install the passed package(s) with ``port install``
name
The name of the formula to be installed. Note that this parameter is
ignored if "pkgs" is passed.
CLI Example:
.. code-block:: bash
salt '*' pkg.install <package name>
version
Specify a version to p... | [
"Install",
"the",
"passed",
"package",
"(",
"s",
")",
"with",
"port",
"install"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L243-L355 | train | Return a dict containing the names and versions of the passed packages. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/mac_portspkg.py | refresh_db | def refresh_db(**kwargs):
'''
Update ports with ``port selfupdate``
CLI Example:
.. code-block:: bash
salt mac pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag(__opts__)
cmd = ['port', 'selfupdate']
ret... | python | def refresh_db(**kwargs):
'''
Update ports with ``port selfupdate``
CLI Example:
.. code-block:: bash
salt mac pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag(__opts__)
cmd = ['port', 'selfupdate']
ret... | [
"def",
"refresh_db",
"(",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"cmd",
"=",
"[",
"'port'",
",",
"'selfupdate'",
"]",
"r... | Update ports with ``port selfupdate``
CLI Example:
.. code-block:: bash
salt mac pkg.refresh_db | [
"Update",
"ports",
"with",
"port",
"selfupdate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_portspkg.py#L392-L405 | train | Refreshes the database of the available ports | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/sdb.py | set_ | def set_(uri, value):
'''
Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``.
If the uri provided does not start with ``sdb://`` or the value is not
successfully set, return ``False``.
CLI Example:
.. code-block:: bash
salt '*' sdb.set sdb://mymemcached/foo bar
... | python | def set_(uri, value):
'''
Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``.
If the uri provided does not start with ``sdb://`` or the value is not
successfully set, return ``False``.
CLI Example:
.. code-block:: bash
salt '*' sdb.set sdb://mymemcached/foo bar
... | [
"def",
"set_",
"(",
"uri",
",",
"value",
")",
":",
"return",
"salt",
".",
"utils",
".",
"sdb",
".",
"sdb_set",
"(",
"uri",
",",
"value",
",",
"__opts__",
",",
"__utils__",
")"
] | Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``.
If the uri provided does not start with ``sdb://`` or the value is not
successfully set, return ``False``.
CLI Example:
.. code-block:: bash
salt '*' sdb.set sdb://mymemcached/foo bar | [
"Set",
"a",
"value",
"in",
"a",
"db",
"using",
"a",
"uri",
"in",
"the",
"form",
"of",
"sdb",
":",
"//",
"<profile",
">",
"/",
"<key",
">",
".",
"If",
"the",
"uri",
"provided",
"does",
"not",
"start",
"with",
"sdb",
":",
"//",
"or",
"the",
"value"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sdb.py#L31-L43 | train | Set a value in a db using a uri in the form of sdb://<profile>/<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/sdb.py | get_or_set_hash | def get_or_set_hash(uri,
length=8,
chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'):
'''
Perform a one-time generation of a hash and write it to sdb.
If that value has already been set return the value instead.
This is useful for generating passwords or keys that are specific... | python | def get_or_set_hash(uri,
length=8,
chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'):
'''
Perform a one-time generation of a hash and write it to sdb.
If that value has already been set return the value instead.
This is useful for generating passwords or keys that are specific... | [
"def",
"get_or_set_hash",
"(",
"uri",
",",
"length",
"=",
"8",
",",
"chars",
"=",
"'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"sdb",
".",
"sdb_get_or_set_hash",
"(",
"uri",
",",
"__opts__",
",",
"length"... | Perform a one-time generation of a hash and write it to sdb.
If that value has already been set return the value instead.
This is useful for generating passwords or keys that are specific to
multiple minions that need to be stored somewhere centrally.
State Example:
.. code-block:: yaml
... | [
"Perform",
"a",
"one",
"-",
"time",
"generation",
"of",
"a",
"hash",
"and",
"write",
"it",
"to",
"sdb",
".",
"If",
"that",
"value",
"has",
"already",
"been",
"set",
"return",
"the",
"value",
"instead",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sdb.py#L61-L94 | train | Return a value from the sdb for a given uri. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | _temp_exists | def _temp_exists(method, ip):
'''
Checks if the ip exists as a temporary rule based
on the method supplied, (tempallow, tempdeny).
'''
_type = method.replace('temp', '').upper()
cmd = "csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'".format(_type=_... | python | def _temp_exists(method, ip):
'''
Checks if the ip exists as a temporary rule based
on the method supplied, (tempallow, tempdeny).
'''
_type = method.replace('temp', '').upper()
cmd = "csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'".format(_type=_... | [
"def",
"_temp_exists",
"(",
"method",
",",
"ip",
")",
":",
"_type",
"=",
"method",
".",
"replace",
"(",
"'temp'",
",",
"''",
")",
".",
"upper",
"(",
")",
"cmd",
"=",
"\"csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}} END {{exit code}}'\"",... | Checks if the ip exists as a temporary rule based
on the method supplied, (tempallow, tempdeny). | [
"Checks",
"if",
"the",
"ip",
"exists",
"as",
"a",
"temporary",
"rule",
"based",
"on",
"the",
"method",
"supplied",
"(",
"tempallow",
"tempdeny",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L31-L39 | train | Checks if the ip exists as a temporary rule based
on the method supplied. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | exists | def exists(method,
ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
ttl=None,
comment=''):
'''
Returns true a rule for the ip already exists
based on the method supplied. Returns false ... | python | def exists(method,
ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
ttl=None,
comment=''):
'''
Returns true a rule for the ip already exists
based on the method supplied. Returns false ... | [
"def",
"exists",
"(",
"method",
",",
"ip",
",",
"port",
"=",
"None",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'d'",
",",
"ttl",
"=",
"None",
",",
"comment",
"=",
"''",
")",
... | Returns true a rule for the ip already exists
based on the method supplied. Returns false if
not found.
CLI Example:
.. code-block:: bash
salt '*' csf.exists allow 1.2.3.4
salt '*' csf.exists tempdeny 1.2.3.4 | [
"Returns",
"true",
"a",
"rule",
"for",
"the",
"ip",
"already",
"exists",
"based",
"on",
"the",
"method",
"supplied",
".",
"Returns",
"false",
"if",
"not",
"found",
".",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L47-L73 | train | Returns true if the ip already exists in the csf 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/csf.py | __csf_cmd | def __csf_cmd(cmd):
'''
Execute csf command
'''
csf_cmd = '{0} {1}'.format(salt.utils.path.which('csf'), cmd)
out = __salt__['cmd.run_all'](csf_cmd)
if out['retcode'] != 0:
if not out['stderr']:
ret = out['stdout']
else:
ret = out['stderr']
raise ... | python | def __csf_cmd(cmd):
'''
Execute csf command
'''
csf_cmd = '{0} {1}'.format(salt.utils.path.which('csf'), cmd)
out = __salt__['cmd.run_all'](csf_cmd)
if out['retcode'] != 0:
if not out['stderr']:
ret = out['stdout']
else:
ret = out['stderr']
raise ... | [
"def",
"__csf_cmd",
"(",
"cmd",
")",
":",
"csf_cmd",
"=",
"'{0} {1}'",
".",
"format",
"(",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'csf'",
")",
",",
"cmd",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"csf_cmd",
")",
... | Execute csf command | [
"Execute",
"csf",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L76-L93 | train | Execute csf command
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/csf.py | _build_args | def _build_args(method, ip, comment):
'''
Returns the cmd args for csf basic allow/deny commands.
'''
opt = _get_opt(method)
args = '{0} {1}'.format(opt, ip)
if comment:
args += ' {0}'.format(comment)
return args | python | def _build_args(method, ip, comment):
'''
Returns the cmd args for csf basic allow/deny commands.
'''
opt = _get_opt(method)
args = '{0} {1}'.format(opt, ip)
if comment:
args += ' {0}'.format(comment)
return args | [
"def",
"_build_args",
"(",
"method",
",",
"ip",
",",
"comment",
")",
":",
"opt",
"=",
"_get_opt",
"(",
"method",
")",
"args",
"=",
"'{0} {1}'",
".",
"format",
"(",
"opt",
",",
"ip",
")",
"if",
"comment",
":",
"args",
"+=",
"' {0}'",
".",
"format",
... | Returns the cmd args for csf basic allow/deny commands. | [
"Returns",
"the",
"cmd",
"args",
"for",
"csf",
"basic",
"allow",
"/",
"deny",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L121-L129 | train | Builds the command line args for csf basic allow and deny commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | _access_rule | def _access_rule(method,
ip=None,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
comment=''):
'''
Handles the cmd execution for allow and deny commands.
'''
if _status... | python | def _access_rule(method,
ip=None,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
comment=''):
'''
Handles the cmd execution for allow and deny commands.
'''
if _status... | [
"def",
"_access_rule",
"(",
"method",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'d'",
",",
"comment",
"=",
"''",
")",
":",
"i... | Handles the cmd execution for allow and deny commands. | [
"Handles",
"the",
"cmd",
"execution",
"for",
"allow",
"and",
"deny",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L132-L159 | train | Handles the command execution for allow and deny rules. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | _csf_to_list | def _csf_to_list(option):
'''
Extract comma-separated values from a csf.conf
option and return a list.
'''
result = []
line = get_option(option)
if line:
csv = line.split('=')[1].replace(' ', '').replace('"', '')
result = csv.split(',')
return result | python | def _csf_to_list(option):
'''
Extract comma-separated values from a csf.conf
option and return a list.
'''
result = []
line = get_option(option)
if line:
csv = line.split('=')[1].replace(' ', '').replace('"', '')
result = csv.split(',')
return result | [
"def",
"_csf_to_list",
"(",
"option",
")",
":",
"result",
"=",
"[",
"]",
"line",
"=",
"get_option",
"(",
"option",
")",
"if",
"line",
":",
"csv",
"=",
"line",
".",
"split",
"(",
"'='",
")",
"[",
"1",
"]",
".",
"replace",
"(",
"' '",
",",
"''",
... | Extract comma-separated values from a csf.conf
option and return a list. | [
"Extract",
"comma",
"-",
"separated",
"values",
"from",
"a",
"csf",
".",
"conf",
"option",
"and",
"return",
"a",
"list",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L204-L214 | train | Extract comma - separated values from a csf. conf
option and return a list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/csf.py | _tmp_access_rule | def _tmp_access_rule(method,
ip=None,
ttl=None,
port=None,
direction='in',
port_origin='d',
ip_origin='d',
comment=''):
'''
Handles the cmd execution for tempdeny and tempa... | python | def _tmp_access_rule(method,
ip=None,
ttl=None,
port=None,
direction='in',
port_origin='d',
ip_origin='d',
comment=''):
'''
Handles the cmd execution for tempdeny and tempa... | [
"def",
"_tmp_access_rule",
"(",
"method",
",",
"ip",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
"port",
"=",
"None",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'d'",
",",
"comment",
"=",
"''",
")",
":",
"... | Handles the cmd execution for tempdeny and tempallow commands. | [
"Handles",
"the",
"cmd",
"execution",
"for",
"tempdeny",
"and",
"tempallow",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L308-L325 | train | Handles the command execution for tempdeny and tempallow commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | _build_tmp_access_args | def _build_tmp_access_args(method, ip, ttl, port, direction, comment):
'''
Builds the cmd args for temporary access/deny opts.
'''
opt = _get_opt(method)
args = '{0} {1} {2}'.format(opt, ip, ttl)
if port:
args += ' -p {0}'.format(port)
if direction:
args += ' -d {0}'.format(d... | python | def _build_tmp_access_args(method, ip, ttl, port, direction, comment):
'''
Builds the cmd args for temporary access/deny opts.
'''
opt = _get_opt(method)
args = '{0} {1} {2}'.format(opt, ip, ttl)
if port:
args += ' -p {0}'.format(port)
if direction:
args += ' -d {0}'.format(d... | [
"def",
"_build_tmp_access_args",
"(",
"method",
",",
"ip",
",",
"ttl",
",",
"port",
",",
"direction",
",",
"comment",
")",
":",
"opt",
"=",
"_get_opt",
"(",
"method",
")",
"args",
"=",
"'{0} {1} {2}'",
".",
"format",
"(",
"opt",
",",
"ip",
",",
"ttl",
... | Builds the cmd args for temporary access/deny opts. | [
"Builds",
"the",
"cmd",
"args",
"for",
"temporary",
"access",
"/",
"deny",
"opts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L328-L340 | train | Builds the cmd args for temporary access and deny opts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | tempallow | def tempallow(ip=None, ttl=None, port=None, direction=None, comment=''):
'''
Add an rule to the temporary ip allow list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access... | python | def tempallow(ip=None, ttl=None, port=None, direction=None, comment=''):
'''
Add an rule to the temporary ip allow list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access... | [
"def",
"tempallow",
"(",
"ip",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
"port",
"=",
"None",
",",
"direction",
"=",
"None",
",",
"comment",
"=",
"''",
")",
":",
"return",
"_tmp_access_rule",
"(",
"'tempallow'",
",",
"ip",
",",
"ttl",
",",
"port",
... | Add an rule to the temporary ip allow list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access' | [
"Add",
"an",
"rule",
"to",
"the",
"temporary",
"ip",
"allow",
"list",
".",
"See",
":",
"func",
":",
"_access_rule",
".",
"1",
"-",
"Add",
"an",
"IP",
":",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L393-L404 | train | A helper function to add a rule to the temporary ip allow list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/csf.py | tempdeny | def tempdeny(ip=None, ttl=None, port=None, direction=None, comment=''):
'''
Add a rule to the temporary ip deny list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt'
... | python | def tempdeny(ip=None, ttl=None, port=None, direction=None, comment=''):
'''
Add a rule to the temporary ip deny list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt'
... | [
"def",
"tempdeny",
"(",
"ip",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
"port",
"=",
"None",
",",
"direction",
"=",
"None",
",",
"comment",
"=",
"''",
")",
":",
"return",
"_tmp_access_rule",
"(",
"'tempdeny'",
",",
"ip",
",",
"ttl",
",",
"port",
"... | Add a rule to the temporary ip deny list.
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt' | [
"Add",
"a",
"rule",
"to",
"the",
"temporary",
"ip",
"deny",
"list",
".",
"See",
":",
"func",
":",
"_access_rule",
".",
"1",
"-",
"Add",
"an",
"IP",
":",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L407-L418 | train | Add a rule to the temporary ip deny list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/csf.py | allow | def allow(ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='s',
ttl=None,
comment=''):
'''
Add an rule to csf allowed hosts
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' c... | python | def allow(ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='s',
ttl=None,
comment=''):
'''
Add an rule to csf allowed hosts
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' c... | [
"def",
"allow",
"(",
"ip",
",",
"port",
"=",
"None",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'s'",
",",
"ttl",
"=",
"None",
",",
"comment",
"=",
"''",
")",
":",
"return",
... | Add an rule to csf allowed hosts
See :func:`_access_rule`.
1- Add an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.allow 127.0.0.1
salt '*' csf.allow 127.0.0.1 comment="Allow localhost" | [
"Add",
"an",
"rule",
"to",
"csf",
"allowed",
"hosts",
"See",
":",
"func",
":",
"_access_rule",
".",
"1",
"-",
"Add",
"an",
"IP",
":",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L421-L447 | train | Allow the given IP address in the current csf. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | deny | def deny(ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
ttl=None,
comment=''):
'''
Add an rule to csf denied hosts
See :func:`_access_rule`.
1- Deny an IP:
CLI Example:
.. code-block:: bash
salt '*' cs... | python | def deny(ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
ttl=None,
comment=''):
'''
Add an rule to csf denied hosts
See :func:`_access_rule`.
1- Deny an IP:
CLI Example:
.. code-block:: bash
salt '*' cs... | [
"def",
"deny",
"(",
"ip",
",",
"port",
"=",
"None",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
",",
"port_origin",
"=",
"'d'",
",",
"ip_origin",
"=",
"'d'",
",",
"ttl",
"=",
"None",
",",
"comment",
"=",
"''",
")",
":",
"return",
"... | Add an rule to csf denied hosts
See :func:`_access_rule`.
1- Deny an IP:
CLI Example:
.. code-block:: bash
salt '*' csf.deny 127.0.0.1
salt '*' csf.deny 127.0.0.1 comment="Too localhosty" | [
"Add",
"an",
"rule",
"to",
"csf",
"denied",
"hosts",
"See",
":",
"func",
":",
"_access_rule",
".",
"1",
"-",
"Deny",
"an",
"IP",
":",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L450-L469 | train | Add an deny rule to csf denied hosts
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | allow_ports | def allow_ports(ports, proto='tcp', direction='in'):
'''
Fully replace the incoming or outgoing ports
line in the csf.conf file - e.g. TCP_IN, TCP_OUT,
UDP_IN, UDP_OUT, etc.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction=... | python | def allow_ports(ports, proto='tcp', direction='in'):
'''
Fully replace the incoming or outgoing ports
line in the csf.conf file - e.g. TCP_IN, TCP_OUT,
UDP_IN, UDP_OUT, etc.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction=... | [
"def",
"allow_ports",
"(",
"ports",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
")",
":",
"results",
"=",
"[",
"]",
"ports",
"=",
"set",
"(",
"ports",
")",
"ports",
"=",
"list",
"(",
"ports",
")",
"proto",
"=",
"proto",
".",
"upper",... | Fully replace the incoming or outgoing ports
line in the csf.conf file - e.g. TCP_IN, TCP_OUT,
UDP_IN, UDP_OUT, etc.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction='in' | [
"Fully",
"replace",
"the",
"incoming",
"or",
"outgoing",
"ports",
"line",
"in",
"the",
"csf",
".",
"conf",
"file",
"-",
"e",
".",
"g",
".",
"TCP_IN",
"TCP_OUT",
"UDP_IN",
"UDP_OUT",
"etc",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L535-L563 | train | Allow ports in the csf. conf 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/csf.py | get_ports | def get_ports(proto='tcp', direction='in'):
'''
Lists ports from csf.conf based on direction and protocol.
e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc..
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in'
'''
proto = proto.upper()
directio... | python | def get_ports(proto='tcp', direction='in'):
'''
Lists ports from csf.conf based on direction and protocol.
e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc..
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in'
'''
proto = proto.upper()
directio... | [
"def",
"get_ports",
"(",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'in'",
")",
":",
"proto",
"=",
"proto",
".",
"upper",
"(",
")",
"direction",
"=",
"direction",
".",
"upper",
"(",
")",
"results",
"=",
"{",
"}",
"_validate_direction_and_proto",
"(",... | Lists ports from csf.conf based on direction and protocol.
e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc..
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in' | [
"Lists",
"ports",
"from",
"csf",
".",
"conf",
"based",
"on",
"direction",
"and",
"protocol",
".",
"e",
".",
"g",
".",
"-",
"TCP_IN",
"TCP_OUT",
"UDP_IN",
"UDP_OUT",
"etc",
".."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L566-L587 | train | Returns a list of ports from csf. conf based on protocol and direction. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/csf.py | allow_port | def allow_port(port, proto='tcp', direction='both'):
'''
Like allow_ports, but it will append to the
existing entry instead of replacing it.
Takes a single port instead of a list of ports.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in'
'''
... | python | def allow_port(port, proto='tcp', direction='both'):
'''
Like allow_ports, but it will append to the
existing entry instead of replacing it.
Takes a single port instead of a list of ports.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in'
'''
... | [
"def",
"allow_port",
"(",
"port",
",",
"proto",
"=",
"'tcp'",
",",
"direction",
"=",
"'both'",
")",
":",
"ports",
"=",
"get_ports",
"(",
"proto",
"=",
"proto",
",",
"direction",
"=",
"direction",
")",
"direction",
"=",
"direction",
".",
"upper",
"(",
"... | Like allow_ports, but it will append to the
existing entry instead of replacing it.
Takes a single port instead of a list of ports.
CLI Example:
.. code-block:: bash
salt '*' csf.allow_port 22 proto='tcp' direction='in' | [
"Like",
"allow_ports",
"but",
"it",
"will",
"append",
"to",
"the",
"existing",
"entry",
"instead",
"of",
"replacing",
"it",
".",
"Takes",
"a",
"single",
"port",
"instead",
"of",
"a",
"list",
"of",
"ports",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L611-L633 | train | Allow a single port in the
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _ssh_state | def _ssh_state(chunks, st_kwargs,
kwargs, test=False):
'''
Function to run a state with the given chunk via salt-ssh
'''
file_refs = salt.client.ssh.state.lowstate_file_refs(
chunks,
_merge_extra_filerefs(
kwargs.get('extra_filerefs', ''),
... | python | def _ssh_state(chunks, st_kwargs,
kwargs, test=False):
'''
Function to run a state with the given chunk via salt-ssh
'''
file_refs = salt.client.ssh.state.lowstate_file_refs(
chunks,
_merge_extra_filerefs(
kwargs.get('extra_filerefs', ''),
... | [
"def",
"_ssh_state",
"(",
"chunks",
",",
"st_kwargs",
",",
"kwargs",
",",
"test",
"=",
"False",
")",
":",
"file_refs",
"=",
"salt",
".",
"client",
".",
"ssh",
".",
"state",
".",
"lowstate_file_refs",
"(",
"chunks",
",",
"_merge_extra_filerefs",
"(",
"kwarg... | Function to run a state with the given chunk via salt-ssh | [
"Function",
"to",
"run",
"a",
"state",
"with",
"the",
"given",
"chunk",
"via",
"salt",
"-",
"ssh"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L39-L89 | train | Function to run a state with the given chunk via salt - ssh
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _set_retcode | def _set_retcode(ret, highstate=None):
'''
Set the return code based on the data back from the state system
'''
# Set default retcode to 0
__context__['retcode'] = 0
if isinstance(ret, list):
__context__['retcode'] = 1
return
if not salt.utils.state.check_result(ret, highst... | python | def _set_retcode(ret, highstate=None):
'''
Set the return code based on the data back from the state system
'''
# Set default retcode to 0
__context__['retcode'] = 0
if isinstance(ret, list):
__context__['retcode'] = 1
return
if not salt.utils.state.check_result(ret, highst... | [
"def",
"_set_retcode",
"(",
"ret",
",",
"highstate",
"=",
"None",
")",
":",
"# Set default retcode to 0",
"__context__",
"[",
"'retcode'",
"]",
"=",
"0",
"if",
"isinstance",
"(",
"ret",
",",
"list",
")",
":",
"__context__",
"[",
"'retcode'",
"]",
"=",
"1",... | Set the return code based on the data back from the state system | [
"Set",
"the",
"return",
"code",
"based",
"on",
"the",
"data",
"back",
"from",
"the",
"state",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L92-L105 | train | Set the return code based on the data back from the state 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/client/ssh/wrapper/state.py | _check_pillar | def _check_pillar(kwargs, pillar=None):
'''
Check the pillar for errors, refuse to run the state if there are errors
in the pillar and return the pillar errors
'''
if kwargs.get('force'):
return True
pillar_dict = pillar if pillar is not None else __pillar__
if '_errors' in pillar_di... | python | def _check_pillar(kwargs, pillar=None):
'''
Check the pillar for errors, refuse to run the state if there are errors
in the pillar and return the pillar errors
'''
if kwargs.get('force'):
return True
pillar_dict = pillar if pillar is not None else __pillar__
if '_errors' in pillar_di... | [
"def",
"_check_pillar",
"(",
"kwargs",
",",
"pillar",
"=",
"None",
")",
":",
"if",
"kwargs",
".",
"get",
"(",
"'force'",
")",
":",
"return",
"True",
"pillar_dict",
"=",
"pillar",
"if",
"pillar",
"is",
"not",
"None",
"else",
"__pillar__",
"if",
"'_errors'... | Check the pillar for errors, refuse to run the state if there are errors
in the pillar and return the pillar errors | [
"Check",
"the",
"pillar",
"for",
"errors",
"refuse",
"to",
"run",
"the",
"state",
"if",
"there",
"are",
"errors",
"in",
"the",
"pillar",
"and",
"return",
"the",
"pillar",
"errors"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L108-L118 | train | Check the pillar for errors and return the pillar errors
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _wait | def _wait(jid):
'''
Wait for all previously started state jobs to finish running
'''
if jid is None:
jid = salt.utils.jid.gen_jid(__opts__)
states = _prior_running_states(jid)
while states:
time.sleep(1)
states = _prior_running_states(jid) | python | def _wait(jid):
'''
Wait for all previously started state jobs to finish running
'''
if jid is None:
jid = salt.utils.jid.gen_jid(__opts__)
states = _prior_running_states(jid)
while states:
time.sleep(1)
states = _prior_running_states(jid) | [
"def",
"_wait",
"(",
"jid",
")",
":",
"if",
"jid",
"is",
"None",
":",
"jid",
"=",
"salt",
".",
"utils",
".",
"jid",
".",
"gen_jid",
"(",
"__opts__",
")",
"states",
"=",
"_prior_running_states",
"(",
"jid",
")",
"while",
"states",
":",
"time",
".",
... | Wait for all previously started state jobs to finish running | [
"Wait",
"for",
"all",
"previously",
"started",
"state",
"jobs",
"to",
"finish",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L121-L130 | train | Wait for all previously started state jobs to finish running
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _merge_extra_filerefs | def _merge_extra_filerefs(*args):
'''
Takes a list of filerefs and returns a merged list
'''
ret = []
for arg in args:
if isinstance(arg, six.string_types):
if arg:
ret.extend(arg.split(','))
elif isinstance(arg, list):
if arg:
... | python | def _merge_extra_filerefs(*args):
'''
Takes a list of filerefs and returns a merged list
'''
ret = []
for arg in args:
if isinstance(arg, six.string_types):
if arg:
ret.extend(arg.split(','))
elif isinstance(arg, list):
if arg:
... | [
"def",
"_merge_extra_filerefs",
"(",
"*",
"args",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"arg",
"in",
"args",
":",
"if",
"isinstance",
"(",
"arg",
",",
"six",
".",
"string_types",
")",
":",
"if",
"arg",
":",
"ret",
".",
"extend",
"(",
"arg",
".",
... | Takes a list of filerefs and returns a merged list | [
"Takes",
"a",
"list",
"of",
"filerefs",
"and",
"returns",
"a",
"merged",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L133-L145 | train | Takes a list of filerefs and returns a merged list
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _cleanup_slsmod_high_data | def _cleanup_slsmod_high_data(high_data):
'''
Set "slsmod" keys to None to make
high_data JSON serializable
'''
for i in six.itervalues(high_data):
if 'stateconf' in i:
stateconf_data = i['stateconf'][1]
if 'slsmod' in stateconf_data:
stateconf_data['s... | python | def _cleanup_slsmod_high_data(high_data):
'''
Set "slsmod" keys to None to make
high_data JSON serializable
'''
for i in six.itervalues(high_data):
if 'stateconf' in i:
stateconf_data = i['stateconf'][1]
if 'slsmod' in stateconf_data:
stateconf_data['s... | [
"def",
"_cleanup_slsmod_high_data",
"(",
"high_data",
")",
":",
"for",
"i",
"in",
"six",
".",
"itervalues",
"(",
"high_data",
")",
":",
"if",
"'stateconf'",
"in",
"i",
":",
"stateconf_data",
"=",
"i",
"[",
"'stateconf'",
"]",
"[",
"1",
"]",
"if",
"'slsmo... | Set "slsmod" keys to None to make
high_data JSON serializable | [
"Set",
"slsmod",
"keys",
"to",
"None",
"to",
"make",
"high_data",
"JSON",
"serializable"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L158-L167 | train | Clean up the SLS mod high_data 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/client/ssh/wrapper/state.py | _parse_mods | def _parse_mods(mods):
'''
Parse modules.
'''
if isinstance(mods, six.string_types):
mods = [item.strip() for item in mods.split(',') if item.strip()]
return mods | python | def _parse_mods(mods):
'''
Parse modules.
'''
if isinstance(mods, six.string_types):
mods = [item.strip() for item in mods.split(',') if item.strip()]
return mods | [
"def",
"_parse_mods",
"(",
"mods",
")",
":",
"if",
"isinstance",
"(",
"mods",
",",
"six",
".",
"string_types",
")",
":",
"mods",
"=",
"[",
"item",
".",
"strip",
"(",
")",
"for",
"item",
"in",
"mods",
".",
"split",
"(",
"','",
")",
"if",
"item",
"... | Parse modules. | [
"Parse",
"modules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L170-L177 | train | Parse modules. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | sls | def sls(mods, saltenv='base', test=None, exclude=None, **kwargs):
'''
Create the seed file for a state.sls run
'''
st_kwargs = __salt__.kwargs
__opts__['grains'] = __grains__
__pillar__.update(kwargs.get('pillar', {}))
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.c... | python | def sls(mods, saltenv='base', test=None, exclude=None, **kwargs):
'''
Create the seed file for a state.sls run
'''
st_kwargs = __salt__.kwargs
__opts__['grains'] = __grains__
__pillar__.update(kwargs.get('pillar', {}))
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.c... | [
"def",
"sls",
"(",
"mods",
",",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"st_kwargs",
"=",
"__salt__",
".",
"kwargs",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"__p... | Create the seed file for a state.sls run | [
"Create",
"the",
"seed",
"file",
"for",
"a",
"state",
".",
"sls",
"run"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L180-L267 | train | Create the state. sls file for a state. sls 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/client/ssh/wrapper/state.py | running | def running(concurrent=False):
'''
Return a list of strings that contain state return data if a state function
is already running. This function is used to prevent multiple state calls
from being run at the same time.
CLI Example:
.. code-block:: bash
salt '*' state.running
'''
... | python | def running(concurrent=False):
'''
Return a list of strings that contain state return data if a state function
is already running. This function is used to prevent multiple state calls
from being run at the same time.
CLI Example:
.. code-block:: bash
salt '*' state.running
'''
... | [
"def",
"running",
"(",
"concurrent",
"=",
"False",
")",
":",
"ret",
"=",
"[",
"]",
"if",
"concurrent",
":",
"return",
"ret",
"active",
"=",
"__salt__",
"[",
"'saltutil.is_running'",
"]",
"(",
"'state.*'",
")",
"for",
"data",
"in",
"active",
":",
"err",
... | Return a list of strings that contain state return data if a state function
is already running. This function is used to prevent multiple state calls
from being run at the same time.
CLI Example:
.. code-block:: bash
salt '*' state.running | [
"Return",
"a",
"list",
"of",
"strings",
"that",
"contain",
"state",
"return",
"data",
"if",
"a",
"state",
"function",
"is",
"already",
"running",
".",
"This",
"function",
"is",
"used",
"to",
"prevent",
"multiple",
"state",
"calls",
"from",
"being",
"run",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L270-L297 | train | Return a list of strings that contain state return data if a state function is already running | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _prior_running_states | def _prior_running_states(jid):
'''
Return a list of dicts of prior calls to state functions. This function is
used to queue state calls so only one is run at a time.
'''
ret = []
active = __salt__['saltutil.is_running']('state.*')
for data in active:
try:
data_jid = in... | python | def _prior_running_states(jid):
'''
Return a list of dicts of prior calls to state functions. This function is
used to queue state calls so only one is run at a time.
'''
ret = []
active = __salt__['saltutil.is_running']('state.*')
for data in active:
try:
data_jid = in... | [
"def",
"_prior_running_states",
"(",
"jid",
")",
":",
"ret",
"=",
"[",
"]",
"active",
"=",
"__salt__",
"[",
"'saltutil.is_running'",
"]",
"(",
"'state.*'",
")",
"for",
"data",
"in",
"active",
":",
"try",
":",
"data_jid",
"=",
"int",
"(",
"data",
"[",
"... | Return a list of dicts of prior calls to state functions. This function is
used to queue state calls so only one is run at a time. | [
"Return",
"a",
"list",
"of",
"dicts",
"of",
"prior",
"calls",
"to",
"state",
"functions",
".",
"This",
"function",
"is",
"used",
"to",
"queue",
"state",
"calls",
"so",
"only",
"one",
"is",
"run",
"at",
"a",
"time",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L300-L315 | train | Return a list of dicts of prior state functions to state functions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | _check_queue | def _check_queue(queue, kwargs):
'''
Utility function to queue the state run if requested
and to check for conflicts in currently running states
'''
if queue:
_wait(kwargs.get('__pub_jid'))
else:
conflict = running(concurrent=kwargs.get('concurrent', False))
if conflict:
... | python | def _check_queue(queue, kwargs):
'''
Utility function to queue the state run if requested
and to check for conflicts in currently running states
'''
if queue:
_wait(kwargs.get('__pub_jid'))
else:
conflict = running(concurrent=kwargs.get('concurrent', False))
if conflict:
... | [
"def",
"_check_queue",
"(",
"queue",
",",
"kwargs",
")",
":",
"if",
"queue",
":",
"_wait",
"(",
"kwargs",
".",
"get",
"(",
"'__pub_jid'",
")",
")",
"else",
":",
"conflict",
"=",
"running",
"(",
"concurrent",
"=",
"kwargs",
".",
"get",
"(",
"'concurrent... | Utility function to queue the state run if requested
and to check for conflicts in currently running states | [
"Utility",
"function",
"to",
"queue",
"the",
"state",
"run",
"if",
"requested",
"and",
"to",
"check",
"for",
"conflicts",
"in",
"currently",
"running",
"states"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L318-L329 | train | Utility function to check if the queue is not already running | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | low | def low(data, **kwargs):
'''
Execute a single low data call
This function is mostly intended for testing the state system
CLI Example:
.. code-block:: bash
salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
'''
st_kwargs = __salt__.kwargs
__opts__['grains'... | python | def low(data, **kwargs):
'''
Execute a single low data call
This function is mostly intended for testing the state system
CLI Example:
.. code-block:: bash
salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
'''
st_kwargs = __salt__.kwargs
__opts__['grains'... | [
"def",
"low",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"st_kwargs",
"=",
"__salt__",
".",
"kwargs",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"chunks",
"=",
"[",
"data",
"]",
"st_",
"=",
"salt",
".",
"client",
".",
"ssh",
".",
"st... | Execute a single low data call
This function is mostly intended for testing the state system
CLI Example:
.. code-block:: bash
salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}' | [
"Execute",
"a",
"single",
"low",
"data",
"call",
"This",
"function",
"is",
"mostly",
"intended",
"for",
"testing",
"the",
"state",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L338-L410 | train | Execute a single low data call | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | request | def request(mods=None,
**kwargs):
'''
.. versionadded:: 2017.7.3
Request that the local admin execute a state run via
`salt-call state.run_request`
All arguments match state.apply
CLI Example:
.. code-block:: bash
salt '*' state.request
salt '*' state.request ... | python | def request(mods=None,
**kwargs):
'''
.. versionadded:: 2017.7.3
Request that the local admin execute a state run via
`salt-call state.run_request`
All arguments match state.apply
CLI Example:
.. code-block:: bash
salt '*' state.request
salt '*' state.request ... | [
"def",
"request",
"(",
"mods",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'test'",
"]",
"=",
"True",
"ret",
"=",
"apply_",
"(",
"mods",
",",
"*",
"*",
"kwargs",
")",
"notify_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
... | .. versionadded:: 2017.7.3
Request that the local admin execute a state run via
`salt-call state.run_request`
All arguments match state.apply
CLI Example:
.. code-block:: bash
salt '*' state.request
salt '*' state.request test
salt '*' state.request test,pkgs | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"3"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L525-L565 | train | Execute a state run via state. run_request | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | clear_request | def clear_request(name=None):
'''
.. versionadded:: 2017.7.3
Clear out the state execution request without executing it
CLI Example:
.. code-block:: bash
salt '*' state.clear_request
'''
notify_path = os.path.join(__opts__['cachedir'], 'req_state.p')
serial = salt.payload.Ser... | python | def clear_request(name=None):
'''
.. versionadded:: 2017.7.3
Clear out the state execution request without executing it
CLI Example:
.. code-block:: bash
salt '*' state.clear_request
'''
notify_path = os.path.join(__opts__['cachedir'], 'req_state.p')
serial = salt.payload.Ser... | [
"def",
"clear_request",
"(",
"name",
"=",
"None",
")",
":",
"notify_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__opts__",
"[",
"'cachedir'",
"]",
",",
"'req_state.p'",
")",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"__opts__",
"... | .. versionadded:: 2017.7.3
Clear out the state execution request without executing it
CLI Example:
.. code-block:: bash
salt '*' state.clear_request | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"3"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L593-L632 | train | Clear out the state execution request without executing it | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | run_request | def run_request(name='default', **kwargs):
'''
.. versionadded:: 2017.7.3
Execute the pending state request
CLI Example:
.. code-block:: bash
salt '*' state.run_request
'''
req = check_request()
if name not in req:
return {}
n_req = req[name]
if 'mods' not in ... | python | def run_request(name='default', **kwargs):
'''
.. versionadded:: 2017.7.3
Execute the pending state request
CLI Example:
.. code-block:: bash
salt '*' state.run_request
'''
req = check_request()
if name not in req:
return {}
n_req = req[name]
if 'mods' not in ... | [
"def",
"run_request",
"(",
"name",
"=",
"'default'",
",",
"*",
"*",
"kwargs",
")",
":",
"req",
"=",
"check_request",
"(",
")",
"if",
"name",
"not",
"in",
"req",
":",
"return",
"{",
"}",
"n_req",
"=",
"req",
"[",
"name",
"]",
"if",
"'mods'",
"not",
... | .. versionadded:: 2017.7.3
Execute the pending state request
CLI Example:
.. code-block:: bash
salt '*' state.run_request | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"3"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L635-L663 | train | Execute the pending state request
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/client/ssh/wrapper/state.py | show_highstate | def show_highstate(**kwargs):
'''
Retrieve the highstate data from the salt master and display it
CLI Example:
.. code-block:: bash
salt '*' state.show_highstate
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.... | python | def show_highstate(**kwargs):
'''
Retrieve the highstate data from the salt master and display it
CLI Example:
.. code-block:: bash
salt '*' state.show_highstate
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.... | [
"def",
"show_highstate",
"(",
"*",
"*",
"kwargs",
")",
":",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"opts",
"=",
"salt",
".",
"utils",
".",
"state",
".",
"get_sls_opts",
"(",
"__opts__",
",",
"*",
"*",
"kwargs",
")",
"st_",
"=",
"salt",
... | Retrieve the highstate data from the salt master and display it
CLI Example:
.. code-block:: bash
salt '*' state.show_highstate | [
"Retrieve",
"the",
"highstate",
"data",
"from",
"the",
"salt",
"master",
"and",
"display",
"it"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L831-L851 | train | Display the highstate data from the salt master and display it | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | show_lowstate | def show_lowstate(**kwargs):
'''
List out the low data that will be applied to this minion
CLI Example:
.. code-block:: bash
salt '*' state.show_lowstate
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.state.SS... | python | def show_lowstate(**kwargs):
'''
List out the low data that will be applied to this minion
CLI Example:
.. code-block:: bash
salt '*' state.show_lowstate
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.state.SS... | [
"def",
"show_lowstate",
"(",
"*",
"*",
"kwargs",
")",
":",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"opts",
"=",
"salt",
".",
"utils",
".",
"state",
".",
"get_sls_opts",
"(",
"__opts__",
",",
"*",
"*",
"kwargs",
")",
"st_",
"=",
"salt",
"... | List out the low data that will be applied to this minion
CLI Example:
.. code-block:: bash
salt '*' state.show_lowstate | [
"List",
"out",
"the",
"low",
"data",
"that",
"will",
"be",
"applied",
"to",
"this",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L854-L874 | train | Show the low state of the 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/client/ssh/wrapper/state.py | sls_id | def sls_id(id_, mods, test=None, queue=False, **kwargs):
'''
Call a single ID from the named module(s) and handle all requisites
The state ID comes *before* the module ID(s) on the command line.
id
ID to call
mods
Comma-delimited list of modules to search for given id and its requ... | python | def sls_id(id_, mods, test=None, queue=False, **kwargs):
'''
Call a single ID from the named module(s) and handle all requisites
The state ID comes *before* the module ID(s) on the command line.
id
ID to call
mods
Comma-delimited list of modules to search for given id and its requ... | [
"def",
"sls_id",
"(",
"id_",
",",
"mods",
",",
"test",
"=",
"None",
",",
"queue",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"st_kwargs",
"=",
"__salt__",
".",
"kwargs",
"conflict",
"=",
"_check_queue",
"(",
"queue",
",",
"kwargs",
")",
"if",
... | Call a single ID from the named module(s) and handle all requisites
The state ID comes *before* the module ID(s) on the command line.
id
ID to call
mods
Comma-delimited list of modules to search for given id and its requisites
.. versionadded:: 2017.7.3
saltenv : base
Sp... | [
"Call",
"a",
"single",
"ID",
"from",
"the",
"named",
"module",
"(",
"s",
")",
"and",
"handle",
"all",
"requisites"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L877-L964 | train | Return a single state ID from the named modules and handle all requisites | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | show_sls | def show_sls(mods, saltenv='base', test=None, **kwargs):
'''
Display the state data from a specific sls or list of sls files on the
master
CLI Example:
.. code-block:: bash
salt '*' state.show_sls core,edit.vim dev
'''
__pillar__.update(kwargs.get('pillar', {}))
__opts__['grai... | python | def show_sls(mods, saltenv='base', test=None, **kwargs):
'''
Display the state data from a specific sls or list of sls files on the
master
CLI Example:
.. code-block:: bash
salt '*' state.show_sls core,edit.vim dev
'''
__pillar__.update(kwargs.get('pillar', {}))
__opts__['grai... | [
"def",
"show_sls",
"(",
"mods",
",",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"__pillar__",
".",
"update",
"(",
"kwargs",
".",
"get",
"(",
"'pillar'",
",",
"{",
"}",
")",
")",
"__opts__",
"[",
"'grains'... | Display the state data from a specific sls or list of sls files on the
master
CLI Example:
.. code-block:: bash
salt '*' state.show_sls core,edit.vim dev | [
"Display",
"the",
"state",
"data",
"from",
"a",
"specific",
"sls",
"or",
"list",
"of",
"sls",
"files",
"on",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L967-L1005 | train | Display the state data from a specific sls or list of sls files on the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | show_top | def show_top(**kwargs):
'''
Return the top data that the minion will use for a highstate
CLI Example:
.. code-block:: bash
salt '*' state.show_top
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.state.SSHHighSt... | python | def show_top(**kwargs):
'''
Return the top data that the minion will use for a highstate
CLI Example:
.. code-block:: bash
salt '*' state.show_top
'''
__opts__['grains'] = __grains__
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.state.SSHHighSt... | [
"def",
"show_top",
"(",
"*",
"*",
"kwargs",
")",
":",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"opts",
"=",
"salt",
".",
"utils",
".",
"state",
".",
"get_sls_opts",
"(",
"__opts__",
",",
"*",
"*",
"kwargs",
")",
"st_",
"=",
"salt",
".",
... | Return the top data that the minion will use for a highstate
CLI Example:
.. code-block:: bash
salt '*' state.show_top | [
"Return",
"the",
"top",
"data",
"that",
"the",
"minion",
"will",
"use",
"for",
"a",
"highstate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L1053-L1076 | train | Return the top data that the minion will use for a highstate
CLI Example : bash
AttributeNames salt '*' state. show_top
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/client/ssh/wrapper/state.py | single | def single(fun, name, test=None, **kwargs):
'''
.. versionadded:: 2015.5.0
Execute a single state function with the named kwargs, returns False if
insufficient data is sent to the command
By default, the values of the kwargs will be parsed as YAML. So, you can
specify lists values, or lists of... | python | def single(fun, name, test=None, **kwargs):
'''
.. versionadded:: 2015.5.0
Execute a single state function with the named kwargs, returns False if
insufficient data is sent to the command
By default, the values of the kwargs will be parsed as YAML. So, you can
specify lists values, or lists of... | [
"def",
"single",
"(",
"fun",
",",
"name",
",",
"test",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"st_kwargs",
"=",
"__salt__",
".",
"kwargs",
"__opts__",
"[",
"'grains'",
"]",
"=",
"__grains__",
"# state.fun -> [state, fun]",
"comps",
"=",
"fun",
"... | .. versionadded:: 2015.5.0
Execute a single state function with the named kwargs, returns False if
insufficient data is sent to the command
By default, the values of the kwargs will be parsed as YAML. So, you can
specify lists values, or lists of single entry key-value maps, as you
would in a YAML... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L1079-L1198 | train | Execute a single state function | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/datadog_api.py | _initialize_connection | def _initialize_connection(api_key, app_key):
'''
Initialize Datadog connection
'''
if api_key is None:
raise SaltInvocationError('api_key must be specified')
if app_key is None:
raise SaltInvocationError('app_key must be specified')
options = {
'api_key': api_key,
... | python | def _initialize_connection(api_key, app_key):
'''
Initialize Datadog connection
'''
if api_key is None:
raise SaltInvocationError('api_key must be specified')
if app_key is None:
raise SaltInvocationError('app_key must be specified')
options = {
'api_key': api_key,
... | [
"def",
"_initialize_connection",
"(",
"api_key",
",",
"app_key",
")",
":",
"if",
"api_key",
"is",
"None",
":",
"raise",
"SaltInvocationError",
"(",
"'api_key must be specified'",
")",
"if",
"app_key",
"is",
"None",
":",
"raise",
"SaltInvocationError",
"(",
"'app_k... | Initialize Datadog connection | [
"Initialize",
"Datadog",
"connection"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L41-L53 | train | Initialize Datadog 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/modules/datadog_api.py | schedule_downtime | def schedule_downtime(scope,
api_key=None,
app_key=None,
monitor_id=None,
start=None,
end=None,
message=None,
recurrence=None,
timezone=None,
... | python | def schedule_downtime(scope,
api_key=None,
app_key=None,
monitor_id=None,
start=None,
end=None,
message=None,
recurrence=None,
timezone=None,
... | [
"def",
"schedule_downtime",
"(",
"scope",
",",
"api_key",
"=",
"None",
",",
"app_key",
"=",
"None",
",",
"monitor_id",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"message",
"=",
"None",
",",
"recurrence",
"=",
"None",
",",
... | Schedule downtime for a scope of monitors.
CLI Example:
.. code-block:: bash
salt-call datadog.schedule_downtime 'host:app2' \\
stop=$(date --date='30 minutes' +%s) \\
app_key='0123456789' \\
... | [
"Schedule",
"downtime",
"for",
"a",
"scope",
"of",
"monitors",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L56-L120 | train | Schedule a downtime for a specific scope of monitors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/datadog_api.py | cancel_downtime | def cancel_downtime(api_key=None,
app_key=None,
scope=None,
id=None):
'''
Cancel a downtime by id or by scope.
CLI Example:
.. code-block:: bash
salt-call datadog.cancel_downtime scope='host:app01' \\
... | python | def cancel_downtime(api_key=None,
app_key=None,
scope=None,
id=None):
'''
Cancel a downtime by id or by scope.
CLI Example:
.. code-block:: bash
salt-call datadog.cancel_downtime scope='host:app01' \\
... | [
"def",
"cancel_downtime",
"(",
"api_key",
"=",
"None",
",",
"app_key",
"=",
"None",
",",
"scope",
"=",
"None",
",",
"id",
"=",
"None",
")",
":",
"if",
"api_key",
"is",
"None",
":",
"raise",
"SaltInvocationError",
"(",
"'api_key must be specified'",
")",
"i... | Cancel a downtime by id or by scope.
CLI Example:
.. code-block:: bash
salt-call datadog.cancel_downtime scope='host:app01' \\
api_key='0123456789' \\
app_key='9876543210'`
Arguments - Either scope or id is requi... | [
"Cancel",
"a",
"downtime",
"by",
"id",
"or",
"by",
"scope",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L123-L180 | train | Cancel a downtime by id or by scope. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/datadog_api.py | post_event | def post_event(api_key=None,
app_key=None,
title=None,
text=None,
date_happened=None,
priority=None,
host=None,
tags=None,
alert_type=None,
aggregation_key=None,
source_t... | python | def post_event(api_key=None,
app_key=None,
title=None,
text=None,
date_happened=None,
priority=None,
host=None,
tags=None,
alert_type=None,
aggregation_key=None,
source_t... | [
"def",
"post_event",
"(",
"api_key",
"=",
"None",
",",
"app_key",
"=",
"None",
",",
"title",
"=",
"None",
",",
"text",
"=",
"None",
",",
"date_happened",
"=",
"None",
",",
"priority",
"=",
"None",
",",
"host",
"=",
"None",
",",
"tags",
"=",
"None",
... | Post an event to the Datadog stream.
CLI Example
.. code-block:: bash
salt-call datadog.post_event api_key='0123456789' \\
app_key='9876543210' \\
title='Salt Highstate' \\
text="Salt highst... | [
"Post",
"an",
"event",
"to",
"the",
"Datadog",
"stream",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L183-L264 | train | Post an event to the Datadog stream. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/xbpspkg.py | _get_version | def _get_version():
'''
Get the xbps version
'''
version_string = __salt__['cmd.run'](
[_check_xbps(), '--version'],
output_loglevel='trace')
if version_string is None:
# Dunno why it would, but...
return False
VERSION_MATCH = re.compile(r'(?:XBPS:[\s]+)([\d.]+)(... | python | def _get_version():
'''
Get the xbps version
'''
version_string = __salt__['cmd.run'](
[_check_xbps(), '--version'],
output_loglevel='trace')
if version_string is None:
# Dunno why it would, but...
return False
VERSION_MATCH = re.compile(r'(?:XBPS:[\s]+)([\d.]+)(... | [
"def",
"_get_version",
"(",
")",
":",
"version_string",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"[",
"_check_xbps",
"(",
")",
",",
"'--version'",
"]",
",",
"output_loglevel",
"=",
"'trace'",
")",
"if",
"version_string",
"is",
"None",
":",
"# Dunno why i... | Get the xbps version | [
"Get",
"the",
"xbps",
"version"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L51-L67 | train | Get the xbps version | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xbpspkg.py | list_pkgs | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | python | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# not yet implemented or not applicable",
"if",
"any",
"(",
... | List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L81-L121 | train | List the packages currently installed 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/xbpspkg.py | list_upgrades | def list_upgrades(refresh=True, **kwargs):
'''
Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
# sample output of 'xbps-install -un':
# fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298... | python | def list_upgrades(refresh=True, **kwargs):
'''
Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
# sample output of 'xbps-install -un':
# fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298... | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# sample output of 'xbps-install -un':",
"# fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298133 91688",
"# xtools-0.34_1 update noarch http://repo.voidlinux.eu/current 21424 1075... | Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades | [
"Check",
"whether",
"or",
"not",
"an",
"upgrade",
"is",
"available",
"for",
"all",
"packages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L124-L167 | train | List upgrades available for all packages in the current virtual environment | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xbpspkg.py | refresh_db | def refresh_db(**kwargs):
'''
Update list of available packages from installed repos
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag(__opts__)
cmd = 'xbps-install... | python | def refresh_db(**kwargs):
'''
Update list of available packages from installed repos
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag(__opts__)
cmd = 'xbps-install... | [
"def",
"refresh_db",
"(",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"cmd",
"=",
"'xbps-install -Sy'",
"call",
"=",
"__salt__",
... | Update list of available packages from installed repos
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | [
"Update",
"list",
"of",
"available",
"packages",
"from",
"installed",
"repos"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L263-L284 | train | Refreshes the database of available packages | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/xbpspkg.py | install | def install(name=None, refresh=False, fromrepo=None,
pkgs=None, sources=None, **kwargs):
'''
Install the passed package
name
The name of the package to be installed.
refresh
Whether or not to refresh the package database before installing.
fromrepo
Specify a pa... | python | def install(name=None, refresh=False, fromrepo=None,
pkgs=None, sources=None, **kwargs):
'''
Install the passed package
name
The name of the package to be installed.
refresh
Whether or not to refresh the package database before installing.
fromrepo
Specify a pa... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# XXX sources is not yet used in this code",
"try",
":",
"p... | Install the passed package
name
The name of the package to be installed.
refresh
Whether or not to refresh the package database before installing.
fromrepo
Specify a package repository (url) to install from.
Multiple Package Installation Options:
pkgs
A list of ... | [
"Install",
"the",
"passed",
"package"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L349-L430 | train | Install the passed package into the package 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/xbpspkg.py | remove | def remove(name=None, pkgs=None, recursive=True, **kwargs):
'''
name
The name of the package to be deleted.
recursive
Also remove dependent packages (not required elsewhere).
Default mode: enabled.
Multiple Package Options:
pkgs
A list of packages to delete. Must b... | python | def remove(name=None, pkgs=None, recursive=True, **kwargs):
'''
name
The name of the package to be deleted.
recursive
Also remove dependent packages (not required elsewhere).
Default mode: enabled.
Multiple Package Options:
pkgs
A list of packages to delete. Must b... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
",",
"pkg_type",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",... | name
The name of the package to be deleted.
recursive
Also remove dependent packages (not required elsewhere).
Default mode: enabled.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignore... | [
"name",
"The",
"name",
"of",
"the",
"package",
"to",
"be",
"deleted",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L433-L484 | train | Remove packages from the current 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/xbpspkg.py | list_repos | def list_repos(**kwargs):
'''
List all repos known by XBPS
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos = {}
out = __salt__['cmd.run']('xbps-query -L', output_loglevel='trace')
for line in out.splitlines():
repo = {}
if not line:
... | python | def list_repos(**kwargs):
'''
List all repos known by XBPS
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos = {}
out = __salt__['cmd.run']('xbps-query -L', output_loglevel='trace')
for line in out.splitlines():
repo = {}
if not line:
... | [
"def",
"list_repos",
"(",
"*",
"*",
"kwargs",
")",
":",
"repos",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'xbps-query -L'",
",",
"output_loglevel",
"=",
"'trace'",
")",
"for",
"line",
"in",
"out",
".",
"splitlines",
"(",
")",... | List all repos known by XBPS
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos | [
"List",
"all",
"repos",
"known",
"by",
"XBPS"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L487-L514 | train | List all repos known by XBPS
requester | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/xbpspkg.py | _locate_repo_files | def _locate_repo_files(repo, rewrite=False):
'''
Find what file a repo is called in.
Helper function for add_repo() and del_repo()
repo
url of the repo to locate (persistent).
rewrite
Whether to remove matching repository settings during this process.
Returns a list of absolu... | python | def _locate_repo_files(repo, rewrite=False):
'''
Find what file a repo is called in.
Helper function for add_repo() and del_repo()
repo
url of the repo to locate (persistent).
rewrite
Whether to remove matching repository settings during this process.
Returns a list of absolu... | [
"def",
"_locate_repo_files",
"(",
"repo",
",",
"rewrite",
"=",
"False",
")",
":",
"ret_val",
"=",
"[",
"]",
"files",
"=",
"[",
"]",
"conf_dirs",
"=",
"[",
"'/etc/xbps.d/'",
",",
"'/usr/share/xbps.d/'",
"]",
"name_glob",
"=",
"'*.conf'",
"# Matches a line where... | Find what file a repo is called in.
Helper function for add_repo() and del_repo()
repo
url of the repo to locate (persistent).
rewrite
Whether to remove matching repository settings during this process.
Returns a list of absolute paths. | [
"Find",
"what",
"file",
"a",
"repo",
"is",
"called",
"in",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L533-L575 | train | Find what files a repository is called in. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/xbpspkg.py | add_repo | def add_repo(repo, conffile='/usr/share/xbps.d/15-saltstack.conf'):
'''
Add an XBPS repository to the system.
repo
url of repo to add (persistent).
conffile
path to xbps conf file to add this repo
default: /usr/share/xbps.d/15-saltstack.conf
CLI Examples:
.. code-bloc... | python | def add_repo(repo, conffile='/usr/share/xbps.d/15-saltstack.conf'):
'''
Add an XBPS repository to the system.
repo
url of repo to add (persistent).
conffile
path to xbps conf file to add this repo
default: /usr/share/xbps.d/15-saltstack.conf
CLI Examples:
.. code-bloc... | [
"def",
"add_repo",
"(",
"repo",
",",
"conffile",
"=",
"'/usr/share/xbps.d/15-saltstack.conf'",
")",
":",
"if",
"not",
"_locate_repo_files",
"(",
"repo",
")",
":",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"conffile",
",",
"... | Add an XBPS repository to the system.
repo
url of repo to add (persistent).
conffile
path to xbps conf file to add this repo
default: /usr/share/xbps.d/15-saltstack.conf
CLI Examples:
.. code-block:: bash
salt '*' pkg.add_repo <repo url> [conffile=/path/to/xbps/repo.... | [
"Add",
"an",
"XBPS",
"repository",
"to",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L578-L607 | train | Add an XBPS repository to the system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xbpspkg.py | del_repo | def del_repo(repo, **kwargs):
'''
Remove an XBPS repository from the system.
repo
url of repo to remove (persistent).
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo <repo url>
'''
try:
_locate_repo_files(repo, rewrite=True)
except IOError:
r... | python | def del_repo(repo, **kwargs):
'''
Remove an XBPS repository from the system.
repo
url of repo to remove (persistent).
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo <repo url>
'''
try:
_locate_repo_files(repo, rewrite=True)
except IOError:
r... | [
"def",
"del_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"_locate_repo_files",
"(",
"repo",
",",
"rewrite",
"=",
"True",
")",
"except",
"IOError",
":",
"return",
"False",
"else",
":",
"return",
"True"
] | Remove an XBPS repository from the system.
repo
url of repo to remove (persistent).
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo <repo url> | [
"Remove",
"an",
"XBPS",
"repository",
"from",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L610-L629 | train | Remove an XBPS repository from the system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/apache_conf.py | enabled | def enabled(name):
'''
Ensure an Apache conf is enabled.
name
Name of the Apache conf
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_enabled = __salt__['apache.check_conf_enabled'](name)
if not is_enabled:
if __opts__['test']:
msg = 'A... | python | def enabled(name):
'''
Ensure an Apache conf is enabled.
name
Name of the Apache conf
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_enabled = __salt__['apache.check_conf_enabled'](name)
if not is_enabled:
if __opts__['test']:
msg = 'A... | [
"def",
"enabled",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_enabled",
"=",
"__salt__",
"[",
"'apache.check_conf_enabled'",
"]",
"(... | Ensure an Apache conf is enabled.
name
Name of the Apache conf | [
"Ensure",
"an",
"Apache",
"conf",
"is",
"enabled",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/apache_conf.py#L33-L64 | train | Ensure an Apache conf is 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/napalm_ntp.py | peers | def peers(**kwargs): # pylint: disable=unused-argument
'''
Returns a list the NTP peers configured on the network device.
:return: configured NTP peers as list.
CLI Example:
.. code-block:: bash
salt '*' ntp.peers
Example output:
.. code-block:: python
[
... | python | def peers(**kwargs): # pylint: disable=unused-argument
'''
Returns a list the NTP peers configured on the network device.
:return: configured NTP peers as list.
CLI Example:
.. code-block:: bash
salt '*' ntp.peers
Example output:
.. code-block:: python
[
... | [
"def",
"peers",
"(",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"ntp_peers",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_device",
",",
"# pylint: disable=undefined-variable",
"'get_ntp_peers'",
",",
"*",
"*",
"{",
... | Returns a list the NTP peers configured on the network device.
:return: configured NTP peers as list.
CLI Example:
.. code-block:: bash
salt '*' ntp.peers
Example output:
.. code-block:: python
[
'192.168.0.1',
'172.17.17.1',
'172.17.17.2',
... | [
"Returns",
"a",
"list",
"the",
"NTP",
"peers",
"configured",
"on",
"the",
"network",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L63-L103 | train | Return a list of NTP peers configured on the network device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/napalm_ntp.py | servers | def servers(**kwargs): # pylint: disable=unused-argument
'''
Returns a list of the configured NTP servers on the device.
CLI Example:
.. code-block:: bash
salt '*' ntp.servers
Example output:
.. code-block:: python
[
'192.168.0.1',
'172.17.17.1',
... | python | def servers(**kwargs): # pylint: disable=unused-argument
'''
Returns a list of the configured NTP servers on the device.
CLI Example:
.. code-block:: bash
salt '*' ntp.servers
Example output:
.. code-block:: python
[
'192.168.0.1',
'172.17.17.1',
... | [
"def",
"servers",
"(",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"ntp_servers",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_device",
",",
"# pylint: disable=undefined-variable",
"'get_ntp_servers'",
",",
"*",
"*",
"... | Returns a list of the configured NTP servers on the device.
CLI Example:
.. code-block:: bash
salt '*' ntp.servers
Example output:
.. code-block:: python
[
'192.168.0.1',
'172.17.17.1',
'172.17.17.2',
'2400:cb00:6:1024::c71b:840a'
... | [
"Returns",
"a",
"list",
"of",
"the",
"configured",
"NTP",
"servers",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L107-L144 | train | Return a list of the configured NTP servers on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/napalm_ntp.py | stats | def stats(peer=None, **kwargs): # pylint: disable=unused-argument
'''
Returns a dictionary containing synchronization details of the NTP peers.
:param peer: Returns only the details of a specific NTP peer.
:return: a list of dictionaries, with the following keys:
* remote
* reference... | python | def stats(peer=None, **kwargs): # pylint: disable=unused-argument
'''
Returns a dictionary containing synchronization details of the NTP peers.
:param peer: Returns only the details of a specific NTP peer.
:return: a list of dictionaries, with the following keys:
* remote
* reference... | [
"def",
"stats",
"(",
"peer",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"proxy_output",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_device",
",",
"# pylint: disable=undefined-variable",
"'get_ntp_st... | Returns a dictionary containing synchronization details of the NTP peers.
:param peer: Returns only the details of a specific NTP peer.
:return: a list of dictionaries, with the following keys:
* remote
* referenceid
* synchronized
* stratum
* type
* when
... | [
"Returns",
"a",
"dictionary",
"containing",
"synchronization",
"details",
"of",
"the",
"NTP",
"peers",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L148-L214 | train | Return a list of dictionaries containing synchronization details of the NTP peers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/napalm_ntp.py | set_peers | def set_peers(*peers, **options):
'''
Configures a list of NTP peers on the device.
:param peers: list of IP Addresses/Domain Names
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:commit commit (bool): commit loaded config. By default ... | python | def set_peers(*peers, **options):
'''
Configures a list of NTP peers on the device.
:param peers: list of IP Addresses/Domain Names
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:commit commit (bool): commit loaded config. By default ... | [
"def",
"set_peers",
"(",
"*",
"peers",
",",
"*",
"*",
"options",
")",
":",
"test",
"=",
"options",
".",
"pop",
"(",
"'test'",
",",
"False",
")",
"commit",
"=",
"options",
".",
"pop",
"(",
"'commit'",
",",
"True",
")",
"return",
"__salt__",
"[",
"'n... | Configures a list of NTP peers on the device.
:param peers: list of IP Addresses/Domain Names
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:commit commit (bool): commit loaded config. By default ``commit`` is True
(will commit the cha... | [
"Configures",
"a",
"list",
"of",
"NTP",
"peers",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L218-L249 | train | Sets the NTP peers on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/napalm_ntp.py | delete_servers | def delete_servers(*servers, **options):
'''
Removes NTP servers configured on the device.
:param servers: list of IP Addresses/Domain Names to be removed as NTP
servers
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:param com... | python | def delete_servers(*servers, **options):
'''
Removes NTP servers configured on the device.
:param servers: list of IP Addresses/Domain Names to be removed as NTP
servers
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:param com... | [
"def",
"delete_servers",
"(",
"*",
"servers",
",",
"*",
"*",
"options",
")",
":",
"test",
"=",
"options",
".",
"pop",
"(",
"'test'",
",",
"False",
")",
"commit",
"=",
"options",
".",
"pop",
"(",
"'commit'",
",",
"True",
")",
"return",
"__salt__",
"["... | Removes NTP servers configured on the device.
:param servers: list of IP Addresses/Domain Names to be removed as NTP
servers
:param test (bool): discard loaded config. By default ``test`` is False
(will not dicard the changes)
:param commit (bool): commit loaded config. By default ``commit`... | [
"Removes",
"NTP",
"servers",
"configured",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L323-L356 | train | Removes NTP servers configured on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/elasticsearch_return.py | returner | def returner(ret):
'''
Process the return from Salt
'''
job_fun = ret['fun']
job_fun_escaped = job_fun.replace('.', '_')
job_id = ret['jid']
job_retcode = ret.get('retcode', 1)
job_success = True if not job_retcode else False
options = _get_options(ret)
if job_fun in options['... | python | def returner(ret):
'''
Process the return from Salt
'''
job_fun = ret['fun']
job_fun_escaped = job_fun.replace('.', '_')
job_id = ret['jid']
job_retcode = ret.get('retcode', 1)
job_success = True if not job_retcode else False
options = _get_options(ret)
if job_fun in options['... | [
"def",
"returner",
"(",
"ret",
")",
":",
"job_fun",
"=",
"ret",
"[",
"'fun'",
"]",
"job_fun_escaped",
"=",
"job_fun",
".",
"replace",
"(",
"'.'",
",",
"'_'",
")",
"job_id",
"=",
"ret",
"[",
"'jid'",
"]",
"job_retcode",
"=",
"ret",
".",
"get",
"(",
... | Process the return from Salt | [
"Process",
"the",
"return",
"from",
"Salt"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L208-L331 | train | Process the return from Salt
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/elasticsearch_return.py | event_return | def event_return(events):
'''
Return events to Elasticsearch
Requires that the `event_return` configuration be set in master config.
'''
options = _get_options()
index = options['master_event_index']
doc_type = options['master_event_doc_type']
if options['index_date']:
index =... | python | def event_return(events):
'''
Return events to Elasticsearch
Requires that the `event_return` configuration be set in master config.
'''
options = _get_options()
index = options['master_event_index']
doc_type = options['master_event_doc_type']
if options['index_date']:
index =... | [
"def",
"event_return",
"(",
"events",
")",
":",
"options",
"=",
"_get_options",
"(",
")",
"index",
"=",
"options",
"[",
"'master_event_index'",
"]",
"doc_type",
"=",
"options",
"[",
"'master_event_doc_type'",
"]",
"if",
"options",
"[",
"'index_date'",
"]",
":"... | Return events to Elasticsearch
Requires that the `event_return` configuration be set in master config. | [
"Return",
"events",
"to",
"Elasticsearch"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L334-L360 | train | Return events to Elasticsearch | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/elasticsearch_return.py | save_load | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
.. versionadded:: 2015.8.1
'''
options = _get_options()
index = options['master_job_cache_index']
doc_type = options['master_job_cache_doc_type']
if options['index_date']:
index = '{0}-{1}'.forma... | python | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
.. versionadded:: 2015.8.1
'''
options = _get_options()
index = options['master_job_cache_index']
doc_type = options['master_job_cache_doc_type']
if options['index_date']:
index = '{0}-{1}'.forma... | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"options",
"=",
"_get_options",
"(",
")",
"index",
"=",
"options",
"[",
"'master_job_cache_index'",
"]",
"doc_type",
"=",
"options",
"[",
"'master_job_cache_doc_type'",
"]",
... | Save the load to the specified jid id
.. versionadded:: 2015.8.1 | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid",
"id"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L370-L404 | train | Save the load to the specified jid id | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/elasticsearch_return.py | get_load | def get_load(jid):
'''
Return the load data that marks a specified jid
.. versionadded:: 2015.8.1
'''
options = _get_options()
index = options['master_job_cache_index']
doc_type = options['master_job_cache_doc_type']
if options['index_date']:
index = '{0}-{1}'.format(index,
... | python | def get_load(jid):
'''
Return the load data that marks a specified jid
.. versionadded:: 2015.8.1
'''
options = _get_options()
index = options['master_job_cache_index']
doc_type = options['master_job_cache_doc_type']
if options['index_date']:
index = '{0}-{1}'.format(index,
... | [
"def",
"get_load",
"(",
"jid",
")",
":",
"options",
"=",
"_get_options",
"(",
")",
"index",
"=",
"options",
"[",
"'master_job_cache_index'",
"]",
"doc_type",
"=",
"options",
"[",
"'master_job_cache_doc_type'",
"]",
"if",
"options",
"[",
"'index_date'",
"]",
":... | Return the load data that marks a specified jid
.. versionadded:: 2015.8.1 | [
"Return",
"the",
"load",
"data",
"that",
"marks",
"a",
"specified",
"jid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L407-L428 | train | Return the load data that marks a specified 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.