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/cloud/clouds/opennebula.py
vn_delete
def vn_delete(call=None, kwargs=None): ''' Deletes the given virtual network from OpenNebula. Either a name or a vn_id must be supplied. .. versionadded:: 2016.3.0 name The name of the virtual network to delete. Can be used instead of ``vn_id``. vn_id The ID of the virtual net...
python
def vn_delete(call=None, kwargs=None): ''' Deletes the given virtual network from OpenNebula. Either a name or a vn_id must be supplied. .. versionadded:: 2016.3.0 name The name of the virtual network to delete. Can be used instead of ``vn_id``. vn_id The ID of the virtual net...
[ "def", "vn_delete", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_delete function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":"...
Deletes the given virtual network from OpenNebula. Either a name or a vn_id must be supplied. .. versionadded:: 2016.3.0 name The name of the virtual network to delete. Can be used instead of ``vn_id``. vn_id The ID of the virtual network to delete. Can be used instead of ``name``. ...
[ "Deletes", "the", "given", "virtual", "network", "from", "OpenNebula", ".", "Either", "a", "name", "or", "a", "vn_id", "must", "be", "supplied", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4028-L4084
train
Deletes the given virtual network from OpenNebula.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
vn_free_ar
def vn_free_ar(call=None, kwargs=None): ''' Frees a reserved address range from a virtual network. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to free an address range. Can be used instead of ``vn_name``. vn_name The name of the virtual networ...
python
def vn_free_ar(call=None, kwargs=None): ''' Frees a reserved address range from a virtual network. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to free an address range. Can be used instead of ``vn_name``. vn_name The name of the virtual networ...
[ "def", "vn_free_ar", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_free_ar function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
Frees a reserved address range from a virtual network. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to free an address range. Can be used instead of ``vn_name``. vn_name The name of the virtual network from which to free an address range. Can b...
[ "Frees", "a", "reserved", "address", "range", "from", "a", "virtual", "network", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4087-L4153
train
Free a reserved address range from a virtual network.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
vn_info
def vn_info(call=None, kwargs=None): ''' Retrieves information for the virtual network. .. versionadded:: 2016.3.0 name The name of the virtual network for which to gather information. Can be used instead of ``vn_id``. vn_id The ID of the virtual network for which to gathe...
python
def vn_info(call=None, kwargs=None): ''' Retrieves information for the virtual network. .. versionadded:: 2016.3.0 name The name of the virtual network for which to gather information. Can be used instead of ``vn_id``. vn_id The ID of the virtual network for which to gathe...
[ "def", "vn_info", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_info function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":", ...
Retrieves information for the virtual network. .. versionadded:: 2016.3.0 name The name of the virtual network for which to gather information. Can be used instead of ``vn_id``. vn_id The ID of the virtual network for which to gather information. Can be used instead of ``n...
[ "Retrieves", "information", "for", "the", "virtual", "network", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4242-L4298
train
Returns information for the virtual network.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
vn_release
def vn_release(call=None, kwargs=None): ''' Releases a virtual network lease that was previously on hold. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to release the lease. Can be used instead of ``vn_name``. vn_name The name of the virtual net...
python
def vn_release(call=None, kwargs=None): ''' Releases a virtual network lease that was previously on hold. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to release the lease. Can be used instead of ``vn_name``. vn_name The name of the virtual net...
[ "def", "vn_release", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_reserve function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
Releases a virtual network lease that was previously on hold. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to release the lease. Can be used instead of ``vn_name``. vn_name The name of the virtual network from which to release the lease. Can be...
[ "Releases", "a", "virtual", "network", "lease", "that", "was", "previously", "on", "hold", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4301-L4384
train
Return a virtual network lease that was previously on hold.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
_get_xml
def _get_xml(xml_str): ''' Intrepret the data coming from opennebula and raise if it's not XML. ''' try: xml_data = etree.XML(xml_str) # XMLSyntaxError seems to be only available from lxml, but that is the xml # library loaded by this module except etree.XMLSyntaxError as err: ...
python
def _get_xml(xml_str): ''' Intrepret the data coming from opennebula and raise if it's not XML. ''' try: xml_data = etree.XML(xml_str) # XMLSyntaxError seems to be only available from lxml, but that is the xml # library loaded by this module except etree.XMLSyntaxError as err: ...
[ "def", "_get_xml", "(", "xml_str", ")", ":", "try", ":", "xml_data", "=", "etree", ".", "XML", "(", "xml_str", ")", "# XMLSyntaxError seems to be only available from lxml, but that is the xml", "# library loaded by this module", "except", "etree", ".", "XMLSyntaxError", "...
Intrepret the data coming from opennebula and raise if it's not XML.
[ "Intrepret", "the", "data", "coming", "from", "opennebula", "and", "raise", "if", "it", "s", "not", "XML", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4500-L4512
train
Intrepret the data coming from OpenNebula and raise it s not XML.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
_get_xml_rpc
def _get_xml_rpc(): ''' Uses the OpenNebula cloud provider configurations to connect to the OpenNebula API. Returns the server connection created as well as the user and password values from the cloud provider config file used to make the connection. ''' vm_ = get_configured_provider() ...
python
def _get_xml_rpc(): ''' Uses the OpenNebula cloud provider configurations to connect to the OpenNebula API. Returns the server connection created as well as the user and password values from the cloud provider config file used to make the connection. ''' vm_ = get_configured_provider() ...
[ "def", "_get_xml_rpc", "(", ")", ":", "vm_", "=", "get_configured_provider", "(", ")", "xml_rpc", "=", "config", ".", "get_cloud_config_value", "(", "'xml_rpc'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", "user", "=", "config", "."...
Uses the OpenNebula cloud provider configurations to connect to the OpenNebula API. Returns the server connection created as well as the user and password values from the cloud provider config file used to make the connection.
[ "Uses", "the", "OpenNebula", "cloud", "provider", "configurations", "to", "connect", "to", "the", "OpenNebula", "API", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4515-L4539
train
Get the connection to the OpenNebula API.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/opennebula.py
_list_nodes
def _list_nodes(full=False): ''' Helper function for the list_* query functions - Constructs the appropriate dictionaries to return from the API query. full If performing a full query, such as in list_nodes_full, change this parameter to ``True``. ''' server, user, password = _g...
python
def _list_nodes(full=False): ''' Helper function for the list_* query functions - Constructs the appropriate dictionaries to return from the API query. full If performing a full query, such as in list_nodes_full, change this parameter to ``True``. ''' server, user, password = _g...
[ "def", "_list_nodes", "(", "full", "=", "False", ")", ":", "server", ",", "user", ",", "password", "=", "_get_xml_rpc", "(", ")", "auth", "=", "':'", ".", "join", "(", "[", "user", ",", "password", "]", ")", "vm_pool", "=", "server", ".", "one", "....
Helper function for the list_* query functions - Constructs the appropriate dictionaries to return from the API query. full If performing a full query, such as in list_nodes_full, change this parameter to ``True``.
[ "Helper", "function", "for", "the", "list_", "*", "query", "functions", "-", "Constructs", "the", "appropriate", "dictionaries", "to", "return", "from", "the", "API", "query", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4542-L4583
train
Returns a list of all VMs in the cluster.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/opennebula.py
_xml_to_dict
def _xml_to_dict(xml): ''' Helper function to covert xml into a data dictionary. xml The xml data to convert. ''' dicts = {} for item in xml: key = item.tag.lower() idx = 1 while key in dicts: key += six.text_type(idx) idx += 1 if ...
python
def _xml_to_dict(xml): ''' Helper function to covert xml into a data dictionary. xml The xml data to convert. ''' dicts = {} for item in xml: key = item.tag.lower() idx = 1 while key in dicts: key += six.text_type(idx) idx += 1 if ...
[ "def", "_xml_to_dict", "(", "xml", ")", ":", "dicts", "=", "{", "}", "for", "item", "in", "xml", ":", "key", "=", "item", ".", "tag", ".", "lower", "(", ")", "idx", "=", "1", "while", "key", "in", "dicts", ":", "key", "+=", "six", ".", "text_ty...
Helper function to covert xml into a data dictionary. xml The xml data to convert.
[ "Helper", "function", "to", "covert", "xml", "into", "a", "data", "dictionary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4586-L4605
train
Helper function to covert xml into a data dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/config.py
option
def option( value, default='', omit_opts=False, omit_master=False, omit_pillar=False): ''' Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host ''' if not omit_o...
python
def option( value, default='', omit_opts=False, omit_master=False, omit_pillar=False): ''' Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host ''' if not omit_o...
[ "def", "option", "(", "value", ",", "default", "=", "''", ",", "omit_opts", "=", "False", ",", "omit_master", "=", "False", ",", "omit_pillar", "=", "False", ")", ":", "if", "not", "omit_opts", ":", "if", "value", "in", "__opts__", ":", "return", "__op...
Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host
[ "Pass", "in", "a", "generic", "option", "and", "receive", "the", "value", "that", "will", "be", "assigned" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L131-L157
train
Return the value of an option
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/config.py
get
def get(key, default='', delimiter=':', merge=None, omit_opts=False, omit_pillar=False, omit_master=False, omit_grains=False): ''' .. versionadded: 0.14.0 Attempt to retrieve the named value from the minion config file, pillar, grains or the master config. If the named value is not available, r...
python
def get(key, default='', delimiter=':', merge=None, omit_opts=False, omit_pillar=False, omit_master=False, omit_grains=False): ''' .. versionadded: 0.14.0 Attempt to retrieve the named value from the minion config file, pillar, grains or the master config. If the named value is not available, r...
[ "def", "get", "(", "key", ",", "default", "=", "''", ",", "delimiter", "=", "':'", ",", "merge", "=", "None", ",", "omit_opts", "=", "False", ",", "omit_pillar", "=", "False", ",", "omit_master", "=", "False", ",", "omit_grains", "=", "False", ")", "...
.. versionadded: 0.14.0 Attempt to retrieve the named value from the minion config file, pillar, grains or the master config. If the named value is not available, return the value specified by ``default``. If not specified, the default is an empty string. Values can also be retrieved from nested d...
[ "..", "versionadded", ":", "0", ".", "14", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L216-L422
train
Return the value associated with the named key in the nested dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/config.py
dot_vals
def dot_vals(value): ''' Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs CLI Example: .. code-block:: bash salt '*' config.dot_vals host ''' ret = {} for key, val in six.iteritems(__pillar_...
python
def dot_vals(value): ''' Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs CLI Example: .. code-block:: bash salt '*' config.dot_vals host ''' ret = {} for key, val in six.iteritems(__pillar_...
[ "def", "dot_vals", "(", "value", ")", ":", "ret", "=", "{", "}", "for", "key", ",", "val", "in", "six", ".", "iteritems", "(", "__pillar__", ".", "get", "(", "'master'", ",", "{", "}", ")", ")", ":", "if", "key", ".", "startswith", "(", "'{0}.'",...
Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs CLI Example: .. code-block:: bash salt '*' config.dot_vals host
[ "Pass", "in", "a", "configuration", "value", "that", "should", "be", "preceded", "by", "the", "module", "name", "and", "a", "dot", "this", "will", "return", "a", "list", "of", "all", "read", "key", "/", "value", "pairs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L425-L443
train
Return a list of all read key value pairs that start with the specified value
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/config.py
gather_bootstrap_script
def gather_bootstrap_script(bootstrap=None): ''' Download the salt-bootstrap script, and return its location bootstrap URL of alternate bootstrap script CLI Example: .. code-block:: bash salt '*' config.gather_bootstrap_script ''' if not HAS_CLOUD: return False, '...
python
def gather_bootstrap_script(bootstrap=None): ''' Download the salt-bootstrap script, and return its location bootstrap URL of alternate bootstrap script CLI Example: .. code-block:: bash salt '*' config.gather_bootstrap_script ''' if not HAS_CLOUD: return False, '...
[ "def", "gather_bootstrap_script", "(", "bootstrap", "=", "None", ")", ":", "if", "not", "HAS_CLOUD", ":", "return", "False", ",", "'config.gather_bootstrap_script is unavailable'", "ret", "=", "salt", ".", "utils", ".", "cloud", ".", "update_bootstrap", "(", "__op...
Download the salt-bootstrap script, and return its location bootstrap URL of alternate bootstrap script CLI Example: .. code-block:: bash salt '*' config.gather_bootstrap_script
[ "Download", "the", "salt", "-", "bootstrap", "script", "and", "return", "its", "location" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L446-L463
train
Download the salt - bootstrap script and return its location
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
_build_members
def _build_members(members, anycheck=False): ''' Builds a member formatted string for XML operation. ''' if isinstance(members, list): # This check will strip down members to a single any statement if anycheck and 'any' in members: return "<member>any</member>" resp...
python
def _build_members(members, anycheck=False): ''' Builds a member formatted string for XML operation. ''' if isinstance(members, list): # This check will strip down members to a single any statement if anycheck and 'any' in members: return "<member>any</member>" resp...
[ "def", "_build_members", "(", "members", ",", "anycheck", "=", "False", ")", ":", "if", "isinstance", "(", "members", ",", "list", ")", ":", "# This check will strip down members to a single any statement", "if", "anycheck", "and", "'any'", "in", "members", ":", "...
Builds a member formatted string for XML operation.
[ "Builds", "a", "member", "formatted", "string", "for", "XML", "operation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L101-L116
train
Builds a member formatted string for XML operation.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/panos.py
_edit_config
def _edit_config(xpath, element): ''' Sends an edit request to the device. ''' query = {'type': 'config', 'action': 'edit', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
python
def _edit_config(xpath, element): ''' Sends an edit request to the device. ''' query = {'type': 'config', 'action': 'edit', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
[ "def", "_edit_config", "(", "xpath", ",", "element", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'edit'", ",", "'xpath'", ":", "xpath", ",", "'element'", ":", "element", "}", "response", "=", "__proxy__", "[", "'panos.c...
Sends an edit request to the device.
[ "Sends", "an", "edit", "request", "to", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L134-L146
train
Sends an edit request to the device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
_move_after
def _move_after(xpath, target): ''' Moves an xpath to the after of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'after', 'dst': target} response = __proxy__['panos.call'](query) return _validate_resp...
python
def _move_after(xpath, target): ''' Moves an xpath to the after of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'after', 'dst': target} response = __proxy__['panos.call'](query) return _validate_resp...
[ "def", "_move_after", "(", "xpath", ",", "target", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'move'", ",", "'xpath'", ":", "xpath", ",", "'where'", ":", "'after'", ",", "'dst'", ":", "target", "}", "response", "=", ...
Moves an xpath to the after of its section.
[ "Moves", "an", "xpath", "to", "the", "after", "of", "its", "section", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L163-L176
train
Moves an xpath to the after of its section.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/panos.py
_move_before
def _move_before(xpath, target): ''' Moves an xpath to the bottom of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'before', 'dst': target} response = __proxy__['panos.call'](query) return _validate_r...
python
def _move_before(xpath, target): ''' Moves an xpath to the bottom of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'before', 'dst': target} response = __proxy__['panos.call'](query) return _validate_r...
[ "def", "_move_before", "(", "xpath", ",", "target", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'move'", ",", "'xpath'", ":", "xpath", ",", "'where'", ":", "'before'", ",", "'dst'", ":", "target", "}", "response", "="...
Moves an xpath to the bottom of its section.
[ "Moves", "an", "xpath", "to", "the", "bottom", "of", "its", "section", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L179-L192
train
Moves an xpath to the bottom of its section.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/panos.py
_set_config
def _set_config(xpath, element): ''' Sends a set request to the device. ''' query = {'type': 'config', 'action': 'set', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
python
def _set_config(xpath, element): ''' Sends a set request to the device. ''' query = {'type': 'config', 'action': 'set', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
[ "def", "_set_config", "(", "xpath", ",", "element", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'set'", ",", "'xpath'", ":", "xpath", ",", "'element'", ":", "element", "}", "response", "=", "__proxy__", "[", "'panos.cal...
Sends a set request to the device.
[ "Sends", "a", "set", "request", "to", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L225-L237
train
Send a set request to the device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
_validate_response
def _validate_response(response): ''' Validates a response from a Palo Alto device. Used to verify success of commands. ''' if not response: return False, 'Unable to validate response from device.' elif 'msg' in response: if 'line' in response['msg']: if response['msg'][...
python
def _validate_response(response): ''' Validates a response from a Palo Alto device. Used to verify success of commands. ''' if not response: return False, 'Unable to validate response from device.' elif 'msg' in response: if 'line' in response['msg']: if response['msg'][...
[ "def", "_validate_response", "(", "response", ")", ":", "if", "not", "response", ":", "return", "False", ",", "'Unable to validate response from device.'", "elif", "'msg'", "in", "response", ":", "if", "'line'", "in", "response", "[", "'msg'", "]", ":", "if", ...
Validates a response from a Palo Alto device. Used to verify success of commands.
[ "Validates", "a", "response", "from", "a", "Palo", "Alto", "device", ".", "Used", "to", "verify", "success", "of", "commands", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L240-L265
train
Validates a response from a Palo Alto device. Used to verify success of commands.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
add_config_lock
def add_config_lock(name): ''' Prevent other users from changing configuration until the lock is released. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.add_config_lock ''' ret = _default_ret(name) ret....
python
def add_config_lock(name): ''' Prevent other users from changing configuration until the lock is released. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.add_config_lock ''' ret = _default_ret(name) ret....
[ "def", "add_config_lock", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'changes'", ":", "__salt__", "[", "'panos.add_config_lock'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "return", ...
Prevent other users from changing configuration until the lock is released. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.add_config_lock
[ "Prevent", "other", "users", "from", "changing", "configuration", "until", "the", "lock", "is", "released", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L268-L289
train
Add a lock to the available configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
address_exists
def address_exists(name, addressname=None, vsys=1, ipnetmask=None, iprange=None, fqdn=None, description=None, commit=False): ''' Ensures that an address object exists in the confi...
python
def address_exists(name, addressname=None, vsys=1, ipnetmask=None, iprange=None, fqdn=None, description=None, commit=False): ''' Ensures that an address object exists in the confi...
[ "def", "address_exists", "(", "name", ",", "addressname", "=", "None", ",", "vsys", "=", "1", ",", "ipnetmask", "=", "None", ",", "iprange", "=", "None", ",", "fqdn", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":"...
Ensures that an address object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. This module will only process a single address type (ip-netmask, ip-range, or fqdn). It will process the specified value...
[ "Ensures", "that", "an", "address", "object", "exists", "in", "the", "configured", "state", ".", "If", "it", "does", "not", "exist", "or", "is", "not", "configured", "with", "the", "specified", "attributes", "it", "will", "be", "adjusted", "to", "match", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L292-L424
train
This module checks that an address object exists in the configured 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/panos.py
commit_config
def commit_config(name): ''' Commits the candidate configuration to the running configuration. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/commit: panos.commit_config ''' ret = _default_ret(name) ret.update({ ...
python
def commit_config(name): ''' Commits the candidate configuration to the running configuration. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/commit: panos.commit_config ''' ret = _default_ret(name) ret.update({ ...
[ "def", "commit_config", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'commit'", ":", "__salt__", "[", "'panos.commit'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "return", "ret" ]
Commits the candidate configuration to the running configuration. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/commit: panos.commit_config
[ "Commits", "the", "candidate", "configuration", "to", "the", "running", "configuration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L589-L610
train
Commits the candidate configuration to the running configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
delete_config
def delete_config(name, xpath=None, commit=False): ''' Deletes a Palo Alto XPATH to a specific value. Use the xpath parameter to specify the location of the object to be deleted. name: The name of the module function to execute. xpath(str): The XPATH of the configuration API tree to control. ...
python
def delete_config(name, xpath=None, commit=False): ''' Deletes a Palo Alto XPATH to a specific value. Use the xpath parameter to specify the location of the object to be deleted. name: The name of the module function to execute. xpath(str): The XPATH of the configuration API tree to control. ...
[ "def", "delete_config", "(", "name", ",", "xpath", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "not", "xpath", ":", "return", "ret", "query", "=", "{", "'type'", ":", "'config'", ",", "'acti...
Deletes a Palo Alto XPATH to a specific value. Use the xpath parameter to specify the location of the object to be deleted. name: The name of the module function to execute. xpath(str): The XPATH of the configuration API tree to control. commit(bool): If true the firewall will commit the changes, if...
[ "Deletes", "a", "Palo", "Alto", "XPATH", "to", "a", "specific", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L613-L660
train
Delete a Palo Alto XPATH to a specific 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/panos.py
download_software
def download_software(name, version=None, synch=False, check=False): ''' Ensures that a software version is downloaded. name: The name of the module function to execute. version(str): The software version to check. If this version is not already downloaded, it will attempt to download the file fro...
python
def download_software(name, version=None, synch=False, check=False): ''' Ensures that a software version is downloaded. name: The name of the module function to execute. version(str): The software version to check. If this version is not already downloaded, it will attempt to download the file fro...
[ "def", "download_software", "(", "name", ",", "version", "=", "None", ",", "synch", "=", "False", ",", "check", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "check", "is", "True", ":", "__salt__", "[", "'panos.check_softwar...
Ensures that a software version is downloaded. name: The name of the module function to execute. version(str): The software version to check. If this version is not already downloaded, it will attempt to download the file from Palo Alto. synch(bool): If true, after downloading the file it will be syn...
[ "Ensures", "that", "a", "software", "version", "is", "downloaded", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L663-L733
train
Download a software version from Palo Alto.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/panos.py
edit_config
def edit_config(name, xpath=None, value=None, commit=False): ''' Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use the...
python
def edit_config(name, xpath=None, value=None, commit=False): ''' Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use the...
[ "def", "edit_config", "(", "name", ",", "xpath", "=", "None", ",", "value", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "# Verify if the current XPATH is equal to the specified value.", "# If we are equal, no cha...
Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use the xpath parameter to specify the location of the object, including the nod...
[ "Edits", "a", "Palo", "Alto", "XPATH", "to", "a", "specific", "value", ".", "This", "will", "always", "overwrite", "the", "existing", "value", "even", "if", "it", "is", "not", "changed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L736-L815
train
Edits a Palo Alto XPATH to a specific 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/panos.py
move_config
def move_config(name, xpath=None, where=None, dst=None, commit=False): ''' Moves a XPATH value to a new location. Use the xpath parameter to specify the location of the object to be moved, the where parameter to specify type of move, and dst parameter to specify the destination path. name: The nam...
python
def move_config(name, xpath=None, where=None, dst=None, commit=False): ''' Moves a XPATH value to a new location. Use the xpath parameter to specify the location of the object to be moved, the where parameter to specify type of move, and dst parameter to specify the destination path. name: The nam...
[ "def", "move_config", "(", "name", ",", "xpath", "=", "None", ",", "where", "=", "None", ",", "dst", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "not", "xpath", ":", "return", "ret", "if",...
Moves a XPATH value to a new location. Use the xpath parameter to specify the location of the object to be moved, the where parameter to specify type of move, and dst parameter to specify the destination path. name: The name of the module function to execute. xpath(str): The XPATH of the configuratio...
[ "Moves", "a", "XPATH", "value", "to", "a", "new", "location", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L818-L888
train
Execute a move operation on the specified configuration object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/panos.py
remove_config_lock
def remove_config_lock(name): ''' Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock ''' ret = _default_ret(name) ret.update({ 'changes': __sal...
python
def remove_config_lock(name): ''' Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock ''' ret = _default_ret(name) ret.update({ 'changes': __sal...
[ "def", "remove_config_lock", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'changes'", ":", "__salt__", "[", "'panos.remove_config_lock'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "ret...
Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock
[ "Release", "config", "lock", "previously", "held", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L891-L912
train
Remove the config lock previously held.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/panos.py
security_rule_exists
def security_rule_exists(name, rulename=None, vsys='1', action=None, disabled=None, sourcezone=None, destinationzone=None, source=None, ...
python
def security_rule_exists(name, rulename=None, vsys='1', action=None, disabled=None, sourcezone=None, destinationzone=None, source=None, ...
[ "def", "security_rule_exists", "(", "name", ",", "rulename", "=", "None", ",", "vsys", "=", "'1'", ",", "action", "=", "None", ",", "disabled", "=", "None", ",", "sourcezone", "=", "None", ",", "destinationzone", "=", "None", ",", "source", "=", "None", ...
Ensures that a security rule exists on the device. Also, ensure that all configurations are set appropriately. This method will create the rule if it does not exist. If the rule does exist, it will ensure that the configurations are set appropriately. If the rule does not exist and is created, any value t...
[ "Ensures", "that", "a", "security", "rule", "exists", "on", "the", "device", ".", "Also", "ensure", "that", "all", "configurations", "are", "set", "appropriately", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L970-L1328
train
A function that checks if a security rule exists on a Palorama 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/states/panos.py
service_exists
def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False): ''' Ensures that a service object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. nam...
python
def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False): ''' Ensures that a service object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. nam...
[ "def", "service_exists", "(", "name", ",", "servicename", "=", "None", ",", "vsys", "=", "1", ",", "protocol", "=", "None", ",", "port", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", ...
Ensures that a service object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. name: The name of the module function to execute. servicename(str): The name of the security object. The name is case-s...
[ "Ensures", "that", "a", "service", "object", "exists", "in", "the", "configured", "state", ".", "If", "it", "does", "not", "exist", "or", "is", "not", "configured", "with", "the", "specified", "attributes", "it", "will", "be", "adjusted", "to", "match", "t...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1331-L1438
train
Ensures that a service object exists in the configured 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/panos.py
service_group_exists
def service_group_exists(name, groupname=None, vsys=1, members=None, description=None, commit=False): ''' Ensures that a service group object exists in the configured state. If it does no...
python
def service_group_exists(name, groupname=None, vsys=1, members=None, description=None, commit=False): ''' Ensures that a service group object exists in the configured state. If it does no...
[ "def", "service_group_exists", "(", "name", ",", "groupname", "=", "None", ",", "vsys", "=", "1", ",", "members", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", ...
Ensures that a service group object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. This module will enforce group membership. If a group exists and contains members this state does not include, thos...
[ "Ensures", "that", "a", "service", "group", "object", "exists", "in", "the", "configured", "state", ".", "If", "it", "does", "not", "exist", "or", "is", "not", "configured", "with", "the", "specified", "attributes", "it", "will", "be", "adjusted", "to", "m...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1441-L1544
train
Ensures that a service group object exists in the configured 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/panos.py
set_config
def set_config(name, xpath=None, value=None, commit=False): ''' Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to...
python
def set_config(name, xpath=None, value=None, commit=False): ''' Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to...
[ "def", "set_config", "(", "name", ",", "xpath", "=", "None", ",", "value", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "result", ",", "msg", "=", "_set_config", "(", "xpath", ",", "value", ")", ...
Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to specify the location of the object in the configuration name: The ...
[ "Sets", "a", "Palo", "Alto", "XPATH", "to", "a", "specific", "value", ".", "This", "will", "always", "overwrite", "the", "existing", "value", "even", "if", "it", "is", "not", "changed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1547-L1592
train
Sets a Palo Alto XPATH to a specific value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/cmdmod.py
_check_cb
def _check_cb(cb_): ''' If the callback is None or is not callable, return a lambda that returns the value passed. ''' if cb_ is not None: if hasattr(cb_, '__call__'): return cb_ else: log.error('log_callback is not callable, ignoring') return lambda x: x
python
def _check_cb(cb_): ''' If the callback is None or is not callable, return a lambda that returns the value passed. ''' if cb_ is not None: if hasattr(cb_, '__call__'): return cb_ else: log.error('log_callback is not callable, ignoring') return lambda x: x
[ "def", "_check_cb", "(", "cb_", ")", ":", "if", "cb_", "is", "not", "None", ":", "if", "hasattr", "(", "cb_", ",", "'__call__'", ")", ":", "return", "cb_", "else", ":", "log", ".", "error", "(", "'log_callback is not callable, ignoring'", ")", "return", ...
If the callback is None or is not callable, return a lambda that returns the value passed.
[ "If", "the", "callback", "is", "None", "or", "is", "not", "callable", "return", "a", "lambda", "that", "returns", "the", "value", "passed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L79-L89
train
Check if the callback is callable and return a lambda that returns the value passed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/cmdmod.py
_python_shell_default
def _python_shell_default(python_shell, __pub_jid): ''' Set python_shell default based on remote execution and __opts__['cmd_safe'] ''' try: # Default to python_shell=True when run directly from remote execution # system. Cross-module calls won't have a jid. if __pub_jid and pyth...
python
def _python_shell_default(python_shell, __pub_jid): ''' Set python_shell default based on remote execution and __opts__['cmd_safe'] ''' try: # Default to python_shell=True when run directly from remote execution # system. Cross-module calls won't have a jid. if __pub_jid and pyth...
[ "def", "_python_shell_default", "(", "python_shell", ",", "__pub_jid", ")", ":", "try", ":", "# Default to python_shell=True when run directly from remote execution", "# system. Cross-module calls won't have a jid.", "if", "__pub_jid", "and", "python_shell", "is", "None", ":", ...
Set python_shell default based on remote execution and __opts__['cmd_safe']
[ "Set", "python_shell", "default", "based", "on", "remote", "execution", "and", "__opts__", "[", "cmd_safe", "]" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L92-L106
train
Set python_shell default based on remote execution and opts
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/cmdmod.py
_render_cmd
def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None): ''' If template is a valid template engine, process the cmd and cwd through that engine. ''' if not template: return (cmd, cwd) # render the path as a template using path_template_engine as the en...
python
def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None): ''' If template is a valid template engine, process the cmd and cwd through that engine. ''' if not template: return (cmd, cwd) # render the path as a template using path_template_engine as the en...
[ "def", "_render_cmd", "(", "cmd", ",", "cwd", ",", "template", ",", "saltenv", "=", "'base'", ",", "pillarenv", "=", "None", ",", "pillar_override", "=", "None", ")", ":", "if", "not", "template", ":", "return", "(", "cmd", ",", "cwd", ")", "# render t...
If template is a valid template engine, process the cmd and cwd through that engine.
[ "If", "template", "is", "a", "valid", "template", "engine", "process", "the", "cmd", "and", "cwd", "through", "that", "engine", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L123-L172
train
Render the command and cwd through the specified template engine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/cmdmod.py
_check_loglevel
def _check_loglevel(level='info'): ''' Retrieve the level code for use in logging.Logger.log(). ''' try: level = level.lower() if level == 'quiet': return None else: return LOG_LEVELS[level] except (AttributeError, KeyError): log.error( ...
python
def _check_loglevel(level='info'): ''' Retrieve the level code for use in logging.Logger.log(). ''' try: level = level.lower() if level == 'quiet': return None else: return LOG_LEVELS[level] except (AttributeError, KeyError): log.error( ...
[ "def", "_check_loglevel", "(", "level", "=", "'info'", ")", ":", "try", ":", "level", "=", "level", ".", "lower", "(", ")", "if", "level", "==", "'quiet'", ":", "return", "None", "else", ":", "return", "LOG_LEVELS", "[", "level", "]", "except", "(", ...
Retrieve the level code for use in logging.Logger.log().
[ "Retrieve", "the", "level", "code", "for", "use", "in", "logging", ".", "Logger", ".", "log", "()", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L175-L191
train
Check the level code for use in logging. Logger. log.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/cmdmod.py
_gather_pillar
def _gather_pillar(pillarenv, pillar_override): ''' Whenever a state run starts, gather the pillar data fresh ''' pillar = salt.pillar.get_pillar( __opts__, __grains__, __opts__['id'], __opts__['saltenv'], pillar_override=pillar_override, pillarenv=pillare...
python
def _gather_pillar(pillarenv, pillar_override): ''' Whenever a state run starts, gather the pillar data fresh ''' pillar = salt.pillar.get_pillar( __opts__, __grains__, __opts__['id'], __opts__['saltenv'], pillar_override=pillar_override, pillarenv=pillare...
[ "def", "_gather_pillar", "(", "pillarenv", ",", "pillar_override", ")", ":", "pillar", "=", "salt", ".", "pillar", ".", "get_pillar", "(", "__opts__", ",", "__grains__", ",", "__opts__", "[", "'id'", "]", ",", "__opts__", "[", "'saltenv'", "]", ",", "pilla...
Whenever a state run starts, gather the pillar data fresh
[ "Whenever", "a", "state", "run", "starts", "gather", "the", "pillar", "data", "fresh" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L204-L219
train
Gather the pillar data for a state run start
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/cmdmod.py
_check_avail
def _check_avail(cmd): ''' Check to see if the given command can be run ''' if isinstance(cmd, list): cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x for x in cmd]) bret = True wret = False if __salt__['config.get']('cmd_blacklis...
python
def _check_avail(cmd): ''' Check to see if the given command can be run ''' if isinstance(cmd, list): cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x for x in cmd]) bret = True wret = False if __salt__['config.get']('cmd_blacklis...
[ "def", "_check_avail", "(", "cmd", ")", ":", "if", "isinstance", "(", "cmd", ",", "list", ")", ":", "cmd", "=", "' '", ".", "join", "(", "[", "six", ".", "text_type", "(", "x", ")", "if", "not", "isinstance", "(", "x", ",", "six", ".", "string_ty...
Check to see if the given command can be run
[ "Check", "to", "see", "if", "the", "given", "command", "can", "be", "run" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L222-L247
train
Check to see if the given command can be run
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/cmdmod.py
_run
def _run(cmd, cwd=None, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, output_encoding=None, output_loglevel='debug', log_callback=None, runas=None, group=None, shell=DEFAULT_SHELL, python_shell=False, ...
python
def _run(cmd, cwd=None, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, output_encoding=None, output_loglevel='debug', log_callback=None, runas=None, group=None, shell=DEFAULT_SHELL, python_shell=False, ...
[ "def", "_run", "(", "cmd", ",", "cwd", "=", "None", ",", "stdin", "=", "None", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ",", "output_encoding", "=", "None", ",", "output_loglevel", "=", "'debug'", ",...
Do the DRY thing and only call subprocess.Popen() once
[ "Do", "the", "DRY", "thing", "and", "only", "call", "subprocess", ".", "Popen", "()", "once" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L250-L858
train
Run a command on the salt - minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/cmdmod.py
_run_quiet
def _run_quiet(cmd, cwd=None, stdin=None, output_encoding=None, runas=None, shell=DEFAULT_SHELL, python_shell=False, env=None, template=None, umask=None, timeout=None, ...
python
def _run_quiet(cmd, cwd=None, stdin=None, output_encoding=None, runas=None, shell=DEFAULT_SHELL, python_shell=False, env=None, template=None, umask=None, timeout=None, ...
[ "def", "_run_quiet", "(", "cmd", ",", "cwd", "=", "None", ",", "stdin", "=", "None", ",", "output_encoding", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "DEFAULT_SHELL", ",", "python_shell", "=", "False", ",", "env", "=", "None", ",", ...
Helper for running commands quietly for minion startup
[ "Helper", "for", "running", "commands", "quietly", "for", "minion", "startup" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L861-L902
train
Helper for running commands quietly for minion startup
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/zoneadm.py
_is_globalzone
def _is_globalzone(): ''' Check if we are running in the globalzone ''' if not __grains__['kernel'] == 'SunOS': return False zonename = __salt__['cmd.run_all']('zonename') if zonename['retcode']: return False if zonename['stdout'] == 'global': return True return...
python
def _is_globalzone(): ''' Check if we are running in the globalzone ''' if not __grains__['kernel'] == 'SunOS': return False zonename = __salt__['cmd.run_all']('zonename') if zonename['retcode']: return False if zonename['stdout'] == 'global': return True return...
[ "def", "_is_globalzone", "(", ")", ":", "if", "not", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "return", "False", "zonename", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zonename'", ")", "if", "zonename", "[", "'retcode'", "]", ":", ...
Check if we are running in the globalzone
[ "Check", "if", "we", "are", "running", "in", "the", "globalzone" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L36-L49
train
Check if we are running in the globalzone
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/zoneadm.py
list_zones
def list_zones(verbose=True, installed=False, configured=False, hide_global=True): ''' List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_...
python
def list_zones(verbose=True, installed=False, configured=False, hide_global=True): ''' List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_...
[ "def", "list_zones", "(", "verbose", "=", "True", ",", "installed", "=", "False", ",", "configured", "=", "False", ",", "hide_global", "=", "True", ")", ":", "zones", "=", "{", "}", "## fetch zones", "header", "=", "'zoneid:zonename:state:zonepath:uuid:brand:ip-...
List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_global : boolean do not include global zone CLI Example: .. code-block:: bash...
[ "List", "all", "zones" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L77-L124
train
List all zones in the system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/zoneadm.py
boot
def boot(zone, single=False, altinit=None, smf_options=None): ''' Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executab...
python
def boot(zone, single=False, altinit=None, smf_options=None): ''' Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executab...
[ "def", "boot", "(", "zone", ",", "single", "=", "False", ",", "altinit", "=", "None", ",", "smf_options", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## build boot_options", "boot_options", "=", "''", "if", "single", ":", "bo...
Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executable to be the primordial process. smf_options : string include ...
[ "Boot", "(", "or", "activate", ")", "the", "specified", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L127-L173
train
Boot the specified zone.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/zoneadm.py
attach
def attach(zone, force=False, brand_opts=None): ''' Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:...
python
def attach(zone, force=False, brand_opts=None): ''' Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:...
[ "def", "attach", "(", "zone", ",", "force", "=", "False", ",", "brand_opts", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## attach zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} attach{force}{bra...
Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:: bash salt '*' zoneadm.attach lawrence sal...
[ "Attach", "the", "specified", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L334-L366
train
Attach the specified zone to the current node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/zoneadm.py
ready
def ready(zone): ''' Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine ''' ret = {'status': True} ## ready zone res = __salt__['cmd.run_all']('zoneadm {zone} ready'...
python
def ready(zone): ''' Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine ''' ret = {'status': True} ## ready zone res = __salt__['cmd.run_all']('zoneadm {zone} ready'...
[ "def", "ready", "(", "zone", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## ready zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm {zone} ready'", ".", "format", "(", "zone", "=", "'-u {0}'", ".", "format", "(", "zon...
Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine
[ "Prepares", "a", "zone", "for", "running", "applications", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L369-L394
train
Returns a base zone for running applications.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/zoneadm.py
verify
def verify(zone): ''' Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores ''' ret = {'status': True} ## verify zone ...
python
def verify(zone): ''' Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores ''' ret = {'status': True} ## verify zone ...
[ "def", "verify", "(", "zone", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## verify zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} verify'", ".", "format", "(", "zone", "=", "zone", ",", ")", ")", "ret", ...
Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores
[ "Check", "to", "make", "sure", "the", "configuration", "of", "the", "specified", "zone", "can", "safely", "be", "installed", "on", "the", "machine", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L397-L423
train
Check to make sure the configuration of the specified zone can safely be installed on the machine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/zoneadm.py
move
def move(zone, zonepath): ''' Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave ''' ret = {'status': True} ## verify zone re...
python
def move(zone, zonepath): ''' Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave ''' ret = {'status': True} ## verify zone re...
[ "def", "move", "(", "zone", ",", "zonepath", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## verify zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm {zone} move {path}'", ".", "format", "(", "zone", "=", "'-u {0}'", "."...
Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave
[ "Move", "zone", "to", "new", "zonepath", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L426-L454
train
Move the specified zone to a new zonepath.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/zoneadm.py
install
def install(zone, nodataset=False, brand_opts=None): ''' Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: b...
python
def install(zone, nodataset=False, brand_opts=None): ''' Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: b...
[ "def", "install", "(", "zone", ",", "nodataset", "=", "False", ",", "brand_opts", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## install zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} install{nod...
Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: bash salt '*' zoneadm.install dolores salt '*' zo...
[ "Install", "the", "specified", "zone", "from", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L488-L520
train
Install the specified zone from the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/zoneadm.py
clone
def clone(zone, source, snapshot=None): ''' Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash ...
python
def clone(zone, source, snapshot=None): ''' Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash ...
[ "def", "clone", "(", "zone", ",", "source", ",", "snapshot", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## install zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} clone {snapshot}{source}'", ".", ...
Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash salt '*' zoneadm.clone clementine dolores
[ "Install", "a", "zone", "by", "copying", "an", "existing", "installed", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L523-L554
train
Copy an existing installed zone into a new one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
find_file
def find_file(path, saltenv='base', **kwargs): ''' Search the environment for the relative path ''' fnd = {'path': '', 'rel': ''} for container in __opts__.get('azurefs', []): if container.get('saltenv', 'base') != saltenv: continue full = os.path.join(_get_con...
python
def find_file(path, saltenv='base', **kwargs): ''' Search the environment for the relative path ''' fnd = {'path': '', 'rel': ''} for container in __opts__.get('azurefs', []): if container.get('saltenv', 'base') != saltenv: continue full = os.path.join(_get_con...
[ "def", "find_file", "(", "path", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "fnd", "=", "{", "'path'", ":", "''", ",", "'rel'", ":", "''", "}", "for", "container", "in", "__opts__", ".", "get", "(", "'azurefs'", ",", "[", "...
Search the environment for the relative path
[ "Search", "the", "environment", "for", "the", "relative", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L102-L133
train
Find the file in 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/fileserver/azurefs.py
envs
def envs(): ''' Each container configuration can have an environment setting, or defaults to base ''' saltenvs = [] for container in __opts__.get('azurefs', []): saltenvs.append(container.get('saltenv', 'base')) # Remove duplicates return list(set(saltenvs))
python
def envs(): ''' Each container configuration can have an environment setting, or defaults to base ''' saltenvs = [] for container in __opts__.get('azurefs', []): saltenvs.append(container.get('saltenv', 'base')) # Remove duplicates return list(set(saltenvs))
[ "def", "envs", "(", ")", ":", "saltenvs", "=", "[", "]", "for", "container", "in", "__opts__", ".", "get", "(", "'azurefs'", ",", "[", "]", ")", ":", "saltenvs", ".", "append", "(", "container", ".", "get", "(", "'saltenv'", ",", "'base'", ")", ")"...
Each container configuration can have an environment setting, or defaults to base
[ "Each", "container", "configuration", "can", "have", "an", "environment", "setting", "or", "defaults", "to", "base" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L136-L145
train
Return a list of all environment settings that can be used for the container configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
serve_file
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' ret = {'data': '', 'dest': ''} required_load_keys = ('path', 'loc', 'saltenv') if not all(x in load for x in required_load_keys): log.debug( 'Not all of the required keys prese...
python
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' ret = {'data': '', 'dest': ''} required_load_keys = ('path', 'loc', 'saltenv') if not all(x in load for x in required_load_keys): log.debug( 'Not all of the required keys prese...
[ "def", "serve_file", "(", "load", ",", "fnd", ")", ":", "ret", "=", "{", "'data'", ":", "''", ",", "'dest'", ":", "''", "}", "required_load_keys", "=", "(", "'path'", ",", "'loc'", ",", "'saltenv'", ")", "if", "not", "all", "(", "x", "in", "load", ...
Return a chunk from a file based on the data received
[ "Return", "a", "chunk", "from", "a", "file", "based", "on", "the", "data", "received" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L148-L175
train
Serve a file based on the data received by 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/fileserver/azurefs.py
update
def update(): ''' Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container ''' f...
python
def update(): ''' Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container ''' f...
[ "def", "update", "(", ")", ":", "for", "container", "in", "__opts__", "[", "'azurefs'", "]", ":", "path", "=", "_get_container_path", "(", "container", ")", "try", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "os", ".", ...
Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container
[ "Update", "caches", "of", "the", "storage", "containers", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L178-L272
train
Update the cache of the storage containers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
file_hash
def file_hash(load, fnd): ''' Return a file hash based on the hash type set in the master config ''' if not all(x in load for x in ('path', 'saltenv')): return '', None ret = {'hash_type': __opts__['hash_type']} relpath = fnd['rel'] path = fnd['path'] hash_cachedir = os.path.join...
python
def file_hash(load, fnd): ''' Return a file hash based on the hash type set in the master config ''' if not all(x in load for x in ('path', 'saltenv')): return '', None ret = {'hash_type': __opts__['hash_type']} relpath = fnd['rel'] path = fnd['path'] hash_cachedir = os.path.join...
[ "def", "file_hash", "(", "load", ",", "fnd", ")", ":", "if", "not", "all", "(", "x", "in", "load", "for", "x", "in", "(", "'path'", ",", "'saltenv'", ")", ")", ":", "return", "''", ",", "None", "ret", "=", "{", "'hash_type'", ":", "__opts__", "["...
Return a file hash based on the hash type set in the master config
[ "Return", "a", "file", "hash", "based", "on", "the", "hash", "type", "set", "in", "the", "master", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L275-L299
train
Return a file hash based on the hash type set in the master config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
file_list
def file_list(load): ''' Return a list of all files in a specified environment ''' ret = set() try: for container in __opts__['azurefs']: if container.get('saltenv', 'base') != load['saltenv']: continue container_list = _get_container_path(container) +...
python
def file_list(load): ''' Return a list of all files in a specified environment ''' ret = set() try: for container in __opts__['azurefs']: if container.get('saltenv', 'base') != load['saltenv']: continue container_list = _get_container_path(container) +...
[ "def", "file_list", "(", "load", ")", ":", "ret", "=", "set", "(", ")", "try", ":", "for", "container", "in", "__opts__", "[", "'azurefs'", "]", ":", "if", "container", ".", "get", "(", "'saltenv'", ",", "'base'", ")", "!=", "load", "[", "'saltenv'",...
Return a list of all files in a specified environment
[ "Return", "a", "list", "of", "all", "files", "in", "a", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L302-L323
train
Return a list of all files in a 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/fileserver/azurefs.py
dir_list
def dir_list(load): ''' Return a list of all directories in a specified environment ''' ret = set() files = file_list(load) for f in files: dirname = f while dirname: dirname = os.path.dirname(dirname) if dirname: ret.add(dirname) retur...
python
def dir_list(load): ''' Return a list of all directories in a specified environment ''' ret = set() files = file_list(load) for f in files: dirname = f while dirname: dirname = os.path.dirname(dirname) if dirname: ret.add(dirname) retur...
[ "def", "dir_list", "(", "load", ")", ":", "ret", "=", "set", "(", ")", "files", "=", "file_list", "(", "load", ")", "for", "f", "in", "files", ":", "dirname", "=", "f", "while", "dirname", ":", "dirname", "=", "os", ".", "path", ".", "dirname", "...
Return a list of all directories in a specified environment
[ "Return", "a", "list", "of", "all", "directories", "in", "a", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L326-L338
train
Return a list of all directories in a 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/fileserver/azurefs.py
_get_container_path
def _get_container_path(container): ''' Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores ''' root = os.path.join(__opts__['cachedir'], 'azurefs') container_dir = '{0}_{1}_{2}'.forma...
python
def _get_container_path(container): ''' Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores ''' root = os.path.join(__opts__['cachedir'], 'azurefs') container_dir = '{0}_{1}_{2}'.forma...
[ "def", "_get_container_path", "(", "container", ")", ":", "root", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'azurefs'", ")", "container_dir", "=", "'{0}_{1}_{2}'", ".", "format", "(", "container", ".", "get", "(", ...
Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores
[ "Get", "the", "cache", "path", "for", "the", "container", "in", "question" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L341-L352
train
Get the path to the container in question
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
_get_container_service
def _get_container_service(container): ''' Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order ''' if 'account_key' in container: account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac...
python
def _get_container_service(container): ''' Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order ''' if 'account_key' in container: account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac...
[ "def", "_get_container_service", "(", "container", ")", ":", "if", "'account_key'", "in", "container", ":", "account", "=", "azure", ".", "storage", ".", "CloudStorageAccount", "(", "container", "[", "'account_name'", "]", ",", "account_key", "=", "container", "...
Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order
[ "Get", "the", "azure", "block", "blob", "service", "for", "the", "container", "in", "question" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L355-L368
train
Get the azure block blob service for the container in question
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/azurefs.py
_validate_config
def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('azurefs configuration is not formed as a list, skipping azurefs') return False for container in __opts__['azurefs']: if not is...
python
def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('azurefs configuration is not formed as a list, skipping azurefs') return False for container in __opts__['azurefs']: if not is...
[ "def", "_validate_config", "(", ")", ":", "if", "not", "isinstance", "(", "__opts__", "[", "'azurefs'", "]", ",", "list", ")", ":", "log", ".", "error", "(", "'azurefs configuration is not formed as a list, skipping azurefs'", ")", "return", "False", "for", "conta...
Validate azurefs config, return False if it doesn't validate
[ "Validate", "azurefs", "config", "return", "False", "if", "it", "doesn", "t", "validate" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L371-L391
train
Validate azurefs config return False if it doesn t validate
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/grains/smartos.py
_smartos_computenode_data
def _smartos_computenode_data(): ''' Return useful information from a SmartOS compute node ''' # Provides: # vms_total # vms_running # vms_stopped # vms_type # sdc_version # vm_capable # vm_hw_virt grains = {} # collect vm data vms = {} for vm ...
python
def _smartos_computenode_data(): ''' Return useful information from a SmartOS compute node ''' # Provides: # vms_total # vms_running # vms_stopped # vms_type # sdc_version # vm_capable # vm_hw_virt grains = {} # collect vm data vms = {} for vm ...
[ "def", "_smartos_computenode_data", "(", ")", ":", "# Provides:", "# vms_total", "# vms_running", "# vms_stopped", "# vms_type", "# sdc_version", "# vm_capable", "# vm_hw_virt", "grains", "=", "{", "}", "# collect vm data", "vms", "=", "{", "}", "for", "vm...
Return useful information from a SmartOS compute node
[ "Return", "useful", "information", "from", "a", "SmartOS", "compute", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L49-L99
train
Return useful information from a SmartOS compute 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/grains/smartos.py
_smartos_zone_data
def _smartos_zone_data(): ''' Return useful information from a SmartOS zone ''' # Provides: # zoneid # zonename # imageversion grains = { 'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True), 'zonename': __salt__['cmd.run']...
python
def _smartos_zone_data(): ''' Return useful information from a SmartOS zone ''' # Provides: # zoneid # zonename # imageversion grains = { 'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True), 'zonename': __salt__['cmd.run']...
[ "def", "_smartos_zone_data", "(", ")", ":", "# Provides:", "# zoneid", "# zonename", "# imageversion", "grains", "=", "{", "'zoneid'", ":", "__salt__", "[", "'cmd.run'", "]", "(", "'zoneadm list -p | awk -F: \\'{ print $1 }\\''", ",", "python_shell", "=", "True", ...
Return useful information from a SmartOS zone
[ "Return", "useful", "information", "from", "a", "SmartOS", "zone" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L102-L126
train
Return useful information from a SmartOS zone
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/grains/smartos.py
_smartos_zone_pkgsrc_data
def _smartos_zone_pkgsrc_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgsrcversion # pkgsrcpath grains = { 'pkgsrcversion': 'Unknown', 'pkgsrcpath': 'Unknown', } pkgsrcversion = re.compile('^release:\\s(.+)') if os.path.isfile('/etc/pkgsrc_...
python
def _smartos_zone_pkgsrc_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgsrcversion # pkgsrcpath grains = { 'pkgsrcversion': 'Unknown', 'pkgsrcpath': 'Unknown', } pkgsrcversion = re.compile('^release:\\s(.+)') if os.path.isfile('/etc/pkgsrc_...
[ "def", "_smartos_zone_pkgsrc_data", "(", ")", ":", "# Provides:", "# pkgsrcversion", "# pkgsrcpath", "grains", "=", "{", "'pkgsrcversion'", ":", "'Unknown'", ",", "'pkgsrcpath'", ":", "'Unknown'", ",", "}", "pkgsrcversion", "=", "re", ".", "compile", "(", "'^r...
SmartOS zone pkgsrc information
[ "SmartOS", "zone", "pkgsrc", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L129-L160
train
Returns a dict of info about SmartOS zone pkgsrc 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/grains/smartos.py
_smartos_zone_pkgin_data
def _smartos_zone_pkgin_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgin_repositories grains = { 'pkgin_repositories': [], } pkginrepo = re.compile('^(?:https|http|ftp|file)://.*$') if os.path.isfile('/opt/local/etc/pkgin/repositories.conf'): wi...
python
def _smartos_zone_pkgin_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgin_repositories grains = { 'pkgin_repositories': [], } pkginrepo = re.compile('^(?:https|http|ftp|file)://.*$') if os.path.isfile('/opt/local/etc/pkgin/repositories.conf'): wi...
[ "def", "_smartos_zone_pkgin_data", "(", ")", ":", "# Provides:", "# pkgin_repositories", "grains", "=", "{", "'pkgin_repositories'", ":", "[", "]", ",", "}", "pkginrepo", "=", "re", ".", "compile", "(", "'^(?:https|http|ftp|file)://.*$'", ")", "if", "os", ".", ...
SmartOS zone pkgsrc information
[ "SmartOS", "zone", "pkgsrc", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L163-L182
train
Return the smartos zone pkgin repositories information for a single object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/grains/smartos.py
smartos
def smartos(): ''' Provide grains for SmartOS ''' grains = {} if salt.utils.platform.is_smartos_zone(): grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True) grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True) ...
python
def smartos(): ''' Provide grains for SmartOS ''' grains = {} if salt.utils.platform.is_smartos_zone(): grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True) grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True) ...
[ "def", "smartos", "(", ")", ":", "grains", "=", "{", "}", "if", "salt", ".", "utils", ".", "platform", ".", "is_smartos_zone", "(", ")", ":", "grains", "=", "salt", ".", "utils", ".", "dictupdate", ".", "update", "(", "grains", ",", "_smartos_zone_data...
Provide grains for SmartOS
[ "Provide", "grains", "for", "SmartOS" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L185-L198
train
Provide grains for SmartOS
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/engines/logentries.py
start
def start(endpoint='data.logentries.com', port=10000, token=None, tag='salt/engines/logentries'): ''' Listen to salt events and forward them to Logentries ''' if __opts__.get('id').endswith('_master'): event_bus = salt.utils.event.get_master_event( __opt...
python
def start(endpoint='data.logentries.com', port=10000, token=None, tag='salt/engines/logentries'): ''' Listen to salt events and forward them to Logentries ''' if __opts__.get('id').endswith('_master'): event_bus = salt.utils.event.get_master_event( __opt...
[ "def", "start", "(", "endpoint", "=", "'data.logentries.com'", ",", "port", "=", "10000", ",", "token", "=", "None", ",", "tag", "=", "'salt/engines/logentries'", ")", ":", "if", "__opts__", ".", "get", "(", "'id'", ")", ".", "endswith", "(", "'_master'", ...
Listen to salt events and forward them to Logentries
[ "Listen", "to", "salt", "events", "and", "forward", "them", "to", "Logentries" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/logentries.py#L174-L215
train
Start a new logentries server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/glusterfs.py
peered
def peered(name): ''' Check if node is peered. name The remote host with which to peer. .. code-block:: yaml peer-cluster: glusterfs.peered: - name: two peer-clusters: glusterfs.peered: - names: - one - t...
python
def peered(name): ''' Check if node is peered. name The remote host with which to peer. .. code-block:: yaml peer-cluster: glusterfs.peered: - name: two peer-clusters: glusterfs.peered: - names: - one - t...
[ "def", "peered", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "False", "}", "try", ":", "suc", ".", "check_name", "(", "name", ",", "'a-zA-Z0-9._-...
Check if node is peered. name The remote host with which to peer. .. code-block:: yaml peer-cluster: glusterfs.peered: - name: two peer-clusters: glusterfs.peered: - names: - one - two - three ...
[ "Check", "if", "node", "is", "peered", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L40-L108
train
Check if a node is peered.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/glusterfs.py
volume_present
def volume_present(name, bricks, stripe=False, replica=False, device_vg=False, transport='tcp', start=False, force=False, arbiter=False): ''' Ensure that the volume exists name name of the volume bricks list of brick paths replica replica count for volum...
python
def volume_present(name, bricks, stripe=False, replica=False, device_vg=False, transport='tcp', start=False, force=False, arbiter=False): ''' Ensure that the volume exists name name of the volume bricks list of brick paths replica replica count for volum...
[ "def", "volume_present", "(", "name", ",", "bricks", ",", "stripe", "=", "False", ",", "replica", "=", "False", ",", "device_vg", "=", "False", ",", "transport", "=", "'tcp'", ",", "start", "=", "False", ",", "force", "=", "False", ",", "arbiter", "=",...
Ensure that the volume exists name name of the volume bricks list of brick paths replica replica count for volume arbiter use every third brick as arbiter (metadata only) .. versionadded:: 2019.2.0 start ensure that the volume is also started ...
[ "Ensure", "that", "the", "volume", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L111-L222
train
Ensure that the volume is present in the system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/glusterfs.py
started
def started(name): ''' Check if volume has been started name name of the volume .. code-block:: yaml mycluster: glusterfs.started: [] ''' ret = {'name': name, 'changes': {}, 'comment': '', 'result': False} volinfo = __salt__['glu...
python
def started(name): ''' Check if volume has been started name name of the volume .. code-block:: yaml mycluster: glusterfs.started: [] ''' ret = {'name': name, 'changes': {}, 'comment': '', 'result': False} volinfo = __salt__['glu...
[ "def", "started", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "False", "}", "volinfo", "=", "__salt__", "[", "'glusterfs.info'", "]", "(", ")", "...
Check if volume has been started name name of the volume .. code-block:: yaml mycluster: glusterfs.started: []
[ "Check", "if", "volume", "has", "been", "started" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L225-L266
train
Check if the named volume has been started
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/glusterfs.py
add_volume_bricks
def add_volume_bricks(name, bricks): ''' Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume .. code-block:: yaml myvolume: glusterfs.add_volume_bricks: - bricks: - host1:/srv/gluster/drive1 ...
python
def add_volume_bricks(name, bricks): ''' Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume .. code-block:: yaml myvolume: glusterfs.add_volume_bricks: - bricks: - host1:/srv/gluster/drive1 ...
[ "def", "add_volume_bricks", "(", "name", ",", "bricks", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "False", "}", "volinfo", "=", "__salt__", "[", "'glusterfs.inf...
Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume .. code-block:: yaml myvolume: glusterfs.add_volume_bricks: - bricks: - host1:/srv/gluster/drive1 - host2:/srv/gluster/drive2 ...
[ "Add", "brick", "(", "s", ")", "to", "an", "existing", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L269-L323
train
Add bricks to an existing volume
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/glusterfs.py
op_version
def op_version(name, version): ''' .. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name version Version to which the cluster.op-version should be set .. code-block:: yaml myvolume: glusterfs.op_version: - name: volume1 ...
python
def op_version(name, version): ''' .. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name version Version to which the cluster.op-version should be set .. code-block:: yaml myvolume: glusterfs.op_version: - name: volume1 ...
[ "def", "op_version", "(", "name", ",", "version", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "False", "}", "try", ":", "current", "=", "int", "(", "__salt__"...
.. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name version Version to which the cluster.op-version should be set .. code-block:: yaml myvolume: glusterfs.op_version: - name: volume1 - version: 30707
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L326-L375
train
Sets the version of the specified volume
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/glusterfs.py
max_op_version
def max_op_version(name): ''' .. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name .. code-block:: yaml myvolume: glusterfs.max_op_version: - name: volume1 - version: 30707 ''' ret = {'name': name, 'ch...
python
def max_op_version(name): ''' .. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name .. code-block:: yaml myvolume: glusterfs.max_op_version: - name: volume1 - version: 30707 ''' ret = {'name': name, 'ch...
[ "def", "max_op_version", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "False", "}", "try", ":", "current", "=", "int", "(", "__salt__", "[", "'glu...
.. versionadded:: 2019.2.0 Add brick(s) to an existing volume name Volume name .. code-block:: yaml myvolume: glusterfs.max_op_version: - name: volume1 - version: 30707
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L378-L431
train
Ensure that the max - op - version of a volume is equal to the one specified by the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/nagios_nrdp_return.py
_prepare_xml
def _prepare_xml(options=None, state=None): ''' Get the requests options from salt. ''' if state: _state = '0' else: _state = '2' xml = "<?xml version='1.0'?>\n<checkresults>\n" # No service defined then we set the status of the hostname if 'service' in options and opt...
python
def _prepare_xml(options=None, state=None): ''' Get the requests options from salt. ''' if state: _state = '0' else: _state = '2' xml = "<?xml version='1.0'?>\n<checkresults>\n" # No service defined then we set the status of the hostname if 'service' in options and opt...
[ "def", "_prepare_xml", "(", "options", "=", "None", ",", "state", "=", "None", ")", ":", "if", "state", ":", "_state", "=", "'0'", "else", ":", "_state", "=", "'2'", "xml", "=", "\"<?xml version='1.0'?>\\n<checkresults>\\n\"", "# No service defined then we set the...
Get the requests options from salt.
[ "Get", "the", "requests", "options", "from", "salt", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L108-L138
train
Prepare the xml for the log entry
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/nagios_nrdp_return.py
_getText
def _getText(nodelist): ''' Simple function to return value from XML ''' rc = [] for node in nodelist: if node.nodeType == node.TEXT_NODE: rc.append(node.data) return ''.join(rc)
python
def _getText(nodelist): ''' Simple function to return value from XML ''' rc = [] for node in nodelist: if node.nodeType == node.TEXT_NODE: rc.append(node.data) return ''.join(rc)
[ "def", "_getText", "(", "nodelist", ")", ":", "rc", "=", "[", "]", "for", "node", "in", "nodelist", ":", "if", "node", ".", "nodeType", "==", "node", ".", "TEXT_NODE", ":", "rc", ".", "append", "(", "node", ".", "data", ")", "return", "''", ".", ...
Simple function to return value from XML
[ "Simple", "function", "to", "return", "value", "from", "XML" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L141-L149
train
Simple function to return value from XML
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/nagios_nrdp_return.py
_post_data
def _post_data(options=None, xml=None): ''' Post data to Nagios NRDP ''' params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml} res = salt.utils.http.query( url=options['url'], method='POST', params=params, data='', decode=True, ...
python
def _post_data(options=None, xml=None): ''' Post data to Nagios NRDP ''' params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml} res = salt.utils.http.query( url=options['url'], method='POST', params=params, data='', decode=True, ...
[ "def", "_post_data", "(", "options", "=", "None", ",", "xml", "=", "None", ")", ":", "params", "=", "{", "'token'", ":", "options", "[", "'token'", "]", ".", "strip", "(", ")", ",", "'cmd'", ":", "'submitcheck'", ",", "'XMLDATA'", ":", "xml", "}", ...
Post data to Nagios NRDP
[ "Post", "data", "to", "Nagios", "NRDP" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L152-L184
train
Post data to Nagios NRDP.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/nagios_nrdp_return.py
returner
def returner(ret): ''' Send a message to Nagios with the data ''' _options = _get_options(ret) log.debug('_options %s', _options) _options['hostname'] = ret.get('id') if 'url' not in _options or _options['url'] == '': log.error('nagios_nrdp.url not defined in salt config') ...
python
def returner(ret): ''' Send a message to Nagios with the data ''' _options = _get_options(ret) log.debug('_options %s', _options) _options['hostname'] = ret.get('id') if 'url' not in _options or _options['url'] == '': log.error('nagios_nrdp.url not defined in salt config') ...
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "log", ".", "debug", "(", "'_options %s'", ",", "_options", ")", "_options", "[", "'hostname'", "]", "=", "ret", ".", "get", "(", "'id'", ")", "if", "'url'", "...
Send a message to Nagios with the data
[ "Send", "a", "message", "to", "Nagios", "with", "the", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L187-L207
train
Send a message to Nagios 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/influxdb_return.py
_get_serv
def _get_serv(ret=None): ''' Return an influxdb client object ''' _options = _get_options(ret) host = _options.get('host') port = _options.get('port') database = _options.get('db') user = _options.get('user') password = _options.get('password') version = _get_version(host, port, ...
python
def _get_serv(ret=None): ''' Return an influxdb client object ''' _options = _get_options(ret) host = _options.get('host') port = _options.get('port') database = _options.get('db') user = _options.get('user') password = _options.get('password') version = _get_version(host, port, ...
[ "def", "_get_serv", "(", "ret", "=", "None", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "host", "=", "_options", ".", "get", "(", "'host'", ")", "port", "=", "_options", ".", "get", "(", "'port'", ")", "database", "=", "_options", "....
Return an influxdb client object
[ "Return", "an", "influxdb", "client", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L122-L147
train
Return an influxdb client object
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/influxdb_return.py
returner
def returner(ret): ''' Return data to a influxdb data store ''' serv = _get_serv(ret) # strip the 'return' key to avoid data duplication in the database json_return = salt.utils.json.dumps(ret['return']) del ret['return'] json_full_ret = salt.utils.json.dumps(ret) # create legacy r...
python
def returner(ret): ''' Return data to a influxdb data store ''' serv = _get_serv(ret) # strip the 'return' key to avoid data duplication in the database json_return = salt.utils.json.dumps(ret['return']) del ret['return'] json_full_ret = salt.utils.json.dumps(ret) # create legacy r...
[ "def", "returner", "(", "ret", ")", ":", "serv", "=", "_get_serv", "(", "ret", ")", "# strip the 'return' key to avoid data duplication in the database", "json_return", "=", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "ret", "[", "'return'", "]", ")", ...
Return data to a influxdb data store
[ "Return", "data", "to", "a", "influxdb", "data", "store" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L150-L192
train
Return data to a influxdb data store
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/influxdb_return.py
save_load
def save_load(jid, load, minions=None): ''' Save the load to the specified jid ''' serv = _get_serv(ret=None) # create legacy request in case an InfluxDB 0.8.x version is used if "influxdb08" in serv.__module__: req = [ { 'name': 'jids', 'colu...
python
def save_load(jid, load, minions=None): ''' Save the load to the specified jid ''' serv = _get_serv(ret=None) # create legacy request in case an InfluxDB 0.8.x version is used if "influxdb08" in serv.__module__: req = [ { 'name': 'jids', 'colu...
[ "def", "save_load", "(", "jid", ",", "load", ",", "minions", "=", "None", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "# create legacy request in case an InfluxDB 0.8.x version is used", "if", "\"influxdb08\"", "in", "serv", ".", "__module__"...
Save the load to the specified jid
[ "Save", "the", "load", "to", "the", "specified", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L195-L229
train
Save the load to the specified jid WorkItem
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/influxdb_return.py
get_load
def get_load(jid): ''' Return the load data that marks a specified jid ''' serv = _get_serv(ret=None) sql = "select load from jids where jid = '{0}'".format(jid) log.debug(">> Now in get_load %s", jid) data = serv.query(sql) log.debug(">> Now Data: %s", data) if data: return...
python
def get_load(jid): ''' Return the load data that marks a specified jid ''' serv = _get_serv(ret=None) sql = "select load from jids where jid = '{0}'".format(jid) log.debug(">> Now in get_load %s", jid) data = serv.query(sql) log.debug(">> Now Data: %s", data) if data: return...
[ "def", "get_load", "(", "jid", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "sql", "=", "\"select load from jids where jid = '{0}'\"", ".", "format", "(", "jid", ")", "log", ".", "debug", "(", "\">> Now in get_load %s\"", ",", "jid", ")"...
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/influxdb_return.py#L239-L251
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/influxdb_return.py
get_jid
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' serv = _get_serv(ret=None) sql = "select id, full_ret from returns where jid = '{0}'".format(jid) data = serv.query(sql) ret = {} if data: points = data[0]['points'] for poi...
python
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' serv = _get_serv(ret=None) sql = "select id, full_ret from returns where jid = '{0}'".format(jid) data = serv.query(sql) ret = {} if data: points = data[0]['points'] for poi...
[ "def", "get_jid", "(", "jid", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "sql", "=", "\"select id, full_ret from returns where jid = '{0}'\"", ".", "format", "(", "jid", ")", "data", "=", "serv", ".", "query", "(", "sql", ")", "ret",...
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/influxdb_return.py#L254-L269
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/influxdb_return.py
get_fun
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' serv = _get_serv(ret=None) sql = '''select first(id) as fid, first(full_ret) as fret from returns where fun = '{0}' group by fun, id '''.format(fun) data = serv.que...
python
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' serv = _get_serv(ret=None) sql = '''select first(id) as fid, first(full_ret) as fret from returns where fun = '{0}' group by fun, id '''.format(fun) data = serv.que...
[ "def", "get_fun", "(", "fun", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "sql", "=", "'''select first(id) as fid, first(full_ret) as fret\n from returns\n where fun = '{0}'\n group by fun, id\n '''", ".", "format", ...
Return a dict of the last function called for all minions
[ "Return", "a", "dict", "of", "the", "last", "function", "called", "for", "all", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L272-L291
train
Return a dict of the last function called for all minions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/influxdb_return.py
get_jids
def get_jids(): ''' Return a list of all job ids ''' serv = _get_serv(ret=None) sql = "select distinct(jid) from jids group by load" # [{u'points': [[0, jid, load], # [0, jid, load]], # u'name': u'jids', # u'columns': [u'time', u'distinct', u'load']}] data = se...
python
def get_jids(): ''' Return a list of all job ids ''' serv = _get_serv(ret=None) sql = "select distinct(jid) from jids group by load" # [{u'points': [[0, jid, load], # [0, jid, load]], # u'name': u'jids', # u'columns': [u'time', u'distinct', u'load']}] data = se...
[ "def", "get_jids", "(", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "sql", "=", "\"select distinct(jid) from jids group by load\"", "# [{u'points': [[0, jid, load],", "# [0, jid, load]],", "# u'name': u'jids',", "# u'columns': [u'time', u...
Return a list of all job ids
[ "Return", "a", "list", "of", "all", "job", "ids" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L294-L310
train
Return a list of all job ids
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/returners/influxdb_return.py
get_minions
def get_minions(): ''' Return a list of minions ''' serv = _get_serv(ret=None) sql = "select distinct(id) from returns" data = serv.query(sql) ret = [] if data: for jid in data[0]['points']: ret.append(jid[1]) return ret
python
def get_minions(): ''' Return a list of minions ''' serv = _get_serv(ret=None) sql = "select distinct(id) from returns" data = serv.query(sql) ret = [] if data: for jid in data[0]['points']: ret.append(jid[1]) return ret
[ "def", "get_minions", "(", ")", ":", "serv", "=", "_get_serv", "(", "ret", "=", "None", ")", "sql", "=", "\"select distinct(id) from returns\"", "data", "=", "serv", ".", "query", "(", "sql", ")", "ret", "=", "[", "]", "if", "data", ":", "for", "jid", ...
Return a list of minions
[ "Return", "a", "list", "of", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L313-L326
train
Return a list of minions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
get_running_jobs
def get_running_jobs(opts): ''' Return the running jobs on the master ''' ret = [] proc_dir = os.path.join(opts['cachedir'], 'proc') if not os.path.isdir(proc_dir): return ret for fn_ in os.listdir(proc_dir): path = os.path.join(proc_dir, fn_) data = read_proc_file(p...
python
def get_running_jobs(opts): ''' Return the running jobs on the master ''' ret = [] proc_dir = os.path.join(opts['cachedir'], 'proc') if not os.path.isdir(proc_dir): return ret for fn_ in os.listdir(proc_dir): path = os.path.join(proc_dir, fn_) data = read_proc_file(p...
[ "def", "get_running_jobs", "(", "opts", ")", ":", "ret", "=", "[", "]", "proc_dir", "=", "os", ".", "path", ".", "join", "(", "opts", "[", "'cachedir'", "]", ",", "'proc'", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "proc_dir", ")", ...
Return the running jobs on the master
[ "Return", "the", "running", "jobs", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L48-L65
train
Return the running jobs 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/utils/master.py
read_proc_file
def read_proc_file(path, opts): ''' Return a dict of JID metadata, or None ''' serial = salt.payload.Serial(opts) with salt.utils.files.fopen(path, 'rb') as fp_: try: data = serial.load(fp_) except Exception as err: # need to add serial exception here ...
python
def read_proc_file(path, opts): ''' Return a dict of JID metadata, or None ''' serial = salt.payload.Serial(opts) with salt.utils.files.fopen(path, 'rb') as fp_: try: data = serial.load(fp_) except Exception as err: # need to add serial exception here ...
[ "def", "read_proc_file", "(", "path", ",", "opts", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "opts", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'rb'", ")", "as", "fp_", ":", "try", ...
Return a dict of JID metadata, or None
[ "Return", "a", "dict", "of", "JID", "metadata", "or", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L68-L93
train
Read a salt. payload. Processor file and return a dict of JID metadata or None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
is_pid_healthy
def is_pid_healthy(pid): ''' This is a health check that will confirm the PID is running and executed by salt. If pusutil is available: * all architectures are checked if psutil is not available: * Linux/Solaris/etc: archs with `/proc/cmdline` available are checked * AIX/Wi...
python
def is_pid_healthy(pid): ''' This is a health check that will confirm the PID is running and executed by salt. If pusutil is available: * all architectures are checked if psutil is not available: * Linux/Solaris/etc: archs with `/proc/cmdline` available are checked * AIX/Wi...
[ "def", "is_pid_healthy", "(", "pid", ")", ":", "if", "HAS_PSUTIL", ":", "try", ":", "proc", "=", "psutil", ".", "Process", "(", "pid", ")", "except", "psutil", ".", "NoSuchProcess", ":", "log", ".", "warning", "(", "\"PID %s is no longer running.\"", ",", ...
This is a health check that will confirm the PID is running and executed by salt. If pusutil is available: * all architectures are checked if psutil is not available: * Linux/Solaris/etc: archs with `/proc/cmdline` available are checked * AIX/Windows: assume PID is healhty and retu...
[ "This", "is", "a", "health", "check", "that", "will", "confirm", "the", "PID", "is", "running", "and", "executed", "by", "salt", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L96-L129
train
Checks if a process is running and executed by salt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
get_values_of_matching_keys
def get_values_of_matching_keys(pattern_dict, user_name): ''' Check a whitelist and/or blacklist to see if the value matches it. ''' ret = [] for expr in pattern_dict: if salt.utils.stringutils.expr_match(user_name, expr): ret.extend(pattern_dict[expr]) return ret
python
def get_values_of_matching_keys(pattern_dict, user_name): ''' Check a whitelist and/or blacklist to see if the value matches it. ''' ret = [] for expr in pattern_dict: if salt.utils.stringutils.expr_match(user_name, expr): ret.extend(pattern_dict[expr]) return ret
[ "def", "get_values_of_matching_keys", "(", "pattern_dict", ",", "user_name", ")", ":", "ret", "=", "[", "]", "for", "expr", "in", "pattern_dict", ":", "if", "salt", ".", "utils", ".", "stringutils", ".", "expr_match", "(", "user_name", ",", "expr", ")", ":...
Check a whitelist and/or blacklist to see if the value matches it.
[ "Check", "a", "whitelist", "and", "/", "or", "blacklist", "to", "see", "if", "the", "value", "matches", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L806-L814
train
Get a list of values that match a user 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/utils/master.py
MasterPillarUtil.get_minion_pillar
def get_minion_pillar(self): ''' Get pillar data for the targeted minions, either by fetching the cached minion data on the master, or by compiling the minion's pillar data on the master. For runner modules that need access minion pillar data, this function should be use...
python
def get_minion_pillar(self): ''' Get pillar data for the targeted minions, either by fetching the cached minion data on the master, or by compiling the minion's pillar data on the master. For runner modules that need access minion pillar data, this function should be use...
[ "def", "get_minion_pillar", "(", "self", ")", ":", "minion_pillars", "=", "{", "}", "minion_grains", "=", "{", "}", "minion_ids", "=", "self", ".", "_tgt_to_list", "(", ")", "if", "any", "(", "arg", "for", "arg", "in", "[", "self", ".", "use_cached_grain...
Get pillar data for the targeted minions, either by fetching the cached minion data on the master, or by compiling the minion's pillar data on the master. For runner modules that need access minion pillar data, this function should be used instead of getting the pillar data by e...
[ "Get", "pillar", "data", "for", "the", "targeted", "minions", "either", "by", "fetching", "the", "cached", "minion", "data", "on", "the", "master", "or", "by", "compiling", "the", "minion", "s", "pillar", "data", "on", "the", "master", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L332-L369
train
Get pillar data for the targeted minions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
MasterPillarUtil.get_minion_grains
def get_minion_grains(self): ''' Get grains data for the targeted minions, either by fetching the cached minion data on the master, or by fetching the grains directly on the minion. By default, this function tries hard to get the grains data: - Try to get the cached ...
python
def get_minion_grains(self): ''' Get grains data for the targeted minions, either by fetching the cached minion data on the master, or by fetching the grains directly on the minion. By default, this function tries hard to get the grains data: - Try to get the cached ...
[ "def", "get_minion_grains", "(", "self", ")", ":", "minion_grains", "=", "{", "}", "minion_ids", "=", "self", ".", "_tgt_to_list", "(", ")", "if", "not", "minion_ids", ":", "return", "{", "}", "if", "any", "(", "arg", "for", "arg", "in", "[", "self", ...
Get grains data for the targeted minions, either by fetching the cached minion data on the master, or by fetching the grains directly on the minion. By default, this function tries hard to get the grains data: - Try to get the cached minion grains if the master has m...
[ "Get", "grains", "data", "for", "the", "targeted", "minions", "either", "by", "fetching", "the", "cached", "minion", "data", "on", "the", "master", "or", "by", "fetching", "the", "grains", "directly", "on", "the", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L371-L397
train
Get the grains data for the targeted minions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
MasterPillarUtil.get_cached_mine_data
def get_cached_mine_data(self): ''' Get cached mine data for the targeted minions. ''' mine_data = {} minion_ids = self._tgt_to_list() log.debug('Getting cached mine data for: %s', minion_ids) mine_data = self._get_cached_mine_data(*minion_ids) return mine...
python
def get_cached_mine_data(self): ''' Get cached mine data for the targeted minions. ''' mine_data = {} minion_ids = self._tgt_to_list() log.debug('Getting cached mine data for: %s', minion_ids) mine_data = self._get_cached_mine_data(*minion_ids) return mine...
[ "def", "get_cached_mine_data", "(", "self", ")", ":", "mine_data", "=", "{", "}", "minion_ids", "=", "self", ".", "_tgt_to_list", "(", ")", "log", ".", "debug", "(", "'Getting cached mine data for: %s'", ",", "minion_ids", ")", "mine_data", "=", "self", ".", ...
Get cached mine data for the targeted minions.
[ "Get", "cached", "mine", "data", "for", "the", "targeted", "minions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L399-L407
train
Get cached mine data for the targeted minions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
MasterPillarUtil.clear_cached_minion_data
def clear_cached_minion_data(self, clear_pillar=False, clear_grains=False, clear_mine=False, clear_mine_func=None): ''' Clear the cached data/files for the targeted minions...
python
def clear_cached_minion_data(self, clear_pillar=False, clear_grains=False, clear_mine=False, clear_mine_func=None): ''' Clear the cached data/files for the targeted minions...
[ "def", "clear_cached_minion_data", "(", "self", ",", "clear_pillar", "=", "False", ",", "clear_grains", "=", "False", ",", "clear_mine", "=", "False", ",", "clear_mine_func", "=", "None", ")", ":", "clear_what", "=", "[", "]", "if", "clear_pillar", ":", "cle...
Clear the cached data/files for the targeted minions.
[ "Clear", "the", "cached", "data", "/", "files", "for", "the", "targeted", "minions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L409-L476
train
Clear the cached data for the targeted minions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
CacheTimer.run
def run(self): ''' main loop that fires the event every second ''' context = zmq.Context() # the socket for outgoing timer events socket = context.socket(zmq.PUB) socket.setsockopt(zmq.LINGER, 100) socket.bind('ipc://' + self.timer_sock) count = 0...
python
def run(self): ''' main loop that fires the event every second ''' context = zmq.Context() # the socket for outgoing timer events socket = context.socket(zmq.PUB) socket.setsockopt(zmq.LINGER, 100) socket.bind('ipc://' + self.timer_sock) count = 0...
[ "def", "run", "(", "self", ")", ":", "context", "=", "zmq", ".", "Context", "(", ")", "# the socket for outgoing timer events", "socket", "=", "context", ".", "socket", "(", "zmq", ".", "PUB", ")", "socket", ".", "setsockopt", "(", "zmq", ".", "LINGER", ...
main loop that fires the event every second
[ "main", "loop", "that", "fires", "the", "event", "every", "second" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L492-L509
train
main loop that fires the event every second
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/master.py
CacheWorker.run
def run(self): ''' Gather currently connected minions and update the cache ''' new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids()) cc = cache_cli(self.opts) cc.get_cached() cc.put_cache([new_mins]) log.debug('ConCache CacheWorker updat...
python
def run(self): ''' Gather currently connected minions and update the cache ''' new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids()) cc = cache_cli(self.opts) cc.get_cached() cc.put_cache([new_mins]) log.debug('ConCache CacheWorker updat...
[ "def", "run", "(", "self", ")", ":", "new_mins", "=", "list", "(", "salt", ".", "utils", ".", "minions", ".", "CkMinions", "(", "self", ".", "opts", ")", ".", "connected_ids", "(", ")", ")", "cc", "=", "cache_cli", "(", "self", ".", "opts", ")", ...
Gather currently connected minions and update the cache
[ "Gather", "currently", "connected", "minions", "and", "update", "the", "cache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L544-L552
train
Gather currently connected minions and update the cache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/master.py
ConnectedCache.cleanup
def cleanup(self): ''' remove sockets on shutdown ''' log.debug('ConCache cleaning up') if os.path.exists(self.cache_sock): os.remove(self.cache_sock) if os.path.exists(self.update_sock): os.remove(self.update_sock) if os.path.exists(self.u...
python
def cleanup(self): ''' remove sockets on shutdown ''' log.debug('ConCache cleaning up') if os.path.exists(self.cache_sock): os.remove(self.cache_sock) if os.path.exists(self.update_sock): os.remove(self.update_sock) if os.path.exists(self.u...
[ "def", "cleanup", "(", "self", ")", ":", "log", ".", "debug", "(", "'ConCache cleaning up'", ")", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "cache_sock", ")", ":", "os", ".", "remove", "(", "self", ".", "cache_sock", ")", "if", "os", ...
remove sockets on shutdown
[ "remove", "sockets", "on", "shutdown" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L613-L623
train
Remove sockets on shutdown and remove update_sock on shutdown.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/master.py
ConnectedCache.secure
def secure(self): ''' secure the sockets for root-only access ''' log.debug('ConCache securing sockets') if os.path.exists(self.cache_sock): os.chmod(self.cache_sock, 0o600) if os.path.exists(self.update_sock): os.chmod(self.update_sock, 0o600) ...
python
def secure(self): ''' secure the sockets for root-only access ''' log.debug('ConCache securing sockets') if os.path.exists(self.cache_sock): os.chmod(self.cache_sock, 0o600) if os.path.exists(self.update_sock): os.chmod(self.update_sock, 0o600) ...
[ "def", "secure", "(", "self", ")", ":", "log", ".", "debug", "(", "'ConCache securing sockets'", ")", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "cache_sock", ")", ":", "os", ".", "chmod", "(", "self", ".", "cache_sock", ",", "0o600", ...
secure the sockets for root-only access
[ "secure", "the", "sockets", "for", "root", "-", "only", "access" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L625-L635
train
secure the sockets for root - only access
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/master.py
ConnectedCache.stop
def stop(self): ''' shutdown cache process ''' # avoid getting called twice self.cleanup() if self.running: self.running = False self.timer_stop.set() self.timer.join()
python
def stop(self): ''' shutdown cache process ''' # avoid getting called twice self.cleanup() if self.running: self.running = False self.timer_stop.set() self.timer.join()
[ "def", "stop", "(", "self", ")", ":", "# avoid getting called twice", "self", ".", "cleanup", "(", ")", "if", "self", ".", "running", ":", "self", ".", "running", "=", "False", "self", ".", "timer_stop", ".", "set", "(", ")", "self", ".", "timer", ".",...
shutdown cache process
[ "shutdown", "cache", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L637-L646
train
shutdown cache process
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/master.py
ConnectedCache.run
def run(self): ''' Main loop of the ConCache, starts updates in intervals and answers requests from the MWorkers ''' context = zmq.Context() # the socket for incoming cache requests creq_in = context.socket(zmq.REP) creq_in.setsockopt(zmq.LINGER, 100) ...
python
def run(self): ''' Main loop of the ConCache, starts updates in intervals and answers requests from the MWorkers ''' context = zmq.Context() # the socket for incoming cache requests creq_in = context.socket(zmq.REP) creq_in.setsockopt(zmq.LINGER, 100) ...
[ "def", "run", "(", "self", ")", ":", "context", "=", "zmq", ".", "Context", "(", ")", "# the socket for incoming cache requests", "creq_in", "=", "context", ".", "socket", "(", "zmq", ".", "REP", ")", "creq_in", ".", "setsockopt", "(", "zmq", ".", "LINGER"...
Main loop of the ConCache, starts updates in intervals and answers requests from the MWorkers
[ "Main", "loop", "of", "the", "ConCache", "starts", "updates", "in", "intervals", "and", "answers", "requests", "from", "the", "MWorkers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L648-L767
train
Main loop of the ConCache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/sms_return.py
returner
def returner(ret): ''' Return a response in an SMS message ''' _options = _get_options(ret) sid = _options.get('sid', None) token = _options.get('token', None) sender = _options.get('from', None) receiver = _options.get('to', None) if sid is None or token is None: log.error...
python
def returner(ret): ''' Return a response in an SMS message ''' _options = _get_options(ret) sid = _options.get('sid', None) token = _options.get('token', None) sender = _options.get('from', None) receiver = _options.get('to', None) if sid is None or token is None: log.error...
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "sid", "=", "_options", ".", "get", "(", "'sid'", ",", "None", ")", "token", "=", "_options", ".", "get", "(", "'token'", ",", "None", ")", "sender", "=", "_...
Return a response in an SMS message
[ "Return", "a", "response", "in", "an", "SMS", "message" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sms_return.py#L72-L105
train
Return a response in an SMS message
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/keystone_group.py
_common
def _common(kwargs): ''' Returns: None if group wasn't found, otherwise a group object ''' search_kwargs = {'name': kwargs['name']} if 'domain' in kwargs: domain = __salt__['keystoneng.get_entity']( 'domain', name=kwargs.pop('domain')) domain_id = domain.id ...
python
def _common(kwargs): ''' Returns: None if group wasn't found, otherwise a group object ''' search_kwargs = {'name': kwargs['name']} if 'domain' in kwargs: domain = __salt__['keystoneng.get_entity']( 'domain', name=kwargs.pop('domain')) domain_id = domain.id ...
[ "def", "_common", "(", "kwargs", ")", ":", "search_kwargs", "=", "{", "'name'", ":", "kwargs", "[", "'name'", "]", "}", "if", "'domain'", "in", "kwargs", ":", "domain", "=", "__salt__", "[", "'keystoneng.get_entity'", "]", "(", "'domain'", ",", "name", "...
Returns: None if group wasn't found, otherwise a group object
[ "Returns", ":", "None", "if", "group", "wasn", "t", "found", "otherwise", "a", "group", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_group.py#L41-L53
train
Common logic for group_get
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/keystone_group.py
absent
def absent(name, auth=None, **kwargs): ''' Ensure group does not exist name Name of the group domain The name or id of the domain ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_kwargs']...
python
def absent(name, auth=None, **kwargs): ''' Ensure group does not exist name Name of the group domain The name or id of the domain ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_kwargs']...
[ "def", "absent", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "kwargs", "=", "...
Ensure group does not exist name Name of the group domain The name or id of the domain
[ "Ensure", "group", "does", "not", "exist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_group.py#L108-L141
train
Ensure group does not exist
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/wheel/pillar_roots.py
find
def find(path, saltenv='base'): ''' Return a dict of the files located with the given path and environment ''' # Return a list of paths + text or bin ret = [] if saltenv not in __opts__['pillar_roots']: return ret for root in __opts__['pillar_roots'][saltenv]: full = os.path....
python
def find(path, saltenv='base'): ''' Return a dict of the files located with the given path and environment ''' # Return a list of paths + text or bin ret = [] if saltenv not in __opts__['pillar_roots']: return ret for root in __opts__['pillar_roots'][saltenv]: full = os.path....
[ "def", "find", "(", "path", ",", "saltenv", "=", "'base'", ")", ":", "# Return a list of paths + text or bin", "ret", "=", "[", "]", "if", "saltenv", "not", "in", "__opts__", "[", "'pillar_roots'", "]", ":", "return", "ret", "for", "root", "in", "__opts__", ...
Return a dict of the files located with the given path and environment
[ "Return", "a", "dict", "of", "the", "files", "located", "with", "the", "given", "path", "and", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L19-L36
train
Return a dict of the files located with the given path and 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/wheel/pillar_roots.py
list_env
def list_env(saltenv='base'): ''' Return all of the file paths found in an environment ''' ret = {} if saltenv not in __opts__['pillar_roots']: return ret for f_root in __opts__['pillar_roots'][saltenv]: ret[f_root] = {} for root, dirs, files in salt.utils.path.os_walk(f_...
python
def list_env(saltenv='base'): ''' Return all of the file paths found in an environment ''' ret = {} if saltenv not in __opts__['pillar_roots']: return ret for f_root in __opts__['pillar_roots'][saltenv]: ret[f_root] = {} for root, dirs, files in salt.utils.path.os_walk(f_...
[ "def", "list_env", "(", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "}", "if", "saltenv", "not", "in", "__opts__", "[", "'pillar_roots'", "]", ":", "return", "ret", "for", "f_root", "in", "__opts__", "[", "'pillar_roots'", "]", "[", "saltenv", ...
Return all of the file paths found in an environment
[ "Return", "all", "of", "the", "file", "paths", "found", "in", "an", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L39-L66
train
Return all of the file paths found in an 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...