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/proxy/nxos.py | sendline | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_co... | python | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_co... | [
"def",
"sendline",
"(",
"command",
",",
"method",
"=",
"'cli_show_ascii'",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"CONNECTION",
"==",
"'ssh'",
":",
"result",
"=",
"_sendline_ssh",
"(",
"command",
",",
"*",
"*",
"kwargs",
")",
"elif",
"CON... | Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
Defaults to `... | [
"Send",
"arbitrary",
"show",
"or",
"config",
"commands",
"to",
"the",
"NX",
"-",
"OS",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L297-L327 | train | Send command to NX - OS device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/nxos.py | proxy_config | def proxy_config(commands, **kwargs):
'''
Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
De... | python | def proxy_config(commands, **kwargs):
'''
Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
De... | [
"def",
"proxy_config",
"(",
"commands",
",",
"*",
"*",
"kwargs",
")",
":",
"no_save_config",
"=",
"DEVICE_DETAILS",
"[",
"'no_save_config'",
"]",
"no_save_config",
"=",
"kwargs",
".",
"get",
"(",
"'no_save_config'",
",",
"no_save_config",
")",
"if",
"not",
"is... | Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block: bash
sal... | [
"Send",
"configuration",
"commands",
"over",
"SSH",
"or",
"NX",
"-",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L330-L376 | train | Send configuration commands over SSH or NX - API | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/nxos.py | _init_ssh | def _init_ssh(opts):
'''
Open a connection to the NX-OS switch over SSH.
'''
if opts is None:
opts = __opts__
try:
this_prompt = None
if 'prompt_regex' in opts['proxy']:
this_prompt = opts['proxy']['prompt_regex']
elif 'prompt_name' in opts['proxy']:
... | python | def _init_ssh(opts):
'''
Open a connection to the NX-OS switch over SSH.
'''
if opts is None:
opts = __opts__
try:
this_prompt = None
if 'prompt_regex' in opts['proxy']:
this_prompt = opts['proxy']['prompt_regex']
elif 'prompt_name' in opts['proxy']:
... | [
"def",
"_init_ssh",
"(",
"opts",
")",
":",
"if",
"opts",
"is",
"None",
":",
"opts",
"=",
"__opts__",
"try",
":",
"this_prompt",
"=",
"None",
"if",
"'prompt_regex'",
"in",
"opts",
"[",
"'proxy'",
"]",
":",
"this_prompt",
"=",
"opts",
"[",
"'proxy'",
"]"... | Open a connection to the NX-OS switch over SSH. | [
"Open",
"a",
"connection",
"to",
"the",
"NX",
"-",
"OS",
"switch",
"over",
"SSH",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L382-L415 | train | Open a connection to NX - OS switch over SSH. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/nxos.py | _parse_output_for_errors | def _parse_output_for_errors(data, command, **kwargs):
'''
Helper method to parse command output for error information
'''
if re.search('% Invalid', data):
raise CommandExecutionError({
'rejected_input': command,
'message': 'CLI excution error',
'code': '400',... | python | def _parse_output_for_errors(data, command, **kwargs):
'''
Helper method to parse command output for error information
'''
if re.search('% Invalid', data):
raise CommandExecutionError({
'rejected_input': command,
'message': 'CLI excution error',
'code': '400',... | [
"def",
"_parse_output_for_errors",
"(",
"data",
",",
"command",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"re",
".",
"search",
"(",
"'% Invalid'",
",",
"data",
")",
":",
"raise",
"CommandExecutionError",
"(",
"{",
"'rejected_input'",
":",
"command",
",",
"'... | Helper method to parse command output for error information | [
"Helper",
"method",
"to",
"parse",
"command",
"output",
"for",
"error",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L446-L465 | train | Helper method to parse command output for error information | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/nxos.py | _init_nxapi | def _init_nxapi(opts):
'''
Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock... | python | def _init_nxapi(opts):
'''
Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock... | [
"def",
"_init_nxapi",
"(",
"opts",
")",
":",
"proxy_dict",
"=",
"opts",
".",
"get",
"(",
"'proxy'",
",",
"{",
"}",
")",
"conn_args",
"=",
"copy",
".",
"deepcopy",
"(",
"proxy_dict",
")",
"conn_args",
".",
"pop",
"(",
"'proxytype'",
",",
"None",
")",
... | Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock``)
which doesn't come with muc... | [
"Open",
"a",
"connection",
"to",
"the",
"NX",
"-",
"OS",
"switch",
"over",
"NX",
"-",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L475-L506 | train | Initialize NX - API with NX - API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/nxos.py | _nxapi_request | def _nxapi_request(commands, method='cli_conf', **kwargs):
'''
Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output... | python | def _nxapi_request(commands, method='cli_conf', **kwargs):
'''
Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output... | [
"def",
"_nxapi_request",
"(",
"commands",
",",
"method",
"=",
"'cli_conf'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"CONNECTION",
"==",
"'ssh'",
":",
"return",
"'_nxapi_request is not available for ssh proxy'",
"conn_args",
"=",
"DEVICE_DETAILS",
"[",
"'conn_args'"... | Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
... | [
"Executes",
"an",
"nxapi_request",
"request",
"over",
"NX",
"-",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L521-L539 | train | Execute NX - API request over NX - API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | availability_set_create_or_update | def availability_set_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availabil... | python | def availability_set_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availabil... | [
"def",
"availability_set_create_or_update",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"if",
"'location'",
"not",
"in",
"kwargs",
":",
"rg_props",
"=",
"__salt__",
"[",
"'azurearm_resource.resource_group_get'... | .. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_create_or... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L80-L145 | train | Create or update an availability set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | availability_set_delete | def availability_set_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash... | python | def availability_set_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash... | [
"def",
"availability_set_delete",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"c... | .. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_delete testset test... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L148-L178 | train | Delete an availability set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | availability_set_get | def availability_set_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Exam... | python | def availability_set_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Exam... | [
"def",
"availability_set_get",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"av_set",
"=",
"compconn",
".... | .. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.ava... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L181-L211 | train | Get a dictionary representing an availability set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | availability_sets_list | def availability_sets_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_comp... | python | def availability_sets_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_comp... | [
"def",
"availability_sets_list",
"(",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"avail_sets",
"... | .. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_sets_list testgroup | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L214-L245 | train | List all availability sets within a resource group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | availability_sets_list_available_sizes | def availability_sets_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set... | python | def availability_sets_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set... | [
"def",
"availability_sets_list_available_sizes",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",... | .. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set name to list available
virtual machine sizes within.
:param resource_group: The resource group name to lis... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L248-L284 | train | List all available virtual machine sizes within an availability set within a resource group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machine_capture | def virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs):
'''
.. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virt... | python | def virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs):
'''
.. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virt... | [
"def",
"virtual_machine_capture",
"(",
"name",
",",
"destination_name",
",",
"resource_group",
",",
"prefix",
"=",
"'capture-'",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"VirtualMachineCaptureParameters",
"="... | .. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virtual machine.
:param destination_name: The destination container name.
:param resource_group: The resource group name ... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L287-L336 | train | Captures the virtual machine by copying the virtual hard disks of the VM and outputs the virtual machine template that can be used to create similar VMs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machine_get | def virtual_machine_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
vi... | python | def virtual_machine_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
vi... | [
"def",
"virtual_machine_get",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"expand",
"=",
"kwargs",
".",
"get",
"(",
"'expand'",
")",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*"... | .. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
s... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L339-L373 | train | Get information about the model view or instance view of a virtual machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machine_convert_to_managed_disks | def virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The na... | python | def virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The na... | [
"def",
"virtual_machine_convert_to_managed_disks",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")... | .. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The name of the virtual machine to convert.
:param resource_group: The resource group name assigned to the
virtual ... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L376-L409 | train | Converts the virtual machine disks from blob - based to managed disks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machine_generalize | def virtual_machine_generalize(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Exampl... | python | def virtual_machine_generalize(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Exampl... | [
"def",
"virtual_machine_generalize",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
... | .. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_mac... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L447-L476 | train | Generalize a virtual machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machines_list | def virtual_machines_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute... | python | def virtual_machines_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute... | [
"def",
"virtual_machines_list",
"(",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"vms",
"=",
"_... | .. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list testgroup | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L479-L509 | train | List all virtual machines within a resource group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machines_list_all | def virtual_machines_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all
'''
result = {}
compconn = __utils__['azurearm.get_client']('comput... | python | def virtual_machines_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all
'''
result = {}
compconn = __utils__['azurearm.get_client']('comput... | [
"def",
"virtual_machines_list_all",
"(",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"vms",
"=",
"__utils__",
"[",
"'a... | .. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L512-L537 | train | List all virtual machines within a subscription. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/azurearm_compute.py | virtual_machines_list_available_sizes | def virtual_machines_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resou... | python | def virtual_machines_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resou... | [
"def",
"virtual_machines_list_available_sizes",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
... | .. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L540-L574 | train | Lists all available virtual machine sizes to which the specified virtual machine can be resized. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/output/yaml_out.py | output | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out YAML using the block mode
'''
params = {}
if 'output_indent' not in __opts__:
# default indentation
params.update(default_flow_style=False)
elif __opts__['output_indent'] >= 0:
# custom indent
... | python | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out YAML using the block mode
'''
params = {}
if 'output_indent' not in __opts__:
# default indentation
params.update(default_flow_style=False)
elif __opts__['output_indent'] >= 0:
# custom indent
... | [
"def",
"output",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"params",
"=",
"{",
"}",
"if",
"'output_indent'",
"not",
"in",
"__opts__",
":",
"# default indentation",
"params",
".",
"update",
"(",
"default_flow_style",
"="... | Print out YAML using the block mode | [
"Print",
"out",
"YAML",
"using",
"the",
"block",
"mode"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/yaml_out.py#L38-L61 | train | Print out YAML using the block mode
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/yast.py | mksls | def mksls(src, dst=None):
'''
Convert an AutoYAST file to an SLS file
'''
with salt.utils.files.fopen(src, 'r') as fh_:
ps_opts = xml.to_dict(ET.fromstring(fh_.read()))
if dst is not None:
with salt.utils.files.fopen(dst, 'w') as fh_:
salt.utils.yaml.safe_dump(ps_opts, f... | python | def mksls(src, dst=None):
'''
Convert an AutoYAST file to an SLS file
'''
with salt.utils.files.fopen(src, 'r') as fh_:
ps_opts = xml.to_dict(ET.fromstring(fh_.read()))
if dst is not None:
with salt.utils.files.fopen(dst, 'w') as fh_:
salt.utils.yaml.safe_dump(ps_opts, f... | [
"def",
"mksls",
"(",
"src",
",",
"dst",
"=",
"None",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"src",
",",
"'r'",
")",
"as",
"fh_",
":",
"ps_opts",
"=",
"xml",
".",
"to_dict",
"(",
"ET",
".",
"fromstring",
"(",
"f... | Convert an AutoYAST file to an SLS file | [
"Convert",
"an",
"AutoYAST",
"file",
"to",
"an",
"SLS",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/yast.py#L14-L25 | train | Convert an AutoYAST file to an SLS file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/color.py | get_color_theme | def get_color_theme(theme):
'''
Return the color theme to use
'''
# Keep the heavy lifting out of the module space
import salt.utils.data
import salt.utils.files
import salt.utils.yaml
if not os.path.isfile(theme):
log.warning('The named theme %s if not available', theme)
tr... | python | def get_color_theme(theme):
'''
Return the color theme to use
'''
# Keep the heavy lifting out of the module space
import salt.utils.data
import salt.utils.files
import salt.utils.yaml
if not os.path.isfile(theme):
log.warning('The named theme %s if not available', theme)
tr... | [
"def",
"get_color_theme",
"(",
"theme",
")",
":",
"# Keep the heavy lifting out of the module space",
"import",
"salt",
".",
"utils",
".",
"data",
"import",
"salt",
".",
"utils",
".",
"files",
"import",
"salt",
".",
"utils",
".",
"yaml",
"if",
"not",
"os",
"."... | Return the color theme to use | [
"Return",
"the",
"color",
"theme",
"to",
"use"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/color.py#L18-L41 | train | Return the color theme to use
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/color.py | get_colors | def get_colors(use=True, theme=None):
'''
Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = ... | python | def get_colors(use=True, theme=None):
'''
Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = ... | [
"def",
"get_colors",
"(",
"use",
"=",
"True",
",",
"theme",
"=",
"None",
")",
":",
"colors",
"=",
"{",
"'BLACK'",
":",
"TextFormat",
"(",
"'black'",
")",
",",
"'DARK_GRAY'",
":",
"TextFormat",
"(",
"'bold'",
",",
"'black'",
")",
",",
"'RED'",
":",
"T... | Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = get_colors() # enable all colors
no_color... | [
"Return",
"the",
"colors",
"as",
"an",
"easy",
"to",
"use",
"dict",
".",
"Pass",
"False",
"to",
"deactivate",
"all",
"colors",
"by",
"setting",
"them",
"to",
"empty",
"strings",
".",
"Pass",
"a",
"string",
"containing",
"only",
"the",
"name",
"of",
"a",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/color.py#L44-L93 | train | Return the colors as an easy to use 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/states/zabbix_usergroup.py | present | def present(name, **kwargs):
'''
Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versiona... | python | def present(name, **kwargs):
'''
Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versiona... | [
"def",
"present",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"connection_args",
"=",
"{",
"}",
"if",
"'_connection_user'",
"in",
"kwargs",
":",
"connection_args",
"[",
"'_connection_user'",
"]",
"=",
"kwargs",
"[",
"'_connection_user'",
"]",
"if",
"'_co... | Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versionadded:: 2016.3.0
:param name: name of... | [
"Creates",
"new",
"user",
"group",
".",
"NOTE",
":",
"This",
"function",
"accepts",
"all",
"standard",
"user",
"group",
"properties",
":",
"keyword",
"argument",
"names",
"differ",
"depending",
"on",
"your",
"zabbix",
"version",
"see",
":",
"https",
":",
"//... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_usergroup.py#L23-L182 | train | Creates a new user group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/zabbix_usergroup.py | absent | def absent(name, **kwargs):
'''
Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connectio... | python | def absent(name, **kwargs):
'''
Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connectio... | [
"def",
"absent",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"connection_args",
"=",
"{",
"}",
"if",
"'_connection_user'",
"in",
"kwargs",
":",
"connection_args",
"[",
"'_connection_user'",
"]",
"=",
"kwargs",
"[",
"'_connection_user'",
"]",
"if",
"'_con... | Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (... | [
"Ensures",
"that",
"the",
"user",
"group",
"does",
"not",
"exist",
"eventually",
"delete",
"user",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_usergroup.py#L185-L253 | train | Ensures that the user group with the given name does not exist eventually delete the user group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | _get_config | def _get_config(**kwargs):
'''
Return configuration
'''
config = {
'filter_id_regex': ['.*!doc_skip'],
'filter_function_regex': [],
'replace_text_regex': {},
'proccesser': 'highstate_doc.proccesser_markdown',
'max_render_file_size': 10000,
'note': None
... | python | def _get_config(**kwargs):
'''
Return configuration
'''
config = {
'filter_id_regex': ['.*!doc_skip'],
'filter_function_regex': [],
'replace_text_regex': {},
'proccesser': 'highstate_doc.proccesser_markdown',
'max_render_file_size': 10000,
'note': None
... | [
"def",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"{",
"'filter_id_regex'",
":",
"[",
"'.*!doc_skip'",
"]",
",",
"'filter_function_regex'",
":",
"[",
"]",
",",
"'replace_text_regex'",
":",
"{",
"}",
",",
"'proccesser'",
":",
"'highstate... | Return configuration | [
"Return",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L365-L383 | train | Return configuration of the current language | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | read_file | def read_file(name):
'''
output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
... | python | def read_file(name):
'''
output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
... | [
"def",
"read_file",
"(",
"name",
")",
":",
"out",
"=",
"''",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"name",
",",
"'r'",
")",
"as",
"f",
":",
"out",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicod... | output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
#!/bin/python
import os
... | [
"output",
"the",
"contents",
"of",
"a",
"file",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L386-L421 | train | read a file from 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/highstate_doc.py | render | def render(jinja_template_text=None, jinja_template_function='highstate_doc.markdown_default_jinja_template', **kwargs):
'''
Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses... | python | def render(jinja_template_text=None, jinja_template_function='highstate_doc.markdown_default_jinja_template', **kwargs):
'''
Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses... | [
"def",
"render",
"(",
"jinja_template_text",
"=",
"None",
",",
"jinja_template_function",
"=",
"'highstate_doc.markdown_default_jinja_template'",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
"lowstates",
"=",
"proc... | Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses to create the document.
jinja_template_function: a salt module call that returns template text.
options:
hig... | [
"Render",
"highstate",
"to",
"a",
"text",
"format",
"(",
"default",
"Markdown",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L424-L461 | train | Render highstate to a text format | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | proccess_lowstates | def proccess_lowstates(**kwargs):
'''
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate
'''
states = []
config = _get_config(**kwargs)
proccesser = config.get('proccesser')
ls = __salt__['state.show... | python | def proccess_lowstates(**kwargs):
'''
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate
'''
states = []
config = _get_config(**kwargs)
proccesser = config.get('proccesser')
ls = __salt__['state.show... | [
"def",
"proccess_lowstates",
"(",
"*",
"*",
"kwargs",
")",
":",
"states",
"=",
"[",
"]",
"config",
"=",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
"proccesser",
"=",
"config",
".",
"get",
"(",
"'proccesser'",
")",
"ls",
"=",
"__salt__",
"[",
"'state.... | return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate | [
"return",
"proccessed",
"lowstate",
"data",
"that",
"was",
"not",
"blacklisted"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L477-L501 | train | Return a list of lowstate documents that were not blacklisted by the user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | _state_data_to_yaml_string | def _state_data_to_yaml_string(data, whitelist=None, blacklist=None):
'''
return a data dict in yaml string format.
'''
y = {}
if blacklist is None:
# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTERNAL_KEYWORDS
blacklist = ['__env__', '__id__',... | python | def _state_data_to_yaml_string(data, whitelist=None, blacklist=None):
'''
return a data dict in yaml string format.
'''
y = {}
if blacklist is None:
# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTERNAL_KEYWORDS
blacklist = ['__env__', '__id__',... | [
"def",
"_state_data_to_yaml_string",
"(",
"data",
",",
"whitelist",
"=",
"None",
",",
"blacklist",
"=",
"None",
")",
":",
"y",
"=",
"{",
"}",
"if",
"blacklist",
"is",
"None",
":",
"# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTER... | return a data dict in yaml string format. | [
"return",
"a",
"data",
"dict",
"in",
"yaml",
"string",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L504-L521 | train | Convert a dictionary of state data into a yaml string format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | _format_markdown_requisite | def _format_markdown_requisite(state, stateid, makelink=True):
'''
format requisite as a link users can click
'''
fmt_id = '{0}: {1}'.format(state, stateid)
if makelink:
return ' * [{0}](#{1})\n'.format(fmt_id, _format_markdown_link(fmt_id))
else:
return ' * `{0}`\n'.format(fmt_i... | python | def _format_markdown_requisite(state, stateid, makelink=True):
'''
format requisite as a link users can click
'''
fmt_id = '{0}: {1}'.format(state, stateid)
if makelink:
return ' * [{0}](#{1})\n'.format(fmt_id, _format_markdown_link(fmt_id))
else:
return ' * `{0}`\n'.format(fmt_i... | [
"def",
"_format_markdown_requisite",
"(",
"state",
",",
"stateid",
",",
"makelink",
"=",
"True",
")",
":",
"fmt_id",
"=",
"'{0}: {1}'",
".",
"format",
"(",
"state",
",",
"stateid",
")",
"if",
"makelink",
":",
"return",
"' * [{0}](#{1})\\n'",
".",
"format",
"... | format requisite as a link users can click | [
"format",
"requisite",
"as",
"a",
"link",
"users",
"can",
"click"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L569-L577 | train | format requisite as a link users can click
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/highstate_doc.py | proccesser_markdown | def proccesser_markdown(lowstate_item, config, **kwargs):
'''
Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: ya... | python | def proccesser_markdown(lowstate_item, config, **kwargs):
'''
Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: ya... | [
"def",
"proccesser_markdown",
"(",
"lowstate_item",
",",
"config",
",",
"*",
"*",
"kwargs",
")",
":",
"# TODO: switch or ... ext call.",
"s",
"=",
"lowstate_item",
"state_function",
"=",
"'{0}.{1}'",
".",
"format",
"(",
"s",
"[",
"'state'",
"]",
",",
"s",
"[",... | Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: yaml
vars: # the raw lowstate_item that was proccessed
... | [
"Takes",
"low",
"state",
"data",
"and",
"returns",
"a",
"dict",
"of",
"proccessed",
"data",
"that",
"is",
"by",
"default",
"used",
"in",
"a",
"jinja",
"template",
"when",
"rendering",
"a",
"markdown",
"highstate_doc",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L580-L692 | train | Return a dict of processed data for a given lowstate item | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/win_osinfo.py | os_version_info_ex | def os_version_info_ex():
'''
Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info
'''
if not HAS_WIN32:
return
clas... | python | def os_version_info_ex():
'''
Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info
'''
if not HAS_WIN32:
return
clas... | [
"def",
"os_version_info_ex",
"(",
")",
":",
"if",
"not",
"HAS_WIN32",
":",
"return",
"class",
"OSVersionInfo",
"(",
"ctypes",
".",
"Structure",
")",
":",
"_fields_",
"=",
"(",
"(",
"'dwOSVersionInfoSize'",
",",
"DWORD",
")",
",",
"(",
"'dwMajorVersion'",
","... | Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info | [
"Helper",
"function",
"to",
"return",
"the",
"results",
"of",
"the",
"GetVersionExW",
"Windows",
"API",
"call",
".",
"It",
"is",
"a",
"ctypes",
"Structure",
"that",
"contains",
"Windows",
"OS",
"Version",
"information",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_osinfo.py#L35-L66 | train | Returns the result of the GetVersionExW Windows API 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_osinfo.py | get_join_info | def get_join_info():
'''
Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status
'''
info = win32net.NetGetJoinInformat... | python | def get_join_info():
'''
Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status
'''
info = win32net.NetGetJoinInformat... | [
"def",
"get_join_info",
"(",
")",
":",
"info",
"=",
"win32net",
".",
"NetGetJoinInformation",
"(",
")",
"status",
"=",
"{",
"win32netcon",
".",
"NetSetupUnknown",
":",
"'Unknown'",
",",
"win32netcon",
".",
"NetSetupUnjoined",
":",
"'Unjoined'",
",",
"win32netcon... | Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status | [
"Gets",
"information",
"about",
"the",
"domain",
"/",
"workgroup",
".",
"This",
"will",
"tell",
"you",
"if",
"the",
"system",
"is",
"joined",
"to",
"a",
"domain",
"or",
"a",
"workgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_osinfo.py#L83-L99 | train | Returns information about the domain and workgroup | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | _dscl | def _dscl(cmd, ctype='create'):
'''
Run a dscl -create command
'''
if __grains__['osrelease_info'] < (10, 8):
source, noderoot = '.', ''
else:
source, noderoot = 'localhost', '/Local/Default'
if noderoot:
cmd[0] = noderoot + cmd[0]
return __salt__['cmd.run_all'](
... | python | def _dscl(cmd, ctype='create'):
'''
Run a dscl -create command
'''
if __grains__['osrelease_info'] < (10, 8):
source, noderoot = '.', ''
else:
source, noderoot = 'localhost', '/Local/Default'
if noderoot:
cmd[0] = noderoot + cmd[0]
return __salt__['cmd.run_all'](
... | [
"def",
"_dscl",
"(",
"cmd",
",",
"ctype",
"=",
"'create'",
")",
":",
"if",
"__grains__",
"[",
"'osrelease_info'",
"]",
"<",
"(",
"10",
",",
"8",
")",
":",
"source",
",",
"noderoot",
"=",
"'.'",
",",
"''",
"else",
":",
"source",
",",
"noderoot",
"="... | Run a dscl -create command | [
"Run",
"a",
"dscl",
"-",
"create",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L56-L71 | train | Run a dscl - create command | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_user.py | add | def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
fullname=None,
createhome=True,
**kwargs):
'''
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <s... | python | def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
fullname=None,
createhome=True,
**kwargs):
'''
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <s... | [
"def",
"add",
"(",
"name",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"home",
"=",
"None",
",",
"shell",
"=",
"None",
",",
"fullname",
"=",
"None",
",",
"createhome",
"=",
"True",
",",
"*",
"*",
"kwargs",
... | Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <shell> | [
"Add",
"a",
"user",
"to",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L81-L136 | train | Add a user to the 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/mac_user.py | delete | def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
'''
if salt.utils.stringutils.contains_whitespace(name):
raise SaltInvocationError('Username cannot contain whitesp... | python | def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
'''
if salt.utils.stringutils.contains_whitespace(name):
raise SaltInvocationError('Username cannot contain whitesp... | [
"def",
"delete",
"(",
"name",
",",
"remove",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"if",
"salt",
".",
"utils",
".",
"stringutils",
".",
"contains_whitespace",
"(",
"name",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'Username cannot contain... | Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True | [
"Remove",
"a",
"user",
"from",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L139-L166 | train | Delete a user from the 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/mac_user.py | getent | def getent(refresh=False):
'''
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
'''
if 'user.getent' in __context__ and not refresh:
return __context__['user.getent']
ret = []
for data in pwd.getpwall():
ret.appe... | python | def getent(refresh=False):
'''
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
'''
if 'user.getent' in __context__ and not refresh:
return __context__['user.getent']
ret = []
for data in pwd.getpwall():
ret.appe... | [
"def",
"getent",
"(",
"refresh",
"=",
"False",
")",
":",
"if",
"'user.getent'",
"in",
"__context__",
"and",
"not",
"refresh",
":",
"return",
"__context__",
"[",
"'user.getent'",
"]",
"ret",
"=",
"[",
"]",
"for",
"data",
"in",
"pwd",
".",
"getpwall",
"(",... | Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent | [
"Return",
"the",
"list",
"of",
"all",
"info",
"for",
"all",
"users"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L169-L186 | train | Return the list of all users
CLI Example : bash
salt '*' user. getent
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | chuid | def chuid(name, uid):
'''
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
'''
if not isinstance(uid, int):
raise SaltInvocationError('uid must be an integer')
pre_info = info(name)
if not pre_info:
raise CommandExe... | python | def chuid(name, uid):
'''
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
'''
if not isinstance(uid, int):
raise SaltInvocationError('uid must be an integer')
pre_info = info(name)
if not pre_info:
raise CommandExe... | [
"def",
"chuid",
"(",
"name",
",",
"uid",
")",
":",
"if",
"not",
"isinstance",
"(",
"uid",
",",
"int",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'uid must be an integer'",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",... | Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376 | [
"Change",
"the",
"uid",
"for",
"a",
"named",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L189-L213 | train | Change the uid for a named user CLI Example : bash
salt '*' user. chuid foo 4376
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | chgid | def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
if not isinstance(gid, int):
raise SaltInvocationError('gid must be an integer')
pre_info = info(name)
if not pre_info:
raise Comma... | python | def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
if not isinstance(gid, int):
raise SaltInvocationError('gid must be an integer')
pre_info = info(name)
if not pre_info:
raise Comma... | [
"def",
"chgid",
"(",
"name",
",",
"gid",
")",
":",
"if",
"not",
"isinstance",
"(",
"gid",
",",
"int",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'gid must be an integer'",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",... | Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376 | [
"Change",
"the",
"default",
"group",
"of",
"the",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L216-L240 | train | Change the default group of the user CLI Example : bash
salt '*' user. chgid foo 4376
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | chshell | def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
if shell == pre_in... | python | def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
if shell == pre_in... | [
"def",
"chshell",
"(",
"name",
",",
"shell",
")",
":",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",
"raise",
"CommandExecutionError",
"(",
"'User \\'{0}\\' does not exist'",
".",
"format",
"(",
"name",
")",
")",
"if",
"shell",
"... | Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh | [
"Change",
"the",
"default",
"shell",
"of",
"the",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L243-L265 | train | Change the default shell of the user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_user.py | chhome | def chhome(name, home, **kwargs):
'''
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
persist = kwargs.pop('persist', False)
if kwargs:
salt.utils.args.inval... | python | def chhome(name, home, **kwargs):
'''
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
persist = kwargs.pop('persist', False)
if kwargs:
salt.utils.args.inval... | [
"def",
"chhome",
"(",
"name",
",",
"home",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"persist",
"=",
"kwargs",
".",
"pop",
"(",
"'persist'",
",",
"False",... | Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo | [
"Change",
"the",
"home",
"directory",
"of",
"the",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L268-L298 | train | Change the home directory of the user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_user.py | chfullname | def chfullname(name, fullname):
'''
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
'''
fullname = salt.utils.data.decode(fullname)
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' doe... | python | def chfullname(name, fullname):
'''
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
'''
fullname = salt.utils.data.decode(fullname)
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' doe... | [
"def",
"chfullname",
"(",
"name",
",",
"fullname",
")",
":",
"fullname",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"fullname",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",
"raise",
"CommandExecutionError... | Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar' | [
"Change",
"the",
"user",
"s",
"Full",
"Name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L301-L330 | train | Change the user s Full Name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_user.py | chgroups | def chgroups(name, groups, append=False):
'''
Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be ... | python | def chgroups(name, groups, append=False):
'''
Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be ... | [
"def",
"chgroups",
"(",
"name",
",",
"groups",
",",
"append",
"=",
"False",
")",
":",
"### NOTE: **args isn't used here but needs to be included in this",
"### function for compatibility with the user.present state",
"uinfo",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"u... | Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be passed either as a
python list or a comma-sepa... | [
"Change",
"the",
"groups",
"to",
"which",
"the",
"user",
"belongs",
".",
"Note",
"that",
"the",
"user",
"s",
"primary",
"group",
"does",
"not",
"have",
"to",
"be",
"one",
"of",
"the",
"groups",
"passed",
"membership",
"in",
"the",
"user",
"s",
"primary",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L333-L387 | train | Change the groups to which the user belongs | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | _format_info | def _format_info(data):
'''
Return user information in a pretty way
'''
return {'gid': data.pw_gid,
'groups': list_groups(data.pw_name),
'home': data.pw_dir,
'name': data.pw_name,
'shell': data.pw_shell,
'uid': data.pw_uid,
'fullnam... | python | def _format_info(data):
'''
Return user information in a pretty way
'''
return {'gid': data.pw_gid,
'groups': list_groups(data.pw_name),
'home': data.pw_dir,
'name': data.pw_name,
'shell': data.pw_shell,
'uid': data.pw_uid,
'fullnam... | [
"def",
"_format_info",
"(",
"data",
")",
":",
"return",
"{",
"'gid'",
":",
"data",
".",
"pw_gid",
",",
"'groups'",
":",
"list_groups",
"(",
"data",
".",
"pw_name",
")",
",",
"'home'",
":",
"data",
".",
"pw_dir",
",",
"'name'",
":",
"data",
".",
"pw_n... | Return user information in a pretty way | [
"Return",
"user",
"information",
"in",
"a",
"pretty",
"way"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L408-L418 | train | Return user information in a pretty way
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | list_groups | def list_groups(name):
'''
Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.... | python | def list_groups(name):
'''
Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.... | [
"def",
"list_groups",
"(",
"name",
")",
":",
"groups",
"=",
"[",
"group",
"for",
"group",
"in",
"salt",
".",
"utils",
".",
"user",
".",
"get_group_list",
"(",
"name",
")",
"]",
"return",
"groups"
] | Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.0
CLI Example:
.. code-bl... | [
"Return",
"a",
"list",
"of",
"groups",
"the",
"named",
"user",
"belongs",
"to",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L437-L456 | train | Return a list of groups the named user belongs to. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | rename | def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = info(name)
if not current_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
new_info... | python | def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = info(name)
if not current_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
new_info... | [
"def",
"rename",
"(",
"name",
",",
"new_name",
")",
":",
"current_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"current_info",
":",
"raise",
"CommandExecutionError",
"(",
"'User \\'{0}\\' does not exist'",
".",
"format",
"(",
"name",
")",
")",
"new_info"... | Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name | [
"Change",
"the",
"username",
"for",
"a",
"named",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L473-L498 | train | Change the username for a named user CLI Example : bash
salt '*' user. rename name new_name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/mac_user.py | get_auto_login | def get_auto_login():
'''
.. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login
'''
cmd = ['defaults',
... | python | def get_auto_login():
'''
.. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login
'''
cmd = ['defaults',
... | [
"def",
"get_auto_login",
"(",
")",
":",
"cmd",
"=",
"[",
"'defaults'",
",",
"'read'",
",",
"'/Library/Preferences/com.apple.loginwindow.plist'",
",",
"'autoLoginUser'",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"ignore_retcode",
"=",... | .. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L501-L521 | train | Get the current setting for Auto Login | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | _kcpassword | def _kcpassword(password):
'''
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpasswo... | python | def _kcpassword(password):
'''
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpasswo... | [
"def",
"_kcpassword",
"(",
"password",
")",
":",
"# The magic 11 bytes - these are just repeated",
"# 0x7D 0x89 0x52 0x23 0xD2 0xBC 0xDD 0xEA 0xA3 0xB9 0x1F",
"key",
"=",
"[",
"125",
",",
"137",
",",
"82",
",",
"35",
",",
"210",
",",
"188",
",",
"221",
",",
"234",
... | Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpassword.py
Args:
password(str)... | [
"Internal",
"function",
"for",
"obfuscating",
"the",
"password",
"used",
"for",
"AutoLogin",
"This",
"is",
"later",
"written",
"as",
"the",
"contents",
"of",
"the",
"/",
"etc",
"/",
"kcpassword",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L524-L571 | train | Internal function for obfuscating the password used for AutoLogin | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | enable_auto_login | def enable_auto_login(name, password):
'''
.. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Re... | python | def enable_auto_login(name, password):
'''
.. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Re... | [
"def",
"enable_auto_login",
"(",
"name",
",",
"password",
")",
":",
"# Make the entry into the defaults file",
"cmd",
"=",
"[",
"'defaults'",
",",
"'write'",
",",
"'/Library/Preferences/com.apple.loginwindow.plist'",
",",
"'autoLoginUser'",
",",
"name",
"]",
"__salt__",
... | .. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Returns:
bool: ``True`` if successful, otherw... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L574-L612 | train | Enables auto login for the specified user account | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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_user.py | disable_auto_login | def disable_auto_login():
'''
.. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login
'''
# Remove the kcpassword file
cmd = 'rm -f... | python | def disable_auto_login():
'''
.. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login
'''
# Remove the kcpassword file
cmd = 'rm -f... | [
"def",
"disable_auto_login",
"(",
")",
":",
"# Remove the kcpassword file",
"cmd",
"=",
"'rm -f /etc/kcpassword'",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"# Remove the entry from the defaults file",
"cmd",
"=",
"[",
"'defaults'",
",",
"'delete'",
",",
"'/... | .. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L615-L640 | train | Disables auto login 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/apf.py | __apf_cmd | def __apf_cmd(cmd):
'''
Return the apf location
'''
apf_cmd = '{0} {1}'.format(salt.utils.path.which('apf'), cmd)
out = __salt__['cmd.run_all'](apf_cmd)
if out['retcode'] != 0:
if not out['stderr']:
msg = out['stdout']
else:
msg = out['stderr']
ra... | python | def __apf_cmd(cmd):
'''
Return the apf location
'''
apf_cmd = '{0} {1}'.format(salt.utils.path.which('apf'), cmd)
out = __salt__['cmd.run_all'](apf_cmd)
if out['retcode'] != 0:
if not out['stderr']:
msg = out['stdout']
else:
msg = out['stderr']
ra... | [
"def",
"__apf_cmd",
"(",
"cmd",
")",
":",
"apf_cmd",
"=",
"'{0} {1}'",
".",
"format",
"(",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'apf'",
")",
",",
"cmd",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"apf_cmd",
")",
... | Return the apf location | [
"Return",
"the",
"apf",
"location"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apf.py#L39-L54 | train | Return the apf location
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/apf.py | _status_apf | def _status_apf():
'''
Return True if apf is running otherwise return False
'''
status = 0
table = iptc.Table(iptc.Table.FILTER)
for chain in table.chains:
if 'sanity' in chain.name.lower():
status = 1
return True if status else False | python | def _status_apf():
'''
Return True if apf is running otherwise return False
'''
status = 0
table = iptc.Table(iptc.Table.FILTER)
for chain in table.chains:
if 'sanity' in chain.name.lower():
status = 1
return True if status else False | [
"def",
"_status_apf",
"(",
")",
":",
"status",
"=",
"0",
"table",
"=",
"iptc",
".",
"Table",
"(",
"iptc",
".",
"Table",
".",
"FILTER",
")",
"for",
"chain",
"in",
"table",
".",
"chains",
":",
"if",
"'sanity'",
"in",
"chain",
".",
"name",
".",
"lower... | Return True if apf is running otherwise return False | [
"Return",
"True",
"if",
"apf",
"is",
"running",
"otherwise",
"return",
"False"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apf.py#L57-L66 | train | Return True if apf is running otherwise return False | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/composer.py | did_composer_install | def did_composer_install(dir):
'''
Test to see if the vendor directory exists in this directory
dir
Directory location of the composer.json file
CLI Example:
.. code-block:: bash
salt '*' composer.did_composer_install /var/www/application
'''
lockFile = "{0}/vendor".forma... | python | def did_composer_install(dir):
'''
Test to see if the vendor directory exists in this directory
dir
Directory location of the composer.json file
CLI Example:
.. code-block:: bash
salt '*' composer.did_composer_install /var/www/application
'''
lockFile = "{0}/vendor".forma... | [
"def",
"did_composer_install",
"(",
"dir",
")",
":",
"lockFile",
"=",
"\"{0}/vendor\"",
".",
"format",
"(",
"dir",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"lockFile",
")",
":",
"return",
"True",
"return",
"False"
] | Test to see if the vendor directory exists in this directory
dir
Directory location of the composer.json file
CLI Example:
.. code-block:: bash
salt '*' composer.did_composer_install /var/www/application | [
"Test",
"to",
"see",
"if",
"the",
"vendor",
"directory",
"exists",
"in",
"this",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/composer.py#L44-L60 | train | Test to see if the vendor directory exists in this directory | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/composer.py | _run_composer | def _run_composer(action,
directory=None,
composer=None,
php=None,
runas=None,
prefer_source=None,
prefer_dist=None,
no_scripts=None,
no_plugins=None,
optimiz... | python | def _run_composer(action,
directory=None,
composer=None,
php=None,
runas=None,
prefer_source=None,
prefer_dist=None,
no_scripts=None,
no_plugins=None,
optimiz... | [
"def",
"_run_composer",
"(",
"action",
",",
"directory",
"=",
"None",
",",
"composer",
"=",
"None",
",",
"php",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"prefer_source",
"=",
"None",
",",
"prefer_dist",
"=",
"None",
",",
"no_scripts",
"=",
"None",
... | Run PHP's composer with a specific action.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
action
The action to pass to composer ('install'... | [
"Run",
"PHP",
"s",
"composer",
"with",
"a",
"specific",
"action",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/composer.py#L63-L209 | train | Run the composer with a specific 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/composer.py | install | def install(directory,
composer=None,
php=None,
runas=None,
prefer_source=None,
prefer_dist=None,
no_scripts=None,
no_plugins=None,
optimize=None,
no_dev=None,
quiet=False,
composer_home='... | python | def install(directory,
composer=None,
php=None,
runas=None,
prefer_source=None,
prefer_dist=None,
no_scripts=None,
no_plugins=None,
optimize=None,
no_dev=None,
quiet=False,
composer_home='... | [
"def",
"install",
"(",
"directory",
",",
"composer",
"=",
"None",
",",
"php",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"prefer_source",
"=",
"None",
",",
"prefer_dist",
"=",
"None",
",",
"no_scripts",
"=",
"None",
",",
"no_plugins",
"=",
"None",
",... | Install composer dependencies for a directory.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
directory
Directory location of the composer... | [
"Install",
"composer",
"dependencies",
"for",
"a",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/composer.py#L212-L297 | train | Installs composer dependencies for a directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/composer.py | selfupdate | def selfupdate(composer=None,
php=None,
runas=None,
quiet=False,
composer_home='/root'):
'''
Update composer itself.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` pa... | python | def selfupdate(composer=None,
php=None,
runas=None,
quiet=False,
composer_home='/root'):
'''
Update composer itself.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` pa... | [
"def",
"selfupdate",
"(",
"composer",
"=",
"None",
",",
"php",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"composer_home",
"=",
"'/root'",
")",
":",
"result",
"=",
"_run_composer",
"(",
"'selfupdate'",
",",
"extra_flags",
"=... | Update composer itself.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
composer
Location of the composer.phar file. If not set composer wi... | [
"Update",
"composer",
"itself",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/composer.py#L392-L435 | train | Update the current version of the current composer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/saltutil.py | sync_all | def sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
'''
Sync all custom types
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
dictionary of modules... | python | def sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
'''
Sync all custom types
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
dictionary of modules... | [
"def",
"sync_all",
"(",
"saltenv",
"=",
"'base'",
",",
"extmod_whitelist",
"=",
"None",
",",
"extmod_blacklist",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Syncing all'",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'clouds'",
"]",
"=",
"sync_clouds",... | Sync all custom types
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
dictionary of modules to sync based on type
extmod_blacklist : None
dictionary of modules to bla... | [
"Sync",
"all",
"custom",
"types"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/saltutil.py#L20-L68 | train | Syncs all custom types of a single file server environment | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/runners/saltutil.py | sync_auth | def sync_auth(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
'''
Sync execution modules from ``salt://_auth`` to the master
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelis... | python | def sync_auth(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
'''
Sync execution modules from ``salt://_auth`` to the master
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelis... | [
"def",
"sync_auth",
"(",
"saltenv",
"=",
"'base'",
",",
"extmod_whitelist",
"=",
"None",
",",
"extmod_blacklist",
"=",
"None",
")",
":",
"return",
"salt",
".",
"utils",
".",
"extmods",
".",
"sync",
"(",
"__opts__",
",",
"'auth'",
",",
"saltenv",
"=",
"sa... | Sync execution modules from ``salt://_auth`` to the master
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
comma-separated list of modules to sync
extmod_blacklist : None
... | [
"Sync",
"execution",
"modules",
"from",
"salt",
":",
"//",
"_auth",
"to",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/saltutil.py#L71-L92 | train | Sync the execution modules from salt. auth to 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/cloud/clouds/packet.py | avail_images | def avail_images(call=None):
'''
Return available Packet os images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images packet-provider
salt-cloud -f avail_images packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fu... | python | def avail_images(call=None):
'''
Return available Packet os images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images packet-provider
salt-cloud -f avail_images packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fu... | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_images function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"vm_",
"=",
"get_configured_provider",
... | Return available Packet os images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images packet-provider
salt-cloud -f avail_images packet-provider | [
"Return",
"available",
"Packet",
"os",
"images",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L117-L143 | train | Return available Packet os images. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | avail_locations | def avail_locations(call=None):
'''
Return available Packet datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations packet-provider
salt-cloud -f avail_locations packet-provider
'''
if call == 'action':
raise SaltCloudException(
... | python | def avail_locations(call=None):
'''
Return available Packet datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations packet-provider
salt-cloud -f avail_locations packet-provider
'''
if call == 'action':
raise SaltCloudException(
... | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"vm_",
"=",
"get_configured_provider",
"(",
")",
"manager"... | Return available Packet datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations packet-provider
salt-cloud -f avail_locations packet-provider | [
"Return",
"available",
"Packet",
"datacenter",
"locations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L146-L170 | train | Return available Packet datacenter locations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | avail_sizes | def avail_sizes(call=None):
'''
Return available Packet sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes packet-provider
salt-cloud -f avail_sizes packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations functi... | python | def avail_sizes(call=None):
'''
Return available Packet sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes packet-provider
salt-cloud -f avail_sizes packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations functi... | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"vm_",
"=",
"get_configured_provider",
"(",
")",
"manager",
... | Return available Packet sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes packet-provider
salt-cloud -f avail_sizes packet-provider | [
"Return",
"available",
"Packet",
"sizes",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L173-L198 | train | Return available Packet sizes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | avail_projects | def avail_projects(call=None):
'''
Return available Packet projects.
CLI Example:
.. code-block:: bash
salt-cloud -f avail_projects packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_projects function must be called with -f or --function.... | python | def avail_projects(call=None):
'''
Return available Packet projects.
CLI Example:
.. code-block:: bash
salt-cloud -f avail_projects packet-provider
'''
if call == 'action':
raise SaltCloudException(
'The avail_projects function must be called with -f or --function.... | [
"def",
"avail_projects",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_projects function must be called with -f or --function.'",
")",
"vm_",
"=",
"get_configured_provider",
"(",
")",
"manager",
... | Return available Packet projects.
CLI Example:
.. code-block:: bash
salt-cloud -f avail_projects packet-provider | [
"Return",
"available",
"Packet",
"projects",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L201-L224 | train | Return available Packet projects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | _wait_for_status | def _wait_for_status(status_type, object_id, status=None, timeout=500, quiet=True):
'''
Wait for a certain status from Packet.
status_type
device or volume
object_id
The ID of the Packet device or volume to wait on. Required.
status
The status to wait for.
timeout
... | python | def _wait_for_status(status_type, object_id, status=None, timeout=500, quiet=True):
'''
Wait for a certain status from Packet.
status_type
device or volume
object_id
The ID of the Packet device or volume to wait on. Required.
status
The status to wait for.
timeout
... | [
"def",
"_wait_for_status",
"(",
"status_type",
",",
"object_id",
",",
"status",
"=",
"None",
",",
"timeout",
"=",
"500",
",",
"quiet",
"=",
"True",
")",
":",
"if",
"status",
"is",
"None",
":",
"status",
"=",
"\"ok\"",
"interval",
"=",
"5",
"iterations",
... | Wait for a certain status from Packet.
status_type
device or volume
object_id
The ID of the Packet device or volume to wait on. Required.
status
The status to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debu... | [
"Wait",
"for",
"a",
"certain",
"status",
"from",
"Packet",
".",
"status_type",
"device",
"or",
"volume",
"object_id",
"The",
"ID",
"of",
"the",
"Packet",
"device",
"or",
"volume",
"to",
"wait",
"on",
".",
"Required",
".",
"status",
"The",
"status",
"to",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L227-L264 | train | Wait for a certain status from Packet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | create | def create(vm_):
'''
Create a single Packet VM.
'''
name = vm_['name']
if not is_profile_configured(vm_):
return False
__utils__['cloud.fire_event'](
'event',
'starting create',
'salt/cloud/{0}/creating'.format(name),
args=__utils__['cloud.filter_event']... | python | def create(vm_):
'''
Create a single Packet VM.
'''
name = vm_['name']
if not is_profile_configured(vm_):
return False
__utils__['cloud.fire_event'](
'event',
'starting create',
'salt/cloud/{0}/creating'.format(name),
args=__utils__['cloud.filter_event']... | [
"def",
"create",
"(",
"vm_",
")",
":",
"name",
"=",
"vm_",
"[",
"'name'",
"]",
"if",
"not",
"is_profile_configured",
"(",
"vm_",
")",
":",
"return",
"False",
"__utils__",
"[",
"'cloud.fire_event'",
"]",
"(",
"'event'",
",",
"'starting create'",
",",
"'salt... | Create a single Packet VM. | [
"Create",
"a",
"single",
"Packet",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L324-L434 | train | Create a single Packet VM. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | list_nodes_full | def list_nodes_full(call=None):
'''
List devices, with all available information.
CLI Example:
.. code-block:: bash
salt-cloud -F
salt-cloud --full-query
salt-cloud -f list_nodes_full packet-provider
..
'''
if call == 'action':
raise SaltCloudException(
... | python | def list_nodes_full(call=None):
'''
List devices, with all available information.
CLI Example:
.. code-block:: bash
salt-cloud -F
salt-cloud --full-query
salt-cloud -f list_nodes_full packet-provider
..
'''
if call == 'action':
raise SaltCloudException(
... | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"for",
"device",
"in",
"get_devi... | List devices, with all available information.
CLI Example:
.. code-block:: bash
salt-cloud -F
salt-cloud --full-query
salt-cloud -f list_nodes_full packet-provider
.. | [
"List",
"devices",
"with",
"all",
"available",
"information",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L437-L461 | train | List all available information for all nodes 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/cloud/clouds/packet.py | list_nodes_min | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt... | python | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt... | [
"def",
"list_nodes_min",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_min function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"for",
"device",
"in",
"get_devic... | Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes_min packet-provider
... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
".",
"Only",
"a",
"list",
"of",
"VM",
"names",
"and",
"their",
"state",
"is",
"returned",
".",
"This",
"is",
"the",
"minimum",
"amount",
"of",
"information",
"needed",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L464-L489 | train | Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | list_nodes | def list_nodes(call=None):
'''
Returns a list of devices, keeping only a brief listing.
CLI Example:
.. code-block:: bash
salt-cloud -Q
salt-cloud --query
salt-cloud -f list_nodes packet-provider
..
'''
if call == 'action':
raise SaltCloudException(
... | python | def list_nodes(call=None):
'''
Returns a list of devices, keeping only a brief listing.
CLI Example:
.. code-block:: bash
salt-cloud -Q
salt-cloud --query
salt-cloud -f list_nodes packet-provider
..
'''
if call == 'action':
raise SaltCloudException(
... | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"for",
"device",
"in",
"get_devices_by_tok... | Returns a list of devices, keeping only a brief listing.
CLI Example:
.. code-block:: bash
salt-cloud -Q
salt-cloud --query
salt-cloud -f list_nodes packet-provider
.. | [
"Returns",
"a",
"list",
"of",
"devices",
"keeping",
"only",
"a",
"brief",
"listing",
".",
"CLI",
"Example",
":",
"..",
"code",
"-",
"block",
"::",
"bash",
"salt",
"-",
"cloud",
"-",
"Q",
"salt",
"-",
"cloud",
"--",
"query",
"salt",
"-",
"cloud",
"-",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L515-L536 | train | Returns a list of devices keeping only a brief listing. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/packet.py | destroy | def destroy(name, call=None):
'''
Destroys a Packet device by name.
name
The hostname of VM to be be destroyed.
CLI Example:
.. code-block:: bash
salt-cloud -d name
'''
if call == 'function':
raise SaltCloudException(
'The destroy action must be called... | python | def destroy(name, call=None):
'''
Destroys a Packet device by name.
name
The hostname of VM to be be destroyed.
CLI Example:
.. code-block:: bash
salt-cloud -d name
'''
if call == 'function':
raise SaltCloudException(
'The destroy action must be called... | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudException",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"__utils__",
"[",
"'cloud.fire_event'",
... | Destroys a Packet device by name.
name
The hostname of VM to be be destroyed.
CLI Example:
.. code-block:: bash
salt-cloud -d name | [
"Destroys",
"a",
"Packet",
"device",
"by",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/packet.py#L539-L593 | train | Destroys a Packet device by 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/beacons/smartos_imgadm.py | beacon | def beacon(config):
'''
Poll imgadm and compare available images
'''
ret = []
# NOTE: lookup current images
current_images = __salt__['imgadm.list'](verbose=True)
# NOTE: apply configuration
if IMGADM_STATE['first_run']:
log.info('Applying configuration for imgadm beacon')
... | python | def beacon(config):
'''
Poll imgadm and compare available images
'''
ret = []
# NOTE: lookup current images
current_images = __salt__['imgadm.list'](verbose=True)
# NOTE: apply configuration
if IMGADM_STATE['first_run']:
log.info('Applying configuration for imgadm beacon')
... | [
"def",
"beacon",
"(",
"config",
")",
":",
"ret",
"=",
"[",
"]",
"# NOTE: lookup current images",
"current_images",
"=",
"__salt__",
"[",
"'imgadm.list'",
"]",
"(",
"verbose",
"=",
"True",
")",
"# NOTE: apply configuration",
"if",
"IMGADM_STATE",
"[",
"'first_run'"... | Poll imgadm and compare available images | [
"Poll",
"imgadm",
"and",
"compare",
"available",
"images"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/smartos_imgadm.py#L69-L117 | train | Poll imgadm and compare available images
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | doc/conf.py | mock_decorator_with_params | def mock_decorator_with_params(*oargs, **okwargs): # pylint: disable=unused-argument
'''
Optionally mock a decorator that takes parameters
E.g.:
@blah(stuff=True)
def things():
pass
'''
def inner(fn, *iargs, **ikwargs): # pylint: disable=unused-argument
if hasattr(fn, '__... | python | def mock_decorator_with_params(*oargs, **okwargs): # pylint: disable=unused-argument
'''
Optionally mock a decorator that takes parameters
E.g.:
@blah(stuff=True)
def things():
pass
'''
def inner(fn, *iargs, **ikwargs): # pylint: disable=unused-argument
if hasattr(fn, '__... | [
"def",
"mock_decorator_with_params",
"(",
"*",
"oargs",
",",
"*",
"*",
"okwargs",
")",
":",
"# pylint: disable=unused-argument",
"def",
"inner",
"(",
"fn",
",",
"*",
"iargs",
",",
"*",
"*",
"ikwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"hasattr... | Optionally mock a decorator that takes parameters
E.g.:
@blah(stuff=True)
def things():
pass | [
"Optionally",
"mock",
"a",
"decorator",
"that",
"takes",
"parameters"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/doc/conf.py#L63-L77 | train | A decorator that returns a mock function that takes parameters
AttributeNames | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/process.py | absent | def absent(name, user=None, signal=None):
'''
Ensures that the named command is not running.
name
The pattern to match.
user
The user to which the process belongs
signal
Signal to send to the process(es).
'''
ret = {'name': name,
'changes': {},
... | python | def absent(name, user=None, signal=None):
'''
Ensures that the named command is not running.
name
The pattern to match.
user
The user to which the process belongs
signal
Signal to send to the process(es).
'''
ret = {'name': name,
'changes': {},
... | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"None",
",",
"signal",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"if",
"__opts_... | Ensures that the named command is not running.
name
The pattern to match.
user
The user to which the process belongs
signal
Signal to send to the process(es). | [
"Ensures",
"that",
"the",
"named",
"command",
"is",
"not",
"running",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/process.py#L21-L61 | train | Ensures that the named command is not running. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/netbox.py | ext_pillar | def ext_pillar(minion_id, pillar, *args, **kwargs):
'''
Query NetBox API for minion data
'''
if minion_id == '*':
log.info('There\'s no data to collect from NetBox for the Master')
return {}
# Pull settings from kwargs
api_url = kwargs['api_url'].rstrip('/')
api_token = kwarg... | python | def ext_pillar(minion_id, pillar, *args, **kwargs):
'''
Query NetBox API for minion data
'''
if minion_id == '*':
log.info('There\'s no data to collect from NetBox for the Master')
return {}
# Pull settings from kwargs
api_url = kwargs['api_url'].rstrip('/')
api_token = kwarg... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"minion_id",
"==",
"'*'",
":",
"log",
".",
"info",
"(",
"'There\\'s no data to collect from NetBox for the Master'",
")",
"return",
"{",
"}",
"# ... | Query NetBox API for minion data | [
"Query",
"NetBox",
"API",
"for",
"minion",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/netbox.py#L61-L172 | train | Query NetBox API for data from a specific 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/tops/ext_nodes.py | top | def top(**kwargs):
'''
Run the command configured
'''
if 'id' not in kwargs['opts']:
return {}
cmd = '{0} {1}'.format(
__opts__['master_tops']['ext_nodes'],
kwargs['opts']['id']
)
ndata = salt.utils.yaml.safe_load(
subprocess.Popen(
... | python | def top(**kwargs):
'''
Run the command configured
'''
if 'id' not in kwargs['opts']:
return {}
cmd = '{0} {1}'.format(
__opts__['master_tops']['ext_nodes'],
kwargs['opts']['id']
)
ndata = salt.utils.yaml.safe_load(
subprocess.Popen(
... | [
"def",
"top",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"'id'",
"not",
"in",
"kwargs",
"[",
"'opts'",
"]",
":",
"return",
"{",
"}",
"cmd",
"=",
"'{0} {1}'",
".",
"format",
"(",
"__opts__",
"[",
"'master_tops'",
"]",
"[",
"'ext_nodes'",
"]",
",",
"kw... | Run the command configured | [
"Run",
"the",
"command",
"configured"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tops/ext_nodes.py#L69-L103 | train | Return the base node 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/states/gnomedesktop.py | _check_current_value | def _check_current_value(gnome_kwargs, value):
'''
Check the current value with the passed value
'''
current_value = __salt__['gnome.get'](**gnome_kwargs)
return six.text_type(current_value) == six.text_type(value) | python | def _check_current_value(gnome_kwargs, value):
'''
Check the current value with the passed value
'''
current_value = __salt__['gnome.get'](**gnome_kwargs)
return six.text_type(current_value) == six.text_type(value) | [
"def",
"_check_current_value",
"(",
"gnome_kwargs",
",",
"value",
")",
":",
"current_value",
"=",
"__salt__",
"[",
"'gnome.get'",
"]",
"(",
"*",
"*",
"gnome_kwargs",
")",
"return",
"six",
".",
"text_type",
"(",
"current_value",
")",
"==",
"six",
".",
"text_t... | Check the current value with the passed value | [
"Check",
"the",
"current",
"value",
"with",
"the",
"passed",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gnomedesktop.py#L38-L43 | train | Check the current value with the passed value
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/gnomedesktop.py | wm_preferences | def wm_preferences(name,
user=None,
action_double_click_titlebar=None,
action_middle_click_titlebar=None,
action_right_click_titlebar=None,
application_based=None,
audible_bell=None,
auto... | python | def wm_preferences(name,
user=None,
action_double_click_titlebar=None,
action_middle_click_titlebar=None,
action_right_click_titlebar=None,
application_based=None,
audible_bell=None,
auto... | [
"def",
"wm_preferences",
"(",
"name",
",",
"user",
"=",
"None",
",",
"action_double_click_titlebar",
"=",
"None",
",",
"action_middle_click_titlebar",
"=",
"None",
",",
"action_right_click_titlebar",
"=",
"None",
",",
"application_based",
"=",
"None",
",",
"audible_... | wm_preferences: sets values in the org.gnome.desktop.wm.preferences schema | [
"wm_preferences",
":",
"sets",
"values",
"in",
"the",
"org",
".",
"gnome",
".",
"desktop",
".",
"wm",
".",
"preferences",
"schema"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gnomedesktop.py#L95-L142 | train | Returns a new org. gnome. desktop. wm. preferences schema object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/gnomedesktop.py | desktop_lockdown | def desktop_lockdown(name,
user=None,
disable_application_handlers=None,
disable_command_line=None,
disable_lock_screen=None,
disable_log_out=None,
disable_print_setup=None,
... | python | def desktop_lockdown(name,
user=None,
disable_application_handlers=None,
disable_command_line=None,
disable_lock_screen=None,
disable_log_out=None,
disable_print_setup=None,
... | [
"def",
"desktop_lockdown",
"(",
"name",
",",
"user",
"=",
"None",
",",
"disable_application_handlers",
"=",
"None",
",",
"disable_command_line",
"=",
"None",
",",
"disable_lock_screen",
"=",
"None",
",",
"disable_log_out",
"=",
"None",
",",
"disable_print_setup",
... | desktop_lockdown: sets values in the org.gnome.desktop.lockdown schema | [
"desktop_lockdown",
":",
"sets",
"values",
"in",
"the",
"org",
".",
"gnome",
".",
"desktop",
".",
"lockdown",
"schema"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gnomedesktop.py#L145-L176 | train | Returns a desktop lockdown schema. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/gnomedesktop.py | desktop_interface | def desktop_interface(name,
user=None,
automatic_mnemonics=None,
buttons_have_icons=None,
can_change_accels=None,
clock_format=None,
clock_show_date=None,
clock_show_... | python | def desktop_interface(name,
user=None,
automatic_mnemonics=None,
buttons_have_icons=None,
can_change_accels=None,
clock_format=None,
clock_show_date=None,
clock_show_... | [
"def",
"desktop_interface",
"(",
"name",
",",
"user",
"=",
"None",
",",
"automatic_mnemonics",
"=",
"None",
",",
"buttons_have_icons",
"=",
"None",
",",
"can_change_accels",
"=",
"None",
",",
"clock_format",
"=",
"None",
",",
"clock_show_date",
"=",
"None",
",... | desktop_interface: sets values in the org.gnome.desktop.interface schema | [
"desktop_interface",
":",
"sets",
"values",
"in",
"the",
"org",
".",
"gnome",
".",
"desktop",
".",
"interface",
"schema"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gnomedesktop.py#L179-L246 | train | Create a new desktop interface. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/serializers/toml.py | deserialize | def deserialize(stream_or_string, **options):
'''
Deserialize from TOML into Python data structure.
:param stream_or_string: toml stream or string to deserialize.
:param options: options given to lower pytoml module.
'''
try:
if not isinstance(stream_or_string, (bytes, six.string_types... | python | def deserialize(stream_or_string, **options):
'''
Deserialize from TOML into Python data structure.
:param stream_or_string: toml stream or string to deserialize.
:param options: options given to lower pytoml module.
'''
try:
if not isinstance(stream_or_string, (bytes, six.string_types... | [
"def",
"deserialize",
"(",
"stream_or_string",
",",
"*",
"*",
"options",
")",
":",
"try",
":",
"if",
"not",
"isinstance",
"(",
"stream_or_string",
",",
"(",
"bytes",
",",
"six",
".",
"string_types",
")",
")",
":",
"return",
"toml",
".",
"load",
"(",
"s... | Deserialize from TOML into Python data structure.
:param stream_or_string: toml stream or string to deserialize.
:param options: options given to lower pytoml module. | [
"Deserialize",
"from",
"TOML",
"into",
"Python",
"data",
"structure",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/toml.py#L29-L46 | train | Deserialize from TOML into Python data structure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/serializers/toml.py | serialize | def serialize(obj, **options):
'''
Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module.
'''
try:
if 'file_out' in options:
return toml.dump(obj, options['file_out'], **options)
else:
... | python | def serialize(obj, **options):
'''
Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module.
'''
try:
if 'file_out' in options:
return toml.dump(obj, options['file_out'], **options)
else:
... | [
"def",
"serialize",
"(",
"obj",
",",
"*",
"*",
"options",
")",
":",
"try",
":",
"if",
"'file_out'",
"in",
"options",
":",
"return",
"toml",
".",
"dump",
"(",
"obj",
",",
"options",
"[",
"'file_out'",
"]",
",",
"*",
"*",
"options",
")",
"else",
":",... | Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module. | [
"Serialize",
"Python",
"data",
"to",
"TOML",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/toml.py#L49-L63 | train | Serialize Python data to TOML. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/mako.py | render | def render(template_file, saltenv='base', sls='', context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Mako rendering system.
:rtype: string
'''
tmp_data = salt.utils.templates.MAKO(template_file, to_str=True,
salt=__sa... | python | def render(template_file, saltenv='base', sls='', context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Mako rendering system.
:rtype: string
'''
tmp_data = salt.utils.templates.MAKO(template_file, to_str=True,
salt=__sa... | [
"def",
"render",
"(",
"template_file",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"context",
"=",
"None",
",",
"tmplpath",
"=",
"None",
",",
"*",
"*",
"kws",
")",
":",
"tmp_data",
"=",
"salt",
".",
"utils",
".",
"templates",
".",
"M... | Render the template_file, passing the functions and grains into the
Mako rendering system.
:rtype: string | [
"Render",
"the",
"template_file",
"passing",
"the",
"functions",
"and",
"grains",
"into",
"the",
"Mako",
"rendering",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/mako.py#L15-L35 | train | Render the template_file passing the functions and grains into the mako rendering 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/proxy/fx2.py | init | def init(opts):
'''
This function gets called when the proxy starts up.
We check opts to see if a fallback user and password are supplied.
If they are present, and the primary credentials don't work, then
we try the backup before failing.
Whichever set of credentials works is placed in the pers... | python | def init(opts):
'''
This function gets called when the proxy starts up.
We check opts to see if a fallback user and password are supplied.
If they are present, and the primary credentials don't work, then
we try the backup before failing.
Whichever set of credentials works is placed in the pers... | [
"def",
"init",
"(",
"opts",
")",
":",
"if",
"'host'",
"not",
"in",
"opts",
"[",
"'proxy'",
"]",
":",
"log",
".",
"critical",
"(",
"'No \"host\" key found in pillar for this proxy'",
")",
"return",
"False",
"DETAILS",
"[",
"'host'",
"]",
"=",
"opts",
"[",
"... | This function gets called when the proxy starts up.
We check opts to see if a fallback user and password are supplied.
If they are present, and the primary credentials don't work, then
we try the backup before failing.
Whichever set of credentials works is placed in the persistent
DETAILS dictionar... | [
"This",
"function",
"gets",
"called",
"when",
"the",
"proxy",
"starts",
"up",
".",
"We",
"check",
"opts",
"to",
"see",
"if",
"a",
"fallback",
"user",
"and",
"password",
"are",
"supplied",
".",
"If",
"they",
"are",
"present",
"and",
"the",
"primary",
"cre... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/fx2.py#L203-L220 | train | This function gets called when the proxy starts up. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/fx2.py | _grains | def _grains(host, user, password):
'''
Get the grains from the proxied device
'''
r = __salt__['dracr.system_info'](host=host,
admin_username=user,
admin_password=password)
if r.get('retcode', 0) == 0:
GRAINS_CACHE =... | python | def _grains(host, user, password):
'''
Get the grains from the proxied device
'''
r = __salt__['dracr.system_info'](host=host,
admin_username=user,
admin_password=password)
if r.get('retcode', 0) == 0:
GRAINS_CACHE =... | [
"def",
"_grains",
"(",
"host",
",",
"user",
",",
"password",
")",
":",
"r",
"=",
"__salt__",
"[",
"'dracr.system_info'",
"]",
"(",
"host",
"=",
"host",
",",
"admin_username",
"=",
"user",
",",
"admin_password",
"=",
"password",
")",
"if",
"r",
".",
"ge... | Get the grains from the proxied device | [
"Get",
"the",
"grains",
"from",
"the",
"proxied",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/fx2.py#L247-L258 | train | Get the grains from the proxied device | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/fx2.py | find_credentials | def find_credentials():
'''
Cycle through all the possible credentials and return the first one that
works
'''
usernames = [__pillar__['proxy'].get('admin_username', 'root')]
if 'fallback_admin_username' in __pillar__.get('proxy'):
usernames.append(__pillar__['proxy'].get('fallback_admin... | python | def find_credentials():
'''
Cycle through all the possible credentials and return the first one that
works
'''
usernames = [__pillar__['proxy'].get('admin_username', 'root')]
if 'fallback_admin_username' in __pillar__.get('proxy'):
usernames.append(__pillar__['proxy'].get('fallback_admin... | [
"def",
"find_credentials",
"(",
")",
":",
"usernames",
"=",
"[",
"__pillar__",
"[",
"'proxy'",
"]",
".",
"get",
"(",
"'admin_username'",
",",
"'root'",
")",
"]",
"if",
"'fallback_admin_username'",
"in",
"__pillar__",
".",
"get",
"(",
"'proxy'",
")",
":",
"... | Cycle through all the possible credentials and return the first one that
works | [
"Cycle",
"through",
"all",
"the",
"possible",
"credentials",
"and",
"return",
"the",
"first",
"one",
"that",
"works"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/fx2.py#L281-L313 | train | Find all the possible credentials and return the first one that works | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/fx2.py | chconfig | def chconfig(cmd, *args, **kwargs):
'''
This function is called by the :mod:`salt.modules.chassis.cmd <salt.modules.chassis.cmd>`
shim. It then calls whatever is passed in ``cmd``
inside the :mod:`salt.modules.dracr <salt.modules.dracr>`
module.
:param cmd: The command to call inside salt.modu... | python | def chconfig(cmd, *args, **kwargs):
'''
This function is called by the :mod:`salt.modules.chassis.cmd <salt.modules.chassis.cmd>`
shim. It then calls whatever is passed in ``cmd``
inside the :mod:`salt.modules.dracr <salt.modules.dracr>`
module.
:param cmd: The command to call inside salt.modu... | [
"def",
"chconfig",
"(",
"cmd",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Strip the __pub_ keys...is there a better way to do this?",
"for",
"k",
"in",
"list",
"(",
"kwargs",
")",
":",
"if",
"k",
".",
"startswith",
"(",
"'__pub_'",
")",
":",
"... | This function is called by the :mod:`salt.modules.chassis.cmd <salt.modules.chassis.cmd>`
shim. It then calls whatever is passed in ``cmd``
inside the :mod:`salt.modules.dracr <salt.modules.dracr>`
module.
:param cmd: The command to call inside salt.modules.dracr
:param args: Arguments that need t... | [
"This",
"function",
"is",
"called",
"by",
"the",
":",
"mod",
":",
"salt",
".",
"modules",
".",
"chassis",
".",
"cmd",
"<salt",
".",
"modules",
".",
"chassis",
".",
"cmd",
">",
"shim",
".",
"It",
"then",
"calls",
"whatever",
"is",
"passed",
"in",
"cmd... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/fx2.py#L316-L348 | train | This function is called by the chassis module to configure the chassis s internal state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/fx2.py | ping | def ping():
'''
Is the chassis responding?
:return: Returns False if the chassis didn't respond, True otherwise.
'''
r = __salt__['dracr.system_info'](host=DETAILS['host'],
admin_username=DETAILS['admin_username'],
admin_p... | python | def ping():
'''
Is the chassis responding?
:return: Returns False if the chassis didn't respond, True otherwise.
'''
r = __salt__['dracr.system_info'](host=DETAILS['host'],
admin_username=DETAILS['admin_username'],
admin_p... | [
"def",
"ping",
"(",
")",
":",
"r",
"=",
"__salt__",
"[",
"'dracr.system_info'",
"]",
"(",
"host",
"=",
"DETAILS",
"[",
"'host'",
"]",
",",
"admin_username",
"=",
"DETAILS",
"[",
"'admin_username'",
"]",
",",
"admin_password",
"=",
"DETAILS",
"[",
"'admin_p... | Is the chassis responding?
:return: Returns False if the chassis didn't respond, True otherwise. | [
"Is",
"the",
"chassis",
"responding?"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/fx2.py#L351-L368 | train | Checks if the chassis is responding and returns True if the chassis was responding. Returns False if the chassis didn t respond True otherwise. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cache/consul.py | store | def store(bank, key, data):
'''
Store a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
c_data = __context__['serial'].dumps(data)
api.kv.put(c_key, c_data)
except Exception as exc:
raise SaltCacheError(
'There was an error writing the key, {0}: {1}'.f... | python | def store(bank, key, data):
'''
Store a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
c_data = __context__['serial'].dumps(data)
api.kv.put(c_key, c_data)
except Exception as exc:
raise SaltCacheError(
'There was an error writing the key, {0}: {1}'.f... | [
"def",
"store",
"(",
"bank",
",",
"key",
",",
"data",
")",
":",
"c_key",
"=",
"'{0}/{1}'",
".",
"format",
"(",
"bank",
",",
"key",
")",
"try",
":",
"c_data",
"=",
"__context__",
"[",
"'serial'",
"]",
".",
"dumps",
"(",
"data",
")",
"api",
".",
"k... | Store a key value. | [
"Store",
"a",
"key",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/consul.py#L95-L108 | train | Store a key value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cache/consul.py | fetch | def fetch(bank, key):
'''
Fetch a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
_, value = api.kv.get(c_key)
if value is None:
return {}
return __context__['serial'].loads(value['Value'])
except Exception as exc:
raise SaltCacheError(
... | python | def fetch(bank, key):
'''
Fetch a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
_, value = api.kv.get(c_key)
if value is None:
return {}
return __context__['serial'].loads(value['Value'])
except Exception as exc:
raise SaltCacheError(
... | [
"def",
"fetch",
"(",
"bank",
",",
"key",
")",
":",
"c_key",
"=",
"'{0}/{1}'",
".",
"format",
"(",
"bank",
",",
"key",
")",
"try",
":",
"_",
",",
"value",
"=",
"api",
".",
"kv",
".",
"get",
"(",
"c_key",
")",
"if",
"value",
"is",
"None",
":",
... | Fetch a key value. | [
"Fetch",
"a",
"key",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/consul.py#L111-L126 | train | Fetch a key value.
Fetch a key value.
Fetch a key value.
SARL | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cache/consul.py | flush | def flush(bank, key=None):
'''
Remove the key from the cache bank with all the key content.
'''
if key is None:
c_key = bank
else:
c_key = '{0}/{1}'.format(bank, key)
try:
return api.kv.delete(c_key, recurse=key is None)
except Exception as exc:
raise SaltCach... | python | def flush(bank, key=None):
'''
Remove the key from the cache bank with all the key content.
'''
if key is None:
c_key = bank
else:
c_key = '{0}/{1}'.format(bank, key)
try:
return api.kv.delete(c_key, recurse=key is None)
except Exception as exc:
raise SaltCach... | [
"def",
"flush",
"(",
"bank",
",",
"key",
"=",
"None",
")",
":",
"if",
"key",
"is",
"None",
":",
"c_key",
"=",
"bank",
"else",
":",
"c_key",
"=",
"'{0}/{1}'",
".",
"format",
"(",
"bank",
",",
"key",
")",
"try",
":",
"return",
"api",
".",
"kv",
"... | Remove the key from the cache bank with all the key content. | [
"Remove",
"the",
"key",
"from",
"the",
"cache",
"bank",
"with",
"all",
"the",
"key",
"content",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/consul.py#L129-L144 | train | Remove the key from the cache bank with all the key content. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cache/consul.py | list_ | def list_(bank):
'''
Return an iterable object containing all entries stored in the specified bank.
'''
try:
_, keys = api.kv.get(bank + '/', keys=True, separator='/')
except Exception as exc:
raise SaltCacheError(
'There was an error getting the key "{0}": {1}'.format(
... | python | def list_(bank):
'''
Return an iterable object containing all entries stored in the specified bank.
'''
try:
_, keys = api.kv.get(bank + '/', keys=True, separator='/')
except Exception as exc:
raise SaltCacheError(
'There was an error getting the key "{0}": {1}'.format(
... | [
"def",
"list_",
"(",
"bank",
")",
":",
"try",
":",
"_",
",",
"keys",
"=",
"api",
".",
"kv",
".",
"get",
"(",
"bank",
"+",
"'/'",
",",
"keys",
"=",
"True",
",",
"separator",
"=",
"'/'",
")",
"except",
"Exception",
"as",
"exc",
":",
"raise",
"Sal... | Return an iterable object containing all entries stored in the specified bank. | [
"Return",
"an",
"iterable",
"object",
"containing",
"all",
"entries",
"stored",
"in",
"the",
"specified",
"bank",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/consul.py#L147-L168 | train | Return an iterable object containing all entries stored in the specified bank. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cache/consul.py | contains | def contains(bank, key):
'''
Checks if the specified bank contains the specified key.
'''
if key is None:
return True # any key could be a branch and a leaf at the same time in Consul
else:
try:
c_key = '{0}/{1}'.format(bank, key)
_, value = api.kv.get(c_key)... | python | def contains(bank, key):
'''
Checks if the specified bank contains the specified key.
'''
if key is None:
return True # any key could be a branch and a leaf at the same time in Consul
else:
try:
c_key = '{0}/{1}'.format(bank, key)
_, value = api.kv.get(c_key)... | [
"def",
"contains",
"(",
"bank",
",",
"key",
")",
":",
"if",
"key",
"is",
"None",
":",
"return",
"True",
"# any key could be a branch and a leaf at the same time in Consul",
"else",
":",
"try",
":",
"c_key",
"=",
"'{0}/{1}'",
".",
"format",
"(",
"bank",
",",
"k... | Checks if the specified bank contains the specified key. | [
"Checks",
"if",
"the",
"specified",
"bank",
"contains",
"the",
"specified",
"key",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/consul.py#L171-L187 | train | Checks if the specified bank contains the specified 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/sensehat.py | set_pixel | def set_pixel(x, y, color):
'''
Sets a single pixel on the LED matrix to a specified color.
x
The x coordinate of the pixel. Ranges from 0 on the left to 7 on the right.
y
The y coordinate of the pixel. Ranges from 0 at the top to 7 at the bottom.
color
The new color of the ... | python | def set_pixel(x, y, color):
'''
Sets a single pixel on the LED matrix to a specified color.
x
The x coordinate of the pixel. Ranges from 0 on the left to 7 on the right.
y
The y coordinate of the pixel. Ranges from 0 at the top to 7 at the bottom.
color
The new color of the ... | [
"def",
"set_pixel",
"(",
"x",
",",
"y",
",",
"color",
")",
":",
"_sensehat",
".",
"set_pixel",
"(",
"x",
",",
"y",
",",
"color",
")",
"return",
"{",
"'color'",
":",
"color",
"}"
] | Sets a single pixel on the LED matrix to a specified color.
x
The x coordinate of the pixel. Ranges from 0 on the left to 7 on the right.
y
The y coordinate of the pixel. Ranges from 0 at the top to 7 at the bottom.
color
The new color of the pixel as a list of ``[R, G, B]`` values.... | [
"Sets",
"a",
"single",
"pixel",
"on",
"the",
"LED",
"matrix",
"to",
"a",
"specified",
"color",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sensehat.py#L89-L107 | train | Sets a single pixel on the LED matrix to a specified color. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/sensehat.py | show_message | def show_message(message, msg_type=None,
text_color=None, back_color=None, scroll_speed=0.1):
'''
Displays a message on the LED matrix.
message
The message to display
msg_type
The type of the message. Changes the appearance of the message.
Available types are::
... | python | def show_message(message, msg_type=None,
text_color=None, back_color=None, scroll_speed=0.1):
'''
Displays a message on the LED matrix.
message
The message to display
msg_type
The type of the message. Changes the appearance of the message.
Available types are::
... | [
"def",
"show_message",
"(",
"message",
",",
"msg_type",
"=",
"None",
",",
"text_color",
"=",
"None",
",",
"back_color",
"=",
"None",
",",
"scroll_speed",
"=",
"0.1",
")",
":",
"text_color",
"=",
"text_color",
"or",
"[",
"255",
",",
"255",
",",
"255",
"... | Displays a message on the LED matrix.
message
The message to display
msg_type
The type of the message. Changes the appearance of the message.
Available types are::
error: red text
warning: orange text
success: green text
info:... | [
"Displays",
"a",
"message",
"on",
"the",
"LED",
"matrix",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sensehat.py#L140-L189 | train | Displays a message on the LED matrix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/sensehat.py | show_letter | def show_letter(letter, text_color=None, back_color=None):
'''
Displays a single letter on the LED matrix.
letter
The letter to display
text_color
The color in which the letter is shown. Defaults to '[255, 255, 255]' (white).
back_color
The background color of the display. D... | python | def show_letter(letter, text_color=None, back_color=None):
'''
Displays a single letter on the LED matrix.
letter
The letter to display
text_color
The color in which the letter is shown. Defaults to '[255, 255, 255]' (white).
back_color
The background color of the display. D... | [
"def",
"show_letter",
"(",
"letter",
",",
"text_color",
"=",
"None",
",",
"back_color",
"=",
"None",
")",
":",
"text_color",
"=",
"text_color",
"or",
"[",
"255",
",",
"255",
",",
"255",
"]",
"back_color",
"=",
"back_color",
"or",
"[",
"0",
",",
"0",
... | Displays a single letter on the LED matrix.
letter
The letter to display
text_color
The color in which the letter is shown. Defaults to '[255, 255, 255]' (white).
back_color
The background color of the display. Defaults to '[0, 0, 0]' (black).
CLI Example:
.. code-block:: ... | [
"Displays",
"a",
"single",
"letter",
"on",
"the",
"LED",
"matrix",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sensehat.py#L192-L215 | train | Displays a single letter on the LED matrix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | _add | def _add(app, endpoint, payload):
'''
POST a payload
'''
nb = _nb_obj(auth_required=True)
try:
return getattr(getattr(nb, app), endpoint).create(**payload)
except RequestError as e:
log.error('%s, %s, %s', e.req.request.headers, e.request_body, e.error)
return False | python | def _add(app, endpoint, payload):
'''
POST a payload
'''
nb = _nb_obj(auth_required=True)
try:
return getattr(getattr(nb, app), endpoint).create(**payload)
except RequestError as e:
log.error('%s, %s, %s', e.req.request.headers, e.request_body, e.error)
return False | [
"def",
"_add",
"(",
"app",
",",
"endpoint",
",",
"payload",
")",
":",
"nb",
"=",
"_nb_obj",
"(",
"auth_required",
"=",
"True",
")",
"try",
":",
"return",
"getattr",
"(",
"getattr",
"(",
"nb",
",",
"app",
")",
",",
"endpoint",
")",
".",
"create",
"(... | POST a payload | [
"POST",
"a",
"payload"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L98-L107 | train | POST a payload
POST a payload
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | slugify | def slugify(value):
''''
Slugify given value.
Credit to Djangoproject https://docs.djangoproject.com/en/2.0/_modules/django/utils/text/#slugify
'''
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
return re.sub(r'[-\s]+', '-', value) | python | def slugify(value):
''''
Slugify given value.
Credit to Djangoproject https://docs.djangoproject.com/en/2.0/_modules/django/utils/text/#slugify
'''
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
return re.sub(r'[-\s]+', '-', value) | [
"def",
"slugify",
"(",
"value",
")",
":",
"value",
"=",
"re",
".",
"sub",
"(",
"r'[^\\w\\s-]'",
",",
"''",
",",
"value",
")",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"return",
"re",
".",
"sub",
"(",
"r'[-\\s]+'",
",",
"'-'",
",",
"value",... | Slugify given value.
Credit to Djangoproject https://docs.djangoproject.com/en/2.0/_modules/django/utils/text/#slugify | [
"Slugify",
"given",
"value",
".",
"Credit",
"to",
"Djangoproject",
"https",
":",
"//",
"docs",
".",
"djangoproject",
".",
"com",
"/",
"en",
"/",
"2",
".",
"0",
"/",
"_modules",
"/",
"django",
"/",
"utils",
"/",
"text",
"/",
"#slugify"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L110-L116 | train | Returns a slugified version of the given value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | _get | def _get(app, endpoint, id=None, auth_required=False, **kwargs):
'''
Helper function to do a GET request to Netbox.
Returns the actual pynetbox object, which allows manipulation from other functions.
'''
nb = _nb_obj(auth_required=auth_required)
if id:
item = getattr(getattr(nb, app), en... | python | def _get(app, endpoint, id=None, auth_required=False, **kwargs):
'''
Helper function to do a GET request to Netbox.
Returns the actual pynetbox object, which allows manipulation from other functions.
'''
nb = _nb_obj(auth_required=auth_required)
if id:
item = getattr(getattr(nb, app), en... | [
"def",
"_get",
"(",
"app",
",",
"endpoint",
",",
"id",
"=",
"None",
",",
"auth_required",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"nb",
"=",
"_nb_obj",
"(",
"auth_required",
"=",
"auth_required",
")",
"if",
"id",
":",
"item",
"=",
"getattr",... | Helper function to do a GET request to Netbox.
Returns the actual pynetbox object, which allows manipulation from other functions. | [
"Helper",
"function",
"to",
"do",
"a",
"GET",
"request",
"to",
"Netbox",
".",
"Returns",
"the",
"actual",
"pynetbox",
"object",
"which",
"allows",
"manipulation",
"from",
"other",
"functions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L119-L130 | train | Helper function to do a GET request to Netbox.
Returns the actual pynetbox object which allows manipulation from other functions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | filter_ | def filter_(app, endpoint, **kwargs):
'''
Get a list of items from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
kwargs
Optional arguments that can be used to filter.
... | python | def filter_(app, endpoint, **kwargs):
'''
Get a list of items from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
kwargs
Optional arguments that can be used to filter.
... | [
"def",
"filter_",
"(",
"app",
",",
"endpoint",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"[",
"]",
"nb",
"=",
"_nb_obj",
"(",
"auth_required",
"=",
"True",
"if",
"app",
"in",
"AUTH_ENDPOINTS",
"else",
"False",
")",
"nb_query",
"=",
"getattr",
"(... | Get a list of items from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
kwargs
Optional arguments that can be used to filter.
All filter keywords are available in Netbox,
... | [
"Get",
"a",
"list",
"of",
"items",
"from",
"NetBox",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L140-L167 | train | Return a list of items from NetBox. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | get_ | def get_(app, endpoint, id=None, **kwargs):
'''
Get a single item from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
Returns a single dictionary
To get an item based on ID.
... | python | def get_(app, endpoint, id=None, **kwargs):
'''
Get a single item from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
Returns a single dictionary
To get an item based on ID.
... | [
"def",
"get_",
"(",
"app",
",",
"endpoint",
",",
"id",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dict",
"(",
"_get",
"(",
"app",
",",
"endpoint",
",",
"id",
"=",
"id",
",",
"auth_required",
"=",
"True",
"if",
"app",
"in",
"AUTH_... | Get a single item from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
Returns a single dictionary
To get an item based on ID.
.. code-block:: bash
salt myminion netbox.ge... | [
"Get",
"a",
"single",
"item",
"from",
"NetBox",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L170-L194 | train | Get a single item from NetBox. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_manufacturer | def create_manufacturer(name):
'''
.. versionadded:: 2019.2.0
Create a device manufacturer.
name
The name of the manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_manufacturer Juniper
'''
nb_man = get_('dcim', 'manufacturer... | python | def create_manufacturer(name):
'''
.. versionadded:: 2019.2.0
Create a device manufacturer.
name
The name of the manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_manufacturer Juniper
'''
nb_man = get_('dcim', 'manufacturer... | [
"def",
"create_manufacturer",
"(",
"name",
")",
":",
"nb_man",
"=",
"get_",
"(",
"'dcim'",
",",
"'manufacturers'",
",",
"name",
"=",
"name",
")",
"if",
"nb_man",
":",
"return",
"False",
"else",
":",
"payload",
"=",
"{",
"'name'",
":",
"name",
",",
"'sl... | .. versionadded:: 2019.2.0
Create a device manufacturer.
name
The name of the manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_manufacturer Juniper | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L197-L221 | train | Create a device manufacturer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_device_type | def create_device_type(model, manufacturer):
'''
.. versionadded:: 2019.2.0
Create a device type. If the manufacturer doesn't exist, create a new manufacturer.
model
String of device model, e.g., ``MX480``
manufacturer
String of device manufacturer, e.g., ``Juniper``
CLI Examp... | python | def create_device_type(model, manufacturer):
'''
.. versionadded:: 2019.2.0
Create a device type. If the manufacturer doesn't exist, create a new manufacturer.
model
String of device model, e.g., ``MX480``
manufacturer
String of device manufacturer, e.g., ``Juniper``
CLI Examp... | [
"def",
"create_device_type",
"(",
"model",
",",
"manufacturer",
")",
":",
"nb_type",
"=",
"get_",
"(",
"'dcim'",
",",
"'device-types'",
",",
"model",
"=",
"model",
")",
"if",
"nb_type",
":",
"return",
"False",
"nb_man",
"=",
"get_",
"(",
"'dcim'",
",",
"... | .. versionadded:: 2019.2.0
Create a device type. If the manufacturer doesn't exist, create a new manufacturer.
model
String of device model, e.g., ``MX480``
manufacturer
String of device manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netb... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L224-L256 | train | Create a device type. If the manufacturer doesn t exist create a new manufacturer. | Pu7Z6IJCgH3a,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.