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/utils/stringutils.py
camel_to_snake_case
def camel_to_snake_case(camel_input): ''' Converts camelCase (or CamelCase) to snake_case. From https://codereview.stackexchange.com/questions/185966/functions-to-convert-camelcase-strings-to-snake-case :param str camel_input: The camelcase or CamelCase string to convert to snake_case :return str ...
python
def camel_to_snake_case(camel_input): ''' Converts camelCase (or CamelCase) to snake_case. From https://codereview.stackexchange.com/questions/185966/functions-to-convert-camelcase-strings-to-snake-case :param str camel_input: The camelcase or CamelCase string to convert to snake_case :return str ...
[ "def", "camel_to_snake_case", "(", "camel_input", ")", ":", "res", "=", "camel_input", "[", "0", "]", ".", "lower", "(", ")", "for", "i", ",", "letter", "in", "enumerate", "(", "camel_input", "[", "1", ":", "]", ",", "1", ")", ":", "if", "letter", ...
Converts camelCase (or CamelCase) to snake_case. From https://codereview.stackexchange.com/questions/185966/functions-to-convert-camelcase-strings-to-snake-case :param str camel_input: The camelcase or CamelCase string to convert to snake_case :return str
[ "Converts", "camelCase", "(", "or", "CamelCase", ")", "to", "snake_case", ".", "From", "https", ":", "//", "codereview", ".", "stackexchange", ".", "com", "/", "questions", "/", "185966", "/", "functions", "-", "to", "-", "convert", "-", "camelcase", "-", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/stringutils.py#L594-L609
train
Converts a camelcase string to snake_case.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/stringutils.py
snake_to_camel_case
def snake_to_camel_case(snake_input, uppercamel=False): ''' Converts snake_case to camelCase (or CamelCase if uppercamel is ``True``). Inspired by https://codereview.stackexchange.com/questions/85311/transform-snake-case-to-camelcase :param str snake_input: The input snake_case string to convert to cam...
python
def snake_to_camel_case(snake_input, uppercamel=False): ''' Converts snake_case to camelCase (or CamelCase if uppercamel is ``True``). Inspired by https://codereview.stackexchange.com/questions/85311/transform-snake-case-to-camelcase :param str snake_input: The input snake_case string to convert to cam...
[ "def", "snake_to_camel_case", "(", "snake_input", ",", "uppercamel", "=", "False", ")", ":", "words", "=", "snake_input", ".", "split", "(", "'_'", ")", "if", "uppercamel", ":", "words", "[", "0", "]", "=", "words", "[", "0", "]", ".", "capitalize", "(...
Converts snake_case to camelCase (or CamelCase if uppercamel is ``True``). Inspired by https://codereview.stackexchange.com/questions/85311/transform-snake-case-to-camelcase :param str snake_input: The input snake_case string to convert to camelCase :param bool uppercamel: Whether or not to convert to Came...
[ "Converts", "snake_case", "to", "camelCase", "(", "or", "CamelCase", "if", "uppercamel", "is", "True", ")", ".", "Inspired", "by", "https", ":", "//", "codereview", ".", "stackexchange", ".", "com", "/", "questions", "/", "85311", "/", "transform", "-", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/stringutils.py#L613-L626
train
Converts a snake_case string to camelCase or CamelCase.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/ethtool.py
show_ring
def show_ring(devname): ''' Queries the specified network device for rx/tx ring parameter information CLI Example: .. code-block:: bash salt '*' ethtool.show_ring <devname> ''' try: ring = ethtool.get_ringparam(devname) except IOError: log.error('Ring parameters n...
python
def show_ring(devname): ''' Queries the specified network device for rx/tx ring parameter information CLI Example: .. code-block:: bash salt '*' ethtool.show_ring <devname> ''' try: ring = ethtool.get_ringparam(devname) except IOError: log.error('Ring parameters n...
[ "def", "show_ring", "(", "devname", ")", ":", "try", ":", "ring", "=", "ethtool", ".", "get_ringparam", "(", "devname", ")", "except", "IOError", ":", "log", ".", "error", "(", "'Ring parameters not supported on %s'", ",", "devname", ")", "return", "'Not suppo...
Queries the specified network device for rx/tx ring parameter information CLI Example: .. code-block:: bash salt '*' ethtool.show_ring <devname>
[ "Queries", "the", "specified", "network", "device", "for", "rx", "/", "tx", "ring", "parameter", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L85-L106
train
Queries the specified network device for rx and tx ring parameter information
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/ethtool.py
show_coalesce
def show_coalesce(devname): ''' Queries the specified network device for coalescing information CLI Example: .. code-block:: bash salt '*' ethtool.show_coalesce <devname> ''' try: coalesce = ethtool.get_coalesce(devname) except IOError: log.error('Interrupt coales...
python
def show_coalesce(devname): ''' Queries the specified network device for coalescing information CLI Example: .. code-block:: bash salt '*' ethtool.show_coalesce <devname> ''' try: coalesce = ethtool.get_coalesce(devname) except IOError: log.error('Interrupt coales...
[ "def", "show_coalesce", "(", "devname", ")", ":", "try", ":", "coalesce", "=", "ethtool", ".", "get_coalesce", "(", "devname", ")", "except", "IOError", ":", "log", ".", "error", "(", "'Interrupt coalescing not supported on %s'", ",", "devname", ")", "return", ...
Queries the specified network device for coalescing information CLI Example: .. code-block:: bash salt '*' ethtool.show_coalesce <devname>
[ "Queries", "the", "specified", "network", "device", "for", "coalescing", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L109-L130
train
Queries the specified network device for coalescing information
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/ethtool.py
show_driver
def show_driver(devname): ''' Queries the specified network device for associated driver information CLI Example: .. code-block:: bash salt '*' ethtool.show_driver <devname> ''' try: module = ethtool.get_module(devname) except IOError: log.error('Driver informatio...
python
def show_driver(devname): ''' Queries the specified network device for associated driver information CLI Example: .. code-block:: bash salt '*' ethtool.show_driver <devname> ''' try: module = ethtool.get_module(devname) except IOError: log.error('Driver informatio...
[ "def", "show_driver", "(", "devname", ")", ":", "try", ":", "module", "=", "ethtool", ".", "get_module", "(", "devname", ")", "except", "IOError", ":", "log", ".", "error", "(", "'Driver information not implemented on %s'", ",", "devname", ")", "return", "'Not...
Queries the specified network device for associated driver information CLI Example: .. code-block:: bash salt '*' ethtool.show_driver <devname>
[ "Queries", "the", "specified", "network", "device", "for", "associated", "driver", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L133-L161
train
Queries the specified network device for associated driver information
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/ethtool.py
set_ring
def set_ring(devname, **kwargs): ''' Changes the rx/tx ring parameters of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N] ''' try: ring = ethtool.get_ringparam(devname) except IOErro...
python
def set_ring(devname, **kwargs): ''' Changes the rx/tx ring parameters of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N] ''' try: ring = ethtool.get_ringparam(devname) except IOErro...
[ "def", "set_ring", "(", "devname", ",", "*", "*", "kwargs", ")", ":", "try", ":", "ring", "=", "ethtool", ".", "get_ringparam", "(", "devname", ")", "except", "IOError", ":", "log", ".", "error", "(", "'Ring parameters not supported on %s'", ",", "devname", ...
Changes the rx/tx ring parameters of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N]
[ "Changes", "the", "rx", "/", "tx", "ring", "parameters", "of", "the", "specified", "network", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L164-L196
train
Changes the rx and tx ring parameters of the specified 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/ethtool.py
set_coalesce
def set_coalesce(devname, **kwargs): ''' Changes the coalescing settings of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N] [rx_usecs_irq=N] [rx_frames_irq=N...
python
def set_coalesce(devname, **kwargs): ''' Changes the coalescing settings of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N] [rx_usecs_irq=N] [rx_frames_irq=N...
[ "def", "set_coalesce", "(", "devname", ",", "*", "*", "kwargs", ")", ":", "try", ":", "coalesce", "=", "ethtool", ".", "get_coalesce", "(", "devname", ")", "except", "IOError", ":", "log", ".", "error", "(", "'Interrupt coalescing not supported on %s'", ",", ...
Changes the coalescing settings of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N] [rx_usecs_irq=N] [rx_frames_irq=N] [tx_usecs=N] [tx_frames=N] [tx_usecs_irq=N] [tx...
[ "Changes", "the", "coalescing", "settings", "of", "the", "specified", "network", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L199-L235
train
Changes the coalescing settings of the specified 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/ethtool.py
show_offload
def show_offload(devname): ''' Queries the specified network device for the state of protocol offload and other features CLI Example: .. code-block:: bash salt '*' ethtool.show_offload <devname> ''' try: sg = ethtool.get_sg(devname) and "on" or "off" except IOError: ...
python
def show_offload(devname): ''' Queries the specified network device for the state of protocol offload and other features CLI Example: .. code-block:: bash salt '*' ethtool.show_offload <devname> ''' try: sg = ethtool.get_sg(devname) and "on" or "off" except IOError: ...
[ "def", "show_offload", "(", "devname", ")", ":", "try", ":", "sg", "=", "ethtool", ".", "get_sg", "(", "devname", ")", "and", "\"on\"", "or", "\"off\"", "except", "IOError", ":", "sg", "=", "\"not supported\"", "try", ":", "tso", "=", "ethtool", ".", "...
Queries the specified network device for the state of protocol offload and other features CLI Example: .. code-block:: bash salt '*' ethtool.show_offload <devname>
[ "Queries", "the", "specified", "network", "device", "for", "the", "state", "of", "protocol", "offload", "and", "other", "features" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L238-L276
train
Queries the specified network device for the state of protocol offload and other features of protocol offload
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/ethtool.py
set_offload
def set_offload(devname, **kwargs): ''' Changes the offload parameters and other features of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on ''' for param, value in kwargs.items(): if param == '...
python
def set_offload(devname, **kwargs): ''' Changes the offload parameters and other features of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on ''' for param, value in kwargs.items(): if param == '...
[ "def", "set_offload", "(", "devname", ",", "*", "*", "kwargs", ")", ":", "for", "param", ",", "value", "in", "kwargs", ".", "items", "(", ")", ":", "if", "param", "==", "'tcp_segmentation_offload'", ":", "value", "=", "value", "==", "\"on\"", "and", "1...
Changes the offload parameters and other features of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on
[ "Changes", "the", "offload", "parameters", "and", "other", "features", "of", "the", "specified", "network", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ethtool.py#L279-L298
train
Changes the offload parameters and other features of the specified 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/tls.py
_microtime
def _microtime(): ''' Return a Unix timestamp as a string of digits :return: ''' val1, val2 = math.modf(time.time()) val2 = int(val2) return '{0:f}{1}'.format(val1, val2)
python
def _microtime(): ''' Return a Unix timestamp as a string of digits :return: ''' val1, val2 = math.modf(time.time()) val2 = int(val2) return '{0:f}{1}'.format(val1, val2)
[ "def", "_microtime", "(", ")", ":", "val1", ",", "val2", "=", "math", ".", "modf", "(", "time", ".", "time", "(", ")", ")", "val2", "=", "int", "(", "val2", ")", "return", "'{0:f}{1}'", ".", "format", "(", "val1", ",", "val2", ")" ]
Return a Unix timestamp as a string of digits :return:
[ "Return", "a", "Unix", "timestamp", "as", "a", "string", "of", "digits", ":", "return", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L164-L171
train
Return a Unix timestamp as a string of digits
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
cert_base_path
def cert_base_path(cacert_path=None): ''' Return the base path for certs from CLI or from options cacert_path absolute path to ca certificates root directory CLI Example: .. code-block:: bash salt '*' tls.cert_base_path ''' if not cacert_path: cacert_path = __cont...
python
def cert_base_path(cacert_path=None): ''' Return the base path for certs from CLI or from options cacert_path absolute path to ca certificates root directory CLI Example: .. code-block:: bash salt '*' tls.cert_base_path ''' if not cacert_path: cacert_path = __cont...
[ "def", "cert_base_path", "(", "cacert_path", "=", "None", ")", ":", "if", "not", "cacert_path", ":", "cacert_path", "=", "__context__", ".", "get", "(", "'ca.contextual_cert_base_path'", ",", "__salt__", "[", "'config.option'", "]", "(", "'ca.contextual_cert_base_pa...
Return the base path for certs from CLI or from options cacert_path absolute path to ca certificates root directory CLI Example: .. code-block:: bash salt '*' tls.cert_base_path
[ "Return", "the", "base", "path", "for", "certs", "from", "CLI", "or", "from", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L174-L195
train
Return the base path for certs from CLI or from options cacert_base_path CLI Example
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/tls.py
_new_serial
def _new_serial(ca_name): ''' Return a serial number in hex using os.urandom() and a Unix timestamp in microseconds. ca_name name of the CA CN common name in the request ''' hashnum = int( binascii.hexlify( b'_'.join(( salt.utils.stringuti...
python
def _new_serial(ca_name): ''' Return a serial number in hex using os.urandom() and a Unix timestamp in microseconds. ca_name name of the CA CN common name in the request ''' hashnum = int( binascii.hexlify( b'_'.join(( salt.utils.stringuti...
[ "def", "_new_serial", "(", "ca_name", ")", ":", "hashnum", "=", "int", "(", "binascii", ".", "hexlify", "(", "b'_'", ".", "join", "(", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "_microtime", "(", ")", ")", ",", "os", ".", ...
Return a serial number in hex using os.urandom() and a Unix timestamp in microseconds. ca_name name of the CA CN common name in the request
[ "Return", "a", "serial", "number", "in", "hex", "using", "os", ".", "urandom", "()", "and", "a", "Unix", "timestamp", "in", "microseconds", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L221-L255
train
Return a new serial number in hex using os. urandom and a Unix timestamp in microseconds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
_get_basic_info
def _get_basic_info(ca_name, cert, ca_dir=None): ''' Get basic info to write out to the index.txt ''' if ca_dir is None: ca_dir = '{0}/{1}'.format(_cert_base_path(), ca_name) index_file = "{0}/index.txt".format(ca_dir) cert = _read_cert(cert) expire_date = _four_digit_year_to_two_d...
python
def _get_basic_info(ca_name, cert, ca_dir=None): ''' Get basic info to write out to the index.txt ''' if ca_dir is None: ca_dir = '{0}/{1}'.format(_cert_base_path(), ca_name) index_file = "{0}/index.txt".format(ca_dir) cert = _read_cert(cert) expire_date = _four_digit_year_to_two_d...
[ "def", "_get_basic_info", "(", "ca_name", ",", "cert", ",", "ca_dir", "=", "None", ")", ":", "if", "ca_dir", "is", "None", ":", "ca_dir", "=", "'{0}/{1}'", ".", "format", "(", "_cert_base_path", "(", ")", ",", "ca_name", ")", "index_file", "=", "\"{0}/in...
Get basic info to write out to the index.txt
[ "Get", "basic", "info", "to", "write", "out", "to", "the", "index", ".", "txt" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L262-L286
train
Get basic info to write out to the index. txt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
maybe_fix_ssl_version
def maybe_fix_ssl_version(ca_name, cacert_path=None, ca_filename=None): ''' Check that the X509 version is correct (was incorrectly set in previous salt versions). This will fix the version if needed. ca_name ca authority name cacert_path absolute path to ca certificates root di...
python
def maybe_fix_ssl_version(ca_name, cacert_path=None, ca_filename=None): ''' Check that the X509 version is correct (was incorrectly set in previous salt versions). This will fix the version if needed. ca_name ca authority name cacert_path absolute path to ca certificates root di...
[ "def", "maybe_fix_ssl_version", "(", "ca_name", ",", "cacert_path", "=", "None", ",", "ca_filename", "=", "None", ")", ":", "set_ca_path", "(", "cacert_path", ")", "if", "not", "ca_filename", ":", "ca_filename", "=", "'{0}_ca_cert'", ".", "format", "(", "ca_na...
Check that the X509 version is correct (was incorrectly set in previous salt versions). This will fix the version if needed. ca_name ca authority name cacert_path absolute path to ca certificates root directory ca_filename alternative filename for the CA .. versiona...
[ "Check", "that", "the", "X509", "version", "is", "correct", "(", "was", "incorrectly", "set", "in", "previous", "salt", "versions", ")", ".", "This", "will", "fix", "the", "version", "if", "needed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L317-L382
train
Check that the X509 version of the SSL certificate is correct and if needed create the CA and the CA s certificates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
ca_exists
def ca_exists(ca_name, cacert_path=None, ca_filename=None): ''' Verify whether a Certificate Authority (CA) already exists ca_name name of the CA cacert_path absolute path to ca certificates root directory ca_filename alternative filename for the CA .. versionadded:...
python
def ca_exists(ca_name, cacert_path=None, ca_filename=None): ''' Verify whether a Certificate Authority (CA) already exists ca_name name of the CA cacert_path absolute path to ca certificates root directory ca_filename alternative filename for the CA .. versionadded:...
[ "def", "ca_exists", "(", "ca_name", ",", "cacert_path", "=", "None", ",", "ca_filename", "=", "None", ")", ":", "set_ca_path", "(", "cacert_path", ")", "if", "not", "ca_filename", ":", "ca_filename", "=", "'{0}_ca_cert'", ".", "format", "(", "ca_name", ")", ...
Verify whether a Certificate Authority (CA) already exists ca_name name of the CA cacert_path absolute path to ca certificates root directory ca_filename alternative filename for the CA .. versionadded:: 2015.5.3 CLI Example: .. code-block:: bash salt '*...
[ "Verify", "whether", "a", "Certificate", "Authority", "(", "CA", ")", "already", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L385-L417
train
Verify whether a certificate authority ( CA ) already exists.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/tls.py
get_ca
def get_ca(ca_name, as_text=False, cacert_path=None): ''' Get the certificate path or content ca_name name of the CA as_text if true, return the certificate content instead of the path cacert_path absolute path to ca certificates root directory CLI Example: .. code...
python
def get_ca(ca_name, as_text=False, cacert_path=None): ''' Get the certificate path or content ca_name name of the CA as_text if true, return the certificate content instead of the path cacert_path absolute path to ca certificates root directory CLI Example: .. code...
[ "def", "get_ca", "(", "ca_name", ",", "as_text", "=", "False", ",", "cacert_path", "=", "None", ")", ":", "set_ca_path", "(", "cacert_path", ")", "certp", "=", "'{0}/{1}/{1}_ca_cert.crt'", ".", "format", "(", "cert_base_path", "(", ")", ",", "ca_name", ")", ...
Get the certificate path or content ca_name name of the CA as_text if true, return the certificate content instead of the path cacert_path absolute path to ca certificates root directory CLI Example: .. code-block:: bash salt '*' tls.get_ca test_ca as_text=False c...
[ "Get", "the", "certificate", "path", "or", "content" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L425-L450
train
Get the certificate path or content of a CA
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
get_ca_signed_key
def get_ca_signed_key(ca_name, CN='localhost', as_text=False, cacert_path=None, key_filename=None): ''' Get the certificate path or content ca_name name of the CA CN common name of the certificate ...
python
def get_ca_signed_key(ca_name, CN='localhost', as_text=False, cacert_path=None, key_filename=None): ''' Get the certificate path or content ca_name name of the CA CN common name of the certificate ...
[ "def", "get_ca_signed_key", "(", "ca_name", ",", "CN", "=", "'localhost'", ",", "as_text", "=", "False", ",", "cacert_path", "=", "None", ",", "key_filename", "=", "None", ")", ":", "set_ca_path", "(", "cacert_path", ")", "if", "not", "key_filename", ":", ...
Get the certificate path or content ca_name name of the CA CN common name of the certificate as_text if true, return the certificate content instead of the path cacert_path absolute path to certificates root directory key_filename alternative filename for the...
[ "Get", "the", "certificate", "path", "or", "content" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L498-L544
train
Get the certificate path or content of a CA signed 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/tls.py
validate
def validate(cert, ca_name, crl_file): ''' .. versionadded:: Neon Validate a certificate against a given CA/CRL. cert path to the certifiate PEM file or string ca_name name of the CA crl_file full path to the CRL file ''' store = OpenSSL.crypto.X509Store() ...
python
def validate(cert, ca_name, crl_file): ''' .. versionadded:: Neon Validate a certificate against a given CA/CRL. cert path to the certifiate PEM file or string ca_name name of the CA crl_file full path to the CRL file ''' store = OpenSSL.crypto.X509Store() ...
[ "def", "validate", "(", "cert", ",", "ca_name", ",", "crl_file", ")", ":", "store", "=", "OpenSSL", ".", "crypto", ".", "X509Store", "(", ")", "cert_obj", "=", "_read_cert", "(", "cert", ")", "if", "cert_obj", "is", "None", ":", "raise", "CommandExecutio...
.. versionadded:: Neon Validate a certificate against a given CA/CRL. cert path to the certifiate PEM file or string ca_name name of the CA crl_file full path to the CRL file
[ "..", "versionadded", "::", "Neon" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L566-L609
train
Validate a certificate against a CA and CRL.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
_get_expiration_date
def _get_expiration_date(cert): ''' Returns a datetime.datetime object ''' cert_obj = _read_cert(cert) if cert_obj is None: raise CommandExecutionError( 'Failed to read cert from {0}, see log for details'.format(cert) ) return datetime.strptime( salt.utils.s...
python
def _get_expiration_date(cert): ''' Returns a datetime.datetime object ''' cert_obj = _read_cert(cert) if cert_obj is None: raise CommandExecutionError( 'Failed to read cert from {0}, see log for details'.format(cert) ) return datetime.strptime( salt.utils.s...
[ "def", "_get_expiration_date", "(", "cert", ")", ":", "cert_obj", "=", "_read_cert", "(", "cert", ")", "if", "cert_obj", "is", "None", ":", "raise", "CommandExecutionError", "(", "'Failed to read cert from {0}, see log for details'", ".", "format", "(", "cert", ")",...
Returns a datetime.datetime object
[ "Returns", "a", "datetime", ".", "datetime", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L612-L626
train
Returns a datetime. datetime object containing the expiration date of the certificate.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
create_ca
def create_ca(ca_name, bits=2048, days=365, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='SaltStack', OU=None, emailAddress=None, fixmode=False, cacert_pa...
python
def create_ca(ca_name, bits=2048, days=365, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='SaltStack', OU=None, emailAddress=None, fixmode=False, cacert_pa...
[ "def", "create_ca", "(", "ca_name", ",", "bits", "=", "2048", ",", "days", "=", "365", ",", "CN", "=", "'localhost'", ",", "C", "=", "'US'", ",", "ST", "=", "'Utah'", ",", "L", "=", "'Salt Lake City'", ",", "O", "=", "'SaltStack'", ",", "OU", "=", ...
Create a Certificate Authority (CA) ca_name name of the CA bits number of RSA key bits, default is 2048 days number of days the CA will be valid, default is 365 CN common name in the request, default is "localhost" C country, default is "US" ST st...
[ "Create", "a", "Certificate", "Authority", "(", "CA", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L675-L870
train
Create a new CA certificate and associated 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/tls.py
get_extensions
def get_extensions(cert_type): ''' Fetch X509 and CSR extension definitions from tls:extensions: (common|server|client) or set them to standard defaults. .. versionadded:: 2015.8.0 cert_type: The type of certificate such as ``server`` or ``client``. CLI Example: .. code-block:: b...
python
def get_extensions(cert_type): ''' Fetch X509 and CSR extension definitions from tls:extensions: (common|server|client) or set them to standard defaults. .. versionadded:: 2015.8.0 cert_type: The type of certificate such as ``server`` or ``client``. CLI Example: .. code-block:: b...
[ "def", "get_extensions", "(", "cert_type", ")", ":", "assert", "X509_EXT_ENABLED", ",", "(", "'X509 extensions are not supported in '", "'pyOpenSSL prior to version 0.15.1. Your '", "'version: {0}'", ".", "format", "(", "OpenSSL_version", ")", ")", "ext", "=", "{", "}", ...
Fetch X509 and CSR extension definitions from tls:extensions: (common|server|client) or set them to standard defaults. .. versionadded:: 2015.8.0 cert_type: The type of certificate such as ``server`` or ``client``. CLI Example: .. code-block:: bash salt '*' tls.get_extensions cl...
[ "Fetch", "X509", "and", "CSR", "extension", "definitions", "from", "tls", ":", "extensions", ":", "(", "common|server|client", ")", "or", "set", "them", "to", "standard", "defaults", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L873-L961
train
Return a list of X509 extensions for the specified type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/tls.py
create_csr
def create_csr(ca_name, bits=2048, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='SaltStack', OU=None, emailAddress=None, subjectAltName=None, cacert_path=None...
python
def create_csr(ca_name, bits=2048, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='SaltStack', OU=None, emailAddress=None, subjectAltName=None, cacert_path=None...
[ "def", "create_csr", "(", "ca_name", ",", "bits", "=", "2048", ",", "CN", "=", "'localhost'", ",", "C", "=", "'US'", ",", "ST", "=", "'Utah'", ",", "L", "=", "'Salt Lake City'", ",", "O", "=", "'SaltStack'", ",", "OU", "=", "None", ",", "emailAddress...
Create a Certificate Signing Request (CSR) for a particular Certificate Authority (CA) ca_name name of the CA bits number of RSA key bits, default is 2048 CN common name in the request, default is "localhost" C country, default is "US" ST state, default i...
[ "Create", "a", "Certificate", "Signing", "Request", "(", "CSR", ")", "for", "a", "particular", "Certificate", "Authority", "(", "CA", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L964-L1193
train
Create a CSR for a particular CA certificate Authority 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/modules/tls.py
create_self_signed_cert
def create_self_signed_cert(tls_dir='tls', bits=2048, days=365, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='Sa...
python
def create_self_signed_cert(tls_dir='tls', bits=2048, days=365, CN='localhost', C='US', ST='Utah', L='Salt Lake City', O='Sa...
[ "def", "create_self_signed_cert", "(", "tls_dir", "=", "'tls'", ",", "bits", "=", "2048", ",", "days", "=", "365", ",", "CN", "=", "'localhost'", ",", "C", "=", "'US'", ",", "ST", "=", "'Utah'", ",", "L", "=", "'Salt Lake City'", ",", "O", "=", "'Sal...
Create a Self-Signed Certificate (CERT) tls_dir location appended to the ca.cert_base_path, default is 'tls' bits number of RSA key bits, default is 2048 CN common name in the request, default is "localhost" C country, default is "US" ST state, default is "Ut...
[ "Create", "a", "Self", "-", "Signed", "Certificate", "(", "CERT", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1196-L1348
train
Create a self - signed certificate.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
create_ca_signed_cert
def create_ca_signed_cert(ca_name, CN, days=365, cacert_path=None, ca_filename=None, cert_path=None, cert_filename=None, digest='sha256', ...
python
def create_ca_signed_cert(ca_name, CN, days=365, cacert_path=None, ca_filename=None, cert_path=None, cert_filename=None, digest='sha256', ...
[ "def", "create_ca_signed_cert", "(", "ca_name", ",", "CN", ",", "days", "=", "365", ",", "cacert_path", "=", "None", ",", "ca_filename", "=", "None", ",", "cert_path", "=", "None", ",", "cert_filename", "=", "None", ",", "digest", "=", "'sha256'", ",", "...
Create a Certificate (CERT) signed by a named Certificate Authority (CA) If the certificate file already exists, the function just returns assuming the CERT already exists. The CN *must* match an existing CSR generated by create_csr. If it does not, this method does nothing. ca_name name ...
[ "Create", "a", "Certificate", "(", "CERT", ")", "signed", "by", "a", "named", "Certificate", "Authority", "(", "CA", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1351-L1579
train
Create a new CA signed certificate.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
create_pkcs12
def create_pkcs12(ca_name, CN, passphrase='', cacert_path=None, replace=False): ''' Create a PKCS#12 browser certificate for a particular Certificate (CN) ca_name name of the CA CN common name matching the certificate signing request passphrase used to unlock the PKCS#12 cer...
python
def create_pkcs12(ca_name, CN, passphrase='', cacert_path=None, replace=False): ''' Create a PKCS#12 browser certificate for a particular Certificate (CN) ca_name name of the CA CN common name matching the certificate signing request passphrase used to unlock the PKCS#12 cer...
[ "def", "create_pkcs12", "(", "ca_name", ",", "CN", ",", "passphrase", "=", "''", ",", "cacert_path", "=", "None", ",", "replace", "=", "False", ")", ":", "set_ca_path", "(", "cacert_path", ")", "if", "not", "replace", "and", "os", ".", "path", ".", "ex...
Create a PKCS#12 browser certificate for a particular Certificate (CN) ca_name name of the CA CN common name matching the certificate signing request passphrase used to unlock the PKCS#12 certificate when loaded into the browser cacert_path absolute path to ca certificat...
[ "Create", "a", "PKCS#12", "browser", "certificate", "for", "a", "particular", "Certificate", "(", "CN", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1582-L1673
train
Create a PKCS#12 browser certificate for a particular CA and CN.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
cert_info
def cert_info(cert, digest='sha256'): ''' Return information for a particular certificate cert path to the certifiate PEM file or string .. versionchanged:: 2018.3.4 digest what digest to use for fingerprinting CLI Example: .. code-block:: bash salt '*' tls....
python
def cert_info(cert, digest='sha256'): ''' Return information for a particular certificate cert path to the certifiate PEM file or string .. versionchanged:: 2018.3.4 digest what digest to use for fingerprinting CLI Example: .. code-block:: bash salt '*' tls....
[ "def", "cert_info", "(", "cert", ",", "digest", "=", "'sha256'", ")", ":", "# format that OpenSSL returns dates in", "date_fmt", "=", "'%Y%m%d%H%M%SZ'", "if", "'-----BEGIN'", "not", "in", "cert", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "...
Return information for a particular certificate cert path to the certifiate PEM file or string .. versionchanged:: 2018.3.4 digest what digest to use for fingerprinting CLI Example: .. code-block:: bash salt '*' tls.cert_info /dir/for/certs/cert.pem
[ "Return", "information", "for", "a", "particular", "certificate" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1676-L1770
train
Return information for a particular certificate
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
create_empty_crl
def create_empty_crl( ca_name, cacert_path=None, ca_filename=None, crl_file=None, digest='sha256'): ''' Create an empty Certificate Revocation List. .. versionadded:: 2015.8.0 ca_name name of the CA cacert_path absolute path to ca certificate...
python
def create_empty_crl( ca_name, cacert_path=None, ca_filename=None, crl_file=None, digest='sha256'): ''' Create an empty Certificate Revocation List. .. versionadded:: 2015.8.0 ca_name name of the CA cacert_path absolute path to ca certificate...
[ "def", "create_empty_crl", "(", "ca_name", ",", "cacert_path", "=", "None", ",", "ca_filename", "=", "None", ",", "crl_file", "=", "None", ",", "digest", "=", "'sha256'", ")", ":", "set_ca_path", "(", "cacert_path", ")", "if", "not", "ca_filename", ":", "c...
Create an empty Certificate Revocation List. .. versionadded:: 2015.8.0 ca_name name of the CA cacert_path absolute path to ca certificates root directory ca_filename alternative filename for the CA .. versionadded:: 2015.5.3 crl_file full path to the CRL ...
[ "Create", "an", "empty", "Certificate", "Revocation", "List", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1773-L1854
train
Create an empty Certificate Revocation List for a given CA.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/tls.py
revoke_cert
def revoke_cert( ca_name, CN, cacert_path=None, ca_filename=None, cert_path=None, cert_filename=None, crl_file=None, digest='sha256', ): ''' Revoke a certificate. .. versionadded:: 2015.8.0 ca_name Name of the CA. CN ...
python
def revoke_cert( ca_name, CN, cacert_path=None, ca_filename=None, cert_path=None, cert_filename=None, crl_file=None, digest='sha256', ): ''' Revoke a certificate. .. versionadded:: 2015.8.0 ca_name Name of the CA. CN ...
[ "def", "revoke_cert", "(", "ca_name", ",", "CN", ",", "cacert_path", "=", "None", ",", "ca_filename", "=", "None", ",", "cert_path", "=", "None", ",", "cert_filename", "=", "None", ",", "crl_file", "=", "None", ",", "digest", "=", "'sha256'", ",", ")", ...
Revoke a certificate. .. versionadded:: 2015.8.0 ca_name Name of the CA. CN Common name matching the certificate signing request. cacert_path Absolute path to ca certificates root directory. ca_filename Alternative filename for the CA. cert_path Path...
[ "Revoke", "a", "certificate", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tls.py#L1857-L2035
train
This function is used to revoke a certificate from the CA.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
_convert_range_to_list
def _convert_range_to_list(tgt, range_server): ''' convert a seco.range range into a list target ''' r = seco.range.Range(range_server) try: return r.expand(tgt) except seco.range.RangeException as err: log.error('Range server exception: %s', err) return []
python
def _convert_range_to_list(tgt, range_server): ''' convert a seco.range range into a list target ''' r = seco.range.Range(range_server) try: return r.expand(tgt) except seco.range.RangeException as err: log.error('Range server exception: %s', err) return []
[ "def", "_convert_range_to_list", "(", "tgt", ",", "range_server", ")", ":", "r", "=", "seco", ".", "range", ".", "Range", "(", "range_server", ")", "try", ":", "return", "r", ".", "expand", "(", "tgt", ")", "except", "seco", ".", "range", ".", "RangeEx...
convert a seco.range range into a list target
[ "convert", "a", "seco", ".", "range", "range", "into", "a", "list", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L133-L142
train
convert a seco. range into a list target
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher._ret_minions
def _ret_minions(self, filter_): ''' Filter minions by a generic filter. ''' minions = {} for minion in filter_(self.raw): data = self.get_data(minion) if data: minions[minion] = data.copy() return minions
python
def _ret_minions(self, filter_): ''' Filter minions by a generic filter. ''' minions = {} for minion in filter_(self.raw): data = self.get_data(minion) if data: minions[minion] = data.copy() return minions
[ "def", "_ret_minions", "(", "self", ",", "filter_", ")", ":", "minions", "=", "{", "}", "for", "minion", "in", "filter_", "(", "self", ".", "raw", ")", ":", "data", "=", "self", ".", "get_data", "(", "minion", ")", "if", "data", ":", "minions", "["...
Filter minions by a generic filter.
[ "Filter", "minions", "by", "a", "generic", "filter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L66-L75
train
Return a list of minions that match the filter
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.ret_glob_minions
def ret_glob_minions(self): ''' Return minions that match via glob ''' fnfilter = functools.partial(fnmatch.filter, pat=self.tgt) return self._ret_minions(fnfilter)
python
def ret_glob_minions(self): ''' Return minions that match via glob ''' fnfilter = functools.partial(fnmatch.filter, pat=self.tgt) return self._ret_minions(fnfilter)
[ "def", "ret_glob_minions", "(", "self", ")", ":", "fnfilter", "=", "functools", ".", "partial", "(", "fnmatch", ".", "filter", ",", "pat", "=", "self", ".", "tgt", ")", "return", "self", ".", "_ret_minions", "(", "fnfilter", ")" ]
Return minions that match via glob
[ "Return", "minions", "that", "match", "via", "glob" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L77-L82
train
Return minions that match via glob
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.ret_pcre_minions
def ret_pcre_minions(self): ''' Return minions that match via pcre ''' tgt = re.compile(self.tgt) refilter = functools.partial(filter, tgt.match) return self._ret_minions(refilter)
python
def ret_pcre_minions(self): ''' Return minions that match via pcre ''' tgt = re.compile(self.tgt) refilter = functools.partial(filter, tgt.match) return self._ret_minions(refilter)
[ "def", "ret_pcre_minions", "(", "self", ")", ":", "tgt", "=", "re", ".", "compile", "(", "self", ".", "tgt", ")", "refilter", "=", "functools", ".", "partial", "(", "filter", ",", "tgt", ".", "match", ")", "return", "self", ".", "_ret_minions", "(", ...
Return minions that match via pcre
[ "Return", "minions", "that", "match", "via", "pcre" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L84-L90
train
Return minions that match via pcre
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.ret_list_minions
def ret_list_minions(self): ''' Return minions that match via list ''' tgt = _tgt_set(self.tgt) return self._ret_minions(tgt.intersection)
python
def ret_list_minions(self): ''' Return minions that match via list ''' tgt = _tgt_set(self.tgt) return self._ret_minions(tgt.intersection)
[ "def", "ret_list_minions", "(", "self", ")", ":", "tgt", "=", "_tgt_set", "(", "self", ".", "tgt", ")", "return", "self", ".", "_ret_minions", "(", "tgt", ".", "intersection", ")" ]
Return minions that match via list
[ "Return", "minions", "that", "match", "via", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L92-L97
train
Return minions that match via list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.ret_nodegroup_minions
def ret_nodegroup_minions(self): ''' Return minions which match the special list-only groups defined by ssh_list_nodegroups ''' nodegroup = __opts__.get('ssh_list_nodegroups', {}).get(self.tgt, []) nodegroup = _tgt_set(nodegroup) return self._ret_minions(nodegroup...
python
def ret_nodegroup_minions(self): ''' Return minions which match the special list-only groups defined by ssh_list_nodegroups ''' nodegroup = __opts__.get('ssh_list_nodegroups', {}).get(self.tgt, []) nodegroup = _tgt_set(nodegroup) return self._ret_minions(nodegroup...
[ "def", "ret_nodegroup_minions", "(", "self", ")", ":", "nodegroup", "=", "__opts__", ".", "get", "(", "'ssh_list_nodegroups'", ",", "{", "}", ")", ".", "get", "(", "self", ".", "tgt", ",", "[", "]", ")", "nodegroup", "=", "_tgt_set", "(", "nodegroup", ...
Return minions which match the special list-only groups defined by ssh_list_nodegroups
[ "Return", "minions", "which", "match", "the", "special", "list", "-", "only", "groups", "defined", "by", "ssh_list_nodegroups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L99-L106
train
Return minions which match the special list - only groups defined by the specified nodegroup
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.ret_range_minions
def ret_range_minions(self): ''' Return minions that are returned by a range query ''' if HAS_RANGE is False: raise RuntimeError("Python lib 'seco.range' is not available") minions = {} range_hosts = _convert_range_to_list(self.tgt, __opts__['range_server']) ...
python
def ret_range_minions(self): ''' Return minions that are returned by a range query ''' if HAS_RANGE is False: raise RuntimeError("Python lib 'seco.range' is not available") minions = {} range_hosts = _convert_range_to_list(self.tgt, __opts__['range_server']) ...
[ "def", "ret_range_minions", "(", "self", ")", ":", "if", "HAS_RANGE", "is", "False", ":", "raise", "RuntimeError", "(", "\"Python lib 'seco.range' is not available\"", ")", "minions", "=", "{", "}", "range_hosts", "=", "_convert_range_to_list", "(", "self", ".", "...
Return minions that are returned by a range query
[ "Return", "minions", "that", "are", "returned", "by", "a", "range", "query" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L108-L117
train
Return minions that are returned by a range query
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/roster_matcher.py
RosterMatcher.get_data
def get_data(self, minion): ''' Return the configured ip ''' ret = copy.deepcopy(__opts__.get('roster_defaults', {})) if isinstance(self.raw[minion], six.string_types): ret.update({'host': self.raw[minion]}) return ret elif isinstance(self.raw[mini...
python
def get_data(self, minion): ''' Return the configured ip ''' ret = copy.deepcopy(__opts__.get('roster_defaults', {})) if isinstance(self.raw[minion], six.string_types): ret.update({'host': self.raw[minion]}) return ret elif isinstance(self.raw[mini...
[ "def", "get_data", "(", "self", ",", "minion", ")", ":", "ret", "=", "copy", ".", "deepcopy", "(", "__opts__", ".", "get", "(", "'roster_defaults'", ",", "{", "}", ")", ")", "if", "isinstance", "(", "self", ".", "raw", "[", "minion", "]", ",", "six...
Return the configured ip
[ "Return", "the", "configured", "ip" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/roster_matcher.py#L119-L130
train
Return the configured ip
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/output/raw.py
output
def output(data, **kwargs): # pylint: disable=unused-argument ''' Rather basic.... ''' if not isinstance(data, six.string_types): data = six.text_type(data) return salt.utils.stringutils.to_unicode(data)
python
def output(data, **kwargs): # pylint: disable=unused-argument ''' Rather basic.... ''' if not isinstance(data, six.string_types): data = six.text_type(data) return salt.utils.stringutils.to_unicode(data)
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "if", "not", "isinstance", "(", "data", ",", "six", ".", "string_types", ")", ":", "data", "=", "six", ".", "text_type", "(", "data", ")", "return", "sa...
Rather basic....
[ "Rather", "basic", "...." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/raw.py#L29-L35
train
Return the data as a unicode string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
avail_images
def avail_images(call=None): ''' Return a list of the images that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) items = query(act...
python
def avail_images(call=None): ''' Return a list of the images that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) items = query(act...
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "items", "=", "query", "("...
Return a list of the images that are on the provider
[ "Return", "a", "list", "of", "the", "images", "that", "are", "on", "the", "provider" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L84-L99
train
Return a list of the images that are on the provider
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
list_nodes
def list_nodes(call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} items = query(action='ve') for item in items: ...
python
def list_nodes(call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} items = query(action='ve') for item in items: ...
[ "def", "list_nodes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "items", "=", "query", "(", "action", ...
Return a list of the VMs that are on the provider
[ "Return", "a", "list", "of", "the", "VMs", "that", "are", "on", "the", "provider" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L102-L128
train
Return a list of the VMs that are on the provider
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
create_node
def create_node(vm_): ''' Build and submit the XML to create a node ''' # Start the tree content = ET.Element('ve') # Name of the instance name = ET.SubElement(content, 'name') name.text = vm_['name'] # Description, defaults to name desc = ET.SubElement(content, 'description') ...
python
def create_node(vm_): ''' Build and submit the XML to create a node ''' # Start the tree content = ET.Element('ve') # Name of the instance name = ET.SubElement(content, 'name') name.text = vm_['name'] # Description, defaults to name desc = ET.SubElement(content, 'description') ...
[ "def", "create_node", "(", "vm_", ")", ":", "# Start the tree", "content", "=", "ET", ".", "Element", "(", "'ve'", ")", "# Name of the instance", "name", "=", "ET", ".", "SubElement", "(", "content", ",", "'name'", ")", "name", ".", "text", "=", "vm_", "...
Build and submit the XML to create a node
[ "Build", "and", "submit", "the", "XML", "to", "create", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L184-L270
train
Builds and submit the XML to create a node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
create
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'par...
python
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'par...
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'paral...
Create a single VM from a data dict
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L273-L365
train
Create a single VM from a data dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
query
def query(action=None, command=None, args=None, method='GET', data=None): ''' Make a web call to a Parallels provider ''' path = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) auth_handler = _HTTPBasicAuthHandler() auth_handler.add_pa...
python
def query(action=None, command=None, args=None, method='GET', data=None): ''' Make a web call to a Parallels provider ''' path = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) auth_handler = _HTTPBasicAuthHandler() auth_handler.add_pa...
[ "def", "query", "(", "action", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "data", "=", "None", ")", ":", "path", "=", "config", ".", "get_cloud_config_value", "(", "'url'", ",", "get_configured...
Make a web call to a Parallels provider
[ "Make", "a", "web", "call", "to", "a", "Parallels", "provider" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L368-L432
train
Make a web call to a Parallels provider
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
show_image
def show_image(kwargs, call=None): ''' Show the details from Parallels concerning an image ''' if call != 'function': raise SaltCloudSystemExit( 'The show_image function must be called with -f or --function.' ) items = query(action='template', command=kwargs['image']) ...
python
def show_image(kwargs, call=None): ''' Show the details from Parallels concerning an image ''' if call != 'function': raise SaltCloudSystemExit( 'The show_image function must be called with -f or --function.' ) items = query(action='template', command=kwargs['image']) ...
[ "def", "show_image", "(", "kwargs", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_image function must be called with -f or --function.'", ")", "items", "=", "query", "(", "action", "=", "...
Show the details from Parallels concerning an image
[ "Show", "the", "details", "from", "Parallels", "concerning", "an", "image" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L449-L466
train
Show the details from Parallels concerning an image
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
show_instance
def show_instance(name, call=None): ''' Show the details from Parallels concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) items = query(action='ve', command=name) ret = {} ...
python
def show_instance(name, call=None): ''' Show the details from Parallels concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) items = query(action='ve', command=name) ret = {} ...
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "items", "=", "query", "(", "action", "=", "'v...
Show the details from Parallels concerning an instance
[ "Show", "the", "details", "from", "Parallels", "concerning", "an", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L469-L494
train
Show the details from Parallels concerning an instance
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
wait_until
def wait_until(name, state, timeout=300): ''' Wait until a specific state has been reached on a node ''' start_time = time.time() node = show_instance(name, call='action') while True: if node['state'] == state: return True time.sleep(1) if time.time() - start...
python
def wait_until(name, state, timeout=300): ''' Wait until a specific state has been reached on a node ''' start_time = time.time() node = show_instance(name, call='action') while True: if node['state'] == state: return True time.sleep(1) if time.time() - start...
[ "def", "wait_until", "(", "name", ",", "state", ",", "timeout", "=", "300", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "node", "=", "show_instance", "(", "name", ",", "call", "=", "'action'", ")", "while", "True", ":", "if", "node", ...
Wait until a specific state has been reached on a node
[ "Wait", "until", "a", "specific", "state", "has", "been", "reached", "on", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L497-L509
train
Wait until a specific state has been reached on a node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
destroy
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' )...
python
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' )...
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine
[ "Destroy", "a", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L512-L564
train
Destroy a node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/parallels.py
start
def start(name, call=None): ''' Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) data = query(action='ve',...
python
def start(name, call=None): ''' Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) data = query(action='ve',...
[ "def", "start", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "data", "=", "query", "(", "action", "=", "'ve'", ",...
Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine
[ "Start", "a", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L567-L587
train
Start a node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/telegram_return.py
returner
def returner(ret): ''' Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully. ''' _options = _get_options(ret) chat_id = _options.get('chat_id') token = _options.get('token') if not chat_id: log...
python
def returner(ret): ''' Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully. ''' _options = _get_options(ret) chat_id = _options.get('chat_id') token = _options.get('token') if not chat_id: log...
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "chat_id", "=", "_options", ".", "get", "(", "'chat_id'", ")", "token", "=", "_options", ".", "get", "(", "'token'", ")", "if", "not", "chat_id", ":", "log", "...
Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully.
[ "Send", "a", "Telegram", "message", "with", "the", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/telegram_return.py#L67-L99
train
Send a Telegram message with the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
_walk_through
def _walk_through(job_dir): ''' Walk though the jid dir and look for jobs ''' serial = salt.payload.Serial(__opts__) for top in os.listdir(job_dir): t_path = os.path.join(job_dir, top) if not os.path.exists(t_path): continue for final in os.listdir(t_path): ...
python
def _walk_through(job_dir): ''' Walk though the jid dir and look for jobs ''' serial = salt.payload.Serial(__opts__) for top in os.listdir(job_dir): t_path = os.path.join(job_dir, top) if not os.path.exists(t_path): continue for final in os.listdir(t_path): ...
[ "def", "_walk_through", "(", "job_dir", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "for", "top", "in", "os", ".", "listdir", "(", "job_dir", ")", ":", "t_path", "=", "os", ".", "path", ".", "join", "(", "j...
Walk though the jid dir and look for jobs
[ "Walk", "though", "the", "jid", "dir", "and", "look", "for", "jobs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L56-L84
train
Walk though the jid dir and look for jobs
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/local_cache.py
prep_jid
def prep_jid(nocache=False, passed_jid=None, recurse_count=0): ''' Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case ''' if recurse_cou...
python
def prep_jid(nocache=False, passed_jid=None, recurse_count=0): ''' Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case ''' if recurse_cou...
[ "def", "prep_jid", "(", "nocache", "=", "False", ",", "passed_jid", "=", "None", ",", "recurse_count", "=", "0", ")", ":", "if", "recurse_count", ">=", "5", ":", "err", "=", "'prep_jid could not store a jid after {0} tries.'", ".", "format", "(", "recurse_count"...
Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case
[ "Return", "a", "job", "id", "and", "prepare", "the", "job", "id", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L88-L130
train
Return a job id and prepare the job id directory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
returner
def returner(load): ''' Return data to the local job cache ''' serial = salt.payload.Serial(__opts__) # if a minion is returning a standalone job, get a jobid if load['jid'] == 'req': load['jid'] = prep_jid(nocache=load.get('nocache', False)) jid_dir = salt.utils.jid.jid_dir(load['...
python
def returner(load): ''' Return data to the local job cache ''' serial = salt.payload.Serial(__opts__) # if a minion is returning a standalone job, get a jobid if load['jid'] == 'req': load['jid'] = prep_jid(nocache=load.get('nocache', False)) jid_dir = salt.utils.jid.jid_dir(load['...
[ "def", "returner", "(", "load", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "# if a minion is returning a standalone job, get a jobid", "if", "load", "[", "'jid'", "]", "==", "'req'", ":", "load", "[", "'jid'", "]", ...
Return data to the local job cache
[ "Return", "data", "to", "the", "local", "job", "cache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L133-L184
train
Return data to the local job cache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
save_load
def save_load(jid, clear_load, minions=None, recurse_count=0): ''' Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh) ''' if recurse_count >=...
python
def save_load(jid, clear_load, minions=None, recurse_count=0): ''' Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh) ''' if recurse_count >=...
[ "def", "save_load", "(", "jid", ",", "clear_load", ",", "minions", "=", "None", ",", "recurse_count", "=", "0", ")", ":", "if", "recurse_count", ">=", "5", ":", "err", "=", "(", "'save_load could not write job cache file after {0} retries.'", ".", "format", "(",...
Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh)
[ "Save", "the", "load", "to", "the", "specified", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L187-L238
train
Save the load to the 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...
saltstack/salt
salt/returners/local_cache.py
save_minions
def save_minions(jid, minions, syndic_id=None): ''' Save/update the serialized list of minions for a given job ''' # Ensure we have a list for Python 3 compatability minions = list(minions) log.debug( 'Adding minions for job %s%s: %s', jid, ' from syndic master \'{0}\''....
python
def save_minions(jid, minions, syndic_id=None): ''' Save/update the serialized list of minions for a given job ''' # Ensure we have a list for Python 3 compatability minions = list(minions) log.debug( 'Adding minions for job %s%s: %s', jid, ' from syndic master \'{0}\''....
[ "def", "save_minions", "(", "jid", ",", "minions", ",", "syndic_id", "=", "None", ")", ":", "# Ensure we have a list for Python 3 compatability", "minions", "=", "list", "(", "minions", ")", "log", ".", "debug", "(", "'Adding minions for job %s%s: %s'", ",", "jid", ...
Save/update the serialized list of minions for a given job
[ "Save", "/", "update", "the", "serialized", "list", "of", "minions", "for", "a", "given", "job" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L241-L289
train
Save the minions list for a given job
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/local_cache.py
get_load
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) load_fn = os.path.join(jid_dir, LOAD_P) if not os.path.exists(jid_dir) or not os.path.exists(load_fn): return {} serial = salt.payload.S...
python
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) load_fn = os.path.join(jid_dir, LOAD_P) if not os.path.exists(jid_dir) or not os.path.exists(load_fn): return {} serial = salt.payload.S...
[ "def", "get_load", "(", "jid", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "load_fn", "=", "os", ".", "path", ".", "join", "(", ...
Return the load data that marks a specified jid
[ "Return", "the", "load", "data", "that", "marks", "a", "specified", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L292-L333
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...
saltstack/salt
salt/returners/local_cache.py
get_jid
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) serial = salt.payload.Serial(__opts__) ret = {} # Check to see if the jid is real, if not return the empty dict if no...
python
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) serial = salt.payload.Serial(__opts__) ret = {} # Check to see if the jid is real, if not return the empty dict if no...
[ "def", "get_jid", "(", "jid", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "serial", "=", "salt", ".", "payload", ".", "Serial", "(...
Return the information returned when the specified job id was executed
[ "Return", "the", "information", "returned", "when", "the", "specified", "job", "id", "was", "executed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L336-L371
train
Return the information returned when the specified job id was executed
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
get_jids
def get_jids(): ''' Return a dict mapping all job ids to job information ''' ret = {} for jid, job, _, _ in _walk_through(_job_dir()): ret[jid] = salt.utils.jid.format_jid_instance(jid, job) if __opts__.get('job_cache_store_endtime'): endtime = get_endtime(jid) ...
python
def get_jids(): ''' Return a dict mapping all job ids to job information ''' ret = {} for jid, job, _, _ in _walk_through(_job_dir()): ret[jid] = salt.utils.jid.format_jid_instance(jid, job) if __opts__.get('job_cache_store_endtime'): endtime = get_endtime(jid) ...
[ "def", "get_jids", "(", ")", ":", "ret", "=", "{", "}", "for", "jid", ",", "job", ",", "_", ",", "_", "in", "_walk_through", "(", "_job_dir", "(", ")", ")", ":", "ret", "[", "jid", "]", "=", "salt", ".", "utils", ".", "jid", ".", "format_jid_in...
Return a dict mapping all job ids to job information
[ "Return", "a", "dict", "mapping", "all", "job", "ids", "to", "job", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L374-L387
train
Return a dict mapping all job ids to job information
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/local_cache.py
get_jids_filter
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' keys = [] ret = [] for jid,...
python
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' keys = [] ret = [] for jid,...
[ "def", "get_jids_filter", "(", "count", ",", "filter_find_job", "=", "True", ")", ":", "keys", "=", "[", "]", "ret", "=", "[", "]", "for", "jid", ",", "job", ",", "_", ",", "_", "in", "_walk_through", "(", "_job_dir", "(", ")", ")", ":", "job", "...
Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs
[ "Return", "a", "list", "of", "all", "jobs", "information", "filtered", "by", "the", "given", "criteria", ".", ":", "param", "int", "count", ":", "show", "not", "more", "than", "the", "count", "of", "most", "recent", "jobs", ":", "param", "bool", "filter_...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L390-L410
train
Return a list of all jobs information filtered by the given criteria.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/local_cache.py
clean_old_jobs
def clean_old_jobs(): ''' Clean out the old jobs from the job cache ''' if __opts__['keep_jobs'] != 0: jid_root = _job_dir() if not os.path.exists(jid_root): return # Keep track of any empty t_path dirs that need to be removed later dirs_to_remove = set() ...
python
def clean_old_jobs(): ''' Clean out the old jobs from the job cache ''' if __opts__['keep_jobs'] != 0: jid_root = _job_dir() if not os.path.exists(jid_root): return # Keep track of any empty t_path dirs that need to be removed later dirs_to_remove = set() ...
[ "def", "clean_old_jobs", "(", ")", ":", "if", "__opts__", "[", "'keep_jobs'", "]", "!=", "0", ":", "jid_root", "=", "_job_dir", "(", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "jid_root", ")", ":", "return", "# Keep track of any empty t_path ...
Clean out the old jobs from the job cache
[ "Clean", "out", "the", "old", "jobs", "from", "the", "job", "cache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L413-L466
train
Clean out the old jobs from the job cache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
update_endtime
def update_endtime(jid, time): ''' Update (or store) the end time for a given job Endtime is stored as a plain text string ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) try: if not os.path.exists(jid_dir): os.makedirs(jid_dir) with salt...
python
def update_endtime(jid, time): ''' Update (or store) the end time for a given job Endtime is stored as a plain text string ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) try: if not os.path.exists(jid_dir): os.makedirs(jid_dir) with salt...
[ "def", "update_endtime", "(", "jid", ",", "time", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "try", ":", "if", "not", "os", ".", ...
Update (or store) the end time for a given job Endtime is stored as a plain text string
[ "Update", "(", "or", "store", ")", "the", "end", "time", "for", "a", "given", "job" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L469-L482
train
Update the end time for a given job
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/local_cache.py
save_reg
def save_reg(data): ''' Save the register to msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: if not os.path.exists(reg_dir): os.makedirs(reg_dir) except OSError as exc: if exc.errno == errno.EEXIST: pass ...
python
def save_reg(data): ''' Save the register to msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: if not os.path.exists(reg_dir): os.makedirs(reg_dir) except OSError as exc: if exc.errno == errno.EEXIST: pass ...
[ "def", "save_reg", "(", "data", ")", ":", "reg_dir", "=", "_reg_dir", "(", ")", "regfile", "=", "os", ".", "path", ".", "join", "(", "reg_dir", ",", "'register'", ")", "try", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "reg_dir", ")", ...
Save the register to msgpack files
[ "Save", "the", "register", "to", "msgpack", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L507-L526
train
Save the data to msgpack files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/local_cache.py
load_reg
def load_reg(): ''' Load the register from msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: with salt.utils.files.fopen(regfile, 'r') as fh_: return salt.utils.msgpack.load(fh_) except Exception: log.error('Could not write to...
python
def load_reg(): ''' Load the register from msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: with salt.utils.files.fopen(regfile, 'r') as fh_: return salt.utils.msgpack.load(fh_) except Exception: log.error('Could not write to...
[ "def", "load_reg", "(", ")", ":", "reg_dir", "=", "_reg_dir", "(", ")", "regfile", "=", "os", ".", "path", ".", "join", "(", "reg_dir", ",", "'register'", ")", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "regfile", ",...
Load the register from msgpack files
[ "Load", "the", "register", "from", "msgpack", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L529-L540
train
Load the register from msgpack files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/serializers/yamlex.py
merge_recursive
def merge_recursive(obj_a, obj_b, level=False): ''' Merge obj_b into obj_a. ''' return aggregate(obj_a, obj_b, level, map_class=AggregatedMap, sequence_class=AggregatedSequence)
python
def merge_recursive(obj_a, obj_b, level=False): ''' Merge obj_b into obj_a. ''' return aggregate(obj_a, obj_b, level, map_class=AggregatedMap, sequence_class=AggregatedSequence)
[ "def", "merge_recursive", "(", "obj_a", ",", "obj_b", ",", "level", "=", "False", ")", ":", "return", "aggregate", "(", "obj_a", ",", "obj_b", ",", "level", ",", "map_class", "=", "AggregatedMap", ",", "sequence_class", "=", "AggregatedSequence", ")" ]
Merge obj_b into obj_a.
[ "Merge", "obj_b", "into", "obj_a", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L427-L433
train
Merge obj_b into obj_a.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/serializers/yamlex.py
Loader.construct_yaml_omap
def construct_yaml_omap(self, node): ''' Build the SLSMap ''' sls_map = SLSMap() if not isinstance(node, MappingNode): raise ConstructorError( None, None, 'expected a mapping node, but found {0}'.format(node.id), ...
python
def construct_yaml_omap(self, node): ''' Build the SLSMap ''' sls_map = SLSMap() if not isinstance(node, MappingNode): raise ConstructorError( None, None, 'expected a mapping node, but found {0}'.format(node.id), ...
[ "def", "construct_yaml_omap", "(", "self", ",", "node", ")", ":", "sls_map", "=", "SLSMap", "(", ")", "if", "not", "isinstance", "(", "node", ",", "MappingNode", ")", ":", "raise", "ConstructorError", "(", "None", ",", "None", ",", "'expected a mapping node,...
Build the SLSMap
[ "Build", "the", "SLSMap" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L214-L252
train
Builds the SLSMap from a mapping 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/serializers/yamlex.py
Loader.construct_sls_str
def construct_sls_str(self, node): ''' Build the SLSString. ''' # Ensure obj is str, not py2 unicode or py3 bytes obj = self.construct_scalar(node) if six.PY2: obj = obj.encode('utf-8') return SLSString(obj)
python
def construct_sls_str(self, node): ''' Build the SLSString. ''' # Ensure obj is str, not py2 unicode or py3 bytes obj = self.construct_scalar(node) if six.PY2: obj = obj.encode('utf-8') return SLSString(obj)
[ "def", "construct_sls_str", "(", "self", ",", "node", ")", ":", "# Ensure obj is str, not py2 unicode or py3 bytes", "obj", "=", "self", ".", "construct_scalar", "(", "node", ")", "if", "six", ".", "PY2", ":", "obj", "=", "obj", ".", "encode", "(", "'utf-8'", ...
Build the SLSString.
[ "Build", "the", "SLSString", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L254-L263
train
Builds the SLSString.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/serializers/yamlex.py
Loader.construct_sls_int
def construct_sls_int(self, node): ''' Verify integers and pass them in correctly is they are declared as octal ''' if node.value == '0': pass elif node.value.startswith('0') \ and not node.value.startswith(('0b', '0x')): node.value...
python
def construct_sls_int(self, node): ''' Verify integers and pass them in correctly is they are declared as octal ''' if node.value == '0': pass elif node.value.startswith('0') \ and not node.value.startswith(('0b', '0x')): node.value...
[ "def", "construct_sls_int", "(", "self", ",", "node", ")", ":", "if", "node", ".", "value", "==", "'0'", ":", "pass", "elif", "node", ".", "value", ".", "startswith", "(", "'0'", ")", "and", "not", "node", ".", "value", ".", "startswith", "(", "(", ...
Verify integers and pass them in correctly is they are declared as octal
[ "Verify", "integers", "and", "pass", "them", "in", "correctly", "is", "they", "are", "declared", "as", "octal" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L265-L279
train
Constructs the SLS int from the node s 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/states/boto_dynamodb.py
present
def present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar="boto_dynamodb_alarms", ha...
python
def present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar="boto_dynamodb_alarms", ha...
[ "def", "present", "(", "name", "=", "None", ",", "table_name", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "read_capacity_units", "=", "None", ",", "write_capacity_units",...
Ensure the DynamoDB table exists. Table throughput can be updated after table creation. Global secondary indexes (GSIs) are managed with some exceptions: - If a GSI deletion is detected, a failure will occur (deletes should be done manually in the AWS console). - If multiple GSIs are added in a...
[ "Ensure", "the", "DynamoDB", "table", "exists", ".", "Table", "throughput", "can", "be", "updated", "after", "table", "creation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L190-L425
train
Ensures that the DynamoDB table exists and has the specified attributes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_global_indexes_present
def _global_indexes_present(provisioned_indexes, global_indexes, changes_old, changes_new, comments, name, region, key, keyid, profile): '''Handles global secondary index for the table present state.''' ret = {'result': True} if provisioned_indexes: ...
python
def _global_indexes_present(provisioned_indexes, global_indexes, changes_old, changes_new, comments, name, region, key, keyid, profile): '''Handles global secondary index for the table present state.''' ret = {'result': True} if provisioned_indexes: ...
[ "def", "_global_indexes_present", "(", "provisioned_indexes", ",", "global_indexes", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "name", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "ret", "=", "{", "'result'", ":", "T...
Handles global secondary index for the table present state.
[ "Handles", "global", "secondary", "index", "for", "the", "table", "present", "state", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L435-L495
train
Handles global secondary indexes for the table present state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_partition_index_names
def _partition_index_names(provisioned_index_names, index_names): '''Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.''' existing_index_names = set() new_index_names = set() for name in index_names: if name in provisioned_index_names: existing_index_nam...
python
def _partition_index_names(provisioned_index_names, index_names): '''Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.''' existing_index_names = set() new_index_names = set() for name in index_names: if name in provisioned_index_names: existing_index_nam...
[ "def", "_partition_index_names", "(", "provisioned_index_names", ",", "index_names", ")", ":", "existing_index_names", "=", "set", "(", ")", "new_index_names", "=", "set", "(", ")", "for", "name", "in", "index_names", ":", "if", "name", "in", "provisioned_index_na...
Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.
[ "Returns", "3", "disjoint", "sets", "of", "indexes", ":", "existing", "to", "be", "created", "and", "to", "be", "deleted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L498-L508
train
Returns 3 disjoint sets of indexes existing to be created and to be deleted.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_add_global_secondary_index
def _add_global_secondary_index(ret, name, index_name, changes_old, changes_new, comments, gsi_config, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' if __opts__['test']: ret['result'] = None ret['comment'] = 'Dynamo table...
python
def _add_global_secondary_index(ret, name, index_name, changes_old, changes_new, comments, gsi_config, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' if __opts__['test']: ret['result'] = None ret['comment'] = 'Dynamo table...
[ "def", "_add_global_secondary_index", "(", "ret", ",", "name", ",", "index_name", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "gsi_config", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "if", "__opts__", "[", "'test'", ...
Updates ret iff there was a failure or in test mode.
[ "Updates", "ret", "iff", "there", "was", "a", "failure", "or", "in", "test", "mode", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L511-L535
train
Adds a global secondary index to the Dynamo table.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_update_global_secondary_indexes
def _update_global_secondary_indexes(ret, changes_old, changes_new, comments, existing_index_names, provisioned_gsi_config, gsi_config, name, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' try: ...
python
def _update_global_secondary_indexes(ret, changes_old, changes_new, comments, existing_index_names, provisioned_gsi_config, gsi_config, name, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' try: ...
[ "def", "_update_global_secondary_indexes", "(", "ret", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "existing_index_names", ",", "provisioned_gsi_config", ",", "gsi_config", ",", "name", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")"...
Updates ret iff there was a failure or in test mode.
[ "Updates", "ret", "iff", "there", "was", "a", "failure", "or", "in", "test", "mode", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L538-L575
train
Updates ret iff there was a failure or in test mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_alarms_present
def _alarms_present(name, alarms, alarms_from_pillar, write_capacity_units, read_capacity_units, region, key, keyid, profile): '''helper method for present. ensure that cloudwatch_alarms are set''' # load data from alarms_from_pillar tmp = copy.deepcopy( __sa...
python
def _alarms_present(name, alarms, alarms_from_pillar, write_capacity_units, read_capacity_units, region, key, keyid, profile): '''helper method for present. ensure that cloudwatch_alarms are set''' # load data from alarms_from_pillar tmp = copy.deepcopy( __sa...
[ "def", "_alarms_present", "(", "name", ",", "alarms", ",", "alarms_from_pillar", ",", "write_capacity_units", ",", "read_capacity_units", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "# load data from alarms_from_pillar", "tmp", "=", "copy", ...
helper method for present. ensure that cloudwatch_alarms are set
[ "helper", "method", "for", "present", ".", "ensure", "that", "cloudwatch_alarms", "are", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L617-L668
train
helper method for present. ensure that the CloudWatch alarms are set
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/boto_dynamodb.py
_next_datetime_with_utc_hour
def _next_datetime_with_utc_hour(table_name, utc_hour): ''' Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minut...
python
def _next_datetime_with_utc_hour(table_name, utc_hour): ''' Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minut...
[ "def", "_next_datetime_with_utc_hour", "(", "table_name", ",", "utc_hour", ")", ":", "today", "=", "datetime", ".", "date", ".", "today", "(", ")", "# The minute and second values generated are deterministic, as we do not want", "# pipeline definition to change for every run.", ...
Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minute = A value between 0-59 (depending on table name) second = ...
[ "Datapipeline", "API", "is", "throttling", "us", "as", "all", "the", "pipelines", "are", "started", "at", "the", "same", "time", ".", "We", "would", "like", "to", "uniformly", "distribute", "the", "startTime", "over", "a", "60", "minute", "window", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L701-L728
train
This function returns the next utc datetime for the given table name and utc_hour.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/winrepo.py
genrepo
def genrepo(opts=None, fire_event=True): ''' Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supp...
python
def genrepo(opts=None, fire_event=True): ''' Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supp...
[ "def", "genrepo", "(", "opts", "=", "None", ",", "fire_event", "=", "True", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "__opts__", "winrepo_dir", "=", "opts", "[", "'winrepo_dir'", "]", "winrepo_cachefile", "=", "opts", "[", "'winrepo_cachefil...
Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supported on the master. CLI Example: .. code-b...
[ "Generate", "winrepo_cachefile", "based", "on", "sls", "files", "in", "the", "winrepo_dir" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/winrepo.py#L40-L125
train
Generate a winrepo_cachefile based on sls files in the winrepo_dir.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/runners/winrepo.py
update_git_repos
def update_git_repos(opts=None, clean=False, masterless=False): ''' Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cac...
python
def update_git_repos(opts=None, clean=False, masterless=False): ''' Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cac...
[ "def", "update_git_repos", "(", "opts", "=", "None", ",", "clean", "=", "False", ",", "masterless", "=", "False", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "__opts__", "winrepo_dir", "=", "opts", "[", "'winrepo_dir'", "]", "winrepo_remotes", ...
Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cachedirs which are not configured under :conf_master:`winrepo_remotes`...
[ "Checkout", "git", "repos", "containing", "Windows", "Software", "Package", "Definitions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/winrepo.py#L128-L233
train
Return a list of git repos containing Windows Software Package Definitions and non - git repo definitions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/extmods.py
sync
def sync(opts, form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync custom modules into the extension_modules directory ''' if saltenv is None: saltenv = ['base'] if extmod_whitelist is None: extmod_whitelist = opts['extmod_...
python
def sync(opts, form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync custom modules into the extension_modules directory ''' if saltenv is None: saltenv = ['base'] if extmod_whitelist is None: extmod_whitelist = opts['extmod_...
[ "def", "sync", "(", "opts", ",", "form", ",", "saltenv", "=", "None", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "if", "saltenv", "is", "None", ":", "saltenv", "=", "[", "'base'", "]", "if", "extmod_whitelist", ...
Sync custom modules into the extension_modules directory
[ "Sync", "custom", "modules", "into", "the", "extension_modules", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extmods.py#L43-L159
train
Syncs the specified custom modules into the specified environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltmod.py
_parallel_map
def _parallel_map(func, inputs): ''' Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the resul...
python
def _parallel_map(func, inputs): ''' Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the resul...
[ "def", "_parallel_map", "(", "func", ",", "inputs", ")", ":", "outputs", "=", "len", "(", "inputs", ")", "*", "[", "None", "]", "errors", "=", "len", "(", "inputs", ")", "*", "[", "None", "]", "def", "create_thread", "(", "index", ")", ":", "def", ...
Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the results corresponding to the inputs is returne...
[ "Applies", "a", "function", "to", "each", "element", "of", "a", "list", "returning", "the", "resulting", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L66-L105
train
Applies a function to each element of a list returning the resulting list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltmod.py
state
def state(name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, highstate=None, sls=None, top=None, saltenv=None, test=None, pillar=None, pillarenv=None, expect_minions=True, ...
python
def state(name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, highstate=None, sls=None, top=None, saltenv=None, test=None, pillar=None, pillarenv=None, expect_minions=True, ...
[ "def", "state", "(", "name", ",", "tgt", ",", "ssh", "=", "False", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "ret_config", "=", "None", ",", "ret_kwargs", "=", "None", ",", "highstate", "=", "None", ",", "sls", "=", "None", ",", ...
Invoke a state run on a given target name An arbitrary name used to track the state execution tgt The target specification for the state run. .. versionadded: 2016.11.0 Masterless support: When running on a masterless minion, the ``tgt`` is ignored and will always be ...
[ "Invoke", "a", "state", "run", "on", "a", "given", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L108-L452
train
Return the state for a given target
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/saltmod.py
function
def function( name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, expect_minions=False, fail_minions=None, fail_function=None, arg=None, kwarg=None, timeout=None, batch=None, ...
python
def function( name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, expect_minions=False, fail_minions=None, fail_function=None, arg=None, kwarg=None, timeout=None, batch=None, ...
[ "def", "function", "(", "name", ",", "tgt", ",", "ssh", "=", "False", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "ret_config", "=", "None", ",", "ret_kwargs", "=", "None", ",", "expect_minions", "=", "False", ",", "fail_minions", "=", ...
Execute a single module function on a remote minion via salt or salt-ssh name The name of the function to run, aka cmd.run or pkg.install tgt The target specification, aka '*' for all minions tgt_type The target type, defaults to ``glob`` arg The list of arguments to ...
[ "Execute", "a", "single", "module", "function", "on", "a", "remote", "minion", "via", "salt", "or", "salt", "-", "ssh" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L455-L633
train
Execute a single module function on a targeted minion 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/states/saltmod.py
wait_for_event
def wait_for_event( name, id_list, event_id='id', timeout=300, node='master'): ''' Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A...
python
def wait_for_event( name, id_list, event_id='id', timeout=300, node='master'): ''' Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A...
[ "def", "wait_for_event", "(", "name", ",", "id_list", ",", "event_id", "=", "'id'", ",", "timeout", "=", "300", ",", "node", "=", "'master'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", ...
Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A list of event identifiers to watch for -- usually the minion ID. Each time an event tag is matched the event data is inspe...
[ "Watch", "Salt", "s", "event", "bus", "and", "block", "until", "a", "condition", "is", "met" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L636-L748
train
Wait for an event from a specific event tag.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/saltmod.py
runner
def runner(name, **kwargs): ''' Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. ...
python
def runner(name, **kwargs): ''' Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. ...
[ "def", "runner", "(", "name", ",", "*", "*", "kwargs", ")", ":", "try", ":", "jid", "=", "__orchestration_jid__", "except", "NameError", ":", "log", ".", "debug", "(", "'Unable to fire args event due to missing __orchestration_jid__'", ")", "jid", "=", "None", "...
Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. versionadded:: neon .. code-block:...
[ "Execute", "a", "runner", "module", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L751-L819
train
Execute a runner module 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/states/saltmod.py
parallel_runners
def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argument ''' Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in pla...
python
def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argument ''' Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in pla...
[ "def", "parallel_runners", "(", "name", ",", "runners", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "# For the sake of consistency, we treat a single string in the same way as", "# a key without a value. This allows something like", "# salt.parallel_runn...
Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in place of the ``saltmod.runner`` state when different tasks should be run in parallel. In gene...
[ "Executes", "multiple", "runner", "modules", "on", "the", "master", "in", "parallel", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L822-L1003
train
Execute multiple runners on the master in parallel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/saltmod.py
wheel
def wheel(name, **kwargs): ''' Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. ver...
python
def wheel(name, **kwargs): ''' Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. ver...
[ "def", "wheel", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "try", ":", "jid", "=", "__orchestration_jid__...
Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. versionadded:: neon .. code-block:: ...
[ "Execute", "a", "wheel", "module", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L1006-L1079
train
Execute a wheel module 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/modules/slack_notify.py
list_rooms
def list_rooms(api_key=None): ''' List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 ''' if not api_key:...
python
def list_rooms(api_key=None): ''' List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 ''' if not api_key:...
[ "def", "list_rooms", "(", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "return", "salt", ".", "utils", ".", "slack", ".", "query", "(", "function", "=", "'rooms'", ",", "api_key", "=", "api_ke...
List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15
[ "List", "all", "Slack", "rooms", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L69-L88
train
List all Slack rooms.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/slack_notify.py
find_room
def find_room(name, api_key=None): ''' Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find...
python
def find_room(name, api_key=None): ''' Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find...
[ "def", "find_room", "(", "name", ",", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "# search results don't include the name of the", "# channel with a hash, if the passed channel name", "# has a hash we remove it."...
Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find_room name="random" api_key=peWcBiMOS9HrZG15peW...
[ "Find", "a", "room", "by", "name", "and", "return", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L113-L144
train
Find a room by name and return it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slack_notify.py
find_user
def find_user(name, api_key=None): ''' Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" sa...
python
def find_user(name, api_key=None): ''' Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" sa...
[ "def", "find_user", "(", "name", ",", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "ret", "=", "list_users", "(", "api_key", ")", "if", "ret", "[", "'res'", "]", ":", "users", "=", "ret", ...
Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" salt '*' slack.find_user name="ThomasHatch" api_k...
[ "Find", "a", "user", "by", "name", "and", "return", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L147-L173
train
Find a user by name and return it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slack_notify.py
post_message
def post_message(channel, message, from_name, api_key=None, icon=None): ''' Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :p...
python
def post_message(channel, message, from_name, api_key=None, icon=None): ''' Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :p...
[ "def", "post_message", "(", "channel", ",", "message", ",", "from_name", ",", "api_key", "=", "None", ",", "icon", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "if", "not", "channel", ":", "log", ".", ...
Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :param from_name: Specify who the message is from. :param api_key: The Slack api key, if not specified in the configuration. :param icon: ...
[ "Send", "a", "message", "to", "a", "Slack", "channel", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L176-L241
train
Send a message to a Slack channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slack_notify.py
call_hook
def call_hook(message, attachment=None, color='good', short=False, identifier=None, channel=None, username=None, icon_emoji=None): ''' Send message to Slack incoming webhook. :param message: The topic of m...
python
def call_hook(message, attachment=None, color='good', short=False, identifier=None, channel=None, username=None, icon_emoji=None): ''' Send message to Slack incoming webhook. :param message: The topic of m...
[ "def", "call_hook", "(", "message", ",", "attachment", "=", "None", ",", "color", "=", "'good'", ",", "short", "=", "False", ",", "identifier", "=", "None", ",", "channel", "=", "None", ",", "username", "=", "None", ",", "icon_emoji", "=", "None", ")",...
Send message to Slack incoming webhook. :param message: The topic of message. :param attachment: The message to send to the Slacke WebHook. :param color: The color of border of left side :param short: An optional flag indicating whether the value is short enough...
[ "Send", "message", "to", "Slack", "incoming", "webhook", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L244-L325
train
Send a message to Slack incoming webhook.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/groupadd.py
add
def add(name, gid=None, system=False, root=None): ''' Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' gr...
python
def add(name, gid=None, system=False, root=None): ''' Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' gr...
[ "def", "add", "(", "name", ",", "gid", "=", "None", ",", "system", "=", "False", ",", "root", "=", "None", ")", ":", "cmd", "=", "[", "'groupadd'", "]", "if", "gid", ":", "cmd", ".", "append", "(", "'-g {0}'", ".", "format", "(", "gid", ")", ")...
Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.add foo 3456
[ "Add", "the", "specified", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L43-L78
train
Add a new group to the chroot
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/groupadd.py
delete
def delete(name, root=None): ''' Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo ''' cmd = ['groupdel'] if root is not None: cmd.extend(('-R', root)) ...
python
def delete(name, root=None): ''' Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo ''' cmd = ['groupdel'] if root is not None: cmd.extend(('-R', root)) ...
[ "def", "delete", "(", "name", ",", "root", "=", "None", ")", ":", "cmd", "=", "[", "'groupdel'", "]", "if", "root", "is", "not", "None", ":", "cmd", ".", "extend", "(", "(", "'-R'", ",", "root", ")", ")", "cmd", ".", "append", "(", "name", ")",...
Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo
[ "Remove", "the", "named", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L81-L106
train
Delete the named group from chroot
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/groupadd.py
info
def info(name, root=None): ''' Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo ''' if root is not None: getgrnam = functools.partial(_getgrnam, root=root) ...
python
def info(name, root=None): ''' Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo ''' if root is not None: getgrnam = functools.partial(_getgrnam, root=root) ...
[ "def", "info", "(", "name", ",", "root", "=", "None", ")", ":", "if", "root", "is", "not", "None", ":", "getgrnam", "=", "functools", ".", "partial", "(", "_getgrnam", ",", "root", "=", "root", ")", "else", ":", "getgrnam", "=", "functools", ".", "...
Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo
[ "Return", "information", "about", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L109-L135
train
Return information about a group
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/groupadd.py
getent
def getent(refresh=False, root=None): ''' Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: ...
python
def getent(refresh=False, root=None): ''' Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: ...
[ "def", "getent", "(", "refresh", "=", "False", ",", "root", "=", "None", ")", ":", "if", "'group.getent'", "in", "__context__", "and", "not", "refresh", ":", "return", "__context__", "[", "'group.getent'", "]", "ret", "=", "[", "]", "if", "root", "is", ...
Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent
[ "Return", "info", "on", "all", "groups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L148-L176
train
Return info on all groups
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/groupadd.py
_chattrib
def _chattrib(name, key, value, param, root=None): ''' Change an attribute for a named user ''' pre_info = info(name, root=root) if not pre_info: return False if value == pre_info[key]: return True cmd = ['groupmod'] if root is not None: cmd.extend(('-R', root)...
python
def _chattrib(name, key, value, param, root=None): ''' Change an attribute for a named user ''' pre_info = info(name, root=root) if not pre_info: return False if value == pre_info[key]: return True cmd = ['groupmod'] if root is not None: cmd.extend(('-R', root)...
[ "def", "_chattrib", "(", "name", ",", "key", ",", "value", ",", "param", ",", "root", "=", "None", ")", ":", "pre_info", "=", "info", "(", "name", ",", "root", "=", "root", ")", "if", "not", "pre_info", ":", "return", "False", "if", "value", "==", ...
Change an attribute for a named user
[ "Change", "an", "attribute", "for", "a", "named", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L179-L198
train
Change an attribute for a named 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/groupadd.py
adduser
def adduser(name, username, root=None): ''' Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a...
python
def adduser(name, username, root=None): ''' Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a...
[ "def", "adduser", "(", "name", ",", "username", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "on_s...
Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a valid username 'bar' as a member of an existing gro...
[ "Add", "a", "user", "in", "the", "group", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L223-L264
train
Add a user to the group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/groupadd.py
deluser
def deluser(name, username, root=None): ''' Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Rem...
python
def deluser(name, username, root=None): ''' Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Rem...
[ "def", "deluser", "(", "name", ",", "username", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "on_s...
Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If grou...
[ "Remove", "a", "user", "from", "the", "group", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L267-L319
train
Removes a user from a group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/groupadd.py
members
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,...
python
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,...
[ "def", "members", "(", "name", ",", "members_list", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "...
Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,user2,user3,...' Replaces a membership list for a l...
[ "Replaces", "members", "of", "the", "group", "with", "a", "provided", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L322-L379
train
Replaces members of a group with a provided 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/groupadd.py
_getgrnam
def _getgrnam(name, root=None): ''' Alternative implementation for getgrnam, that use only /etc/group ''' root = root or '/' passwd = os.path.join(root, 'etc/group') with salt.utils.files.fopen(passwd) as fp_: for line in fp_: line = salt.utils.stringutils.to_unicode(line) ...
python
def _getgrnam(name, root=None): ''' Alternative implementation for getgrnam, that use only /etc/group ''' root = root or '/' passwd = os.path.join(root, 'etc/group') with salt.utils.files.fopen(passwd) as fp_: for line in fp_: line = salt.utils.stringutils.to_unicode(line) ...
[ "def", "_getgrnam", "(", "name", ",", "root", "=", "None", ")", ":", "root", "=", "root", "or", "'/'", "passwd", "=", "os", ".", "path", ".", "join", "(", "root", ",", "'etc/group'", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", ...
Alternative implementation for getgrnam, that use only /etc/group
[ "Alternative", "implementation", "for", "getgrnam", "that", "use", "only", "/", "etc", "/", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L382-L400
train
Internal function to get a group from a 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/nagios.py
_execute_cmd
def _execute_cmd(plugin, args='', run_type='cmd.retcode'): ''' Execute nagios plugin if it's in the directory with salt command specified in run_type ''' data = {} all_plugins = list_plugins() if plugin in all_plugins: data = __salt__[run_type]( '{0}{1} {2}'.format(PLUGI...
python
def _execute_cmd(plugin, args='', run_type='cmd.retcode'): ''' Execute nagios plugin if it's in the directory with salt command specified in run_type ''' data = {} all_plugins = list_plugins() if plugin in all_plugins: data = __salt__[run_type]( '{0}{1} {2}'.format(PLUGI...
[ "def", "_execute_cmd", "(", "plugin", ",", "args", "=", "''", ",", "run_type", "=", "'cmd.retcode'", ")", ":", "data", "=", "{", "}", "all_plugins", "=", "list_plugins", "(", ")", "if", "plugin", "in", "all_plugins", ":", "data", "=", "__salt__", "[", ...
Execute nagios plugin if it's in the directory with salt command specified in run_type
[ "Execute", "nagios", "plugin", "if", "it", "s", "in", "the", "directory", "with", "salt", "command", "specified", "in", "run_type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L29-L41
train
Execute nagios plugin with salt command specified in run_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/nagios.py
_execute_pillar
def _execute_pillar(pillar_name, run_type): ''' Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: ...
python
def _execute_pillar(pillar_name, run_type): ''' Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: ...
[ "def", "_execute_pillar", "(", "pillar_name", ",", "run_type", ")", ":", "groups", "=", "__salt__", "[", "'pillar.get'", "]", "(", "pillar_name", ")", "data", "=", "{", "}", "for", "group", "in", "groups", ":", "data", "[", "group", "]", "=", "{", "}",...
Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: - check_load: -w 0.8 -c 1 APT: - ch...
[ "Run", "one", "or", "more", "nagios", "plugins", "from", "pillar", "data", "and", "get", "the", "result", "of", "run_type", "The", "pillar", "have", "to", "be", "in", "this", "format", ":", "------", "webserver", ":", "Ping_google", ":", "-", "check_icmp",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L44-L76
train
Execute nagios plugins from pillar data and get the result of run_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/nagios.py
retcode
def retcode(plugin, args='', key_name=None): ''' Run one nagios plugin and return retcode of the execution ''' data = {} # Remove all the spaces, the key must not have any space if key_name is None: key_name = _format_dict_key(args, plugin) data[key_name] = {} status = _execut...
python
def retcode(plugin, args='', key_name=None): ''' Run one nagios plugin and return retcode of the execution ''' data = {} # Remove all the spaces, the key must not have any space if key_name is None: key_name = _format_dict_key(args, plugin) data[key_name] = {} status = _execut...
[ "def", "retcode", "(", "plugin", ",", "args", "=", "''", ",", "key_name", "=", "None", ")", ":", "data", "=", "{", "}", "# Remove all the spaces, the key must not have any space", "if", "key_name", "is", "None", ":", "key_name", "=", "_format_dict_key", "(", "...
Run one nagios plugin and return retcode of the execution
[ "Run", "one", "nagios", "plugin", "and", "return", "retcode", "of", "the", "execution" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L105-L120
train
Run one nagios plugin and return retcode of the execution
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/nagios.py
retcode_pillar
def retcode_pillar(pillar_name): ''' Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com ...
python
def retcode_pillar(pillar_name): ''' Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com ...
[ "def", "retcode_pillar", "(", "pillar_name", ")", ":", "groups", "=", "__salt__", "[", "'pillar.get'", "]", "(", "pillar_name", ")", "check", "=", "{", "}", "data", "=", "{", "}", "for", "group", "in", "groups", ":", "commands", "=", "groups", "[", "gr...
Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: - check_load: -w 0.8 -...
[ "Run", "one", "or", "more", "nagios", "plugins", "from", "pillar", "data", "and", "get", "the", "result", "of", "cmd", ".", "retcode", "The", "pillar", "have", "to", "be", "in", "this", "format", "::" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L131-L189
train
Return the result of nagios check
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...