repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/reg.py | key_exists | def key_exists(hive, key, use_32bit_registry=False):
r'''
Check that the key is found in the registry. This refers to keys and not
value/data pairs.
Args:
hive (str): The hive to connect to
key (str): The key to check
use_32bit_registry (bool): Look in the 32bit portion of th... | python | def key_exists(hive, key, use_32bit_registry=False):
r'''
Check that the key is found in the registry. This refers to keys and not
value/data pairs.
Args:
hive (str): The hive to connect to
key (str): The key to check
use_32bit_registry (bool): Look in the 32bit portion of th... | [
"def",
"key_exists",
"(",
"hive",
",",
"key",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.key_exists'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",",
"use_32bit_registry",
"=",
"use_32bit_registry",
")"
... | r'''
Check that the key is found in the registry. This refers to keys and not
value/data pairs.
Args:
hive (str): The hive to connect to
key (str): The key to check
use_32bit_registry (bool): Look in the 32bit portion of the registry
Returns:
bool: True if exists, ot... | [
"r",
"Check",
"that",
"the",
"key",
"is",
"found",
"in",
"the",
"registry",
".",
"This",
"refers",
"to",
"keys",
"and",
"not",
"value",
"/",
"data",
"pairs",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L99-L123 | train | r Check that the given key exists in the registry. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | list_keys | def list_keys(hive, key=None, use_32bit_registry=False):
'''
Enumerates the subkeys in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
... | python | def list_keys(hive, key=None, use_32bit_registry=False):
'''
Enumerates the subkeys in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
... | [
"def",
"list_keys",
"(",
"hive",
",",
"key",
"=",
"None",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.list_keys'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",",
"use_32bit_registry",
"=",
"use_32bit_re... | Enumerates the subkeys in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES_ROOT or HKCR
... | [
"Enumerates",
"the",
"subkeys",
"in",
"a",
"registry",
"key",
"or",
"hive",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L146-L180 | train | List the keys under a given hive or key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | list_values | def list_values(hive, key=None, use_32bit_registry=False, include_default=True):
r'''
Enumerates the values in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER ... | python | def list_values(hive, key=None, use_32bit_registry=False, include_default=True):
r'''
Enumerates the values in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER ... | [
"def",
"list_values",
"(",
"hive",
",",
"key",
"=",
"None",
",",
"use_32bit_registry",
"=",
"False",
",",
"include_default",
"=",
"True",
")",
":",
"return",
"__utils__",
"[",
"'reg.list_values'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",... | r'''
Enumerates the values in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES_ROOT or HKC... | [
"r",
"Enumerates",
"the",
"values",
"in",
"a",
"registry",
"key",
"or",
"hive",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L183-L221 | train | r Returns a list of values under the specified registry key or hive. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | read_value | def read_value(hive, key, vname=None, use_32bit_registry=False):
r'''
Reads a registry value entry or the default value for a key. To read the
default value, don't pass ``vname``
Args:
hive (str): The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
... | python | def read_value(hive, key, vname=None, use_32bit_registry=False):
r'''
Reads a registry value entry or the default value for a key. To read the
default value, don't pass ``vname``
Args:
hive (str): The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
... | [
"def",
"read_value",
"(",
"hive",
",",
"key",
",",
"vname",
"=",
"None",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.read_value'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",",
"vname",
"=",
"vname... | r'''
Reads a registry value entry or the default value for a key. To read the
default value, don't pass ``vname``
Args:
hive (str): The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
... | [
"r",
"Reads",
"a",
"registry",
"value",
"entry",
"or",
"the",
"default",
"value",
"for",
"a",
"key",
".",
"To",
"read",
"the",
"default",
"value",
"don",
"t",
"pass",
"vname"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L224-L282 | train | r Reads a value from the registry entry or the default value for a key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | set_value | def set_value(hive,
key,
vname=None,
vdata=None,
vtype='REG_SZ',
use_32bit_registry=False,
volatile=False):
'''
Sets a value in the registry. If ``vname`` is passed, it will be the value
for that value name, otherwise it wil... | python | def set_value(hive,
key,
vname=None,
vdata=None,
vtype='REG_SZ',
use_32bit_registry=False,
volatile=False):
'''
Sets a value in the registry. If ``vname`` is passed, it will be the value
for that value name, otherwise it wil... | [
"def",
"set_value",
"(",
"hive",
",",
"key",
",",
"vname",
"=",
"None",
",",
"vdata",
"=",
"None",
",",
"vtype",
"=",
"'REG_SZ'",
",",
"use_32bit_registry",
"=",
"False",
",",
"volatile",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.set_valu... | Sets a value in the registry. If ``vname`` is passed, it will be the value
for that value name, otherwise it will be the default value for the
specified key
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
... | [
"Sets",
"a",
"value",
"in",
"the",
"registry",
".",
"If",
"vname",
"is",
"passed",
"it",
"will",
"be",
"the",
"value",
"for",
"that",
"value",
"name",
"otherwise",
"it",
"will",
"be",
"the",
"default",
"value",
"for",
"the",
"specified",
"key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L285-L408 | train | Sets a value in the KeyReservedModule registry. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | delete_key_recursive | def delete_key_recursive(hive, key, use_32bit_registry=False):
r'''
.. versionadded:: 2015.5.4
Delete a registry key to include all subkeys and value/data pairs.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
... | python | def delete_key_recursive(hive, key, use_32bit_registry=False):
r'''
.. versionadded:: 2015.5.4
Delete a registry key to include all subkeys and value/data pairs.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
... | [
"def",
"delete_key_recursive",
"(",
"hive",
",",
"key",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.delete_key_recursive'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",",
"use_32bit_registry",
"=",
"use_32b... | r'''
.. versionadded:: 2015.5.4
Delete a registry key to include all subkeys and value/data pairs.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER ... | [
"r",
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"4"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L411-L450 | train | Delete a key in a given hive and all its subkeys and value pairs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | delete_value | def delete_value(hive, key, vname=None, use_32bit_registry=False):
r'''
Delete a registry value entry or the default value for a key.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or... | python | def delete_value(hive, key, vname=None, use_32bit_registry=False):
r'''
Delete a registry value entry or the default value for a key.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or... | [
"def",
"delete_value",
"(",
"hive",
",",
"key",
",",
"vname",
"=",
"None",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"return",
"__utils__",
"[",
"'reg.delete_value'",
"]",
"(",
"hive",
"=",
"hive",
",",
"key",
"=",
"key",
",",
"vname",
"=",
"v... | r'''
Delete a registry value entry or the default value for a key.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES... | [
"r",
"Delete",
"a",
"registry",
"value",
"entry",
"or",
"the",
"default",
"value",
"for",
"a",
"key",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L453-L491 | train | r Delete a value from the registry. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/reg.py | import_file | def import_file(source, use_32bit_registry=False):
'''
Import registry settings from a Windows ``REG`` file by invoking ``REG.EXE``.
.. versionadded:: 2018.3.0
Args:
source (str):
The full path of the ``REG`` file. This can be either a local file
path or a URL type sup... | python | def import_file(source, use_32bit_registry=False):
'''
Import registry settings from a Windows ``REG`` file by invoking ``REG.EXE``.
.. versionadded:: 2018.3.0
Args:
source (str):
The full path of the ``REG`` file. This can be either a local file
path or a URL type sup... | [
"def",
"import_file",
"(",
"source",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"cache_path",
"=",
"__salt__",
"[",
"'cp.cache_file'",
"]",
"(",
"source",
")",
"if",
"not",
"cache_path",
":",
"error_msg",
"=",
"\"File/URL '{0}' probably invalid.\"",
".",
... | Import registry settings from a Windows ``REG`` file by invoking ``REG.EXE``.
.. versionadded:: 2018.3.0
Args:
source (str):
The full path of the ``REG`` file. This can be either a local file
path or a URL type supported by salt (e.g. ``salt://salt_master_path``)
use_... | [
"Import",
"registry",
"settings",
"from",
"a",
"Windows",
"REG",
"file",
"by",
"invoking",
"REG",
".",
"EXE",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/reg.py#L494-L542 | train | Imports the registry settings from a Windows REG file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/ec2_pillar.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
use_grain=False,
minion_ids=None,
tag_match_key=None,
tag_match_value='asis',
tag_list_key=None,
tag_list_sep=';'):
'''
Execute a command and read t... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
use_grain=False,
minion_ids=None,
tag_match_key=None,
tag_match_value='asis',
tag_list_key=None,
tag_list_sep=';'):
'''
Execute a command and read t... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"use_grain",
"=",
"False",
",",
"minion_ids",
"=",
"None",
",",
"tag_match_key",
"=",
"None",
",",
"tag_match_value",
"=",
"'asis'",
",",
"tag_list_key",
"=",
"None",
",",
"t... | Execute a command and read the output as YAML | [
"Execute",
"a",
"command",
"and",
"read",
"the",
"output",
"as",
"YAML"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/ec2_pillar.py#L108-L254 | train | Execute a command and read the output as YAML and return the result as a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/venafi.py | ext_pillar | def ext_pillar(minion_id, pillar, conf):
'''
Return an existing set of certificates
'''
cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
ret = {}
dns_names = cache.fetch('venafi/minions', minion_id)
for dns_name in dns_names:
data = cache.fetch('venafi/domains', dns_name)
... | python | def ext_pillar(minion_id, pillar, conf):
'''
Return an existing set of certificates
'''
cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
ret = {}
dns_names = cache.fetch('venafi/minions', minion_id)
for dns_name in dns_names:
data = cache.fetch('venafi/domains', dns_name)
... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"conf",
")",
":",
"cache",
"=",
"salt",
".",
"cache",
".",
"Cache",
"(",
"__opts__",
",",
"syspaths",
".",
"CACHE_DIR",
")",
"ret",
"=",
"{",
"}",
"dns_names",
"=",
"cache",
".",
"fetch",
"("... | Return an existing set of certificates | [
"Return",
"an",
"existing",
"set",
"of",
"certificates"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/venafi.py#L32-L44 | train | Return an existing set of certificates
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/s6.py | status | def status(name, sig=None):
'''
Return the status for a service via s6, return pid if running
CLI Example:
.. code-block:: bash
salt '*' s6.status <service name>
'''
cmd = 's6-svstat {0}'.format(_service_path(name))
out = __salt__['cmd.run_stdout'](cmd)
try:
pid = re.s... | python | def status(name, sig=None):
'''
Return the status for a service via s6, return pid if running
CLI Example:
.. code-block:: bash
salt '*' s6.status <service name>
'''
cmd = 's6-svstat {0}'.format(_service_path(name))
out = __salt__['cmd.run_stdout'](cmd)
try:
pid = re.s... | [
"def",
"status",
"(",
"name",
",",
"sig",
"=",
"None",
")",
":",
"cmd",
"=",
"'s6-svstat {0}'",
".",
"format",
"(",
"_service_path",
"(",
"name",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"cmd",
")",
"try",
":",
"pid",
"=",... | Return the status for a service via s6, return pid if running
CLI Example:
.. code-block:: bash
salt '*' s6.status <service name> | [
"Return",
"the",
"status",
"for",
"a",
"service",
"via",
"s6",
"return",
"pid",
"if",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s6.py#L135-L151 | train | Return the status of a service via s6 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/s6.py | get_all | def get_all():
'''
Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' s6.get_all
'''
if not SERVICE_DIR:
raise CommandExecutionError("Could not find service directory.")
service_list = [dirname for dirname
in os.l... | python | def get_all():
'''
Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' s6.get_all
'''
if not SERVICE_DIR:
raise CommandExecutionError("Could not find service directory.")
service_list = [dirname for dirname
in os.l... | [
"def",
"get_all",
"(",
")",
":",
"if",
"not",
"SERVICE_DIR",
":",
"raise",
"CommandExecutionError",
"(",
"\"Could not find service directory.\"",
")",
"service_list",
"=",
"[",
"dirname",
"for",
"dirname",
"in",
"os",
".",
"listdir",
"(",
"SERVICE_DIR",
")",
"if... | Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' s6.get_all | [
"Return",
"a",
"list",
"of",
"all",
"available",
"services"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s6.py#L183-L198 | train | Return a list of all available services | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/omapi.py | add_host | def add_host(mac, name=None, ip=None, ddns=False, group=None,
supersede_host=False):
'''
Add a host object for the given mac.
CLI Example:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
.. code-b... | python | def add_host(mac, name=None, ip=None, ddns=False, group=None,
supersede_host=False):
'''
Add a host object for the given mac.
CLI Example:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
.. code-b... | [
"def",
"add_host",
"(",
"mac",
",",
"name",
"=",
"None",
",",
"ip",
"=",
"None",
",",
"ddns",
"=",
"False",
",",
"group",
"=",
"None",
",",
"supersede_host",
"=",
"False",
")",
":",
"statements",
"=",
"''",
"o",
"=",
"_conn",
"(",
")",
"msg",
"="... | Add a host object for the given mac.
CLI Example:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1 ip=10.1.1.1 ddns=true | [
"Add",
"a",
"host",
"object",
"for",
"the",
"given",
"mac",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/omapi.py#L60-L99 | train | Adds a host object for the given mac. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/omapi.py | delete_host | def delete_host(mac=None, name=None):
'''
Delete the host with the given mac or name.
CLI Examples:
.. code-block:: bash
salt dhcp-server omapi.delete_host name=host1
salt dhcp-server omapi.delete_host mac=ab:ab:ab:ab:ab:ab
'''
if not (mac or name):
raise TypeError('At... | python | def delete_host(mac=None, name=None):
'''
Delete the host with the given mac or name.
CLI Examples:
.. code-block:: bash
salt dhcp-server omapi.delete_host name=host1
salt dhcp-server omapi.delete_host mac=ab:ab:ab:ab:ab:ab
'''
if not (mac or name):
raise TypeError('At... | [
"def",
"delete_host",
"(",
"mac",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"(",
"mac",
"or",
"name",
")",
":",
"raise",
"TypeError",
"(",
"'At least one argument is required'",
")",
"o",
"=",
"_conn",
"(",
")",
"msg",
"=",
"omapi",... | Delete the host with the given mac or name.
CLI Examples:
.. code-block:: bash
salt dhcp-server omapi.delete_host name=host1
salt dhcp-server omapi.delete_host mac=ab:ab:ab:ab:ab:ab | [
"Delete",
"the",
"host",
"with",
"the",
"given",
"mac",
"or",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/omapi.py#L102-L130 | train | Delete the host with the given mac or name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | _auth | def _auth():
'''
Return the auth object
'''
if 'auth' not in __context__:
try:
__context__['auth'] = salt.crypt.SAuth(__opts__)
except SaltClientError:
log.error('Could not authenticate with master.'
'Mine data will not be transmitted.')
... | python | def _auth():
'''
Return the auth object
'''
if 'auth' not in __context__:
try:
__context__['auth'] = salt.crypt.SAuth(__opts__)
except SaltClientError:
log.error('Could not authenticate with master.'
'Mine data will not be transmitted.')
... | [
"def",
"_auth",
"(",
")",
":",
"if",
"'auth'",
"not",
"in",
"__context__",
":",
"try",
":",
"__context__",
"[",
"'auth'",
"]",
"=",
"salt",
".",
"crypt",
".",
"SAuth",
"(",
"__opts__",
")",
"except",
"SaltClientError",
":",
"log",
".",
"error",
"(",
... | Return the auth object | [
"Return",
"the",
"auth",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L40-L50 | train | Return the auth object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | update | def update(clear=False, mine_functions=None):
'''
Execute the configured functions and send the data back up to the master.
The functions to be executed are merged from the master config, pillar and
minion config under the option `mine_functions`:
.. code-block:: yaml
mine_functions:
... | python | def update(clear=False, mine_functions=None):
'''
Execute the configured functions and send the data back up to the master.
The functions to be executed are merged from the master config, pillar and
minion config under the option `mine_functions`:
.. code-block:: yaml
mine_functions:
... | [
"def",
"update",
"(",
"clear",
"=",
"False",
",",
"mine_functions",
"=",
"None",
")",
":",
"m_data",
"=",
"{",
"}",
"if",
"not",
"mine_functions",
":",
"m_data",
"=",
"__salt__",
"[",
"'config.merge'",
"]",
"(",
"'mine_functions'",
",",
"{",
"}",
")",
... | Execute the configured functions and send the data back up to the master.
The functions to be executed are merged from the master config, pillar and
minion config under the option `mine_functions`:
.. code-block:: yaml
mine_functions:
network.ip_addrs:
- eth0
disk.u... | [
"Execute",
"the",
"configured",
"functions",
"and",
"send",
"the",
"data",
"back",
"up",
"to",
"the",
"master",
".",
"The",
"functions",
"to",
"be",
"executed",
"are",
"merged",
"from",
"the",
"master",
"config",
"pillar",
"and",
"minion",
"config",
"under",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L86-L188 | train | Execute the configured functions and send the data back up to the master. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | send | def send(func, *args, **kwargs):
'''
Send a specific function to the mine.
CLI Example:
.. code-block:: bash
salt '*' mine.send network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
mi... | python | def send(func, *args, **kwargs):
'''
Send a specific function to the mine.
CLI Example:
.. code-block:: bash
salt '*' mine.send network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
mi... | [
"def",
"send",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"mine_func",
"=",
"kwargs",
".",
"pop",
"(",
"'mine_function'",
",... | Send a specific function to the mine.
CLI Example:
.. code-block:: bash
salt '*' mine.send network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0 | [
"Send",
"a",
"specific",
"function",
"to",
"the",
"mine",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L191-L242 | train | Send a specific function to the mine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | get | def get(tgt,
fun,
tgt_type='glob',
exclude_minion=False):
'''
Get data from the mine based on the target, function and tgt_type
Targets can be matched based on any standard matching system that can be
matched on the master via these keywords:
- glob
- pcre
- grain
... | python | def get(tgt,
fun,
tgt_type='glob',
exclude_minion=False):
'''
Get data from the mine based on the target, function and tgt_type
Targets can be matched based on any standard matching system that can be
matched on the master via these keywords:
- glob
- pcre
- grain
... | [
"def",
"get",
"(",
"tgt",
",",
"fun",
",",
"tgt_type",
"=",
"'glob'",
",",
"exclude_minion",
"=",
"False",
")",
":",
"if",
"__opts__",
"[",
"'file_client'",
"]",
"==",
"'local'",
":",
"ret",
"=",
"{",
"}",
"is_target",
"=",
"{",
"'glob'",
":",
"__sal... | Get data from the mine based on the target, function and tgt_type
Targets can be matched based on any standard matching system that can be
matched on the master via these keywords:
- glob
- pcre
- grain
- grain_pcre
- compound
- pillar
- pillar_pcre
Note that all pillar matche... | [
"Get",
"data",
"from",
"the",
"mine",
"based",
"on",
"the",
"target",
"function",
"and",
"tgt_type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L245-L339 | train | Return the data from the master based on the target function and tgt_type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | delete | def delete(fun):
'''
Remove specific function contents of minion. Returns True on success.
CLI Example:
.. code-block:: bash
salt '*' mine.delete 'network.interfaces'
'''
if __opts__['file_client'] == 'local':
data = __salt__['data.get']('mine_cache')
if isinstance(dat... | python | def delete(fun):
'''
Remove specific function contents of minion. Returns True on success.
CLI Example:
.. code-block:: bash
salt '*' mine.delete 'network.interfaces'
'''
if __opts__['file_client'] == 'local':
data = __salt__['data.get']('mine_cache')
if isinstance(dat... | [
"def",
"delete",
"(",
"fun",
")",
":",
"if",
"__opts__",
"[",
"'file_client'",
"]",
"==",
"'local'",
":",
"data",
"=",
"__salt__",
"[",
"'data.get'",
"]",
"(",
"'mine_cache'",
")",
"if",
"isinstance",
"(",
"data",
",",
"dict",
")",
"and",
"fun",
"in",
... | Remove specific function contents of minion. Returns True on success.
CLI Example:
.. code-block:: bash
salt '*' mine.delete 'network.interfaces' | [
"Remove",
"specific",
"function",
"contents",
"of",
"minion",
".",
"Returns",
"True",
"on",
"success",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L342-L362 | train | Remove specific function contents of minion. Returns True on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | get_docker | def get_docker(interfaces=None, cidrs=None, with_container_id=False):
'''
.. versionchanged:: 2017.7.8,2018.3.3
When :conf_minion:`docker.update_mine` is set to ``False`` for a given
minion, no mine data will be populated for that minion, and thus none
will be returned for it.
.. ver... | python | def get_docker(interfaces=None, cidrs=None, with_container_id=False):
'''
.. versionchanged:: 2017.7.8,2018.3.3
When :conf_minion:`docker.update_mine` is set to ``False`` for a given
minion, no mine data will be populated for that minion, and thus none
will be returned for it.
.. ver... | [
"def",
"get_docker",
"(",
"interfaces",
"=",
"None",
",",
"cidrs",
"=",
"None",
",",
"with_container_id",
"=",
"False",
")",
":",
"# Enforce that interface and cidr are lists",
"if",
"interfaces",
":",
"interface_",
"=",
"[",
"]",
"interface_",
".",
"extend",
"(... | .. versionchanged:: 2017.7.8,2018.3.3
When :conf_minion:`docker.update_mine` is set to ``False`` for a given
minion, no mine data will be populated for that minion, and thus none
will be returned for it.
.. versionchanged:: 2019.2.0
:conf_minion:`docker.update_mine` now defaults to `... | [
"..",
"versionchanged",
"::",
"2017",
".",
"7",
".",
"8",
"2018",
".",
"3",
".",
"3",
"When",
":",
"conf_minion",
":",
"docker",
".",
"update_mine",
"is",
"set",
"to",
"False",
"for",
"a",
"given",
"minion",
"no",
"mine",
"data",
"will",
"be",
"popul... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L384-L489 | train | Get all docker info for a given set of network interfaces and subnet addresses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mine.py | valid | def valid():
'''
List valid entries in mine configuration.
CLI Example:
.. code-block:: bash
salt '*' mine.valid
'''
m_data = __salt__['config.merge']('mine_functions', {})
# If we don't have any mine functions configured, then we should just bail out
if not m_data:
re... | python | def valid():
'''
List valid entries in mine configuration.
CLI Example:
.. code-block:: bash
salt '*' mine.valid
'''
m_data = __salt__['config.merge']('mine_functions', {})
# If we don't have any mine functions configured, then we should just bail out
if not m_data:
re... | [
"def",
"valid",
"(",
")",
":",
"m_data",
"=",
"__salt__",
"[",
"'config.merge'",
"]",
"(",
"'mine_functions'",
",",
"{",
"}",
")",
"# If we don't have any mine functions configured, then we should just bail out",
"if",
"not",
"m_data",
":",
"return",
"data",
"=",
"{... | List valid entries in mine configuration.
CLI Example:
.. code-block:: bash
salt '*' mine.valid | [
"List",
"valid",
"entries",
"in",
"mine",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mine.py#L492-L528 | train | List valid entries in mine 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/returners/pgjsonb.py | returner | def returner(ret):
'''
Return data to a Pg server
'''
try:
with _get_serv(ret, commit=True) as cur:
sql = '''INSERT INTO salt_returns
(fun, jid, return, id, success, full_ret, alter_time)
VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s))'''
... | python | def returner(ret):
'''
Return data to a Pg server
'''
try:
with _get_serv(ret, commit=True) as cur:
sql = '''INSERT INTO salt_returns
(fun, jid, return, id, success, full_ret, alter_time)
VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s))'''
... | [
"def",
"returner",
"(",
"ret",
")",
":",
"try",
":",
"with",
"_get_serv",
"(",
"ret",
",",
"commit",
"=",
"True",
")",
"as",
"cur",
":",
"sql",
"=",
"'''INSERT INTO salt_returns\n (fun, jid, return, id, success, full_ret, alter_time)\n ... | Return data to a Pg server | [
"Return",
"data",
"to",
"a",
"Pg",
"server"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L288-L305 | train | Return data to a Pg server
ArcGIS server | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/pgjsonb.py | event_return | def event_return(events):
'''
Return event to Pg server
Requires that configuration be enabled via 'event_return'
option in master config.
'''
with _get_serv(events, commit=True) as cur:
for event in events:
tag = event.get('tag', '')
data = event.get('data', '')... | python | def event_return(events):
'''
Return event to Pg server
Requires that configuration be enabled via 'event_return'
option in master config.
'''
with _get_serv(events, commit=True) as cur:
for event in events:
tag = event.get('tag', '')
data = event.get('data', '')... | [
"def",
"event_return",
"(",
"events",
")",
":",
"with",
"_get_serv",
"(",
"events",
",",
"commit",
"=",
"True",
")",
"as",
"cur",
":",
"for",
"event",
"in",
"events",
":",
"tag",
"=",
"event",
".",
"get",
"(",
"'tag'",
",",
"''",
")",
"data",
"=",
... | Return event to Pg server
Requires that configuration be enabled via 'event_return'
option in master config. | [
"Return",
"event",
"to",
"Pg",
"server"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L308-L322 | train | Return event to Pg server | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/pgjsonb.py | save_load | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
with _get_serv(commit=True) as cur:
try:
cur.execute(PG_SAVE_LOAD_SQL,
{'jid': jid, 'load': psycopg2.extras.Json(load)})
except psycopg2.IntegrityError:
#... | python | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
with _get_serv(commit=True) as cur:
try:
cur.execute(PG_SAVE_LOAD_SQL,
{'jid': jid, 'load': psycopg2.extras.Json(load)})
except psycopg2.IntegrityError:
#... | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"with",
"_get_serv",
"(",
"commit",
"=",
"True",
")",
"as",
"cur",
":",
"try",
":",
"cur",
".",
"execute",
"(",
"PG_SAVE_LOAD_SQL",
",",
"{",
"'jid'",
":",
"jid",
"... | Save the load to the specified jid id | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid",
"id"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L325-L337 | train | Save the load to the specified jid id
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/pgjsonb.py | get_load | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT load FROM jids WHERE jid = %s;'''
cur.execute(sql, (jid,))
data = cur.fetchone()
if data:
return data[0]
return {} | python | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT load FROM jids WHERE jid = %s;'''
cur.execute(sql, (jid,))
data = cur.fetchone()
if data:
return data[0]
return {} | [
"def",
"get_load",
"(",
"jid",
")",
":",
"with",
"_get_serv",
"(",
"ret",
"=",
"None",
",",
"commit",
"=",
"True",
")",
"as",
"cur",
":",
"sql",
"=",
"'''SELECT load FROM jids WHERE jid = %s;'''",
"cur",
".",
"execute",
"(",
"sql",
",",
"(",
"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/pgjsonb.py#L347-L358 | train | Return the load data that marks a specified jid
Return the load data that marks a specified jid
Return the load data that marks a specified jid
Return the load data that marks a specified jid
Return the empty dict if no load data is found | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/pgjsonb.py | get_fun | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT s.id,s.jid, s.full_ret
FROM salt_returns s
JOIN ( SELECT MAX(`jid`) as jid
from salt_returns GROU... | python | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT s.id,s.jid, s.full_ret
FROM salt_returns s
JOIN ( SELECT MAX(`jid`) as jid
from salt_returns GROU... | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"with",
"_get_serv",
"(",
"ret",
"=",
"None",
",",
"commit",
"=",
"True",
")",
"as",
"cur",
":",
"sql",
"=",
"'''SELECT s.id,s.jid, s.full_ret\n FROM salt_returns s\n JOIN ( SELECT MAX(`jid`) as jid\n ... | 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/pgjsonb.py#L379-L400 | 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/pgjsonb.py | _purge_jobs | def _purge_jobs(timestamp):
'''
Purge records from the returner tables.
:param job_age_in_seconds: Purge jobs older than this
:return:
'''
with _get_serv() as cursor:
try:
sql = 'delete from jids where jid in (select distinct jid from salt_returns where alter_time < %s)'
... | python | def _purge_jobs(timestamp):
'''
Purge records from the returner tables.
:param job_age_in_seconds: Purge jobs older than this
:return:
'''
with _get_serv() as cursor:
try:
sql = 'delete from jids where jid in (select distinct jid from salt_returns where alter_time < %s)'
... | [
"def",
"_purge_jobs",
"(",
"timestamp",
")",
":",
"with",
"_get_serv",
"(",
")",
"as",
"cursor",
":",
"try",
":",
"sql",
"=",
"'delete from jids where jid in (select distinct jid from salt_returns where alter_time < %s)'",
"cursor",
".",
"execute",
"(",
"sql",
",",
"(... | Purge records from the returner tables.
:param job_age_in_seconds: Purge jobs older than this
:return: | [
"Purge",
"records",
"from",
"the",
"returner",
"tables",
".",
":",
"param",
"job_age_in_seconds",
":",
"Purge",
"jobs",
"older",
"than",
"this",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L444-L481 | train | Purge jobs older than this date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/returners/pgjsonb.py | _archive_jobs | def _archive_jobs(timestamp):
'''
Copy rows to a set of backup tables, then purge rows.
:param timestamp: Archive rows older than this timestamp
:return:
'''
source_tables = ['jids',
'salt_returns',
'salt_events']
with _get_serv() as cursor:
... | python | def _archive_jobs(timestamp):
'''
Copy rows to a set of backup tables, then purge rows.
:param timestamp: Archive rows older than this timestamp
:return:
'''
source_tables = ['jids',
'salt_returns',
'salt_events']
with _get_serv() as cursor:
... | [
"def",
"_archive_jobs",
"(",
"timestamp",
")",
":",
"source_tables",
"=",
"[",
"'jids'",
",",
"'salt_returns'",
",",
"'salt_events'",
"]",
"with",
"_get_serv",
"(",
")",
"as",
"cursor",
":",
"target_tables",
"=",
"{",
"}",
"for",
"table_name",
"in",
"source_... | Copy rows to a set of backup tables, then purge rows.
:param timestamp: Archive rows older than this timestamp
:return: | [
"Copy",
"rows",
"to",
"a",
"set",
"of",
"backup",
"tables",
"then",
"purge",
"rows",
".",
":",
"param",
"timestamp",
":",
"Archive",
"rows",
"older",
"than",
"this",
"timestamp",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L484-L542 | train | Archive jobs from the backup tables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/pgjsonb.py | clean_old_jobs | def clean_old_jobs():
'''
Called in the master's event loop every loop_interval. Archives and/or
deletes the events and job details from the database.
:return:
'''
if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0:
try:
with _get_serv() as cur:
... | python | def clean_old_jobs():
'''
Called in the master's event loop every loop_interval. Archives and/or
deletes the events and job details from the database.
:return:
'''
if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0:
try:
with _get_serv() as cur:
... | [
"def",
"clean_old_jobs",
"(",
")",
":",
"if",
"__opts__",
".",
"get",
"(",
"'keep_jobs'",
",",
"False",
")",
"and",
"int",
"(",
"__opts__",
".",
"get",
"(",
"'keep_jobs'",
",",
"0",
")",
")",
">",
"0",
":",
"try",
":",
"with",
"_get_serv",
"(",
")"... | Called in the master's event loop every loop_interval. Archives and/or
deletes the events and job details from the database.
:return: | [
"Called",
"in",
"the",
"master",
"s",
"event",
"loop",
"every",
"loop_interval",
".",
"Archives",
"and",
"/",
"or",
"deletes",
"the",
"events",
"and",
"job",
"details",
"from",
"the",
"database",
".",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/pgjsonb.py#L545-L564 | train | Called in the master s event loop every loop_interval. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | cpustats | def cpustats():
'''
Return information about the CPU.
Returns
dict: A dictionary containing information about the CPU stats
CLI Example:
.. code-block:: bash
salt * status.cpustats
'''
# Tries to gather information similar to that returned by a Linux machine
# Avoid u... | python | def cpustats():
'''
Return information about the CPU.
Returns
dict: A dictionary containing information about the CPU stats
CLI Example:
.. code-block:: bash
salt * status.cpustats
'''
# Tries to gather information similar to that returned by a Linux machine
# Avoid u... | [
"def",
"cpustats",
"(",
")",
":",
"# Tries to gather information similar to that returned by a Linux machine",
"# Avoid using WMI as there's a lot of overhead",
"# Time related info",
"user",
",",
"system",
",",
"idle",
",",
"interrupt",
",",
"dpc",
"=",
"psutil",
".",
"cpu_t... | Return information about the CPU.
Returns
dict: A dictionary containing information about the CPU stats
CLI Example:
.. code-block:: bash
salt * status.cpustats | [
"Return",
"information",
"about",
"the",
"CPU",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L167-L202 | train | Return information about the CPU. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | meminfo | def meminfo():
'''
Return information about physical and virtual memory on the system
Returns:
dict: A dictionary of information about memory on the system
CLI Example:
.. code-block:: bash
salt * status.meminfo
'''
# Get physical memory
vm_total, vm_available, vm_per... | python | def meminfo():
'''
Return information about physical and virtual memory on the system
Returns:
dict: A dictionary of information about memory on the system
CLI Example:
.. code-block:: bash
salt * status.meminfo
'''
# Get physical memory
vm_total, vm_available, vm_per... | [
"def",
"meminfo",
"(",
")",
":",
"# Get physical memory",
"vm_total",
",",
"vm_available",
",",
"vm_percent",
",",
"vm_used",
",",
"vm_free",
"=",
"psutil",
".",
"virtual_memory",
"(",
")",
"# Get swap memory",
"swp_total",
",",
"swp_used",
",",
"swp_free",
",",... | Return information about physical and virtual memory on the system
Returns:
dict: A dictionary of information about memory on the system
CLI Example:
.. code-block:: bash
salt * status.meminfo | [
"Return",
"information",
"about",
"physical",
"and",
"virtual",
"memory",
"on",
"the",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L205-L242 | train | Return information about physical and virtual memory on the system
otope | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | vmstats | def vmstats():
'''
Return information about the virtual memory on the machine
Returns:
dict: A dictionary of virtual memory stats
CLI Example:
.. code-block:: bash
salt * status.vmstats
'''
# Setup the SPI Structure
spi = SYSTEM_PERFORMANCE_INFORMATION()
retlen = ... | python | def vmstats():
'''
Return information about the virtual memory on the machine
Returns:
dict: A dictionary of virtual memory stats
CLI Example:
.. code-block:: bash
salt * status.vmstats
'''
# Setup the SPI Structure
spi = SYSTEM_PERFORMANCE_INFORMATION()
retlen = ... | [
"def",
"vmstats",
"(",
")",
":",
"# Setup the SPI Structure",
"spi",
"=",
"SYSTEM_PERFORMANCE_INFORMATION",
"(",
")",
"retlen",
"=",
"ctypes",
".",
"c_ulong",
"(",
")",
"# 2 means to query System Performance Information and return it in a",
"# SYSTEM_PERFORMANCE_INFORMATION Str... | Return information about the virtual memory on the machine
Returns:
dict: A dictionary of virtual memory stats
CLI Example:
.. code-block:: bash
salt * status.vmstats | [
"Return",
"information",
"about",
"the",
"virtual",
"memory",
"on",
"the",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L245-L272 | train | Return information about the virtual memory 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/win_status.py | diskusage | def diskusage(human_readable=False, path=None):
'''
.. versionadded:: 2015.8.0
Return the disk usage for this minion
human_readable : False
If ``True``, usage will be in KB/MB/GB etc.
CLI Example:
.. code-block:: bash
salt '*' status.diskusage path=c:/salt
'''
if not... | python | def diskusage(human_readable=False, path=None):
'''
.. versionadded:: 2015.8.0
Return the disk usage for this minion
human_readable : False
If ``True``, usage will be in KB/MB/GB etc.
CLI Example:
.. code-block:: bash
salt '*' status.diskusage path=c:/salt
'''
if not... | [
"def",
"diskusage",
"(",
"human_readable",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"if",
"not",
"path",
":",
"path",
"=",
"'c:/'",
"disk_stats",
"=",
"psutil",
".",
"disk_usage",
"(",
"path",
")",
"total_val",
"=",
"disk_stats",
".",
"total",
... | .. versionadded:: 2015.8.0
Return the disk usage for this minion
human_readable : False
If ``True``, usage will be in KB/MB/GB etc.
CLI Example:
.. code-block:: bash
salt '*' status.diskusage path=c:/salt | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L322-L355 | train | Return the disk usage for this 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/win_status.py | procs | def procs(count=False):
'''
Return the process data
count : False
If ``True``, this function will simply return the number of processes.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' status.procs
salt '*' status.procs count
'''
wit... | python | def procs(count=False):
'''
Return the process data
count : False
If ``True``, this function will simply return the number of processes.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' status.procs
salt '*' status.procs count
'''
wit... | [
"def",
"procs",
"(",
"count",
"=",
"False",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"wmi_obj",
"=",
"wmi",
".",
"WMI",
"(",
")",
"processes",
"=",
"wmi_obj",
".",
"win32_process",
"(",
")",
"#this short circu... | Return the process data
count : False
If ``True``, this function will simply return the number of processes.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' status.procs
salt '*' status.procs count | [
"Return",
"the",
"process",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L358-L387 | train | Return the process data for all processes 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/win_status.py | saltmem | def saltmem(human_readable=False):
'''
.. versionadded:: 2015.8.0
Returns the amount of memory that salt is using
human_readable : False
return the value in a nicely formatted number
CLI Example:
.. code-block:: bash
salt '*' status.saltmem
salt '*' status.saltmem hu... | python | def saltmem(human_readable=False):
'''
.. versionadded:: 2015.8.0
Returns the amount of memory that salt is using
human_readable : False
return the value in a nicely formatted number
CLI Example:
.. code-block:: bash
salt '*' status.saltmem
salt '*' status.saltmem hu... | [
"def",
"saltmem",
"(",
"human_readable",
"=",
"False",
")",
":",
"# psutil.Process defaults to current process (`os.getpid()`)",
"p",
"=",
"psutil",
".",
"Process",
"(",
")",
"# Use oneshot to get a snapshot",
"with",
"p",
".",
"oneshot",
"(",
")",
":",
"mem",
"=",
... | .. versionadded:: 2015.8.0
Returns the amount of memory that salt is using
human_readable : False
return the value in a nicely formatted number
CLI Example:
.. code-block:: bash
salt '*' status.saltmem
salt '*' status.saltmem human_readable=True | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L390-L416 | train | Return the amount of memory that salt is using | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | uptime | def uptime(human_readable=False):
'''
.. versionadded:: 2015.8.0
Return the system uptime for the machine
Args:
human_readable (bool):
Return uptime in human readable format if ``True``, otherwise
return seconds. Default is ``False``
.. note::
... | python | def uptime(human_readable=False):
'''
.. versionadded:: 2015.8.0
Return the system uptime for the machine
Args:
human_readable (bool):
Return uptime in human readable format if ``True``, otherwise
return seconds. Default is ``False``
.. note::
... | [
"def",
"uptime",
"(",
"human_readable",
"=",
"False",
")",
":",
"# Get startup time",
"startup_time",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"psutil",
".",
"boot_time",
"(",
")",
")",
"# Subtract startup time from current time to get the uptime of ... | .. versionadded:: 2015.8.0
Return the system uptime for the machine
Args:
human_readable (bool):
Return uptime in human readable format if ``True``, otherwise
return seconds. Default is ``False``
.. note::
Human readable format is ``days, hours:min... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L419-L453 | train | Return the system uptime for the specified resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | _get_process_info | def _get_process_info(proc):
'''
Return process information
'''
cmd = salt.utils.stringutils.to_unicode(proc.CommandLine or '')
name = salt.utils.stringutils.to_unicode(proc.Name)
info = dict(
cmd=cmd,
name=name,
**_get_process_owner(proc)
)
return info | python | def _get_process_info(proc):
'''
Return process information
'''
cmd = salt.utils.stringutils.to_unicode(proc.CommandLine or '')
name = salt.utils.stringutils.to_unicode(proc.Name)
info = dict(
cmd=cmd,
name=name,
**_get_process_owner(proc)
)
return info | [
"def",
"_get_process_info",
"(",
"proc",
")",
":",
"cmd",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicode",
"(",
"proc",
".",
"CommandLine",
"or",
"''",
")",
"name",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicode",
"(",
... | Return process information | [
"Return",
"process",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L456-L467 | train | Return process information as a dict | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_status.py | master | def master(master=None, connected=True):
'''
.. versionadded:: 2015.5.0
Fire an event if the minion gets disconnected from its master. This
function is meant to be run via a scheduled job from the minion. If
master_ip is an FQDN/Hostname, is must be resolvable to a valid IPv4
address.
CLI ... | python | def master(master=None, connected=True):
'''
.. versionadded:: 2015.5.0
Fire an event if the minion gets disconnected from its master. This
function is meant to be run via a scheduled job from the minion. If
master_ip is an FQDN/Hostname, is must be resolvable to a valid IPv4
address.
CLI ... | [
"def",
"master",
"(",
"master",
"=",
"None",
",",
"connected",
"=",
"True",
")",
":",
"def",
"_win_remotes_on",
"(",
"port",
")",
":",
"'''\n Windows specific helper function.\n Returns set of ipv4 host addresses of remote established connections\n on local o... | .. versionadded:: 2015.5.0
Fire an event if the minion gets disconnected from its master. This
function is meant to be run via a scheduled job from the minion. If
master_ip is an FQDN/Hostname, is must be resolvable to a valid IPv4
address.
CLI Example:
.. code-block:: bash
salt '*' ... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_status.py#L506-L589 | train | Return a new master entry for the current state of the master. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | _check_config_exists | def _check_config_exists(config_file=None):
'''
Verify the config file is present
'''
if config_file is None:
config_file = _config_file()
if not os.path.isfile(config_file):
return False
return True | python | def _check_config_exists(config_file=None):
'''
Verify the config file is present
'''
if config_file is None:
config_file = _config_file()
if not os.path.isfile(config_file):
return False
return True | [
"def",
"_check_config_exists",
"(",
"config_file",
"=",
"None",
")",
":",
"if",
"config_file",
"is",
"None",
":",
"config_file",
"=",
"_config_file",
"(",
")",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"config_file",
")",
":",
"return",
"False",
... | Verify the config file is present | [
"Verify",
"the",
"config",
"file",
"is",
"present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L43-L51 | train | Verify the config file is present and is a valid resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | is_jail | def is_jail(name):
'''
Return True if jail exists False if not
CLI Example:
.. code-block:: bash
salt '*' poudriere.is_jail <jail name>
'''
jails = list_jails()
for jail in jails:
if jail.split()[0] == name:
return True
return False | python | def is_jail(name):
'''
Return True if jail exists False if not
CLI Example:
.. code-block:: bash
salt '*' poudriere.is_jail <jail name>
'''
jails = list_jails()
for jail in jails:
if jail.split()[0] == name:
return True
return False | [
"def",
"is_jail",
"(",
"name",
")",
":",
"jails",
"=",
"list_jails",
"(",
")",
"for",
"jail",
"in",
"jails",
":",
"if",
"jail",
".",
"split",
"(",
")",
"[",
"0",
"]",
"==",
"name",
":",
"return",
"True",
"return",
"False"
] | Return True if jail exists False if not
CLI Example:
.. code-block:: bash
salt '*' poudriere.is_jail <jail name> | [
"Return",
"True",
"if",
"jail",
"exists",
"False",
"if",
"not"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L54-L68 | train | Check if a jail exists | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | make_pkgng_aware | def make_pkgng_aware(jname):
'''
Make jail ``jname`` pkgng aware
CLI Example:
.. code-block:: bash
salt '*' poudriere.make_pkgng_aware <jail name>
'''
ret = {'changes': {}}
cdir = _config_dir()
# ensure cdir is there
if not os.path.isdir(cdir):
os.makedirs(cdir)
... | python | def make_pkgng_aware(jname):
'''
Make jail ``jname`` pkgng aware
CLI Example:
.. code-block:: bash
salt '*' poudriere.make_pkgng_aware <jail name>
'''
ret = {'changes': {}}
cdir = _config_dir()
# ensure cdir is there
if not os.path.isdir(cdir):
os.makedirs(cdir)
... | [
"def",
"make_pkgng_aware",
"(",
"jname",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
"}",
"cdir",
"=",
"_config_dir",
"(",
")",
"# ensure cdir is there",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"cdir",
")",
":",
"os",
".",
"make... | Make jail ``jname`` pkgng aware
CLI Example:
.. code-block:: bash
salt '*' poudriere.make_pkgng_aware <jail name> | [
"Make",
"jail",
"jname",
"pkgng",
"aware"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L71-L103 | train | Make pkgng aware version of the current hierarchy | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | parse_config | def parse_config(config_file=None):
'''
Returns a dict of poudriere main configuration definitions
CLI Example:
.. code-block:: bash
salt '*' poudriere.parse_config
'''
if config_file is None:
config_file = _config_file()
ret = {}
if _check_config_exists(config_file):
... | python | def parse_config(config_file=None):
'''
Returns a dict of poudriere main configuration definitions
CLI Example:
.. code-block:: bash
salt '*' poudriere.parse_config
'''
if config_file is None:
config_file = _config_file()
ret = {}
if _check_config_exists(config_file):
... | [
"def",
"parse_config",
"(",
"config_file",
"=",
"None",
")",
":",
"if",
"config_file",
"is",
"None",
":",
"config_file",
"=",
"_config_file",
"(",
")",
"ret",
"=",
"{",
"}",
"if",
"_check_config_exists",
"(",
"config_file",
")",
":",
"with",
"salt",
".",
... | Returns a dict of poudriere main configuration definitions
CLI Example:
.. code-block:: bash
salt '*' poudriere.parse_config | [
"Returns",
"a",
"dict",
"of",
"poudriere",
"main",
"configuration",
"definitions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L106-L126 | train | Parses the poudriere main configuration file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | create_jail | def create_jail(name, arch, version="9.0-RELEASE"):
'''
Creates a new poudriere jail if one does not exist
*NOTE* creating a new jail will take some time the master is not hanging
CLI Example:
.. code-block:: bash
salt '*' poudriere.create_jail 90amd64 amd64
'''
# Config file mus... | python | def create_jail(name, arch, version="9.0-RELEASE"):
'''
Creates a new poudriere jail if one does not exist
*NOTE* creating a new jail will take some time the master is not hanging
CLI Example:
.. code-block:: bash
salt '*' poudriere.create_jail 90amd64 amd64
'''
# Config file mus... | [
"def",
"create_jail",
"(",
"name",
",",
"arch",
",",
"version",
"=",
"\"9.0-RELEASE\"",
")",
":",
"# Config file must be on system to create a poudriere jail",
"_check_config_exists",
"(",
")",
"# Check if the jail is there",
"if",
"is_jail",
"(",
"name",
")",
":",
"ret... | Creates a new poudriere jail if one does not exist
*NOTE* creating a new jail will take some time the master is not hanging
CLI Example:
.. code-block:: bash
salt '*' poudriere.create_jail 90amd64 amd64 | [
"Creates",
"a",
"new",
"poudriere",
"jail",
"if",
"one",
"does",
"not",
"exist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L175-L204 | train | Create a new poudriere jail | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | update_jail | def update_jail(name):
'''
Run freebsd-update on `name` poudriere jail
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_jail freebsd:10:x86:64
'''
if is_jail(name):
cmd = 'poudriere jail -u -j {0}'.format(name)
ret = __salt__['cmd.run'](cmd)
return r... | python | def update_jail(name):
'''
Run freebsd-update on `name` poudriere jail
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_jail freebsd:10:x86:64
'''
if is_jail(name):
cmd = 'poudriere jail -u -j {0}'.format(name)
ret = __salt__['cmd.run'](cmd)
return r... | [
"def",
"update_jail",
"(",
"name",
")",
":",
"if",
"is_jail",
"(",
"name",
")",
":",
"cmd",
"=",
"'poudriere jail -u -j {0}'",
".",
"format",
"(",
"name",
")",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"return",
"ret",
"else",
":"... | Run freebsd-update on `name` poudriere jail
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_jail freebsd:10:x86:64 | [
"Run",
"freebsd",
"-",
"update",
"on",
"name",
"poudriere",
"jail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L207-L222 | train | Update the freebsd - update on the specified jail | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | delete_jail | def delete_jail(name):
'''
Deletes poudriere jail with `name`
CLI Example:
.. code-block:: bash
salt '*' poudriere.delete_jail 90amd64
'''
if is_jail(name):
cmd = 'poudriere jail -d -j {0}'.format(name)
__salt__['cmd.run'](cmd)
# Make sure jail is gone
... | python | def delete_jail(name):
'''
Deletes poudriere jail with `name`
CLI Example:
.. code-block:: bash
salt '*' poudriere.delete_jail 90amd64
'''
if is_jail(name):
cmd = 'poudriere jail -d -j {0}'.format(name)
__salt__['cmd.run'](cmd)
# Make sure jail is gone
... | [
"def",
"delete_jail",
"(",
"name",
")",
":",
"if",
"is_jail",
"(",
"name",
")",
":",
"cmd",
"=",
"'poudriere jail -d -j {0}'",
".",
"format",
"(",
"name",
")",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"# Make sure jail is gone",
"if",
"is_jail",
... | Deletes poudriere jail with `name`
CLI Example:
.. code-block:: bash
salt '*' poudriere.delete_jail 90amd64 | [
"Deletes",
"poudriere",
"jail",
"with",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L225-L257 | train | Deletes poudriere jail with name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | update_ports_tree | def update_ports_tree(ports_tree):
'''
Updates the ports tree, either the default or the `ports_tree` specified
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_ports_tree staging
'''
_check_config_exists()
if ports_tree:
cmd = 'poudriere ports -u -p {0}'.format... | python | def update_ports_tree(ports_tree):
'''
Updates the ports tree, either the default or the `ports_tree` specified
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_ports_tree staging
'''
_check_config_exists()
if ports_tree:
cmd = 'poudriere ports -u -p {0}'.format... | [
"def",
"update_ports_tree",
"(",
"ports_tree",
")",
":",
"_check_config_exists",
"(",
")",
"if",
"ports_tree",
":",
"cmd",
"=",
"'poudriere ports -u -p {0}'",
".",
"format",
"(",
"ports_tree",
")",
"else",
":",
"cmd",
"=",
"'poudriere ports -u'",
"ret",
"=",
"__... | Updates the ports tree, either the default or the `ports_tree` specified
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_ports_tree staging | [
"Updates",
"the",
"ports",
"tree",
"either",
"the",
"default",
"or",
"the",
"ports_tree",
"specified"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L270-L286 | train | Updates the ports tree either the default or the ports_tree specified | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/poudriere.py | bulk_build | def bulk_build(jail, pkg_file, keep=False):
'''
Run bulk build on poudriere server.
Return number of pkg builds, failures, and errors, on error dump to CLI
CLI Example:
.. code-block:: bash
salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list
'''
# make sure `pkg f... | python | def bulk_build(jail, pkg_file, keep=False):
'''
Run bulk build on poudriere server.
Return number of pkg builds, failures, and errors, on error dump to CLI
CLI Example:
.. code-block:: bash
salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list
'''
# make sure `pkg f... | [
"def",
"bulk_build",
"(",
"jail",
",",
"pkg_file",
",",
"keep",
"=",
"False",
")",
":",
"# make sure `pkg file` and jail is on file system",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"pkg_file",
")",
":",
"return",
"'Could not find file {0} on filesystem'"... | Run bulk build on poudriere server.
Return number of pkg builds, failures, and errors, on error dump to CLI
CLI Example:
.. code-block:: bash
salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list | [
"Run",
"bulk",
"build",
"on",
"poudriere",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/poudriere.py#L289-L321 | train | Run bulk build on poudriere server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _update_nilrt_restart_state | def _update_nilrt_restart_state():
'''
NILRT systems determine whether to reboot after various package operations
including but not limited to kernel module installs/removals by checking
specific file md5sums & timestamps. These files are touched/modified by
the post-install/post-remove functions of... | python | def _update_nilrt_restart_state():
'''
NILRT systems determine whether to reboot after various package operations
including but not limited to kernel module installs/removals by checking
specific file md5sums & timestamps. These files are touched/modified by
the post-install/post-remove functions of... | [
"def",
"_update_nilrt_restart_state",
"(",
")",
":",
"__salt__",
"[",
"'cmd.shell'",
"]",
"(",
"'stat -c %Y /lib/modules/$(uname -r)/modules.dep >{0}/modules.dep.timestamp'",
".",
"format",
"(",
"NILRT_RESTARTCHECK_STATE_PATH",
")",
")",
"__salt__",
"[",
"'cmd.shell'",
"]",
... | NILRT systems determine whether to reboot after various package operations
including but not limited to kernel module installs/removals by checking
specific file md5sums & timestamps. These files are touched/modified by
the post-install/post-remove functions of their respective packages.
The opkg modul... | [
"NILRT",
"systems",
"determine",
"whether",
"to",
"reboot",
"after",
"various",
"package",
"operations",
"including",
"but",
"not",
"limited",
"to",
"kernel",
"module",
"installs",
"/",
"removals",
"by",
"checking",
"specific",
"file",
"md5sums",
"&",
"timestamps"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L63-L106 | train | Update the state of the NILRT restartcheck module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _get_restartcheck_result | def _get_restartcheck_result(errors):
'''
Return restartcheck result and append errors (if any) to ``errors``
'''
rs_result = __salt__['restartcheck.restartcheck'](verbose=False)
if isinstance(rs_result, dict) and 'comment' in rs_result:
errors.append(rs_result['comment'])
return rs_resu... | python | def _get_restartcheck_result(errors):
'''
Return restartcheck result and append errors (if any) to ``errors``
'''
rs_result = __salt__['restartcheck.restartcheck'](verbose=False)
if isinstance(rs_result, dict) and 'comment' in rs_result:
errors.append(rs_result['comment'])
return rs_resu... | [
"def",
"_get_restartcheck_result",
"(",
"errors",
")",
":",
"rs_result",
"=",
"__salt__",
"[",
"'restartcheck.restartcheck'",
"]",
"(",
"verbose",
"=",
"False",
")",
"if",
"isinstance",
"(",
"rs_result",
",",
"dict",
")",
"and",
"'comment'",
"in",
"rs_result",
... | Return restartcheck result and append errors (if any) to ``errors`` | [
"Return",
"restartcheck",
"result",
"and",
"append",
"errors",
"(",
"if",
"any",
")",
"to",
"errors"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L109-L116 | train | Return restartcheck result and append errors to errors | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _process_restartcheck_result | def _process_restartcheck_result(rs_result, **kwargs):
'''
Check restartcheck output to see if system/service restarts were requested
and take appropriate action.
'''
if 'No packages seem to need to be restarted' in rs_result:
return
reboot_required = False
for rstr in rs_result:
... | python | def _process_restartcheck_result(rs_result, **kwargs):
'''
Check restartcheck output to see if system/service restarts were requested
and take appropriate action.
'''
if 'No packages seem to need to be restarted' in rs_result:
return
reboot_required = False
for rstr in rs_result:
... | [
"def",
"_process_restartcheck_result",
"(",
"rs_result",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'No packages seem to need to be restarted'",
"in",
"rs_result",
":",
"return",
"reboot_required",
"=",
"False",
"for",
"rstr",
"in",
"rs_result",
":",
"if",
"'System r... | Check restartcheck output to see if system/service restarts were requested
and take appropriate action. | [
"Check",
"restartcheck",
"output",
"to",
"see",
"if",
"system",
"/",
"service",
"restarts",
"were",
"requested",
"and",
"take",
"appropriate",
"action",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L119-L137 | train | Process restartcheck output to see if system restarts were requested and take appropriate action. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | refresh_db | def refresh_db(failhard=False, **kwargs): # pylint: disable=unused-argument
'''
Updates the opkg database to latest packages based upon repositories
Returns a dict, with the keys being package databases and the values being
the result of the update attempt. Values can be one of the following:
- `... | python | def refresh_db(failhard=False, **kwargs): # pylint: disable=unused-argument
'''
Updates the opkg database to latest packages based upon repositories
Returns a dict, with the keys being package databases and the values being
the result of the update attempt. Values can be one of the following:
- `... | [
"def",
"refresh_db",
"(",
"failhard",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
... | Updates the opkg database to latest packages based upon repositories
Returns a dict, with the keys being package databases and the values being
the result of the update attempt. Values can be one of the following:
- ``True``: Database updated successfully
- ``False``: Problem updating database
fa... | [
"Updates",
"the",
"opkg",
"database",
"to",
"latest",
"packages",
"based",
"upon",
"repositories"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L231-L294 | train | Update the opkg database to latest packages based upon repositories | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _build_install_command_list | def _build_install_command_list(cmd_prefix, to_install, to_downgrade, to_reinstall):
'''
Builds a list of install commands to be executed in sequence in order to process
each of the to_install, to_downgrade, and to_reinstall lists.
'''
cmds = []
if to_install:
cmd = copy.deepcopy(cmd_pre... | python | def _build_install_command_list(cmd_prefix, to_install, to_downgrade, to_reinstall):
'''
Builds a list of install commands to be executed in sequence in order to process
each of the to_install, to_downgrade, and to_reinstall lists.
'''
cmds = []
if to_install:
cmd = copy.deepcopy(cmd_pre... | [
"def",
"_build_install_command_list",
"(",
"cmd_prefix",
",",
"to_install",
",",
"to_downgrade",
",",
"to_reinstall",
")",
":",
"cmds",
"=",
"[",
"]",
"if",
"to_install",
":",
"cmd",
"=",
"copy",
".",
"deepcopy",
"(",
"cmd_prefix",
")",
"cmd",
".",
"extend",... | Builds a list of install commands to be executed in sequence in order to process
each of the to_install, to_downgrade, and to_reinstall lists. | [
"Builds",
"a",
"list",
"of",
"install",
"commands",
"to",
"be",
"executed",
"in",
"sequence",
"in",
"order",
"to",
"process",
"each",
"of",
"the",
"to_install",
"to_downgrade",
"and",
"to_reinstall",
"lists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L312-L333 | train | Builds a list of install commands to be executed in sequence in order to process
each of the to_install to_downgrade and to_reinstall lists. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _parse_reported_packages_from_install_output | def _parse_reported_packages_from_install_output(output):
'''
Parses the output of "opkg install" to determine what packages would have been
installed by an operation run with the --noaction flag.
We are looking for lines like:
Installing <package> (<version>) on <target>
or
Upgradi... | python | def _parse_reported_packages_from_install_output(output):
'''
Parses the output of "opkg install" to determine what packages would have been
installed by an operation run with the --noaction flag.
We are looking for lines like:
Installing <package> (<version>) on <target>
or
Upgradi... | [
"def",
"_parse_reported_packages_from_install_output",
"(",
"output",
")",
":",
"reported_pkgs",
"=",
"{",
"}",
"install_pattern",
"=",
"re",
".",
"compile",
"(",
"r'Installing\\s(?P<package>.*?)\\s\\((?P<version>.*?)\\)\\son\\s(?P<target>.*?)'",
")",
"upgrade_pattern",
"=",
... | Parses the output of "opkg install" to determine what packages would have been
installed by an operation run with the --noaction flag.
We are looking for lines like:
Installing <package> (<version>) on <target>
or
Upgrading <package> from <oldVersion> to <version> on root | [
"Parses",
"the",
"output",
"of",
"opkg",
"install",
"to",
"determine",
"what",
"packages",
"would",
"have",
"been",
"installed",
"by",
"an",
"operation",
"run",
"with",
"the",
"--",
"noaction",
"flag",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L336-L356 | train | Parses the output of opkg install to determine what packages would have been installed on the root
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _execute_install_command | def _execute_install_command(cmd, parse_output, errors, parsed_packages):
'''
Executes a command for the install operation.
If the command fails, its error output will be appended to the errors list.
If the command succeeds and parse_output is true, updated packages will be appended
to the parsed_pa... | python | def _execute_install_command(cmd, parse_output, errors, parsed_packages):
'''
Executes a command for the install operation.
If the command fails, its error output will be appended to the errors list.
If the command succeeds and parse_output is true, updated packages will be appended
to the parsed_pa... | [
"def",
"_execute_install_command",
"(",
"cmd",
",",
"parse_output",
",",
"errors",
",",
"parsed_packages",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'trace'",
",",
"python_shell",
"=",
"False",
")",
... | Executes a command for the install operation.
If the command fails, its error output will be appended to the errors list.
If the command succeeds and parse_output is true, updated packages will be appended
to the parsed_packages dictionary. | [
"Executes",
"a",
"command",
"for",
"the",
"install",
"operation",
".",
"If",
"the",
"command",
"fails",
"its",
"error",
"output",
"will",
"be",
"appended",
"to",
"the",
"errors",
"list",
".",
"If",
"the",
"command",
"succeeds",
"and",
"parse_output",
"is",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L359-L377 | train | Executes a command for the install 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/modules/opkg.py | install | def install(name=None,
refresh=False,
pkgs=None,
sources=None,
reinstall=False,
**kwargs):
'''
Install the passed package, add refresh=True to update the opkg database.
name
The name of the package to be installed. Note that this parameter... | python | def install(name=None,
refresh=False,
pkgs=None,
sources=None,
reinstall=False,
**kwargs):
'''
Install the passed package, add refresh=True to update the opkg database.
name
The name of the package to be installed. Note that this parameter... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"reinstall",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"refreshdb",
"=",
"salt",
".",
"utils",
".",
"data",... | Install the passed package, add refresh=True to update the opkg database.
name
The name of the package to be installed. Note that this parameter is
ignored if either "pkgs" or "sources" is passed. Additionally, please
note that this option can only be used to install packages from a
... | [
"Install",
"the",
"passed",
"package",
"add",
"refresh",
"=",
"True",
"to",
"update",
"the",
"opkg",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L380-L587 | train | Installs the passed package from the IPK database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _parse_reported_packages_from_remove_output | def _parse_reported_packages_from_remove_output(output):
'''
Parses the output of "opkg remove" to determine what packages would have been
removed by an operation run with the --noaction flag.
We are looking for lines like
Removing <package> (<version>) from <Target>...
'''
reported_pkg... | python | def _parse_reported_packages_from_remove_output(output):
'''
Parses the output of "opkg remove" to determine what packages would have been
removed by an operation run with the --noaction flag.
We are looking for lines like
Removing <package> (<version>) from <Target>...
'''
reported_pkg... | [
"def",
"_parse_reported_packages_from_remove_output",
"(",
"output",
")",
":",
"reported_pkgs",
"=",
"{",
"}",
"remove_pattern",
"=",
"re",
".",
"compile",
"(",
"r'Removing\\s(?P<package>.*?)\\s\\((?P<version>.*?)\\)\\sfrom\\s(?P<target>.*?)...'",
")",
"for",
"line",
"in",
... | Parses the output of "opkg remove" to determine what packages would have been
removed by an operation run with the --noaction flag.
We are looking for lines like
Removing <package> (<version>) from <Target>... | [
"Parses",
"the",
"output",
"of",
"opkg",
"remove",
"to",
"determine",
"what",
"packages",
"would",
"have",
"been",
"removed",
"by",
"an",
"operation",
"run",
"with",
"the",
"--",
"noaction",
"flag",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L590-L605 | train | Parses the output of opkg remove to determine what packages would have been removed from the target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | remove | def remove(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
'''
Remove packages using ``opkg remove``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name``... | python | def remove(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
'''
Remove packages using ``opkg remove``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name``... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
")",
... | Remove packages using ``opkg remove``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this option is passed.
remove_dependencies
Remov... | [
"Remove",
"packages",
"using",
"opkg",
"remove",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L608-L690 | train | Remove packages using opkg remove. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | upgrade | def upgrade(refresh=True, **kwargs): # pylint: disable=unused-argument
'''
Upgrades all packages via ``opkg upgrade``
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Example... | python | def upgrade(refresh=True, **kwargs): # pylint: disable=unused-argument
'''
Upgrades all packages via ``opkg upgrade``
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Example... | [
"def",
"upgrade",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"}",
"errors",
"=",
"[",... | Upgrades all packages via ``opkg upgrade``
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Example:
.. code-block:: bash
salt '*' pkg.upgrade | [
"Upgrades",
"all",
"packages",
"via",
"opkg",
"upgrade"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L722-L773 | train | Upgrade all packages via opkg upgrade | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | hold | def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
CLI Example:
.. code-block:: bash
salt '*' pkg.hold <package name>
pkgs
... | python | def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
CLI Example:
.. code-block:: bash
salt '*' pkg.hold <package name>
pkgs
... | [
"def",
"hold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"if",
"not",
"name",
"and",
"not",
"pkgs",
"and",
"not",
"sources",
":",
"raise",
"SaltInvocat... | Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
CLI Example:
.. code-block:: bash
salt '*' pkg.hold <package name>
pkgs
A list of packages to hold. Must be passed as a python list.
CLI Example:
... | [
"Set",
"package",
"in",
"hold",
"state",
"meaning",
"it",
"will",
"not",
"be",
"upgraded",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L776-L844 | train | Hold a package in the sequence of packages. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _get_state | def _get_state(pkg):
'''
View package state from the opkg database
Return the state of pkg
'''
cmd = ['opkg', 'status']
cmd.append(pkg)
out = __salt__['cmd.run'](cmd, python_shell=False)
state_flag = ''
for line in salt.utils.itertools.split(out, '\n'):
if line.startswith('S... | python | def _get_state(pkg):
'''
View package state from the opkg database
Return the state of pkg
'''
cmd = ['opkg', 'status']
cmd.append(pkg)
out = __salt__['cmd.run'](cmd, python_shell=False)
state_flag = ''
for line in salt.utils.itertools.split(out, '\n'):
if line.startswith('S... | [
"def",
"_get_state",
"(",
"pkg",
")",
":",
"cmd",
"=",
"[",
"'opkg'",
",",
"'status'",
"]",
"cmd",
".",
"append",
"(",
"pkg",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"state_flag",
"=",
... | View package state from the opkg database
Return the state of pkg | [
"View",
"package",
"state",
"from",
"the",
"opkg",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L919-L933 | train | Return the state of the pkg | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _set_state | def _set_state(pkg, state):
'''
Change package state on the opkg database
The state can be any of:
- hold
- noprune
- user
- ok
- installed
- unpacked
This command is commonly used to mark a specific package to be held from
being upgraded, that is, to be kept at a ce... | python | def _set_state(pkg, state):
'''
Change package state on the opkg database
The state can be any of:
- hold
- noprune
- user
- ok
- installed
- unpacked
This command is commonly used to mark a specific package to be held from
being upgraded, that is, to be kept at a ce... | [
"def",
"_set_state",
"(",
"pkg",
",",
"state",
")",
":",
"ret",
"=",
"{",
"}",
"valid_states",
"=",
"(",
"'hold'",
",",
"'noprune'",
",",
"'user'",
",",
"'ok'",
",",
"'installed'",
",",
"'unpacked'",
")",
"if",
"state",
"not",
"in",
"valid_states",
":"... | Change package state on the opkg database
The state can be any of:
- hold
- noprune
- user
- ok
- installed
- unpacked
This command is commonly used to mark a specific package to be held from
being upgraded, that is, to be kept at a certain version.
Returns a dict conta... | [
"Change",
"package",
"state",
"on",
"the",
"opkg",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L936-L968 | train | Change the state of a specific package on the opkg database | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | list_upgrades | def list_upgrades(refresh=True, **kwargs): # pylint: disable=unused-argument
'''
List all available package upgrades.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
ret = {}
if salt.utils.data.is_true(refresh):
refresh_db()
cmd = ['opkg', 'list-upgr... | python | def list_upgrades(refresh=True, **kwargs): # pylint: disable=unused-argument
'''
List all available package upgrades.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
ret = {}
if salt.utils.data.is_true(refresh):
refresh_db()
cmd = ['opkg', 'list-upgr... | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"ret",
"=",
"{",
"}",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"refresh",
")",
":",
"refresh_db",
"(",
")",
... | List all available package upgrades.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades | [
"List",
"all",
"available",
"package",
"upgrades",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1018-L1051 | train | List all available package upgrades. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _convert_to_standard_attr | def _convert_to_standard_attr(attr):
'''
Helper function for _process_info_installed_output()
Converts an opkg attribute name to a standard attribute
name which is used across 'pkg' modules.
'''
ret_attr = ATTR_MAP.get(attr, None)
if ret_attr is None:
# All others convert to lowerca... | python | def _convert_to_standard_attr(attr):
'''
Helper function for _process_info_installed_output()
Converts an opkg attribute name to a standard attribute
name which is used across 'pkg' modules.
'''
ret_attr = ATTR_MAP.get(attr, None)
if ret_attr is None:
# All others convert to lowerca... | [
"def",
"_convert_to_standard_attr",
"(",
"attr",
")",
":",
"ret_attr",
"=",
"ATTR_MAP",
".",
"get",
"(",
"attr",
",",
"None",
")",
"if",
"ret_attr",
"is",
"None",
":",
"# All others convert to lowercase",
"return",
"attr",
".",
"lower",
"(",
")",
"return",
"... | Helper function for _process_info_installed_output()
Converts an opkg attribute name to a standard attribute
name which is used across 'pkg' modules. | [
"Helper",
"function",
"for",
"_process_info_installed_output",
"()"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1054-L1065 | train | Helper function for _process_info_installed_output() converts an opkg attribute name to a standard attribute name which is used across pkg modules. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _process_info_installed_output | def _process_info_installed_output(out, filter_attrs):
'''
Helper function for info_installed()
Processes stdout output from a single invocation of
'opkg status'.
'''
ret = {}
name = None
attrs = {}
attr = None
for line in salt.utils.itertools.split(out, '\n'):
if line ... | python | def _process_info_installed_output(out, filter_attrs):
'''
Helper function for info_installed()
Processes stdout output from a single invocation of
'opkg status'.
'''
ret = {}
name = None
attrs = {}
attr = None
for line in salt.utils.itertools.split(out, '\n'):
if line ... | [
"def",
"_process_info_installed_output",
"(",
"out",
",",
"filter_attrs",
")",
":",
"ret",
"=",
"{",
"}",
"name",
"=",
"None",
"attrs",
"=",
"{",
"}",
"attr",
"=",
"None",
"for",
"line",
"in",
"salt",
".",
"utils",
".",
"itertools",
".",
"split",
"(",
... | Helper function for info_installed()
Processes stdout output from a single invocation of
'opkg status'. | [
"Helper",
"function",
"for",
"info_installed",
"()"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1068-L1109 | train | Helper function for info_installed() processes the output from a single invocation of info_installed opkg status. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | info_installed | def info_installed(*names, **kwargs):
'''
Return the information of the named package(s), installed on the system.
.. versionadded:: 2017.7.0
:param names:
Names of the packages to get information about. If none are specified,
will return information for all installed packages.
:p... | python | def info_installed(*names, **kwargs):
'''
Return the information of the named package(s), installed on the system.
.. versionadded:: 2017.7.0
:param names:
Names of the packages to get information about. If none are specified,
will return information for all installed packages.
:p... | [
"def",
"info_installed",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"attr",
"=",
"kwargs",
".",
"pop",
"(",
"'attr'",
",",
"None",
")",
"if",
"attr",
"is",
"None",
":",
"filter_attrs",
"=",
"None",
"elif",
"isinstance",
"(",
"attr",
",",
... | Return the information of the named package(s), installed on the system.
.. versionadded:: 2017.7.0
:param names:
Names of the packages to get information about. If none are specified,
will return information for all installed packages.
:param attr:
Comma-separated package attribu... | [
"Return",
"the",
"information",
"of",
"the",
"named",
"package",
"(",
"s",
")",
"installed",
"on",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1112-L1182 | train | Return the information of the named packages installed on the system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | version_cmp | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): # pylint: disable=unused-argument
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set ... | python | def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): # pylint: disable=unused-argument
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set ... | [
"def",
"version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"normalize",
"=",
"lambda",
"x",
":",
"six",
".",
"text_type",
"(",
"x",
")",
".",
"split",
"(",
"'... | Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ``True`` to ignore the epoch when comparing versions
.. versionadded:: 2016.3.4
CLI Examp... | [
"Do",
"a",
"cmp",
"-",
"style",
"comparison",
"on",
"two",
"packages",
".",
"Return",
"-",
"1",
"if",
"pkg1",
"<",
"pkg2",
"0",
"if",
"pkg1",
"==",
"pkg2",
"and",
"1",
"if",
"pkg1",
">",
"pkg2",
".",
"Return",
"None",
"if",
"there",
"was",
"a",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1198-L1244 | train | Compare two packages and return the version of the first one. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _set_repo_option | def _set_repo_option(repo, option):
'''
Set the option to repo
'''
if not option:
return
opt = option.split('=')
if len(opt) != 2:
return
if opt[0] == 'trusted':
repo['trusted'] = opt[1] == 'yes'
else:
repo[opt[0]] = opt[1] | python | def _set_repo_option(repo, option):
'''
Set the option to repo
'''
if not option:
return
opt = option.split('=')
if len(opt) != 2:
return
if opt[0] == 'trusted':
repo['trusted'] = opt[1] == 'yes'
else:
repo[opt[0]] = opt[1] | [
"def",
"_set_repo_option",
"(",
"repo",
",",
"option",
")",
":",
"if",
"not",
"option",
":",
"return",
"opt",
"=",
"option",
".",
"split",
"(",
"'='",
")",
"if",
"len",
"(",
"opt",
")",
"!=",
"2",
":",
"return",
"if",
"opt",
"[",
"0",
"]",
"==",
... | Set the option to repo | [
"Set",
"the",
"option",
"to",
"repo"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1247-L1259 | train | Set the option to repo
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _set_repo_options | def _set_repo_options(repo, options):
'''
Set the options to the repo.
'''
delimiters = "[", "]"
pattern = '|'.join(map(re.escape, delimiters))
for option in options:
splitted = re.split(pattern, option)
for opt in splitted:
_set_repo_option(repo, opt) | python | def _set_repo_options(repo, options):
'''
Set the options to the repo.
'''
delimiters = "[", "]"
pattern = '|'.join(map(re.escape, delimiters))
for option in options:
splitted = re.split(pattern, option)
for opt in splitted:
_set_repo_option(repo, opt) | [
"def",
"_set_repo_options",
"(",
"repo",
",",
"options",
")",
":",
"delimiters",
"=",
"\"[\"",
",",
"\"]\"",
"pattern",
"=",
"'|'",
".",
"join",
"(",
"map",
"(",
"re",
".",
"escape",
",",
"delimiters",
")",
")",
"for",
"option",
"in",
"options",
":",
... | Set the options to the repo. | [
"Set",
"the",
"options",
"to",
"the",
"repo",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1262-L1271 | train | Set the options to the repo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _create_repo | def _create_repo(line, filename):
'''
Create repo
'''
repo = {}
if line.startswith('#'):
repo['enabled'] = False
line = line[1:]
else:
repo['enabled'] = True
cols = salt.utils.args.shlex_split(line.strip())
repo['compressed'] = not cols[0] in 'src'
repo['name'... | python | def _create_repo(line, filename):
'''
Create repo
'''
repo = {}
if line.startswith('#'):
repo['enabled'] = False
line = line[1:]
else:
repo['enabled'] = True
cols = salt.utils.args.shlex_split(line.strip())
repo['compressed'] = not cols[0] in 'src'
repo['name'... | [
"def",
"_create_repo",
"(",
"line",
",",
"filename",
")",
":",
"repo",
"=",
"{",
"}",
"if",
"line",
".",
"startswith",
"(",
"'#'",
")",
":",
"repo",
"[",
"'enabled'",
"]",
"=",
"False",
"line",
"=",
"line",
"[",
"1",
":",
"]",
"else",
":",
"repo"... | Create repo | [
"Create",
"repo"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1274-L1291 | train | Create repo dict from line | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _read_repos | def _read_repos(conf_file, repos, filename, regex):
'''
Read repos from configuration file
'''
for line in conf_file:
line = salt.utils.stringutils.to_unicode(line)
if not regex.search(line):
continue
repo = _create_repo(line, filename)
# do not store duplica... | python | def _read_repos(conf_file, repos, filename, regex):
'''
Read repos from configuration file
'''
for line in conf_file:
line = salt.utils.stringutils.to_unicode(line)
if not regex.search(line):
continue
repo = _create_repo(line, filename)
# do not store duplica... | [
"def",
"_read_repos",
"(",
"conf_file",
",",
"repos",
",",
"filename",
",",
"regex",
")",
":",
"for",
"line",
"in",
"conf_file",
":",
"line",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicode",
"(",
"line",
")",
"if",
"not",
"regex",
".",... | Read repos from configuration file | [
"Read",
"repos",
"from",
"configuration",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1294-L1306 | train | Read repos from configuration file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | list_repos | def list_repos(**kwargs): # pylint: disable=unused-argument
'''
Lists all repos on ``/etc/opkg/*.conf``
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos = {}
regex = re.compile(REPO_REGEXP)
for filename in os.listdir(OPKG_CONFDIR):
if not filename.en... | python | def list_repos(**kwargs): # pylint: disable=unused-argument
'''
Lists all repos on ``/etc/opkg/*.conf``
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos = {}
regex = re.compile(REPO_REGEXP)
for filename in os.listdir(OPKG_CONFDIR):
if not filename.en... | [
"def",
"list_repos",
"(",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"repos",
"=",
"{",
"}",
"regex",
"=",
"re",
".",
"compile",
"(",
"REPO_REGEXP",
")",
"for",
"filename",
"in",
"os",
".",
"listdir",
"(",
"OPKG_CONFDIR",
")",
":",
... | Lists all repos on ``/etc/opkg/*.conf``
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos | [
"Lists",
"all",
"repos",
"on",
"/",
"etc",
"/",
"opkg",
"/",
"*",
".",
"conf"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1309-L1326 | train | Lists all repos on the OPKG. conf dir | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | get_repo | def get_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Display a repo from the ``/etc/opkg/*.conf``
CLI Examples:
.. code-block:: bash
salt '*' pkg.get_repo repo
'''
repos = list_repos()
if repos:
for source in six.itervalues(repos):
for sub in s... | python | def get_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Display a repo from the ``/etc/opkg/*.conf``
CLI Examples:
.. code-block:: bash
salt '*' pkg.get_repo repo
'''
repos = list_repos()
if repos:
for source in six.itervalues(repos):
for sub in s... | [
"def",
"get_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"repos",
"=",
"list_repos",
"(",
")",
"if",
"repos",
":",
"for",
"source",
"in",
"six",
".",
"itervalues",
"(",
"repos",
")",
":",
"for",
"sub",
"in",... | Display a repo from the ``/etc/opkg/*.conf``
CLI Examples:
.. code-block:: bash
salt '*' pkg.get_repo repo | [
"Display",
"a",
"repo",
"from",
"the",
"/",
"etc",
"/",
"opkg",
"/",
"*",
".",
"conf"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1329-L1346 | train | Display a repo 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/opkg.py | _del_repo_from_file | def _del_repo_from_file(repo, filepath):
'''
Remove a repo from filepath
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
regex = re.compile(REPO_REGEXP)
for line in fhandle:
line = salt.utils.stringutils.to_unicode(line)
if regex.search(l... | python | def _del_repo_from_file(repo, filepath):
'''
Remove a repo from filepath
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
regex = re.compile(REPO_REGEXP)
for line in fhandle:
line = salt.utils.stringutils.to_unicode(line)
if regex.search(l... | [
"def",
"_del_repo_from_file",
"(",
"repo",
",",
"filepath",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"filepath",
")",
"as",
"fhandle",
":",
"output",
"=",
"[",
"]",
"regex",
"=",
"re",
".",
"compile",
"(",
"REPO_REGEXP",... | Remove a repo from filepath | [
"Remove",
"a",
"repo",
"from",
"filepath"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1349-L1365 | train | Remove a repo from filepath
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _set_trusted_option_if_needed | def _set_trusted_option_if_needed(repostr, trusted):
'''
Set trusted option to repo if needed
'''
if trusted is True:
repostr += ' [trusted=yes]'
elif trusted is False:
repostr += ' [trusted=no]'
return repostr | python | def _set_trusted_option_if_needed(repostr, trusted):
'''
Set trusted option to repo if needed
'''
if trusted is True:
repostr += ' [trusted=yes]'
elif trusted is False:
repostr += ' [trusted=no]'
return repostr | [
"def",
"_set_trusted_option_if_needed",
"(",
"repostr",
",",
"trusted",
")",
":",
"if",
"trusted",
"is",
"True",
":",
"repostr",
"+=",
"' [trusted=yes]'",
"elif",
"trusted",
"is",
"False",
":",
"repostr",
"+=",
"' [trusted=no]'",
"return",
"repostr"
] | Set trusted option to repo if needed | [
"Set",
"trusted",
"option",
"to",
"repo",
"if",
"needed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1368-L1376 | train | Sets trusted option to repo if needed
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | _add_new_repo | def _add_new_repo(repo, properties):
'''
Add a new repo entry
'''
repostr = '# ' if not properties.get('enabled') else ''
repostr += 'src/gz ' if properties.get('compressed') else 'src '
if ' ' in repo:
repostr += '"' + repo + '" '
else:
repostr += repo + ' '
repostr += p... | python | def _add_new_repo(repo, properties):
'''
Add a new repo entry
'''
repostr = '# ' if not properties.get('enabled') else ''
repostr += 'src/gz ' if properties.get('compressed') else 'src '
if ' ' in repo:
repostr += '"' + repo + '" '
else:
repostr += repo + ' '
repostr += p... | [
"def",
"_add_new_repo",
"(",
"repo",
",",
"properties",
")",
":",
"repostr",
"=",
"'# '",
"if",
"not",
"properties",
".",
"get",
"(",
"'enabled'",
")",
"else",
"''",
"repostr",
"+=",
"'src/gz '",
"if",
"properties",
".",
"get",
"(",
"'compressed'",
")",
... | Add a new repo entry | [
"Add",
"a",
"new",
"repo",
"entry"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1379-L1395 | train | Add a new repo 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/modules/opkg.py | _mod_repo_in_file | def _mod_repo_in_file(repo, repostr, filepath):
'''
Replace a repo entry in filepath with repostr
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
for line in fhandle:
cols = salt.utils.args.shlex_split(
salt.utils.stringutils.to_unicode(line)... | python | def _mod_repo_in_file(repo, repostr, filepath):
'''
Replace a repo entry in filepath with repostr
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
for line in fhandle:
cols = salt.utils.args.shlex_split(
salt.utils.stringutils.to_unicode(line)... | [
"def",
"_mod_repo_in_file",
"(",
"repo",
",",
"repostr",
",",
"filepath",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"filepath",
")",
"as",
"fhandle",
":",
"output",
"=",
"[",
"]",
"for",
"line",
"in",
"fhandle",
":",
"c... | Replace a repo entry in filepath with repostr | [
"Replace",
"a",
"repo",
"entry",
"in",
"filepath",
"with",
"repostr"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1398-L1413 | train | Replace a repo entry in filepath with repostr | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | del_repo | def del_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Delete a repo from ``/etc/opkg/*.conf``
If the file does not contain any other repo configuration, the file itself
will be deleted.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo repo
'''
refresh =... | python | def del_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Delete a repo from ``/etc/opkg/*.conf``
If the file does not contain any other repo configuration, the file itself
will be deleted.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo repo
'''
refresh =... | [
"def",
"del_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"refresh",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"kwargs",
".",
"get",
"(",
"'refresh'",
",",
"True",
")",
")",
"repos",
"=",
... | Delete a repo from ``/etc/opkg/*.conf``
If the file does not contain any other repo configuration, the file itself
will be deleted.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo repo | [
"Delete",
"a",
"repo",
"from",
"/",
"etc",
"/",
"opkg",
"/",
"*",
".",
"conf"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1416-L1459 | train | Delete a repo from the opkg repo lists | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | mod_repo | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as uri is defined.
The following options are available to modify a repo definition:
repo
alias by which opkg refers to the repo.
uri
the URI to the r... | python | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as uri is defined.
The following options are available to modify a repo definition:
repo
alias by which opkg refers to the repo.
uri
the URI to the r... | [
"def",
"mod_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"repos",
"=",
"list_repos",
"(",
")",
"found",
"=",
"False",
"uri",
"=",
"''",
"if",
"'uri'",
"in",
"kwargs",
":",
"uri",
"=",
"kwargs",
"[",
"'uri'",
"]",
"for",
"repository",
"in"... | Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as uri is defined.
The following options are available to modify a repo definition:
repo
alias by which opkg refers to the repo.
uri
the URI to the repo.
compressed
defines (True ... | [
"Modify",
"one",
"or",
"more",
"values",
"for",
"a",
"repo",
".",
"If",
"the",
"repo",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"so",
"long",
"as",
"uri",
"is",
"defined",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1462-L1533 | train | Modify one or more values for a repo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | file_list | def file_list(*packages, **kwargs): # pylint: disable=unused-argument
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' ... | python | def file_list(*packages, **kwargs): # pylint: disable=unused-argument
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' ... | [
"def",
"file_list",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"output",
"=",
"file_dict",
"(",
"*",
"packages",
")",
"files",
"=",
"[",
"]",
"for",
"package",
"in",
"list",
"(",
"output",
"[",
"'packages'... | List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfix
salt '*' p... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
"generally",
"recommended",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1536-L1554 | train | A wrapper for file_list that returns a list of all files that belong to a package. Not specifying any packages will
return a list of all files that belong to a package on the system s package database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | file_dict | def file_dict(*packages, **kwargs): # pylint: disable=unused-argument
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bas... | python | def file_dict(*packages, **kwargs): # pylint: disable=unused-argument
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bas... | [
"def",
"file_dict",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"errors",
"=",
"[",
"]",
"ret",
"=",
"{",
"}",
"cmd_files",
"=",
"[",
"'opkg'",
",",
"'files'",
"]",
"if",
"not",
"packages",
":",
"packages... | List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfi... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
"grouped",
"by",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1557-L1596 | train | Return a dict of all files in a package. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/opkg.py | owner | def owner(*paths, **kwargs): # pylint: disable=unused-argument
'''
Return the name of the package that owns the file. Multiple file paths can
be passed. Like :mod:`pkg.version <salt.modules.opkg.version`, if a single
path is passed, a string will be returned, and if multiple paths are passed,
a dic... | python | def owner(*paths, **kwargs): # pylint: disable=unused-argument
'''
Return the name of the package that owns the file. Multiple file paths can
be passed. Like :mod:`pkg.version <salt.modules.opkg.version`, if a single
path is passed, a string will be returned, and if multiple paths are passed,
a dic... | [
"def",
"owner",
"(",
"*",
"paths",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"not",
"paths",
":",
"return",
"''",
"ret",
"=",
"{",
"}",
"cmd_search",
"=",
"[",
"'opkg'",
",",
"'search'",
"]",
"for",
"path",
"in",
"pa... | Return the name of the package that owns the file. Multiple file paths can
be passed. Like :mod:`pkg.version <salt.modules.opkg.version`, if a single
path is passed, a string will be returned, and if multiple paths are passed,
a dictionary of file/package name pairs will be returned.
If the file is not... | [
"Return",
"the",
"name",
"of",
"the",
"package",
"that",
"owns",
"the",
"file",
".",
"Multiple",
"file",
"paths",
"can",
"be",
"passed",
".",
"Like",
":",
"mod",
":",
"pkg",
".",
"version",
"<salt",
".",
"modules",
".",
"opkg",
".",
"version",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/opkg.py#L1599-L1630 | train | Return the name of the package that owns the file. Multiple file paths can be 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/splunk.py | _send_email | def _send_email(name, email):
"send a email to inform user of account creation"
config = __salt__['config.option']('splunk')
email_object = config.get('email')
if email_object:
cc = email_object.get('cc')
subject = email_object.get('subject')
message = email_object.get('message')... | python | def _send_email(name, email):
"send a email to inform user of account creation"
config = __salt__['config.option']('splunk')
email_object = config.get('email')
if email_object:
cc = email_object.get('cc')
subject = email_object.get('subject')
message = email_object.get('message')... | [
"def",
"_send_email",
"(",
"name",
",",
"email",
")",
":",
"config",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'splunk'",
")",
"email_object",
"=",
"config",
".",
"get",
"(",
"'email'",
")",
"if",
"email_object",
":",
"cc",
"=",
"email_object",
... | send a email to inform user of account creation | [
"send",
"a",
"email",
"to",
"inform",
"user",
"of",
"account",
"creation"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L84-L100 | train | send a email to inform user of account creation | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | _get_splunk | def _get_splunk(profile):
'''
Return the splunk client, cached into __context__ for performance
'''
config = __salt__['config.option'](profile)
key = "splunk.{0}:{1}:{2}:{3}".format(
config.get('host'),
config.get('port'),
config.get('username'),
config.get('password... | python | def _get_splunk(profile):
'''
Return the splunk client, cached into __context__ for performance
'''
config = __salt__['config.option'](profile)
key = "splunk.{0}:{1}:{2}:{3}".format(
config.get('host'),
config.get('port'),
config.get('username'),
config.get('password... | [
"def",
"_get_splunk",
"(",
"profile",
")",
":",
"config",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"key",
"=",
"\"splunk.{0}:{1}:{2}:{3}\"",
".",
"format",
"(",
"config",
".",
"get",
"(",
"'host'",
")",
",",
"config",
".",
"get",
... | Return the splunk client, cached into __context__ for performance | [
"Return",
"the",
"splunk",
"client",
"cached",
"into",
"__context__",
"for",
"performance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L124-L144 | train | Return the splunk client cached into __context__ for performance
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | list_users | def list_users(profile="splunk"):
'''
List all users in the splunk DB
CLI Example:
salt myminion splunk.list_users
'''
config = __salt__['config.option'](profile)
key = "splunk.users.{0}".format(
config.get('host')
)
if key not in __context__:
_populate_cache(... | python | def list_users(profile="splunk"):
'''
List all users in the splunk DB
CLI Example:
salt myminion splunk.list_users
'''
config = __salt__['config.option'](profile)
key = "splunk.users.{0}".format(
config.get('host')
)
if key not in __context__:
_populate_cache(... | [
"def",
"list_users",
"(",
"profile",
"=",
"\"splunk\"",
")",
":",
"config",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"key",
"=",
"\"splunk.users.{0}\"",
".",
"format",
"(",
"config",
".",
"get",
"(",
"'host'",
")",
")",
"if",
"k... | List all users in the splunk DB
CLI Example:
salt myminion splunk.list_users | [
"List",
"all",
"users",
"in",
"the",
"splunk",
"DB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L147-L164 | train | List all users in the splunk DB
CLI Example : splunk. list_users | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | get_user | def get_user(email, profile="splunk", **kwargs):
'''
Get a splunk user by name/email
CLI Example:
salt myminion splunk.get_user 'user@example.com' user_details=false
salt myminion splunk.get_user 'user@example.com' user_details=true
'''
user_map = list_users(profile)
user_foun... | python | def get_user(email, profile="splunk", **kwargs):
'''
Get a splunk user by name/email
CLI Example:
salt myminion splunk.get_user 'user@example.com' user_details=false
salt myminion splunk.get_user 'user@example.com' user_details=true
'''
user_map = list_users(profile)
user_foun... | [
"def",
"get_user",
"(",
"email",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"user_map",
"=",
"list_users",
"(",
"profile",
")",
"user_found",
"=",
"email",
".",
"lower",
"(",
")",
"in",
"user_map",
".",
"keys",
"(",
")",
"i... | Get a splunk user by name/email
CLI Example:
salt myminion splunk.get_user 'user@example.com' user_details=false
salt myminion splunk.get_user 'user@example.com' user_details=true | [
"Get",
"a",
"splunk",
"user",
"by",
"name",
"/",
"email"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L167-L196 | train | Get a splunk user by name or email | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | create_user | def create_user(email, profile="splunk", **kwargs):
'''
create a splunk user by name/email
CLI Example:
salt myminion splunk.create_user user@example.com roles=['user'] realname="Test User" name=testuser
'''
client = _get_splunk(profile)
email = email.lower()
user = list_users(p... | python | def create_user(email, profile="splunk", **kwargs):
'''
create a splunk user by name/email
CLI Example:
salt myminion splunk.create_user user@example.com roles=['user'] realname="Test User" name=testuser
'''
client = _get_splunk(profile)
email = email.lower()
user = list_users(p... | [
"def",
"create_user",
"(",
"email",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"email",
"=",
"email",
".",
"lower",
"(",
")",
"user",
"=",
"list_users",
"(",
"profile",
")",
... | create a splunk user by name/email
CLI Example:
salt myminion splunk.create_user user@example.com roles=['user'] realname="Test User" name=testuser | [
"create",
"a",
"splunk",
"user",
"by",
"name",
"/",
"email"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L199-L246 | train | Create a splunk user by name email | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | update_user | def update_user(email, profile="splunk", **kwargs):
'''
Create a splunk user by email
CLI Example:
salt myminion splunk.update_user example@domain.com roles=['user'] realname="Test User"
'''
client = _get_splunk(profile)
email = email.lower()
user = list_users(profile).get(email... | python | def update_user(email, profile="splunk", **kwargs):
'''
Create a splunk user by email
CLI Example:
salt myminion splunk.update_user example@domain.com roles=['user'] realname="Test User"
'''
client = _get_splunk(profile)
email = email.lower()
user = list_users(profile).get(email... | [
"def",
"update_user",
"(",
"email",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"email",
"=",
"email",
".",
"lower",
"(",
")",
"user",
"=",
"list_users",
"(",
"profile",
")",
... | Create a splunk user by email
CLI Example:
salt myminion splunk.update_user example@domain.com roles=['user'] realname="Test User" | [
"Create",
"a",
"splunk",
"user",
"by",
"email"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L249-L301 | train | Update a splunk user by email | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/splunk.py | delete_user | def delete_user(email, profile="splunk"):
'''
Delete a splunk user by email
CLI Example:
salt myminion splunk_user.delete 'user@example.com'
'''
client = _get_splunk(profile)
user = list_users(profile).get(email)
if user:
try:
client.users.delete(user.name)
... | python | def delete_user(email, profile="splunk"):
'''
Delete a splunk user by email
CLI Example:
salt myminion splunk_user.delete 'user@example.com'
'''
client = _get_splunk(profile)
user = list_users(profile).get(email)
if user:
try:
client.users.delete(user.name)
... | [
"def",
"delete_user",
"(",
"email",
",",
"profile",
"=",
"\"splunk\"",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"user",
"=",
"list_users",
"(",
"profile",
")",
".",
"get",
"(",
"email",
")",
"if",
"user",
":",
"try",
":",
"client",
... | Delete a splunk user by email
CLI Example:
salt myminion splunk_user.delete 'user@example.com' | [
"Delete",
"a",
"splunk",
"user",
"by",
"email"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk.py#L304-L326 | train | Delete a splunk user by email | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/extra.py | shell | def shell():
'''
Return the default shell to use on this system
'''
# Provides:
# shell
if salt.utils.platform.is_windows():
env_var = 'COMSPEC'
default = r'C:\Windows\system32\cmd.exe'
else:
env_var = 'SHELL'
default = '/bin/sh'
return {'shell': os.env... | python | def shell():
'''
Return the default shell to use on this system
'''
# Provides:
# shell
if salt.utils.platform.is_windows():
env_var = 'COMSPEC'
default = r'C:\Windows\system32\cmd.exe'
else:
env_var = 'SHELL'
default = '/bin/sh'
return {'shell': os.env... | [
"def",
"shell",
"(",
")",
":",
"# Provides:",
"# shell",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"env_var",
"=",
"'COMSPEC'",
"default",
"=",
"r'C:\\Windows\\system32\\cmd.exe'",
"else",
":",
"env_var",
"=",
"'SHELL'",
... | Return the default shell to use on this system | [
"Return",
"the",
"default",
"shell",
"to",
"use",
"on",
"this",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/extra.py#L21-L34 | train | Return the default shell to use on this 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/grains/extra.py | config | def config():
'''
Return the grains set in the grains file
'''
if 'conf_file' not in __opts__:
return {}
if os.path.isdir(__opts__['conf_file']):
if salt.utils.platform.is_proxy():
gfn = os.path.join(
__opts__['conf_file'],
'proxy.d... | python | def config():
'''
Return the grains set in the grains file
'''
if 'conf_file' not in __opts__:
return {}
if os.path.isdir(__opts__['conf_file']):
if salt.utils.platform.is_proxy():
gfn = os.path.join(
__opts__['conf_file'],
'proxy.d... | [
"def",
"config",
"(",
")",
":",
"if",
"'conf_file'",
"not",
"in",
"__opts__",
":",
"return",
"{",
"}",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_... | Return the grains set in the grains file | [
"Return",
"the",
"grains",
"set",
"in",
"the",
"grains",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/extra.py#L37-L77 | train | Return the grains set in the grains file
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_desktop.py | get_output_volume | def get_output_volume():
'''
Get the output volume (range 0 to 100)
CLI Example:
.. code-block:: bash
salt '*' desktop.get_output_volume
'''
cmd = 'osascript -e "get output volume of (get volume settings)"'
call = __salt__['cmd.run_all'](
cmd,
output_loglevel='debu... | python | def get_output_volume():
'''
Get the output volume (range 0 to 100)
CLI Example:
.. code-block:: bash
salt '*' desktop.get_output_volume
'''
cmd = 'osascript -e "get output volume of (get volume settings)"'
call = __salt__['cmd.run_all'](
cmd,
output_loglevel='debu... | [
"def",
"get_output_volume",
"(",
")",
":",
"cmd",
"=",
"'osascript -e \"get output volume of (get volume settings)\"'",
"call",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'debug'",
",",
"python_shell",
"=",
"False",
")",
"_... | Get the output volume (range 0 to 100)
CLI Example:
.. code-block:: bash
salt '*' desktop.get_output_volume | [
"Get",
"the",
"output",
"volume",
"(",
"range",
"0",
"to",
"100",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_desktop.py#L24-L42 | train | Get the output volume of 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/mac_desktop.py | set_output_volume | def set_output_volume(volume):
'''
Set the volume of sound.
volume
The level of volume. Can range from 0 to 100.
CLI Example:
.. code-block:: bash
salt '*' desktop.set_output_volume <volume>
'''
cmd = 'osascript -e "set volume output volume {0}"'.format(volume)
call =... | python | def set_output_volume(volume):
'''
Set the volume of sound.
volume
The level of volume. Can range from 0 to 100.
CLI Example:
.. code-block:: bash
salt '*' desktop.set_output_volume <volume>
'''
cmd = 'osascript -e "set volume output volume {0}"'.format(volume)
call =... | [
"def",
"set_output_volume",
"(",
"volume",
")",
":",
"cmd",
"=",
"'osascript -e \"set volume output volume {0}\"'",
".",
"format",
"(",
"volume",
")",
"call",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'debug'",
",",
"p... | Set the volume of sound.
volume
The level of volume. Can range from 0 to 100.
CLI Example:
.. code-block:: bash
salt '*' desktop.set_output_volume <volume> | [
"Set",
"the",
"volume",
"of",
"sound",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_desktop.py#L45-L66 | train | Set the output volume of sound. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_desktop.py | screensaver | def screensaver():
'''
Launch the screensaver.
CLI Example:
.. code-block:: bash
salt '*' desktop.screensaver
'''
cmd = 'open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'
call = __salt__['cmd.run_all'](
cmd,
output_lo... | python | def screensaver():
'''
Launch the screensaver.
CLI Example:
.. code-block:: bash
salt '*' desktop.screensaver
'''
cmd = 'open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'
call = __salt__['cmd.run_all'](
cmd,
output_lo... | [
"def",
"screensaver",
"(",
")",
":",
"cmd",
"=",
"'open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'",
"call",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'debug'",
",",
"python_shell"... | Launch the screensaver.
CLI Example:
.. code-block:: bash
salt '*' desktop.screensaver | [
"Launch",
"the",
"screensaver",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_desktop.py#L69-L87 | train | Launch the screensaver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_desktop.py | say | def say(*words):
'''
Say some words.
words
The words to execute the say command with.
CLI Example:
.. code-block:: bash
salt '*' desktop.say <word0> <word1> ... <wordN>
'''
cmd = 'say {0}'.format(' '.join(words))
call = __salt__['cmd.run_all'](
cmd,
ou... | python | def say(*words):
'''
Say some words.
words
The words to execute the say command with.
CLI Example:
.. code-block:: bash
salt '*' desktop.say <word0> <word1> ... <wordN>
'''
cmd = 'say {0}'.format(' '.join(words))
call = __salt__['cmd.run_all'](
cmd,
ou... | [
"def",
"say",
"(",
"*",
"words",
")",
":",
"cmd",
"=",
"'say {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"words",
")",
")",
"call",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'debug'",
",",
"python_s... | Say some words.
words
The words to execute the say command with.
CLI Example:
.. code-block:: bash
salt '*' desktop.say <word0> <word1> ... <wordN> | [
"Say",
"some",
"words",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_desktop.py#L111-L132 | train | Say some words with the specified words. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_desktop.py | _check_cmd | def _check_cmd(call):
'''
Check the output of the cmd.run_all function call.
'''
if call['retcode'] != 0:
comment = ''
std_err = call.get('stderr')
std_out = call.get('stdout')
if std_err:
comment += std_err
if std_out:
comment += std_out
... | python | def _check_cmd(call):
'''
Check the output of the cmd.run_all function call.
'''
if call['retcode'] != 0:
comment = ''
std_err = call.get('stderr')
std_out = call.get('stdout')
if std_err:
comment += std_err
if std_out:
comment += std_out
... | [
"def",
"_check_cmd",
"(",
"call",
")",
":",
"if",
"call",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"comment",
"=",
"''",
"std_err",
"=",
"call",
".",
"get",
"(",
"'stderr'",
")",
"std_out",
"=",
"call",
".",
"get",
"(",
"'stdout'",
")",
"if",
"std_er... | Check the output of the cmd.run_all function call. | [
"Check",
"the",
"output",
"of",
"the",
"cmd",
".",
"run_all",
"function",
"call",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_desktop.py#L135-L150 | train | Check the output of the cmd. run_all function call.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/win_pdh.py | build_counter_list | def build_counter_list(counter_list):
r'''
Create a list of Counter objects to be used in the pdh query
Args:
counter_list (list):
A list of tuples containing counter information. Each tuple should
contain the object, instance, and counter name. For example, to
g... | python | def build_counter_list(counter_list):
r'''
Create a list of Counter objects to be used in the pdh query
Args:
counter_list (list):
A list of tuples containing counter information. Each tuple should
contain the object, instance, and counter name. For example, to
g... | [
"def",
"build_counter_list",
"(",
"counter_list",
")",
":",
"counters",
"=",
"[",
"]",
"index",
"=",
"0",
"for",
"obj",
",",
"instance",
",",
"counter_name",
"in",
"counter_list",
":",
"try",
":",
"counter",
"=",
"Counter",
".",
"build_counter",
"(",
"obj"... | r'''
Create a list of Counter objects to be used in the pdh query
Args:
counter_list (list):
A list of tuples containing counter information. Each tuple should
contain the object, instance, and counter name. For example, to
get the ``% Processor Time`` counter for al... | [
"r",
"Create",
"a",
"list",
"of",
"Counter",
"objects",
"to",
"be",
"used",
"in",
"the",
"pdh",
"query"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_pdh.py#L292-L334 | train | r Builds a list of Counter objects for the given list of objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/win_pdh.py | get_all_counters | def get_all_counters(obj, instance_list=None):
'''
Get the values for all counters available to a Counter object
Args:
obj (str):
The name of the counter object. You can get a list of valid names
using the ``list_objects`` function
instance_list (list):
... | python | def get_all_counters(obj, instance_list=None):
'''
Get the values for all counters available to a Counter object
Args:
obj (str):
The name of the counter object. You can get a list of valid names
using the ``list_objects`` function
instance_list (list):
... | [
"def",
"get_all_counters",
"(",
"obj",
",",
"instance_list",
"=",
"None",
")",
":",
"counters",
",",
"instances_avail",
"=",
"win32pdh",
".",
"EnumObjectItems",
"(",
"None",
",",
"None",
",",
"obj",
",",
"-",
"1",
",",
"0",
")",
"if",
"instance_list",
"i... | Get the values for all counters available to a Counter object
Args:
obj (str):
The name of the counter object. You can get a list of valid names
using the ``list_objects`` function
instance_list (list):
A list of instances to return. Use this to narrow down the... | [
"Get",
"the",
"values",
"for",
"all",
"counters",
"available",
"to",
"a",
"Counter",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_pdh.py#L337-L370 | train | Get the values for all counters available to a Counter 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/utils/win_pdh.py | get_counters | def get_counters(counter_list):
'''
Get the values for the passes list of counters
Args:
counter_list (list):
A list of counters to lookup
Returns:
dict: A dictionary of counters and their values
'''
if not isinstance(counter_list, list):
raise CommandExecut... | python | def get_counters(counter_list):
'''
Get the values for the passes list of counters
Args:
counter_list (list):
A list of counters to lookup
Returns:
dict: A dictionary of counters and their values
'''
if not isinstance(counter_list, list):
raise CommandExecut... | [
"def",
"get_counters",
"(",
"counter_list",
")",
":",
"if",
"not",
"isinstance",
"(",
"counter_list",
",",
"list",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'counter_list must be a list of tuples'",
")",
"try",
":",
"# Start a Query instances",
"query",
"=",
... | Get the values for the passes list of counters
Args:
counter_list (list):
A list of counters to lookup
Returns:
dict: A dictionary of counters and their values | [
"Get",
"the",
"values",
"for",
"the",
"passes",
"list",
"of",
"counters"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_pdh.py#L373-L420 | train | Get the values for the passes list of counters | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/win_pdh.py | Counter.build_counter | def build_counter(obj, instance, instance_index, counter):
r'''
Makes a fully resolved counter path. Counter names are formatted like
this:
``\Processor(*)\% Processor Time``
The above breaks down like this:
obj = 'Processor'
instance = '*'
... | python | def build_counter(obj, instance, instance_index, counter):
r'''
Makes a fully resolved counter path. Counter names are formatted like
this:
``\Processor(*)\% Processor Time``
The above breaks down like this:
obj = 'Processor'
instance = '*'
... | [
"def",
"build_counter",
"(",
"obj",
",",
"instance",
",",
"instance_index",
",",
"counter",
")",
":",
"path",
"=",
"win32pdh",
".",
"MakeCounterPath",
"(",
"(",
"None",
",",
"obj",
",",
"instance",
",",
"None",
",",
"instance_index",
",",
"counter",
")",
... | r'''
Makes a fully resolved counter path. Counter names are formatted like
this:
``\Processor(*)\% Processor Time``
The above breaks down like this:
obj = 'Processor'
instance = '*'
counter = '% Processor Time'
Args:
obj (str):... | [
"r",
"Makes",
"a",
"fully",
"resolved",
"counter",
"path",
".",
"Counter",
"names",
"are",
"formatted",
"like",
"this",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_pdh.py#L132-L169 | train | Builds a Counter object from the specified object instance and counter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/win_pdh.py | Counter.add_to_query | def add_to_query(self, query):
'''
Add the current path to the query
Args:
query (obj):
The handle to the query to add the counter
'''
self.handle = win32pdh.AddCounter(query, self.path) | python | def add_to_query(self, query):
'''
Add the current path to the query
Args:
query (obj):
The handle to the query to add the counter
'''
self.handle = win32pdh.AddCounter(query, self.path) | [
"def",
"add_to_query",
"(",
"self",
",",
"query",
")",
":",
"self",
".",
"handle",
"=",
"win32pdh",
".",
"AddCounter",
"(",
"query",
",",
"self",
".",
"path",
")"
] | Add the current path to the query
Args:
query (obj):
The handle to the query to add the counter | [
"Add",
"the",
"current",
"path",
"to",
"the",
"query"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_pdh.py#L183-L191 | train | Add the current path to the query | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.