partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | network_info | Return Network Configuration
CLI Example:
.. code-block:: bash
salt dell dracr.network_info | salt/modules/dracr.py | def network_info(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Return Network Configuration
CLI Example:
.. code-block:: bash
salt dell dracr.network_info
'''
inv = inventory(host=host, admin_username=admin_u... | def network_info(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Return Network Configuration
CLI Example:
.. code-block:: bash
salt dell dracr.network_info
'''
inv = inventory(host=host, admin_username=admin_u... | [
"Return",
"Network",
"Configuration"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L342-L380 | [
"def",
"network_info",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"inv",
"=",
"inventory",
"(",
"host",
"=",
"host",
",",
"admin_username",
"=",
"admin_username",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nameservers | Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell dracr.nameservers [NAMESERVERS]
salt dell dracr.nameservers ns1.example.com ns2.example.com
admin_username=root admin_password=calvin module=server-1
host=192.168.1.1 | salt/modules/dracr.py | def nameservers(ns,
host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell dracr.nameservers [NAMESERVERS]
salt dell dracr.... | def nameservers(ns,
host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell dracr.nameservers [NAMESERVERS]
salt dell dracr.... | [
"Configure",
"the",
"nameservers",
"on",
"the",
"DRAC"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L383-L413 | [
"def",
"nameservers",
"(",
"ns",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"if",
"len",
"(",
"ns",
")",
">",
"2",
":",
"log",
".",
"warning",
"(",
"'racad... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | syslog | Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed by False
CLI Example:
.. code-block:: bash
salt dell dracr.syslog [SYSLOG IP] [ENABLE/DISABLE]
s... | salt/modules/dracr.py | def syslog(server, enable=True, host=None,
admin_username=None, admin_password=None, module=None):
'''
Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed b... | def syslog(server, enable=True, host=None,
admin_username=None, admin_password=None, module=None):
'''
Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed b... | [
"Configure",
"syslog",
"remote",
"logging",
"by",
"default",
"syslog",
"will",
"automatically",
"be",
"enabled",
"if",
"a",
"server",
"is",
"specified",
".",
"However",
"if",
"you",
"want",
"to",
"disable",
"syslog",
"you",
"will",
"need",
"to",
"specify",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L416-L447 | [
"def",
"syslog",
"(",
"server",
",",
"enable",
"=",
"True",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"if",
"enable",
"and",
"__execute_cmd",
"(",
"'config -g c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | email_alerts | Enable/Disable email alerts
CLI Example:
.. code-block:: bash
salt dell dracr.email_alerts True
salt dell dracr.email_alerts False | salt/modules/dracr.py | def email_alerts(action,
host=None,
admin_username=None,
admin_password=None):
'''
Enable/Disable email alerts
CLI Example:
.. code-block:: bash
salt dell dracr.email_alerts True
salt dell dracr.email_alerts False
'''
if acti... | def email_alerts(action,
host=None,
admin_username=None,
admin_password=None):
'''
Enable/Disable email alerts
CLI Example:
.. code-block:: bash
salt dell dracr.email_alerts True
salt dell dracr.email_alerts False
'''
if acti... | [
"Enable",
"/",
"Disable",
"email",
"alerts"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L450-L472 | [
"def",
"email_alerts",
"(",
"action",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"if",
"action",
":",
"return",
"__execute_cmd",
"(",
"'config -g cfgEmailAlert -o '",
"'cfgEmailAlertEnable -i 1 1'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_users | List all DRAC users
CLI Example:
.. code-block:: bash
salt dell dracr.list_users | salt/modules/dracr.py | def list_users(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
List all DRAC users
CLI Example:
.. code-block:: bash
salt dell dracr.list_users
'''
users = {}
_username = ''
for idx in range(1, 17):
c... | def list_users(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
List all DRAC users
CLI Example:
.. code-block:: bash
salt dell dracr.list_users
'''
users = {}
_username = ''
for idx in range(1, 17):
c... | [
"List",
"all",
"DRAC",
"users"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L475-L517 | [
"def",
"list_users",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"users",
"=",
"{",
"}",
"_username",
"=",
"''",
"for",
"idx",
"in",
"range",
"(",
"1",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_user | Delete a user
CLI Example:
.. code-block:: bash
salt dell dracr.delete_user [USERNAME] [UID - optional]
salt dell dracr.delete_user diana 4 | salt/modules/dracr.py | def delete_user(username,
uid=None,
host=None,
admin_username=None,
admin_password=None):
'''
Delete a user
CLI Example:
.. code-block:: bash
salt dell dracr.delete_user [USERNAME] [UID - optional]
salt dell dracr.delete_... | def delete_user(username,
uid=None,
host=None,
admin_username=None,
admin_password=None):
'''
Delete a user
CLI Example:
.. code-block:: bash
salt dell dracr.delete_user [USERNAME] [UID - optional]
salt dell dracr.delete_... | [
"Delete",
"a",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L520-L547 | [
"def",
"delete_user",
"(",
"username",
",",
"uid",
"=",
"None",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"if",
"uid",
"is",
"None",
":",
"user",
"=",
"list_users",
"(",
")",
"uid",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | change_password | Change user's password
CLI Example:
.. code-block:: bash
salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL]
host=<remote DRAC> admin_username=<DRAC user>
admin_password=<DRAC PW>
salt dell dracr.change_password diana secret
Note that if only a us... | salt/modules/dracr.py | def change_password(username, password, uid=None, host=None,
admin_username=None, admin_password=None,
module=None):
'''
Change user's password
CLI Example:
.. code-block:: bash
salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL]
... | def change_password(username, password, uid=None, host=None,
admin_username=None, admin_password=None,
module=None):
'''
Change user's password
CLI Example:
.. code-block:: bash
salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL]
... | [
"Change",
"user",
"s",
"password"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L550-L588 | [
"def",
"change_password",
"(",
"username",
",",
"password",
",",
"uid",
"=",
"None",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"if",
"len",
"(",
"password",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deploy_password | Change the QuickDeploy password, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_password [USERNAME] [PASSWORD]
host=<remote DRAC> admin_username=<DRAC user>
admin_password=<DRAC PW>
salt dell dracr.change_password diana secret
N... | salt/modules/dracr.py | def deploy_password(username, password, host=None, admin_username=None,
admin_password=None, module=None):
'''
Change the QuickDeploy password, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_password [USERNAME] [PASSWORD]
hos... | def deploy_password(username, password, host=None, admin_username=None,
admin_password=None, module=None):
'''
Change the QuickDeploy password, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_password [USERNAME] [PASSWORD]
hos... | [
"Change",
"the",
"QuickDeploy",
"password",
"used",
"for",
"switches",
"as",
"well"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L591-L614 | [
"def",
"deploy_password",
"(",
"username",
",",
"password",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'deploy -u {0} -p {1}'",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deploy_snmp | Change the QuickDeploy SNMP community string, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_snmp SNMP_STRING
host=<remote DRAC or CMC> admin_username=<DRAC user>
admin_password=<DRAC PW>
salt dell dracr.deploy_password diana secret | salt/modules/dracr.py | def deploy_snmp(snmp, host=None, admin_username=None,
admin_password=None, module=None):
'''
Change the QuickDeploy SNMP community string, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_snmp SNMP_STRING
host=<remote DRAC or CMC> ... | def deploy_snmp(snmp, host=None, admin_username=None,
admin_password=None, module=None):
'''
Change the QuickDeploy SNMP community string, used for switches as well
CLI Example:
.. code-block:: bash
salt dell dracr.deploy_snmp SNMP_STRING
host=<remote DRAC or CMC> ... | [
"Change",
"the",
"QuickDeploy",
"SNMP",
"community",
"string",
"used",
"for",
"switches",
"as",
"well"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L617-L636 | [
"def",
"deploy_snmp",
"(",
"snmp",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'deploy -v SNMPv2 {0} ro'",
".",
"format",
"(",
"snmp"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_snmp | Configure CMC or individual iDRAC SNMP community string.
Use ``deploy_snmp`` for configuring chassis switch SNMP.
CLI Example:
.. code-block:: bash
salt dell dracr.set_snmp [COMMUNITY]
salt dell dracr.set_snmp public | salt/modules/dracr.py | def set_snmp(community, host=None,
admin_username=None, admin_password=None):
'''
Configure CMC or individual iDRAC SNMP community string.
Use ``deploy_snmp`` for configuring chassis switch SNMP.
CLI Example:
.. code-block:: bash
salt dell dracr.set_snmp [COMMUNITY]
s... | def set_snmp(community, host=None,
admin_username=None, admin_password=None):
'''
Configure CMC or individual iDRAC SNMP community string.
Use ``deploy_snmp`` for configuring chassis switch SNMP.
CLI Example:
.. code-block:: bash
salt dell dracr.set_snmp [COMMUNITY]
s... | [
"Configure",
"CMC",
"or",
"individual",
"iDRAC",
"SNMP",
"community",
"string",
".",
"Use",
"deploy_snmp",
"for",
"configuring",
"chassis",
"switch",
"SNMP",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L763-L779 | [
"def",
"set_snmp",
"(",
"community",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'config -g cfgOobSnmp -o '",
"'cfgOobSnmpAgentCommunity {0}'",
".",
"format",
"(",
"co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_network | Configure Network on the CMC or individual iDRAC.
Use ``set_niccfg`` for blade and switch addresses.
CLI Example:
.. code-block:: bash
salt dell dracr.set_network [DRAC IP] [NETMASK] [GATEWAY]
salt dell dracr.set_network 192.168.0.2 255.255.255.0 192.168.0.1
admin_username=roo... | salt/modules/dracr.py | def set_network(ip, netmask, gateway, host=None,
admin_username=None, admin_password=None):
'''
Configure Network on the CMC or individual iDRAC.
Use ``set_niccfg`` for blade and switch addresses.
CLI Example:
.. code-block:: bash
salt dell dracr.set_network [DRAC IP] [NET... | def set_network(ip, netmask, gateway, host=None,
admin_username=None, admin_password=None):
'''
Configure Network on the CMC or individual iDRAC.
Use ``set_niccfg`` for blade and switch addresses.
CLI Example:
.. code-block:: bash
salt dell dracr.set_network [DRAC IP] [NET... | [
"Configure",
"Network",
"on",
"the",
"CMC",
"or",
"individual",
"iDRAC",
".",
"Use",
"set_niccfg",
"for",
"blade",
"and",
"switch",
"addresses",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L782-L799 | [
"def",
"set_network",
"(",
"ip",
",",
"netmask",
",",
"gateway",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'setniccfg -s {0} {1} {2}'",
".",
"format",
"(",
"ip... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_power | status
One of 'powerup', 'powerdown', 'powercycle', 'hardreset',
'graceshutdown'
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
module
The element to reboot on the ... | salt/modules/dracr.py | def server_power(status, host=None,
admin_username=None,
admin_password=None,
module=None):
'''
status
One of 'powerup', 'powerdown', 'powercycle', 'hardreset',
'graceshutdown'
host
The chassis host.
admin_username
T... | def server_power(status, host=None,
admin_username=None,
admin_password=None,
module=None):
'''
status
One of 'powerup', 'powerdown', 'powercycle', 'hardreset',
'graceshutdown'
host
The chassis host.
admin_username
T... | [
"status",
"One",
"of",
"powerup",
"powerdown",
"powercycle",
"hardreset",
"graceshutdown"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L802-L834 | [
"def",
"server_power",
"(",
"status",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'serveraction {0}'",
".",
"format",
"(",
"status",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_reboot | Issues a power-cycle operation on the managed server. This action is
similar to pressing the power button on the system's front panel to
power down and then power up the system.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
T... | salt/modules/dracr.py | def server_reboot(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Issues a power-cycle operation on the managed server. This action is
similar to pressing the power button on the system's front panel to
power down and then powe... | def server_reboot(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Issues a power-cycle operation on the managed server. This action is
similar to pressing the power button on the system's front panel to
power down and then powe... | [
"Issues",
"a",
"power",
"-",
"cycle",
"operation",
"on",
"the",
"managed",
"server",
".",
"This",
"action",
"is",
"similar",
"to",
"pressing",
"the",
"power",
"button",
"on",
"the",
"system",
"s",
"front",
"panel",
"to",
"power",
"down",
"and",
"then",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L837-L869 | [
"def",
"server_reboot",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'serveraction powercycle'",
",",
"host",
"=",
"host",
",",
"admin... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_poweroff | Powers down the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
module
The element to power off on the chassis such as a blade.
If not provided, the chassis ... | salt/modules/dracr.py | def server_poweroff(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Powers down the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
... | def server_poweroff(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Powers down the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
... | [
"Powers",
"down",
"the",
"managed",
"server",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L872-L901 | [
"def",
"server_poweroff",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'serveraction powerdown'",
",",
"host",
"=",
"host",
",",
"admi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_poweron | Powers up the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
module
The element to power on located on the chassis such as a blade. If
not provided, the cha... | salt/modules/dracr.py | def server_poweron(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Powers up the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
Th... | def server_poweron(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Powers up the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
Th... | [
"Powers",
"up",
"the",
"managed",
"server",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L904-L933 | [
"def",
"server_poweron",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'serveraction powerup'",
",",
"host",
"=",
"host",
",",
"admin_u... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_hardreset | Performs a reset (reboot) operation on the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
module
The element to hard reset on the chassis such as a blade. If
... | salt/modules/dracr.py | def server_hardreset(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Performs a reset (reboot) operation on the managed server.
host
The chassis host.
admin_username
The username used to access the ch... | def server_hardreset(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Performs a reset (reboot) operation on the managed server.
host
The chassis host.
admin_username
The username used to access the ch... | [
"Performs",
"a",
"reset",
"(",
"reboot",
")",
"operation",
"on",
"the",
"managed",
"server",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L936-L967 | [
"def",
"server_hardreset",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'serveraction hardreset'",
",",
"host",
"=",
"host",
",",
"adm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_powerstatus | return the power status for the passed module
CLI Example:
.. code-block:: bash
salt dell drac.server_powerstatus | salt/modules/dracr.py | def server_powerstatus(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
return the power status for the passed module
CLI Example:
.. code-block:: bash
salt dell drac.server_powerstatus
'''
ret ... | def server_powerstatus(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
return the power status for the passed module
CLI Example:
.. code-block:: bash
salt dell drac.server_powerstatus
'''
ret ... | [
"return",
"the",
"power",
"status",
"for",
"the",
"passed",
"module"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L970-L999 | [
"def",
"server_powerstatus",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
",",
"module",
"=",
"None",
")",
":",
"ret",
"=",
"__execute_ret",
"(",
"'serveraction powerstatus'",
",",
"host",
"=",
"host",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_pxe | Configure server to PXE perform a one off PXE boot
CLI Example:
.. code-block:: bash
salt dell dracr.server_pxe | salt/modules/dracr.py | def server_pxe(host=None,
admin_username=None,
admin_password=None):
'''
Configure server to PXE perform a one off PXE boot
CLI Example:
.. code-block:: bash
salt dell dracr.server_pxe
'''
if __execute_cmd('config -g cfgServerInfo -o cfgServerFirstBootDev... | def server_pxe(host=None,
admin_username=None,
admin_password=None):
'''
Configure server to PXE perform a one off PXE boot
CLI Example:
.. code-block:: bash
salt dell dracr.server_pxe
'''
if __execute_cmd('config -g cfgServerInfo -o cfgServerFirstBootDev... | [
"Configure",
"server",
"to",
"PXE",
"perform",
"a",
"one",
"off",
"PXE",
"boot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1002-L1026 | [
"def",
"server_pxe",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"if",
"__execute_cmd",
"(",
"'config -g cfgServerInfo -o cfgServerFirstBootDevice PXE'",
",",
"host",
"=",
"host",
",",
"admin_username",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_slotnames | List the names of all slots in the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: bash
salt-call --local dracr.list_slotnames host=111.2... | salt/modules/dracr.py | def list_slotnames(host=None,
admin_username=None,
admin_password=None):
'''
List the names of all slots in the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to... | def list_slotnames(host=None,
admin_username=None,
admin_password=None):
'''
List the names of all slots in the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to... | [
"List",
"the",
"names",
"of",
"all",
"slots",
"in",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1029-L1078 | [
"def",
"list_slotnames",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"slotraw",
"=",
"__execute_ret",
"(",
"'getslotname'",
",",
"host",
"=",
"host",
",",
"admin_username",
"=",
"admin_username",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_slotname | Get the name of a slot number in the chassis.
slot
The number of the slot for which to obtain the name.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. cod... | salt/modules/dracr.py | def get_slotname(slot, host=None, admin_username=None, admin_password=None):
'''
Get the name of a slot number in the chassis.
slot
The number of the slot for which to obtain the name.
host
The chassis host.
admin_username
The username used to access the chassis.
admi... | def get_slotname(slot, host=None, admin_username=None, admin_password=None):
'''
Get the name of a slot number in the chassis.
slot
The number of the slot for which to obtain the name.
host
The chassis host.
admin_username
The username used to access the chassis.
admi... | [
"Get",
"the",
"name",
"of",
"a",
"slot",
"number",
"in",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1081-L1110 | [
"def",
"get_slotname",
"(",
"slot",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"slots",
"=",
"list_slotnames",
"(",
"host",
"=",
"host",
",",
"admin_username",
"=",
"admin_username",
",",
"ad... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_slotname | Set the name of a slot in a chassis.
slot
The slot number to change.
name
The name to set. Can only be 15 characters long.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassi... | salt/modules/dracr.py | def set_slotname(slot, name, host=None,
admin_username=None, admin_password=None):
'''
Set the name of a slot in a chassis.
slot
The slot number to change.
name
The name to set. Can only be 15 characters long.
host
The chassis host.
admin_username
... | def set_slotname(slot, name, host=None,
admin_username=None, admin_password=None):
'''
Set the name of a slot in a chassis.
slot
The slot number to change.
name
The name to set. Can only be 15 characters long.
host
The chassis host.
admin_username
... | [
"Set",
"the",
"name",
"of",
"a",
"slot",
"in",
"a",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1113-L1143 | [
"def",
"set_slotname",
"(",
"slot",
",",
"name",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'config -g cfgServerInfo -o cfgServerName -i {0} {1}'",
".",
"format",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_chassis_name | Set the name of the chassis.
name
The name to be set on the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: bash
salt '*' dr... | salt/modules/dracr.py | def set_chassis_name(name,
host=None,
admin_username=None,
admin_password=None):
'''
Set the name of the chassis.
name
The name to be set on the chassis.
host
The chassis host.
admin_username
The username used ... | def set_chassis_name(name,
host=None,
admin_username=None,
admin_password=None):
'''
Set the name of the chassis.
name
The name to be set on the chassis.
host
The chassis host.
admin_username
The username used ... | [
"Set",
"the",
"name",
"of",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1146-L1175 | [
"def",
"set_chassis_name",
"(",
"name",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'setsysinfo -c chassisname {0}'",
".",
"format",
"(",
"name",
")",
",",
"host",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_chassis_name | Get the name of a chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: bash
salt '*' dracr.get_chassis_name host=111.222.333.444
a... | salt/modules/dracr.py | def get_chassis_name(host=None, admin_username=None, admin_password=None):
'''
Get the name of a chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-b... | def get_chassis_name(host=None, admin_username=None, admin_password=None):
'''
Get the name of a chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-b... | [
"Get",
"the",
"name",
"of",
"a",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1178-L1201 | [
"def",
"get_chassis_name",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"bare_rac_cmd",
"(",
"'getchassisname'",
",",
"host",
"=",
"host",
",",
"admin_username",
"=",
"admin_username",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_chassis_location | Set the location of the chassis.
location
The name of the location to be set on the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: b... | salt/modules/dracr.py | def set_chassis_location(location,
host=None,
admin_username=None,
admin_password=None):
'''
Set the location of the chassis.
location
The name of the location to be set on the chassis.
host
The chassis host.
... | def set_chassis_location(location,
host=None,
admin_username=None,
admin_password=None):
'''
Set the location of the chassis.
location
The name of the location to be set on the chassis.
host
The chassis host.
... | [
"Set",
"the",
"location",
"of",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1285-L1314 | [
"def",
"set_chassis_location",
"(",
"location",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"__execute_cmd",
"(",
"'setsysinfo -c chassislocation {0}'",
".",
"format",
"(",
"location",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_chassis_location | Get the location of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: bash
salt '*' dracr.set_chassis_location host=111.222.333.444
... | salt/modules/dracr.py | def get_chassis_location(host=None,
admin_username=None,
admin_password=None):
'''
Get the location of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password ... | def get_chassis_location(host=None,
admin_username=None,
admin_password=None):
'''
Get the location of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password ... | [
"Get",
"the",
"location",
"of",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1317-L1342 | [
"def",
"get_chassis_location",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"system_info",
"(",
"host",
"=",
"host",
",",
"admin_username",
"=",
"admin_username",
",",
"admin_password",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_chassis_datacenter | Set the location of the chassis.
location
The name of the datacenter to be set on the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block::... | salt/modules/dracr.py | def set_chassis_datacenter(location,
host=None,
admin_username=None,
admin_password=None):
'''
Set the location of the chassis.
location
The name of the datacenter to be set on the chassis.
host
The chassis host... | def set_chassis_datacenter(location,
host=None,
admin_username=None,
admin_password=None):
'''
Set the location of the chassis.
location
The name of the datacenter to be set on the chassis.
host
The chassis host... | [
"Set",
"the",
"location",
"of",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1345-L1374 | [
"def",
"set_chassis_datacenter",
"(",
"location",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"set_general",
"(",
"'cfgLocation'",
",",
"'cfgLocationDatacenter'",
",",
"location",
",",
"ho... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_chassis_datacenter | Get the datacenter of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The password used to access the chassis.
CLI Example:
.. code-block:: bash
salt '*' dracr.set_chassis_location host=111.222.333.444
... | salt/modules/dracr.py | def get_chassis_datacenter(host=None,
admin_username=None,
admin_password=None):
'''
Get the datacenter of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The passw... | def get_chassis_datacenter(host=None,
admin_username=None,
admin_password=None):
'''
Get the datacenter of the chassis.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
The passw... | [
"Get",
"the",
"datacenter",
"of",
"the",
"chassis",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1377-L1401 | [
"def",
"get_chassis_datacenter",
"(",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"return",
"get_general",
"(",
"'cfgLocation'",
",",
"'cfgLocationDatacenter'",
",",
"host",
"=",
"host",
",",
"admin_user... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | idrac_general | Run a generic racadm command against a particular
blade in a chassis. Blades are usually named things like
'server-1', 'server-2', etc. If the iDRAC has a different
password than the CMC, then you can pass it with the
idrac_password kwarg.
:param blade_name: Name of the blade to run the command o... | salt/modules/dracr.py | def idrac_general(blade_name, command, idrac_password=None,
host=None,
admin_username=None, admin_password=None):
'''
Run a generic racadm command against a particular
blade in a chassis. Blades are usually named things like
'server-1', 'server-2', etc. If the iDRAC... | def idrac_general(blade_name, command, idrac_password=None,
host=None,
admin_username=None, admin_password=None):
'''
Run a generic racadm command against a particular
blade in a chassis. Blades are usually named things like
'server-1', 'server-2', etc. If the iDRAC... | [
"Run",
"a",
"generic",
"racadm",
"command",
"against",
"a",
"particular",
"blade",
"in",
"a",
"chassis",
".",
"Blades",
"are",
"usually",
"named",
"things",
"like",
"server",
"-",
"1",
"server",
"-",
"2",
"etc",
".",
"If",
"the",
"iDRAC",
"has",
"a",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1426-L1469 | [
"def",
"idrac_general",
"(",
"blade_name",
",",
"command",
",",
"idrac_password",
"=",
"None",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"module_network",
"=",
"network_info",
"(",
"host",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_firmware | Updates firmware using local firmware file
.. code-block:: bash
salt dell dracr.update_firmware firmware.exe
This executes the following command on your FX2
(using username and password stored in the pillar data)
.. code-block:: bash
racadm update –f firmware.exe -u user –p pass | salt/modules/dracr.py | def update_firmware(filename,
host=None,
admin_username=None,
admin_password=None):
'''
Updates firmware using local firmware file
.. code-block:: bash
salt dell dracr.update_firmware firmware.exe
This executes the following command... | def update_firmware(filename,
host=None,
admin_username=None,
admin_password=None):
'''
Updates firmware using local firmware file
.. code-block:: bash
salt dell dracr.update_firmware firmware.exe
This executes the following command... | [
"Updates",
"firmware",
"using",
"local",
"firmware",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1506-L1532 | [
"def",
"update_firmware",
"(",
"filename",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"return",
"_update_firmware",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_firmware_nfs_or_cifs | Executes the following for CIFS
(using username and password stored in the pillar data)
.. code-block:: bash
racadm update -f <updatefile> -u user –p pass -l //IP-Address/share
Or for NFS
(using username and password stored in the pillar data)
.. code-block:: bash
racadm upda... | salt/modules/dracr.py | def update_firmware_nfs_or_cifs(filename, share,
host=None,
admin_username=None,
admin_password=None):
'''
Executes the following for CIFS
(using username and password stored in the pillar data)
.. code-bloc... | def update_firmware_nfs_or_cifs(filename, share,
host=None,
admin_username=None,
admin_password=None):
'''
Executes the following for CIFS
(using username and password stored in the pillar data)
.. code-bloc... | [
"Executes",
"the",
"following",
"for",
"CIFS",
"(",
"using",
"username",
"and",
"password",
"stored",
"in",
"the",
"pillar",
"data",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1535-L1577 | [
"def",
"update_firmware_nfs_or_cifs",
"(",
"filename",
",",
"share",
",",
"host",
"=",
"None",
",",
"admin_username",
"=",
"None",
",",
"admin_password",
"=",
"None",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | post_card | Send a message to a Microsft Teams channel
.. code-block:: yaml
send-msteams-message:
msteams.post_card:
- message: 'This state was executed successfully.'
- hook_url: https://outlook.office.com/webhook/837
The following parameters are required:
message
... | salt/states/msteams.py | def post_card(name,
message,
hook_url=None,
title=None,
theme_color=None):
'''
Send a message to a Microsft Teams channel
.. code-block:: yaml
send-msteams-message:
msteams.post_card:
- message: 'This state was executed ... | def post_card(name,
message,
hook_url=None,
title=None,
theme_color=None):
'''
Send a message to a Microsft Teams channel
.. code-block:: yaml
send-msteams-message:
msteams.post_card:
- message: 'This state was executed ... | [
"Send",
"a",
"message",
"to",
"a",
"Microsft",
"Teams",
"channel"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/msteams.py#L39-L99 | [
"def",
"post_card",
"(",
"name",
",",
"message",
",",
"hook_url",
"=",
"None",
",",
"title",
"=",
"None",
",",
"theme_color",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"Fal... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | accept_dict | Accept keys based on a dict of keys. Returns a dictionary.
match
The dictionary of keys to accept.
include_rejected
To include rejected keys in the match along with pending keys, set this
to ``True``. Defaults to ``False``.
.. versionadded:: 2016.3.4
include_denied
... | salt/wheel/key.py | def accept_dict(match, include_rejected=False, include_denied=False):
'''
Accept keys based on a dict of keys. Returns a dictionary.
match
The dictionary of keys to accept.
include_rejected
To include rejected keys in the match along with pending keys, set this
to ``True``. Def... | def accept_dict(match, include_rejected=False, include_denied=False):
'''
Accept keys based on a dict of keys. Returns a dictionary.
match
The dictionary of keys to accept.
include_rejected
To include rejected keys in the match along with pending keys, set this
to ``True``. Def... | [
"Accept",
"keys",
"based",
"on",
"a",
"dict",
"of",
"keys",
".",
"Returns",
"a",
"dictionary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L121-L158 | [
"def",
"accept_dict",
"(",
"match",
",",
"include_rejected",
"=",
"False",
",",
"include_denied",
"=",
"False",
")",
":",
"skey",
"=",
"get_key",
"(",
"__opts__",
")",
"return",
"skey",
".",
"accept",
"(",
"match_dict",
"=",
"match",
",",
"include_rejected",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reject | Reject keys based on a glob match. Returns a dictionary.
match
The glob match of keys to reject.
include_accepted
To include accepted keys in the match along with pending keys, set this
to ``True``. Defaults to ``False``.
include_denied
To include denied keys in the match ... | salt/wheel/key.py | def reject(match, include_accepted=False, include_denied=False):
'''
Reject keys based on a glob match. Returns a dictionary.
match
The glob match of keys to reject.
include_accepted
To include accepted keys in the match along with pending keys, set this
to ``True``. Defaults t... | def reject(match, include_accepted=False, include_denied=False):
'''
Reject keys based on a glob match. Returns a dictionary.
match
The glob match of keys to reject.
include_accepted
To include accepted keys in the match along with pending keys, set this
to ``True``. Defaults t... | [
"Reject",
"keys",
"based",
"on",
"a",
"glob",
"match",
".",
"Returns",
"a",
"dictionary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L200-L221 | [
"def",
"reject",
"(",
"match",
",",
"include_accepted",
"=",
"False",
",",
"include_denied",
"=",
"False",
")",
":",
"skey",
"=",
"get_key",
"(",
"__opts__",
")",
"return",
"skey",
".",
"reject",
"(",
"match",
",",
"include_accepted",
"=",
"include_accepted"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | finger | Return the matching key fingerprints. Returns a dictionary.
match
The key for with to retrieve the fingerprint.
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger', ['minion1'])
{'minions': {'minion1': '5d:f6:79... | salt/wheel/key.py | def finger(match, hash_type=None):
'''
Return the matching key fingerprints. Returns a dictionary.
match
The key for with to retrieve the fingerprint.
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger', ['minio... | def finger(match, hash_type=None):
'''
Return the matching key fingerprints. Returns a dictionary.
match
The key for with to retrieve the fingerprint.
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger', ['minio... | [
"Return",
"the",
"matching",
"key",
"fingerprints",
".",
"Returns",
"a",
"dictionary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L279-L299 | [
"def",
"finger",
"(",
"match",
",",
"hash_type",
"=",
"None",
")",
":",
"if",
"hash_type",
"is",
"None",
":",
"hash_type",
"=",
"__opts__",
"[",
"'hash_type'",
"]",
"skey",
"=",
"get_key",
"(",
"__opts__",
")",
"return",
"skey",
".",
"finger",
"(",
"ma... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | finger_master | Return the fingerprint of the master's public key
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger_master')
{'local': {'master.pub': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}} | salt/wheel/key.py | def finger_master(hash_type=None):
'''
Return the fingerprint of the master's public key
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger_master')
{'local': {'master.pub': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4... | def finger_master(hash_type=None):
'''
Return the fingerprint of the master's public key
hash_type
The hash algorithm used to calculate the fingerprint
.. code-block:: python
>>> wheel.cmd('key.finger_master')
{'local': {'master.pub': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4... | [
"Return",
"the",
"fingerprint",
"of",
"the",
"master",
"s",
"public",
"key"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L302-L320 | [
"def",
"finger_master",
"(",
"hash_type",
"=",
"None",
")",
":",
"keyname",
"=",
"'master.pub'",
"if",
"hash_type",
"is",
"None",
":",
"hash_type",
"=",
"__opts__",
"[",
"'hash_type'",
"]",
"fingerprint",
"=",
"salt",
".",
"utils",
".",
"crypt",
".",
"pem_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen | r'''
Generate a key pair. No keys are stored on the master. A key pair is
returned as a dict containing pub and priv keys. Returns a dictionary
containing the the ``pub`` and ``priv`` keys with their generated values.
id\_
Set a name to generate a key pair for use with salt. If not specified,
... | salt/wheel/key.py | def gen(id_=None, keysize=2048):
r'''
Generate a key pair. No keys are stored on the master. A key pair is
returned as a dict containing pub and priv keys. Returns a dictionary
containing the the ``pub`` and ``priv`` keys with their generated values.
id\_
Set a name to generate a key pair f... | def gen(id_=None, keysize=2048):
r'''
Generate a key pair. No keys are stored on the master. A key pair is
returned as a dict containing pub and priv keys. Returns a dictionary
containing the the ``pub`` and ``priv`` keys with their generated values.
id\_
Set a name to generate a key pair f... | [
"r",
"Generate",
"a",
"key",
"pair",
".",
"No",
"keys",
"are",
"stored",
"on",
"the",
"master",
".",
"A",
"key",
"pair",
"is",
"returned",
"as",
"a",
"dict",
"containing",
"pub",
"and",
"priv",
"keys",
".",
"Returns",
"a",
"dictionary",
"containing",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L323-L371 | [
"def",
"gen",
"(",
"id_",
"=",
"None",
",",
"keysize",
"=",
"2048",
")",
":",
"if",
"id_",
"is",
"None",
":",
"id_",
"=",
"hashlib",
".",
"sha512",
"(",
"os",
".",
"urandom",
"(",
"32",
")",
")",
".",
"hexdigest",
"(",
")",
"else",
":",
"id_",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_accept | r'''
Generate a key pair then accept the public key. This function returns the
key pair in a dict, only the public key is preserved on the master. Returns
a dictionary.
id\_
The name of the minion for which to generate a key pair.
keysize
The size of the key pair to generate. The s... | salt/wheel/key.py | def gen_accept(id_, keysize=2048, force=False):
r'''
Generate a key pair then accept the public key. This function returns the
key pair in a dict, only the public key is preserved on the master. Returns
a dictionary.
id\_
The name of the minion for which to generate a key pair.
keysize... | def gen_accept(id_, keysize=2048, force=False):
r'''
Generate a key pair then accept the public key. This function returns the
key pair in a dict, only the public key is preserved on the master. Returns
a dictionary.
id\_
The name of the minion for which to generate a key pair.
keysize... | [
"r",
"Generate",
"a",
"key",
"pair",
"then",
"accept",
"the",
"public",
"key",
".",
"This",
"function",
"returns",
"the",
"key",
"pair",
"in",
"a",
"dict",
"only",
"the",
"public",
"key",
"is",
"preserved",
"on",
"the",
"master",
".",
"Returns",
"a",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L374-L421 | [
"def",
"gen_accept",
"(",
"id_",
",",
"keysize",
"=",
"2048",
",",
"force",
"=",
"False",
")",
":",
"id_",
"=",
"clean",
".",
"id",
"(",
"id_",
")",
"ret",
"=",
"gen",
"(",
"id_",
",",
"keysize",
")",
"acc_path",
"=",
"os",
".",
"path",
".",
"j... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_keys | Generate minion RSA public keypair | salt/wheel/key.py | def gen_keys(keydir=None, keyname=None, keysize=None, user=None):
'''
Generate minion RSA public keypair
'''
skey = get_key(__opts__)
return skey.gen_keys(keydir, keyname, keysize, user) | def gen_keys(keydir=None, keyname=None, keysize=None, user=None):
'''
Generate minion RSA public keypair
'''
skey = get_key(__opts__)
return skey.gen_keys(keydir, keyname, keysize, user) | [
"Generate",
"minion",
"RSA",
"public",
"keypair"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L424-L429 | [
"def",
"gen_keys",
"(",
"keydir",
"=",
"None",
",",
"keyname",
"=",
"None",
",",
"keysize",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"skey",
"=",
"get_key",
"(",
"__opts__",
")",
"return",
"skey",
".",
"gen_keys",
"(",
"keydir",
",",
"keyname... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_signature | Generate master public-key-signature | salt/wheel/key.py | def gen_signature(priv, pub, signature_path, auto_create=False, keysize=None):
'''
Generate master public-key-signature
'''
skey = get_key(__opts__)
return skey.gen_keys_signature(priv, pub, signature_path, auto_create, keysize) | def gen_signature(priv, pub, signature_path, auto_create=False, keysize=None):
'''
Generate master public-key-signature
'''
skey = get_key(__opts__)
return skey.gen_keys_signature(priv, pub, signature_path, auto_create, keysize) | [
"Generate",
"master",
"public",
"-",
"key",
"-",
"signature"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L432-L437 | [
"def",
"gen_signature",
"(",
"priv",
",",
"pub",
",",
"signature_path",
",",
"auto_create",
"=",
"False",
",",
"keysize",
"=",
"None",
")",
":",
"skey",
"=",
"get_key",
"(",
"__opts__",
")",
"return",
"skey",
".",
"gen_keys_signature",
"(",
"priv",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dirinfo | Return information on a directory located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]] | salt/modules/moosefs.py | def dirinfo(path, opts=None):
'''
Return information on a directory located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]]
'''
cmd = 'mfsdirinfo'
ret = {}
if opts:
cmd += ' -' + opts
cmd += ' ' + path
out = __s... | def dirinfo(path, opts=None):
'''
Return information on a directory located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]]
'''
cmd = 'mfsdirinfo'
ret = {}
if opts:
cmd += ' -' + opts
cmd += ' ' + path
out = __s... | [
"Return",
"information",
"on",
"a",
"directory",
"located",
"on",
"the",
"Moose"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L20-L43 | [
"def",
"dirinfo",
"(",
"path",
",",
"opts",
"=",
"None",
")",
":",
"cmd",
"=",
"'mfsdirinfo'",
"ret",
"=",
"{",
"}",
"if",
"opts",
":",
"cmd",
"+=",
"' -'",
"+",
"opts",
"cmd",
"+=",
"' '",
"+",
"path",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fileinfo | Return information on a file located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.fileinfo /path/to/dir/ | salt/modules/moosefs.py | def fileinfo(path):
'''
Return information on a file located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.fileinfo /path/to/dir/
'''
cmd = 'mfsfileinfo ' + path
ret = {}
chunknum = ''
out = __salt__['cmd.run_all'](cmd, python_shell=False)
output = o... | def fileinfo(path):
'''
Return information on a file located on the Moose
CLI Example:
.. code-block:: bash
salt '*' moosefs.fileinfo /path/to/dir/
'''
cmd = 'mfsfileinfo ' + path
ret = {}
chunknum = ''
out = __salt__['cmd.run_all'](cmd, python_shell=False)
output = o... | [
"Return",
"information",
"on",
"a",
"file",
"located",
"on",
"the",
"Moose"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L46-L89 | [
"def",
"fileinfo",
"(",
"path",
")",
":",
"cmd",
"=",
"'mfsfileinfo '",
"+",
"path",
"ret",
"=",
"{",
"}",
"chunknum",
"=",
"''",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"output",
"=",
"o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mounts | Return a list of current MooseFS mounts
CLI Example:
.. code-block:: bash
salt '*' moosefs.mounts | salt/modules/moosefs.py | def mounts():
'''
Return a list of current MooseFS mounts
CLI Example:
.. code-block:: bash
salt '*' moosefs.mounts
'''
cmd = 'mount'
ret = {}
out = __salt__['cmd.run_all'](cmd)
output = out['stdout'].splitlines()
for line in output:
if not line:
c... | def mounts():
'''
Return a list of current MooseFS mounts
CLI Example:
.. code-block:: bash
salt '*' moosefs.mounts
'''
cmd = 'mount'
ret = {}
out = __salt__['cmd.run_all'](cmd)
output = out['stdout'].splitlines()
for line in output:
if not line:
c... | [
"Return",
"a",
"list",
"of",
"current",
"MooseFS",
"mounts"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L92-L124 | [
"def",
"mounts",
"(",
")",
":",
"cmd",
"=",
"'mount'",
"ret",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"output",
"=",
"out",
"[",
"'stdout'",
"]",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"output",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getgoal | Return goal(s) for a file or directory
CLI Example:
.. code-block:: bash
salt '*' moosefs.getgoal /path/to/file [-[n][h|H]]
salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]] | salt/modules/moosefs.py | def getgoal(path, opts=None):
'''
Return goal(s) for a file or directory
CLI Example:
.. code-block:: bash
salt '*' moosefs.getgoal /path/to/file [-[n][h|H]]
salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]]
'''
cmd = 'mfsgetgoal'
ret = {}
if opts:
cmd += '... | def getgoal(path, opts=None):
'''
Return goal(s) for a file or directory
CLI Example:
.. code-block:: bash
salt '*' moosefs.getgoal /path/to/file [-[n][h|H]]
salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]]
'''
cmd = 'mfsgetgoal'
ret = {}
if opts:
cmd += '... | [
"Return",
"goal",
"(",
"s",
")",
"for",
"a",
"file",
"or",
"directory"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L127-L164 | [
"def",
"getgoal",
"(",
"path",
",",
"opts",
"=",
"None",
")",
":",
"cmd",
"=",
"'mfsgetgoal'",
"ret",
"=",
"{",
"}",
"if",
"opts",
":",
"cmd",
"+=",
"' -'",
"+",
"opts",
"else",
":",
"opts",
"=",
"''",
"cmd",
"+=",
"' '",
"+",
"path",
"out",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _auditpol_cmd | Helper function for running the auditpol command
Args:
cmd (str): the auditpol command to run
Returns:
list: A list containing each line of the return (splitlines)
Raises:
CommandExecutionError: If the command encounters an error | salt/utils/win_lgpo_auditpol.py | def _auditpol_cmd(cmd):
'''
Helper function for running the auditpol command
Args:
cmd (str): the auditpol command to run
Returns:
list: A list containing each line of the return (splitlines)
Raises:
CommandExecutionError: If the command encounters an error
'''
ret... | def _auditpol_cmd(cmd):
'''
Helper function for running the auditpol command
Args:
cmd (str): the auditpol command to run
Returns:
list: A list containing each line of the return (splitlines)
Raises:
CommandExecutionError: If the command encounters an error
'''
ret... | [
"Helper",
"function",
"for",
"running",
"the",
"auditpol",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L108-L128 | [
"def",
"_auditpol_cmd",
"(",
"cmd",
")",
":",
"ret",
"=",
"salt",
".",
"modules",
".",
"cmdmod",
".",
"run_all",
"(",
"cmd",
"=",
"'auditpol {0}'",
".",
"format",
"(",
"cmd",
")",
",",
"python_shell",
"=",
"True",
")",
"if",
"ret",
"[",
"'retcode'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_settings | Get the current configuration for all audit settings specified in the
category
Args:
category (str):
One of the nine categories to return. Can also be ``All`` to return
the settings for all categories. Valid options are:
- Account Logon
- Account Managem... | salt/utils/win_lgpo_auditpol.py | def get_settings(category='All'):
'''
Get the current configuration for all audit settings specified in the
category
Args:
category (str):
One of the nine categories to return. Can also be ``All`` to return
the settings for all categories. Valid options are:
... | def get_settings(category='All'):
'''
Get the current configuration for all audit settings specified in the
category
Args:
category (str):
One of the nine categories to return. Can also be ``All`` to return
the settings for all categories. Valid options are:
... | [
"Get",
"the",
"current",
"configuration",
"for",
"all",
"audit",
"settings",
"specified",
"in",
"the",
"category"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L131-L189 | [
"def",
"get_settings",
"(",
"category",
"=",
"'All'",
")",
":",
"# Parameter validation",
"if",
"category",
".",
"lower",
"(",
")",
"in",
"[",
"'all'",
",",
"'*'",
"]",
":",
"category",
"=",
"'*'",
"elif",
"category",
".",
"lower",
"(",
")",
"not",
"in... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_setting | Get the current configuration for the named audit setting
Args:
name (str): The name of the setting to retrieve
Returns:
str: The current configuration for the named setting
Raises:
KeyError: On invalid setting name
CommandExecutionError: If an error is encountered retriev... | salt/utils/win_lgpo_auditpol.py | def get_setting(name):
'''
Get the current configuration for the named audit setting
Args:
name (str): The name of the setting to retrieve
Returns:
str: The current configuration for the named setting
Raises:
KeyError: On invalid setting name
CommandExecutionError:... | def get_setting(name):
'''
Get the current configuration for the named audit setting
Args:
name (str): The name of the setting to retrieve
Returns:
str: The current configuration for the named setting
Raises:
KeyError: On invalid setting name
CommandExecutionError:... | [
"Get",
"the",
"current",
"configuration",
"for",
"the",
"named",
"audit",
"setting"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L192-L219 | [
"def",
"get_setting",
"(",
"name",
")",
":",
"current_settings",
"=",
"get_settings",
"(",
"category",
"=",
"'All'",
")",
"for",
"setting",
"in",
"current_settings",
":",
"if",
"name",
".",
"lower",
"(",
")",
"==",
"setting",
".",
"lower",
"(",
")",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_setting | Set the configuration for the named audit setting
Args:
name (str):
The name of the setting to configure
value (str):
The configuration for the named value. Valid options are:
- No Auditing
- Success
- Failure
- Success and ... | salt/utils/win_lgpo_auditpol.py | def set_setting(name, value):
'''
Set the configuration for the named audit setting
Args:
name (str):
The name of the setting to configure
value (str):
The configuration for the named value. Valid options are:
- No Auditing
- Success
... | def set_setting(name, value):
'''
Set the configuration for the named audit setting
Args:
name (str):
The name of the setting to configure
value (str):
The configuration for the named value. Valid options are:
- No Auditing
- Success
... | [
"Set",
"the",
"configuration",
"for",
"the",
"named",
"audit",
"setting"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L229-L280 | [
"def",
"set_setting",
"(",
"name",
",",
"value",
")",
":",
"# Input validation",
"if",
"name",
".",
"lower",
"(",
")",
"not",
"in",
"_get_valid_names",
"(",
")",
":",
"raise",
"KeyError",
"(",
"'Invalid name: {0}'",
".",
"format",
"(",
"name",
")",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_auditpol_dump | Gets the contents of an auditpol /backup. Used by the LGPO module to get
fieldnames and GUIDs for Advanced Audit policies.
Returns:
list: A list of lines form the backup file
Usage:
.. code-block:: python
import salt.utils.win_lgpo_auditpol
dump = salt.utils.win_lgpo_auditpo... | salt/utils/win_lgpo_auditpol.py | def get_auditpol_dump():
'''
Gets the contents of an auditpol /backup. Used by the LGPO module to get
fieldnames and GUIDs for Advanced Audit policies.
Returns:
list: A list of lines form the backup file
Usage:
.. code-block:: python
import salt.utils.win_lgpo_auditpol
... | def get_auditpol_dump():
'''
Gets the contents of an auditpol /backup. Used by the LGPO module to get
fieldnames and GUIDs for Advanced Audit policies.
Returns:
list: A list of lines form the backup file
Usage:
.. code-block:: python
import salt.utils.win_lgpo_auditpol
... | [
"Gets",
"the",
"contents",
"of",
"an",
"auditpol",
"/",
"backup",
".",
"Used",
"by",
"the",
"LGPO",
"module",
"to",
"get",
"fieldnames",
"and",
"GUIDs",
"for",
"Advanced",
"Audit",
"policies",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L283-L308 | [
"def",
"get_auditpol_dump",
"(",
")",
":",
"# Just get a temporary file name",
"# NamedTemporaryFile will delete the file it creates by default on Windows",
"with",
"tempfile",
".",
"NamedTemporaryFile",
"(",
"suffix",
"=",
"'.csv'",
")",
"as",
"tmp_file",
":",
"csv_file",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _ruby_installed | Check to see if given ruby is installed. | salt/states/rbenv.py | def _ruby_installed(ret, ruby, user=None):
'''
Check to see if given ruby is installed.
'''
default = __salt__['rbenv.default'](runas=user)
for version in __salt__['rbenv.versions'](user):
if version == ruby:
ret['result'] = True
ret['comment'] = 'Requested ruby exist... | def _ruby_installed(ret, ruby, user=None):
'''
Check to see if given ruby is installed.
'''
default = __salt__['rbenv.default'](runas=user)
for version in __salt__['rbenv.versions'](user):
if version == ruby:
ret['result'] = True
ret['comment'] = 'Requested ruby exist... | [
"Check",
"to",
"see",
"if",
"given",
"ruby",
"is",
"installed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L72-L84 | [
"def",
"_ruby_installed",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"None",
")",
":",
"default",
"=",
"__salt__",
"[",
"'rbenv.default'",
"]",
"(",
"runas",
"=",
"user",
")",
"for",
"version",
"in",
"__salt__",
"[",
"'rbenv.versions'",
"]",
"(",
"user",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_and_install_ruby | Verify that ruby is installed, install if unavailable | salt/states/rbenv.py | def _check_and_install_ruby(ret, ruby, default=False, user=None):
'''
Verify that ruby is installed, install if unavailable
'''
ret = _ruby_installed(ret, ruby, user=user)
if not ret['result']:
if __salt__['rbenv.install_ruby'](ruby, runas=user):
ret['result'] = True
... | def _check_and_install_ruby(ret, ruby, default=False, user=None):
'''
Verify that ruby is installed, install if unavailable
'''
ret = _ruby_installed(ret, ruby, user=user)
if not ret['result']:
if __salt__['rbenv.install_ruby'](ruby, runas=user):
ret['result'] = True
... | [
"Verify",
"that",
"ruby",
"is",
"installed",
"install",
"if",
"unavailable"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L87-L106 | [
"def",
"_check_and_install_ruby",
"(",
"ret",
",",
"ruby",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"_ruby_installed",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"user",
")",
"if",
"not",
"ret",
"[",
"'result'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Verify that the specified ruby is installed with rbenv. Rbenv is
installed if necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user to run rbenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.1... | salt/states/rbenv.py | def installed(name, default=False, user=None):
'''
Verify that the specified ruby is installed with rbenv. Rbenv is
installed if necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user to run rbenv as.
... | def installed(name, default=False, user=None):
'''
Verify that the specified ruby is installed with rbenv. Rbenv is
installed if necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user to run rbenv as.
... | [
"Verify",
"that",
"the",
"specified",
"ruby",
"is",
"installed",
"with",
"rbenv",
".",
"Rbenv",
"is",
"installed",
"if",
"necessary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L109-L147 | [
"def",
"installed",
"(",
"name",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"rbenv_insta... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_and_uninstall_ruby | Verify that ruby is uninstalled | salt/states/rbenv.py | def _check_and_uninstall_ruby(ret, ruby, user=None):
'''
Verify that ruby is uninstalled
'''
ret = _ruby_installed(ret, ruby, user=user)
if ret['result']:
if ret['default']:
__salt__['rbenv.default']('system', runas=user)
if __salt__['rbenv.uninstall_ruby'](ruby, runas=u... | def _check_and_uninstall_ruby(ret, ruby, user=None):
'''
Verify that ruby is uninstalled
'''
ret = _ruby_installed(ret, ruby, user=user)
if ret['result']:
if ret['default']:
__salt__['rbenv.default']('system', runas=user)
if __salt__['rbenv.uninstall_ruby'](ruby, runas=u... | [
"Verify",
"that",
"ruby",
"is",
"uninstalled"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L150-L172 | [
"def",
"_check_and_uninstall_ruby",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"_ruby_installed",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"user",
")",
"if",
"ret",
"[",
"'result'",
"]",
":",
"if",
"ret",
"[",
"'defaul... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Verify that the specified ruby is not installed with rbenv. Rbenv
is installed if necessary.
name
The version of ruby to uninstall
user: None
The user to run rbenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0 | salt/states/rbenv.py | def absent(name, user=None):
'''
Verify that the specified ruby is not installed with rbenv. Rbenv
is installed if necessary.
name
The version of ruby to uninstall
user: None
The user to run rbenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0
'''
ret =... | def absent(name, user=None):
'''
Verify that the specified ruby is not installed with rbenv. Rbenv
is installed if necessary.
name
The version of ruby to uninstall
user: None
The user to run rbenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0
'''
ret =... | [
"Verify",
"that",
"the",
"specified",
"ruby",
"is",
"not",
"installed",
"with",
"rbenv",
".",
"Rbenv",
"is",
"installed",
"if",
"necessary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L175-L211 | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"name",
".",
"startswith",
"(",
"'rub... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_and_install_rbenv | Verify that rbenv is installed, install if unavailable | salt/states/rbenv.py | def _check_and_install_rbenv(ret, user=None):
'''
Verify that rbenv is installed, install if unavailable
'''
ret = _check_rbenv(ret, user)
if ret['result'] is False:
if __salt__['rbenv.install'](user):
ret['result'] = True
ret['comment'] = 'Rbenv installed'
el... | def _check_and_install_rbenv(ret, user=None):
'''
Verify that rbenv is installed, install if unavailable
'''
ret = _check_rbenv(ret, user)
if ret['result'] is False:
if __salt__['rbenv.install'](user):
ret['result'] = True
ret['comment'] = 'Rbenv installed'
el... | [
"Verify",
"that",
"rbenv",
"is",
"installed",
"install",
"if",
"unavailable"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L214-L230 | [
"def",
"_check_and_install_rbenv",
"(",
"ret",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"_check_rbenv",
"(",
"ret",
",",
"user",
")",
"if",
"ret",
"[",
"'result'",
"]",
"is",
"False",
":",
"if",
"__salt__",
"[",
"'rbenv.install'",
"]",
"(",
"use... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install_rbenv | Install rbenv if not installed. Allows you to require rbenv be installed
prior to installing the plugins. Useful if you want to install rbenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the rbenv.root configuration option to set the path for rbenv if yo... | salt/states/rbenv.py | def install_rbenv(name, user=None):
'''
Install rbenv if not installed. Allows you to require rbenv be installed
prior to installing the plugins. Useful if you want to install rbenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the rbenv.root conf... | def install_rbenv(name, user=None):
'''
Install rbenv if not installed. Allows you to require rbenv be installed
prior to installing the plugins. Useful if you want to install rbenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the rbenv.root conf... | [
"Install",
"rbenv",
"if",
"not",
"installed",
".",
"Allows",
"you",
"to",
"require",
"rbenv",
"be",
"installed",
"prior",
"to",
"installing",
"the",
"plugins",
".",
"Useful",
"if",
"you",
"want",
"to",
"install",
"rbenv",
"plugins",
"via",
"the",
"git",
"o... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L233-L258 | [
"def",
"install_rbenv",
"(",
"name",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"__opts__",
"[",
"'test'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | build_rule | Build a well-formatted nftables rule based on kwargs.
A `table` and `chain` are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are required.
`command` may be specified as either insert, append, or delete.
This will return the nftables command, exactly as i... | salt/modules/nftables.py | def build_rule(table=None, chain=None, command=None, position='', full=None, family='ipv4',
**kwargs):
'''
Build a well-formatted nftables rule based on kwargs.
A `table` and `chain` are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are req... | def build_rule(table=None, chain=None, command=None, position='', full=None, family='ipv4',
**kwargs):
'''
Build a well-formatted nftables rule based on kwargs.
A `table` and `chain` are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are req... | [
"Build",
"a",
"well",
"-",
"formatted",
"nftables",
"rule",
"based",
"on",
"kwargs",
".",
"A",
"table",
"and",
"chain",
"are",
"not",
"required",
"unless",
"full",
"is",
"True",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L86-L274 | [
"def",
"build_rule",
"(",
"table",
"=",
"None",
",",
"chain",
"=",
"None",
",",
"command",
"=",
"None",
",",
"position",
"=",
"''",
",",
"full",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'comm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_saved_rules | Return a data structure of the rules in the conf file
CLI Example:
.. code-block:: bash
salt '*' nftables.get_saved_rules | salt/modules/nftables.py | def get_saved_rules(conf_file=None):
'''
Return a data structure of the rules in the conf file
CLI Example:
.. code-block:: bash
salt '*' nftables.get_saved_rules
'''
if _conf() and not conf_file:
conf_file = _conf()
with salt.utils.files.fopen(conf_file) as fp_:
... | def get_saved_rules(conf_file=None):
'''
Return a data structure of the rules in the conf file
CLI Example:
.. code-block:: bash
salt '*' nftables.get_saved_rules
'''
if _conf() and not conf_file:
conf_file = _conf()
with salt.utils.files.fopen(conf_file) as fp_:
... | [
"Return",
"a",
"data",
"structure",
"of",
"the",
"rules",
"in",
"the",
"conf",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L277-L301 | [
"def",
"get_saved_rules",
"(",
"conf_file",
"=",
"None",
")",
":",
"if",
"_conf",
"(",
")",
"and",
"not",
"conf_file",
":",
"conf_file",
"=",
"_conf",
"(",
")",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"conf_file",
")",
"as",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_rules | Return a data structure of the current, in-memory rules
CLI Example:
.. code-block:: bash
salt '*' nftables.get_rules
salt '*' nftables.get_rules family=ipv6 | salt/modules/nftables.py | def get_rules(family='ipv4'):
'''
Return a data structure of the current, in-memory rules
CLI Example:
.. code-block:: bash
salt '*' nftables.get_rules
salt '*' nftables.get_rules family=ipv6
'''
nft_family = _NFTABLES_FAMILIES[family]
rules = []
cmd = '{0} --numeric... | def get_rules(family='ipv4'):
'''
Return a data structure of the current, in-memory rules
CLI Example:
.. code-block:: bash
salt '*' nftables.get_rules
salt '*' nftables.get_rules family=ipv6
'''
nft_family = _NFTABLES_FAMILIES[family]
rules = []
cmd = '{0} --numeric... | [
"Return",
"a",
"data",
"structure",
"of",
"the",
"current",
"in",
"-",
"memory",
"rules"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L304-L334 | [
"def",
"get_rules",
"(",
"family",
"=",
"'ipv4'",
")",
":",
"nft_family",
"=",
"_NFTABLES_FAMILIES",
"[",
"family",
"]",
"rules",
"=",
"[",
"]",
"cmd",
"=",
"'{0} --numeric --numeric --numeric '",
"'list tables {1}'",
".",
"format",
"(",
"_nftables_cmd",
"(",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save | Save the current in-memory rules to disk
CLI Example:
.. code-block:: bash
salt '*' nftables.save /etc/nftables | salt/modules/nftables.py | def save(filename=None, family='ipv4'):
'''
Save the current in-memory rules to disk
CLI Example:
.. code-block:: bash
salt '*' nftables.save /etc/nftables
'''
if _conf() and not filename:
filename = _conf()
nft_families = ['ip', 'ip6', 'arp', 'bridge']
rules = "#! nf... | def save(filename=None, family='ipv4'):
'''
Save the current in-memory rules to disk
CLI Example:
.. code-block:: bash
salt '*' nftables.save /etc/nftables
'''
if _conf() and not filename:
filename = _conf()
nft_families = ['ip', 'ip6', 'arp', 'bridge']
rules = "#! nf... | [
"Save",
"the",
"current",
"in",
"-",
"memory",
"rules",
"to",
"disk"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L337-L367 | [
"def",
"save",
"(",
"filename",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"_conf",
"(",
")",
"and",
"not",
"filename",
":",
"filename",
"=",
"_conf",
"(",
")",
"nft_families",
"=",
"[",
"'ip'",
",",
"'ip6'",
",",
"'arp'",
",",
"'br... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_rule_handle | Get the handle for a particular rule
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would be irritating at best, and we
already have a parser that can handle it.
CLI Example:
... | salt/modules/nftables.py | def get_rule_handle(table='filter', chain=None, rule=None, family='ipv4'):
'''
Get the handle for a particular rule
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would be irritati... | def get_rule_handle(table='filter', chain=None, rule=None, family='ipv4'):
'''
Get the handle for a particular rule
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would be irritati... | [
"Get",
"the",
"handle",
"for",
"a",
"particular",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L370-L426 | [
"def",
"get_rule_handle",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"None",
",",
"rule",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"if",
"not",
"chain",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check | Check for the existence of a rule in the table and chain
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would be irritating at best, and we
already have a parser that can handle it... | salt/modules/nftables.py | def check(table='filter', chain=None, rule=None, family='ipv4'):
'''
Check for the existence of a rule in the table and chain
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would b... | def check(table='filter', chain=None, rule=None, family='ipv4'):
'''
Check for the existence of a rule in the table and chain
This function accepts a rule in a standard nftables command format,
starting with the chain. Trying to force users to adapt to a new
method of creating rules would b... | [
"Check",
"for",
"the",
"existence",
"of",
"a",
"rule",
"in",
"the",
"table",
"and",
"chain"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L429-L482 | [
"def",
"check",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"None",
",",
"rule",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"if",
"not",
"chain",
":",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_table | Check for the existence of a table
CLI Example::
salt '*' nftables.check_table nat | salt/modules/nftables.py | def check_table(table=None, family='ipv4'):
'''
Check for the existence of a table
CLI Example::
salt '*' nftables.check_table nat
'''
ret = {'comment': '',
'result': False}
if not table:
ret['comment'] = 'Table needs to be specified'
return ret
nft_fam... | def check_table(table=None, family='ipv4'):
'''
Check for the existence of a table
CLI Example::
salt '*' nftables.check_table nat
'''
ret = {'comment': '',
'result': False}
if not table:
ret['comment'] = 'Table needs to be specified'
return ret
nft_fam... | [
"Check",
"for",
"the",
"existence",
"of",
"a",
"table"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L522-L548 | [
"def",
"check_table",
"(",
"table",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"if",
"not",
"table",
":",
"ret",
"[",
"'comment'",
"]",
"=",
"'Table needs to be spec... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | new_chain | .. versionadded:: 2014.7.0
Create new chain to the specified table.
CLI Example:
.. code-block:: bash
salt '*' nftables.new_chain filter input
salt '*' nftables.new_chain filter input \\
table_type=filter hook=input priority=0
salt '*' nftables.new_chain filter ... | salt/modules/nftables.py | def new_chain(table='filter', chain=None, table_type=None, hook=None, priority=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Create new chain to the specified table.
CLI Example:
.. code-block:: bash
salt '*' nftables.new_chain filter input
salt '*' nftables.new_chain fil... | def new_chain(table='filter', chain=None, table_type=None, hook=None, priority=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Create new chain to the specified table.
CLI Example:
.. code-block:: bash
salt '*' nftables.new_chain filter input
salt '*' nftables.new_chain fil... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L631-L694 | [
"def",
"new_chain",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"None",
",",
"table_type",
"=",
"None",
",",
"hook",
"=",
"None",
",",
"priority",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"''",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flush | Flush the chain in the specified table, flush all chains in the specified
table if chain is not specified.
CLI Example:
.. code-block:: bash
salt '*' nftables.flush filter
salt '*' nftables.flush filter input
IPv6:
salt '*' nftables.flush filter input family=ipv6 | salt/modules/nftables.py | def flush(table='filter', chain='', family='ipv4'):
'''
Flush the chain in the specified table, flush all chains in the specified
table if chain is not specified.
CLI Example:
.. code-block:: bash
salt '*' nftables.flush filter
salt '*' nftables.flush filter input
IPv6:
... | def flush(table='filter', chain='', family='ipv4'):
'''
Flush the chain in the specified table, flush all chains in the specified
table if chain is not specified.
CLI Example:
.. code-block:: bash
salt '*' nftables.flush filter
salt '*' nftables.flush filter input
IPv6:
... | [
"Flush",
"the",
"chain",
"in",
"the",
"specified",
"table",
"flush",
"all",
"chains",
"in",
"the",
"specified",
"table",
"if",
"chain",
"is",
"not",
"specified",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L948-L993 | [
"def",
"flush",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"''",
",",
"family",
"=",
"'ipv4'",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"'Failed to flush rules from chain {0} in table {1}.'",
".",
"format",
"(",
"chain",
",",
"table",
")",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rewrite_single_shorthand_state_decl | Rewrite all state declarations that look like this::
state_id_decl:
state.func
into::
state_id_decl:
state.func: [] | salt/renderers/stateconf.py | def rewrite_single_shorthand_state_decl(data): # pylint: disable=C0103
'''
Rewrite all state declarations that look like this::
state_id_decl:
state.func
into::
state_id_decl:
state.func: []
'''
for sid, states in six.iteritems(data):
if isinstance(states, six... | def rewrite_single_shorthand_state_decl(data): # pylint: disable=C0103
'''
Rewrite all state declarations that look like this::
state_id_decl:
state.func
into::
state_id_decl:
state.func: []
'''
for sid, states in six.iteritems(data):
if isinstance(states, six... | [
"Rewrite",
"all",
"state",
"declarations",
"that",
"look",
"like",
"this",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L251-L265 | [
"def",
"rewrite_single_shorthand_state_decl",
"(",
"data",
")",
":",
"# pylint: disable=C0103",
"for",
"sid",
",",
"states",
"in",
"six",
".",
"iteritems",
"(",
"data",
")",
":",
"if",
"isinstance",
"(",
"states",
",",
"six",
".",
"string_types",
")",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _relative_to_abs_sls | Convert ``relative`` sls reference into absolute, relative to ``sls``. | salt/renderers/stateconf.py | def _relative_to_abs_sls(relative, sls):
'''
Convert ``relative`` sls reference into absolute, relative to ``sls``.
'''
levels, suffix = re.match(r'^(\.+)(.*)$', relative).groups()
level_count = len(levels)
p_comps = sls.split('.')
if level_count > len(p_comps):
raise SaltRenderError... | def _relative_to_abs_sls(relative, sls):
'''
Convert ``relative`` sls reference into absolute, relative to ``sls``.
'''
levels, suffix = re.match(r'^(\.+)(.*)$', relative).groups()
level_count = len(levels)
p_comps = sls.split('.')
if level_count > len(p_comps):
raise SaltRenderError... | [
"Convert",
"relative",
"sls",
"reference",
"into",
"absolute",
"relative",
"to",
"sls",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L296-L307 | [
"def",
"_relative_to_abs_sls",
"(",
"relative",
",",
"sls",
")",
":",
"levels",
",",
"suffix",
"=",
"re",
".",
"match",
"(",
"r'^(\\.+)(.*)$'",
",",
"relative",
")",
".",
"groups",
"(",
")",
"level_count",
"=",
"len",
"(",
"levels",
")",
"p_comps",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nvlist | Given a list of items::
- whatever
- name1: value1
- name2:
- key: value
- key: value
return a generator that yields each (item, key, value) tuple, skipping
items that are not name-value's(dictionaries) or those not in the
list of matching names. The item in the... | salt/renderers/stateconf.py | def nvlist(thelist, names=None):
'''
Given a list of items::
- whatever
- name1: value1
- name2:
- key: value
- key: value
return a generator that yields each (item, key, value) tuple, skipping
items that are not name-value's(dictionaries) or those not in th... | def nvlist(thelist, names=None):
'''
Given a list of items::
- whatever
- name1: value1
- name2:
- key: value
- key: value
return a generator that yields each (item, key, value) tuple, skipping
items that are not name-value's(dictionaries) or those not in th... | [
"Given",
"a",
"list",
"of",
"items",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L310-L331 | [
"def",
"nvlist",
"(",
"thelist",
",",
"names",
"=",
"None",
")",
":",
"# iterate over the list under the state dict.",
"for",
"nvitem",
"in",
"thelist",
":",
"if",
"isinstance",
"(",
"nvitem",
",",
"dict",
")",
":",
"# then nvitem is a name-value item(a dict) of the l... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nvlist2 | Like nvlist but applied one more time to each returned value.
So, given a list, args, of arguments to a state like this::
- name: echo test
- cwd: /
- require:
- file: test.sh
nvlist2(args, ['require']) would yield the tuple,
(dict_item, 'file', 'test.sh') where dict_item is the... | salt/renderers/stateconf.py | def nvlist2(thelist, names=None):
'''
Like nvlist but applied one more time to each returned value.
So, given a list, args, of arguments to a state like this::
- name: echo test
- cwd: /
- require:
- file: test.sh
nvlist2(args, ['require']) would yield the tuple,
(dict_i... | def nvlist2(thelist, names=None):
'''
Like nvlist but applied one more time to each returned value.
So, given a list, args, of arguments to a state like this::
- name: echo test
- cwd: /
- require:
- file: test.sh
nvlist2(args, ['require']) would yield the tuple,
(dict_i... | [
"Like",
"nvlist",
"but",
"applied",
"one",
"more",
"time",
"to",
"each",
"returned",
"value",
".",
"So",
"given",
"a",
"list",
"args",
"of",
"arguments",
"to",
"a",
"state",
"like",
"this",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L334-L351 | [
"def",
"nvlist2",
"(",
"thelist",
",",
"names",
"=",
"None",
")",
":",
"for",
"_",
",",
"_",
",",
"value",
"in",
"nvlist",
"(",
"thelist",
",",
"names",
")",
":",
"for",
"each",
"in",
"nvlist",
"(",
"value",
")",
":",
"yield",
"each"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_api_params | Retrieve the API params from the config file. | salt/modules/statuspage.py | def _get_api_params(api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Retrieve the API params from the config file.
'''
statuspage_cfg = __salt__['config.get']('statuspage')
if not statuspage_cfg:
statuspage_cfg = {}
... | def _get_api_params(api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Retrieve the API params from the config file.
'''
statuspage_cfg = __salt__['config.get']('statuspage')
if not statuspage_cfg:
statuspage_cfg = {}
... | [
"Retrieve",
"the",
"API",
"params",
"from",
"the",
"config",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L86-L101 | [
"def",
"_get_api_params",
"(",
"api_url",
"=",
"None",
",",
"page_id",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"api_version",
"=",
"None",
")",
":",
"statuspage_cfg",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'statuspage'",
")",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _validate_api_params | Validate the API params as specified in the config file. | salt/modules/statuspage.py | def _validate_api_params(params):
'''
Validate the API params as specified in the config file.
'''
# page_id and API key are mandatory and they must be string/unicode
return (isinstance(params['api_page_id'], (six.string_types, six.text_type)) and
isinstance(params['api_key'], (six.strin... | def _validate_api_params(params):
'''
Validate the API params as specified in the config file.
'''
# page_id and API key are mandatory and they must be string/unicode
return (isinstance(params['api_page_id'], (six.string_types, six.text_type)) and
isinstance(params['api_key'], (six.strin... | [
"Validate",
"the",
"API",
"params",
"as",
"specified",
"in",
"the",
"config",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L104-L110 | [
"def",
"_validate_api_params",
"(",
"params",
")",
":",
"# page_id and API key are mandatory and they must be string/unicode",
"return",
"(",
"isinstance",
"(",
"params",
"[",
"'api_page_id'",
"]",
",",
"(",
"six",
".",
"string_types",
",",
"six",
".",
"text_type",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _http_request | Make the HTTP request and return the body as python object. | salt/modules/statuspage.py | def _http_request(url,
method='GET',
headers=None,
data=None):
'''
Make the HTTP request and return the body as python object.
'''
req = requests.request(method,
url,
headers=headers,
... | def _http_request(url,
method='GET',
headers=None,
data=None):
'''
Make the HTTP request and return the body as python object.
'''
req = requests.request(method,
url,
headers=headers,
... | [
"Make",
"the",
"HTTP",
"request",
"and",
"return",
"the",
"body",
"as",
"python",
"object",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L122-L144 | [
"def",
"_http_request",
"(",
"url",
",",
"method",
"=",
"'GET'",
",",
"headers",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"req",
"=",
"requests",
".",
"request",
"(",
"method",
",",
"url",
",",
"headers",
"=",
"headers",
",",
"data",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | retrieve | Retrieve a specific endpoint from the Statuspage API.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be specified in the config file.
api_key
API key. Can also be specified in the config file.
api_version: 1
API version. Can also be specifi... | salt/modules/statuspage.py | def retrieve(endpoint='incidents',
api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Retrieve a specific endpoint from the Statuspage API.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be sp... | def retrieve(endpoint='incidents',
api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Retrieve a specific endpoint from the Statuspage API.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be sp... | [
"Retrieve",
"a",
"specific",
"endpoint",
"from",
"the",
"Statuspage",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L246-L378 | [
"def",
"retrieve",
"(",
"endpoint",
"=",
"'incidents'",
",",
"api_url",
"=",
"None",
",",
"page_id",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"api_version",
"=",
"None",
")",
":",
"params",
"=",
"_get_api_params",
"(",
"api_url",
"=",
"api_url",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update | Update attribute(s) of a specific endpoint.
id
The unique ID of the enpoint entry.
endpoint: incidents
Endpoint name.
page_id
Page ID. Can also be specified in the config file.
api_key
API key. Can also be specified in the config file.
api_version: 1
API ... | salt/modules/statuspage.py | def update(endpoint='incidents',
id=None,
api_url=None,
page_id=None,
api_key=None,
api_version=None,
**kwargs):
'''
Update attribute(s) of a specific endpoint.
id
The unique ID of the enpoint entry.
endpoint: incidents
... | def update(endpoint='incidents',
id=None,
api_url=None,
page_id=None,
api_key=None,
api_version=None,
**kwargs):
'''
Update attribute(s) of a specific endpoint.
id
The unique ID of the enpoint entry.
endpoint: incidents
... | [
"Update",
"attribute",
"(",
"s",
")",
"of",
"a",
"specific",
"endpoint",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L381-L483 | [
"def",
"update",
"(",
"endpoint",
"=",
"'incidents'",
",",
"id",
"=",
"None",
",",
"api_url",
"=",
"None",
",",
"page_id",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"api_version",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"endpoint_sg",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Remove an entry from an endpoint.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be specified in the config file.
api_key
API key. Can also be specified in the config file.
api_version: 1
API version. Can also be specified in the config fil... | salt/modules/statuspage.py | def delete(endpoint='incidents',
id=None,
api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Remove an entry from an endpoint.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be specified in... | def delete(endpoint='incidents',
id=None,
api_url=None,
page_id=None,
api_key=None,
api_version=None):
'''
Remove an entry from an endpoint.
endpoint: incidents
Request a specific endpoint.
page_id
Page ID. Can also be specified in... | [
"Remove",
"an",
"entry",
"from",
"an",
"endpoint",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L486-L556 | [
"def",
"delete",
"(",
"endpoint",
"=",
"'incidents'",
",",
"id",
"=",
"None",
",",
"api_url",
"=",
"None",
",",
"page_id",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"api_version",
"=",
"None",
")",
":",
"params",
"=",
"_get_api_params",
"(",
"api_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_repo_options | Return a list of tuples to seed the "env" list, which is used to set
environment variables for any pkg_add commands that are spawned.
If ``fromrepo`` or ``packagesite`` are None, then their corresponding
config parameter will be looked up with config.get.
If both ``fromrepo`` and ``packagesite`` are N... | salt/modules/freebsdpkg.py | def _get_repo_options(fromrepo=None, packagesite=None):
'''
Return a list of tuples to seed the "env" list, which is used to set
environment variables for any pkg_add commands that are spawned.
If ``fromrepo`` or ``packagesite`` are None, then their corresponding
config parameter will be looked up ... | def _get_repo_options(fromrepo=None, packagesite=None):
'''
Return a list of tuples to seed the "env" list, which is used to set
environment variables for any pkg_add commands that are spawned.
If ``fromrepo`` or ``packagesite`` are None, then their corresponding
config parameter will be looked up ... | [
"Return",
"a",
"list",
"of",
"tuples",
"to",
"seed",
"the",
"env",
"list",
"which",
"is",
"used",
"to",
"set",
"environment",
"variables",
"for",
"any",
"pkg_add",
"commands",
"that",
"are",
"spawned",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L113-L135 | [
"def",
"_get_repo_options",
"(",
"fromrepo",
"=",
"None",
",",
"packagesite",
"=",
"None",
")",
":",
"root",
"=",
"fromrepo",
"if",
"fromrepo",
"is",
"not",
"None",
"else",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'freebsdpkg.PACKAGEROOT'",
",",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _match | Since pkg_delete requires the full "pkgname-version" string, this function
will attempt to match the package name with its version. Returns a list of
partial matches and package names that match the "pkgname-version" string
required by pkg_delete, and a list of errors encountered. | salt/modules/freebsdpkg.py | def _match(names):
'''
Since pkg_delete requires the full "pkgname-version" string, this function
will attempt to match the package name with its version. Returns a list of
partial matches and package names that match the "pkgname-version" string
required by pkg_delete, and a list of errors encounte... | def _match(names):
'''
Since pkg_delete requires the full "pkgname-version" string, this function
will attempt to match the package name with its version. Returns a list of
partial matches and package names that match the "pkgname-version" string
required by pkg_delete, and a list of errors encounte... | [
"Since",
"pkg_delete",
"requires",
"the",
"full",
"pkgname",
"-",
"version",
"string",
"this",
"function",
"will",
"attempt",
"to",
"match",
"the",
"package",
"name",
"with",
"its",
"version",
".",
"Returns",
"a",
"list",
"of",
"partial",
"matches",
"and",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L138-L184 | [
"def",
"_match",
"(",
"names",
")",
":",
"pkgs",
"=",
"list_pkgs",
"(",
"versions_as_list",
"=",
"True",
")",
"errors",
"=",
"[",
"]",
"# Look for full matches",
"full_pkg_strings",
"=",
"[",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the packages currently installed as a dict::
{'<package_name>': '<version>'}
with_origin : False
Return a nested dictionary containing both the origin name and version
for each installed package.
.. versionadded:: 2014.1.0
CLI Example:
.. code-block:: bash
... | salt/modules/freebsdpkg.py | def list_pkgs(versions_as_list=False, with_origin=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
with_origin : False
Return a nested dictionary containing both the origin name and version
for each installed package.
... | def list_pkgs(versions_as_list=False, with_origin=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
with_origin : False
Return a nested dictionary containing both the origin name and version
for each installed package.
... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L257-L319 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"with_origin",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# not yet implemented or ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | Install package(s) using ``pkg_add(1)``
name
The name of the package to be installed.
refresh
Whether or not to refresh the package database before installing.
fromrepo or packageroot
Specify a package repository from which to install. Overrides the
system default, as well... | salt/modules/freebsdpkg.py | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
**kwargs):
'''
Install package(s) using ``pkg_add(1)``
name
The name of the package to be installed.
refresh
Whether or not to refresh the package d... | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
**kwargs):
'''
Install package(s) using ``pkg_add(1)``
name
The name of the package to be installed.
refresh
Whether or not to refresh the package d... | [
"Install",
"package",
"(",
"s",
")",
"using",
"pkg_add",
"(",
"1",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L322-L425 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
",",
"pkg_type",
"=",
"__sal... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | Remove packages using ``pkg_delete(1)``
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this option is passed.
.. versionadded:: 0.16.0
R... | salt/modules/freebsdpkg.py | def remove(name=None, pkgs=None, **kwargs):
'''
Remove packages using ``pkg_delete(1)``
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this... | def remove(name=None, pkgs=None, **kwargs):
'''
Remove packages using ``pkg_delete(1)``
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this... | [
"Remove",
"packages",
"using",
"pkg_delete",
"(",
"1",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L428-L487 | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
")",
"[",
"0",
"]",
"except",
"Mini... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_dict | List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the
system's package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfi... | salt/modules/freebsdpkg.py | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the
system's package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list h... | def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the
system's package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list h... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
"grouped",
"by",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L528-L569 | [
"def",
"file_dict",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"files",
"=",
"{",
"}",
"if",
"packages",
":",
"match_pattern",
"=",
"'\\'{0}-[0-9]*\\''",
"cmd",
"=",
"[",
"'pkg_info'",
",",
"'-QL'",
"]",
"+",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | namespaced_function | Redefine (clone) a function under a different globals() namespace scope
preserve_context:
Allow keeping the context taken from orignal namespace,
and extend it with globals() taken from
new targetted namespace. | salt/utils/functools.py | def namespaced_function(function, global_dict, defaults=None, preserve_context=False):
'''
Redefine (clone) a function under a different globals() namespace scope
preserve_context:
Allow keeping the context taken from orignal namespace,
and extend it with globals() taken from
... | def namespaced_function(function, global_dict, defaults=None, preserve_context=False):
'''
Redefine (clone) a function under a different globals() namespace scope
preserve_context:
Allow keeping the context taken from orignal namespace,
and extend it with globals() taken from
... | [
"Redefine",
"(",
"clone",
")",
"a",
"function",
"under",
"a",
"different",
"globals",
"()",
"namespace",
"scope"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/functools.py#L15-L39 | [
"def",
"namespaced_function",
"(",
"function",
",",
"global_dict",
",",
"defaults",
"=",
"None",
",",
"preserve_context",
"=",
"False",
")",
":",
"if",
"defaults",
"is",
"None",
":",
"defaults",
"=",
"function",
".",
"__defaults__",
"if",
"preserve_context",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_function | Copy a function | salt/utils/functools.py | def alias_function(fun, name, doc=None):
'''
Copy a function
'''
alias_fun = types.FunctionType(fun.__code__,
fun.__globals__,
str(name), # future lint: disable=blacklisted-function
fun.__defaults__... | def alias_function(fun, name, doc=None):
'''
Copy a function
'''
alias_fun = types.FunctionType(fun.__code__,
fun.__globals__,
str(name), # future lint: disable=blacklisted-function
fun.__defaults__... | [
"Copy",
"a",
"function"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/functools.py#L42-L61 | [
"def",
"alias_function",
"(",
"fun",
",",
"name",
",",
"doc",
"=",
"None",
")",
":",
"alias_fun",
"=",
"types",
".",
"FunctionType",
"(",
"fun",
".",
"__code__",
",",
"fun",
".",
"__globals__",
",",
"str",
"(",
"name",
")",
",",
"# future lint: disable=b... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dns_exists | Configure the DNS server list in the specified interface
Example:
.. code-block:: yaml
config_dns_servers:
win_dns_client.dns_exists:
- replace: True #remove any servers not in the "servers" list, default is False
- servers:
- 8.8.8.8
- 8.... | salt/states/win_dns_client.py | def dns_exists(name, servers=None, interface='Local Area Connection', replace=False):
'''
Configure the DNS server list in the specified interface
Example:
.. code-block:: yaml
config_dns_servers:
win_dns_client.dns_exists:
- replace: True #remove any servers not in the ... | def dns_exists(name, servers=None, interface='Local Area Connection', replace=False):
'''
Configure the DNS server list in the specified interface
Example:
.. code-block:: yaml
config_dns_servers:
win_dns_client.dns_exists:
- replace: True #remove any servers not in the ... | [
"Configure",
"the",
"DNS",
"server",
"list",
"in",
"the",
"specified",
"interface"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_dns_client.py#L15-L93 | [
"def",
"dns_exists",
"(",
"name",
",",
"servers",
"=",
"None",
",",
"interface",
"=",
"'Local Area Connection'",
",",
"replace",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dns_dhcp | Configure the DNS server list from DHCP Server | salt/states/win_dns_client.py | def dns_dhcp(name, interface='Local Area Connection'):
'''
Configure the DNS server list from DHCP Server
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
# Check the config
config = __salt__['win_dns_client.get_dns_config'](interface)
... | def dns_dhcp(name, interface='Local Area Connection'):
'''
Configure the DNS server list from DHCP Server
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
# Check the config
config = __salt__['win_dns_client.get_dns_config'](interface)
... | [
"Configure",
"the",
"DNS",
"server",
"list",
"from",
"DHCP",
"Server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_dns_client.py#L96-L126 | [
"def",
"dns_dhcp",
"(",
"name",
",",
"interface",
"=",
"'Local Area Connection'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"# Check the config",
"co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | primary_suffix | .. versionadded:: 2014.7.0
Configure the global primary DNS suffix of a DHCP client.
suffix : None
The suffix which is advertised for this client when acquiring a DHCP lease
When none is set, the explicitly configured DNS suffix will be removed.
updates : False
Allow syncing the D... | salt/states/win_dns_client.py | def primary_suffix(name,
suffix=None,
updates=False):
'''
.. versionadded:: 2014.7.0
Configure the global primary DNS suffix of a DHCP client.
suffix : None
The suffix which is advertised for this client when acquiring a DHCP lease
When none is set, the explicitly confi... | def primary_suffix(name,
suffix=None,
updates=False):
'''
.. versionadded:: 2014.7.0
Configure the global primary DNS suffix of a DHCP client.
suffix : None
The suffix which is advertised for this client when acquiring a DHCP lease
When none is set, the explicitly confi... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_dns_client.py#L129-L254 | [
"def",
"primary_suffix",
"(",
"name",
",",
"suffix",
"=",
"None",
",",
"updates",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"'No changes needed'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | insert | .. versionadded:: 2014.1.0
Insert a rule into a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain that should be modified
family
Networking family, either i... | salt/states/iptables.py | def insert(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Insert a rule into a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain ... | def insert(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Insert a rule into a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain ... | [
"..",
"versionadded",
"::",
"2014",
".",
"1",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/iptables.py#L489-L614 | [
"def",
"insert",
"(",
"name",
",",
"table",
"=",
"'filter'",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | .. versionadded:: 2014.1.0
Delete a rule to a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain that should be modified
family
Networking family, either ipv... | salt/states/iptables.py | def delete(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Delete a rule to a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain th... | def delete(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Delete a rule to a chain
name
A user-defined name to call this rule by in another part of a state or
formula. This should not be an actual rule.
table
The table that owns the chain th... | [
"..",
"versionadded",
"::",
"2014",
".",
"1",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/iptables.py#L617-L732 | [
"def",
"delete",
"(",
"name",
",",
"table",
"=",
"'filter'",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_policy | .. versionadded:: 2014.1.0
Sets the default policy for iptables firewall tables
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6
policy
The requested table policy | salt/states/iptables.py | def set_policy(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Sets the default policy for iptables firewall tables
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6
policy
The requ... | def set_policy(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Sets the default policy for iptables firewall tables
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6
policy
The requ... | [
"..",
"versionadded",
"::",
"2014",
".",
"1",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/iptables.py#L735-L800 | [
"def",
"set_policy",
"(",
"name",
",",
"table",
"=",
"'filter'",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flush | .. versionadded:: 2014.1.0
Flush current iptables state
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6 | salt/states/iptables.py | def flush(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Flush current iptables state
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {... | def flush(name, table='filter', family='ipv4', **kwargs):
'''
.. versionadded:: 2014.1.0
Flush current iptables state
table
The table that owns the chain that should be modified
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {... | [
"..",
"versionadded",
"::",
"2014",
".",
"1",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/iptables.py#L803-L845 | [
"def",
"flush",
"(",
"name",
",",
"table",
"=",
"'filter'",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_aggregate | The mod_aggregate function which looks up all rules in the available
low chunks and merges them into a single rules ref in the present low data | salt/states/iptables.py | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all rules in the available
low chunks and merges them into a single rules ref in the present low data
'''
rules = []
agg_enabled = [
'append',
'insert',
]
if low.get('fun') not ... | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all rules in the available
low chunks and merges them into a single rules ref in the present low data
'''
rules = []
agg_enabled = [
'append',
'insert',
]
if low.get('fun') not ... | [
"The",
"mod_aggregate",
"function",
"which",
"looks",
"up",
"all",
"rules",
"in",
"the",
"available",
"low",
"chunks",
"and",
"merges",
"them",
"into",
"a",
"single",
"rules",
"ref",
"in",
"the",
"present",
"low",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/iptables.py#L848-L881 | [
"def",
"mod_aggregate",
"(",
"low",
",",
"chunks",
",",
"running",
")",
":",
"rules",
"=",
"[",
"]",
"agg_enabled",
"=",
"[",
"'append'",
",",
"'insert'",
",",
"]",
"if",
"low",
".",
"get",
"(",
"'fun'",
")",
"not",
"in",
"agg_enabled",
":",
"return"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | beacon | Monitor the memory usage of the minion
Specify thresholds for percent used and only emit a beacon
if it is exceeded.
.. code-block:: yaml
beacons:
memusage:
- percent: 63% | salt/beacons/memusage.py | def beacon(config):
'''
Monitor the memory usage of the minion
Specify thresholds for percent used and only emit a beacon
if it is exceeded.
.. code-block:: yaml
beacons:
memusage:
- percent: 63%
'''
ret = []
_config = {}
list(map(_config.update, con... | def beacon(config):
'''
Monitor the memory usage of the minion
Specify thresholds for percent used and only emit a beacon
if it is exceeded.
.. code-block:: yaml
beacons:
memusage:
- percent: 63%
'''
ret = []
_config = {}
list(map(_config.update, con... | [
"Monitor",
"the",
"memory",
"usage",
"of",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/memusage.py#L54-L81 | [
"def",
"beacon",
"(",
"config",
")",
":",
"ret",
"=",
"[",
"]",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"_current_usage",
"=",
"psutil",
".",
"virtual_memory",
"(",
")",
"current_usage",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltFunctionDocumenter.format_name | Format the function name | doc/_ext/saltautodoc.py | def format_name(self):
'''
Format the function name
'''
if not hasattr(self.module, '__func_alias__'):
# Resume normal sphinx.ext.autodoc operation
return super(FunctionDocumenter, self).format_name()
if not self.objpath:
# Resume normal sphin... | def format_name(self):
'''
Format the function name
'''
if not hasattr(self.module, '__func_alias__'):
# Resume normal sphinx.ext.autodoc operation
return super(FunctionDocumenter, self).format_name()
if not self.objpath:
# Resume normal sphin... | [
"Format",
"the",
"function",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/doc/_ext/saltautodoc.py#L22-L39 | [
"def",
"format_name",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
".",
"module",
",",
"'__func_alias__'",
")",
":",
"# Resume normal sphinx.ext.autodoc operation",
"return",
"super",
"(",
"FunctionDocumenter",
",",
"self",
")",
".",
"format_name",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | managed | Manage NTP servers
servers
A list of NTP servers | salt/states/ntp.py | def managed(name, servers=None):
'''
Manage NTP servers
servers
A list of NTP servers
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': 'NTP servers already configured as specified'}
if not _check_servers(servers):
ret['result']... | def managed(name, servers=None):
'''
Manage NTP servers
servers
A list of NTP servers
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': 'NTP servers already configured as specified'}
if not _check_servers(servers):
ret['result']... | [
"Manage",
"NTP",
"servers"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ntp.py#L58-L100 | [
"def",
"managed",
"(",
"name",
",",
"servers",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"'NTP servers already configured as specified'",
"}",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _iptables_cmd | Return correct command based on the family, e.g. ipv4 or ipv6 | salt/modules/iptables.py | def _iptables_cmd(family='ipv4'):
'''
Return correct command based on the family, e.g. ipv4 or ipv6
'''
if family == 'ipv6':
return salt.utils.path.which('ip6tables')
else:
return salt.utils.path.which('iptables') | def _iptables_cmd(family='ipv4'):
'''
Return correct command based on the family, e.g. ipv4 or ipv6
'''
if family == 'ipv6':
return salt.utils.path.which('ip6tables')
else:
return salt.utils.path.which('iptables') | [
"Return",
"correct",
"command",
"based",
"on",
"the",
"family",
"e",
".",
"g",
".",
"ipv4",
"or",
"ipv6"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L59-L66 | [
"def",
"_iptables_cmd",
"(",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"family",
"==",
"'ipv6'",
":",
"return",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'ip6tables'",
")",
"else",
":",
"return",
"salt",
".",
"utils",
".",
"path",
".",
"w... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _has_option | Return truth of whether iptables has `option`. For example:
.. code-block:: python
_has_option('--wait')
_has_option('--check', family='ipv6') | salt/modules/iptables.py | def _has_option(option, family='ipv4'):
'''
Return truth of whether iptables has `option`. For example:
.. code-block:: python
_has_option('--wait')
_has_option('--check', family='ipv6')
'''
cmd = '{0} --help'.format(_iptables_cmd(family))
if option in __salt__['cmd.run'](cmd,... | def _has_option(option, family='ipv4'):
'''
Return truth of whether iptables has `option`. For example:
.. code-block:: python
_has_option('--wait')
_has_option('--check', family='ipv6')
'''
cmd = '{0} --help'.format(_iptables_cmd(family))
if option in __salt__['cmd.run'](cmd,... | [
"Return",
"truth",
"of",
"whether",
"iptables",
"has",
"option",
".",
"For",
"example",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L69-L81 | [
"def",
"_has_option",
"(",
"option",
",",
"family",
"=",
"'ipv4'",
")",
":",
"cmd",
"=",
"'{0} --help'",
".",
"format",
"(",
"_iptables_cmd",
"(",
"family",
")",
")",
"if",
"option",
"in",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"output_logle... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _conf | Some distros have a specific location for config files | salt/modules/iptables.py | def _conf(family='ipv4'):
'''
Some distros have a specific location for config files
'''
if __grains__['os_family'] == 'RedHat':
if family == 'ipv6':
return '/etc/sysconfig/ip6tables'
else:
return '/etc/sysconfig/iptables'
elif __grains__['os_family'] == 'Arch... | def _conf(family='ipv4'):
'''
Some distros have a specific location for config files
'''
if __grains__['os_family'] == 'RedHat':
if family == 'ipv6':
return '/etc/sysconfig/ip6tables'
else:
return '/etc/sysconfig/iptables'
elif __grains__['os_family'] == 'Arch... | [
"Some",
"distros",
"have",
"a",
"specific",
"location",
"for",
"config",
"files"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L84-L124 | [
"def",
"_conf",
"(",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"__grains__",
"[",
"'os_family'",
"]",
"==",
"'RedHat'",
":",
"if",
"family",
"==",
"'ipv6'",
":",
"return",
"'/etc/sysconfig/ip6tables'",
"else",
":",
"return",
"'/etc/sysconfig/iptables'",
"elif",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _regex_iptables_save | Return string with `save_filter` regex entries removed. For example:
If `filters` is not provided, it will be pulled from minion config,
minion grains, minion pillar, or master config. Default return value
if no filters found is the original cmd_output string.
.. code-block:: python
_regex_i... | salt/modules/iptables.py | def _regex_iptables_save(cmd_output, filters=None):
'''
Return string with `save_filter` regex entries removed. For example:
If `filters` is not provided, it will be pulled from minion config,
minion grains, minion pillar, or master config. Default return value
if no filters found is the original ... | def _regex_iptables_save(cmd_output, filters=None):
'''
Return string with `save_filter` regex entries removed. For example:
If `filters` is not provided, it will be pulled from minion config,
minion grains, minion pillar, or master config. Default return value
if no filters found is the original ... | [
"Return",
"string",
"with",
"save_filter",
"regex",
"entries",
"removed",
".",
"For",
"example",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L142-L174 | [
"def",
"_regex_iptables_save",
"(",
"cmd_output",
",",
"filters",
"=",
"None",
")",
":",
"# grab RE compiled filters from context for performance",
"if",
"'iptables.save_filters'",
"not",
"in",
"__context__",
":",
"__context__",
"[",
"'iptables.save_filters'",
"]",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | Return version from iptables --version
CLI Example:
.. code-block:: bash
salt '*' iptables.version
IPv6:
salt '*' iptables.version family=ipv6 | salt/modules/iptables.py | def version(family='ipv4'):
'''
Return version from iptables --version
CLI Example:
.. code-block:: bash
salt '*' iptables.version
IPv6:
salt '*' iptables.version family=ipv6
'''
cmd = '{0} --version' . format(_iptables_cmd(family))
out = __salt__['cmd.run'](cmd).... | def version(family='ipv4'):
'''
Return version from iptables --version
CLI Example:
.. code-block:: bash
salt '*' iptables.version
IPv6:
salt '*' iptables.version family=ipv6
'''
cmd = '{0} --version' . format(_iptables_cmd(family))
out = __salt__['cmd.run'](cmd).... | [
"Return",
"version",
"from",
"iptables",
"--",
"version"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L177-L192 | [
"def",
"version",
"(",
"family",
"=",
"'ipv4'",
")",
":",
"cmd",
"=",
"'{0} --version'",
".",
"format",
"(",
"_iptables_cmd",
"(",
"family",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"split",
"(",
")",
"return",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | build_rule | Build a well-formatted iptables rule based on kwargs. A `table` and `chain`
are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are required.
`command` may be specified as either a short option ('I') or a long option
(`--insert`). This will return the iptab... | salt/modules/iptables.py | def build_rule(table='filter', chain=None, command=None, position='', full=None, family='ipv4',
**kwargs):
'''
Build a well-formatted iptables rule based on kwargs. A `table` and `chain`
are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are... | def build_rule(table='filter', chain=None, command=None, position='', full=None, family='ipv4',
**kwargs):
'''
Build a well-formatted iptables rule based on kwargs. A `table` and `chain`
are not required, unless `full` is True.
If `full` is `True`, then `table`, `chain` and `command` are... | [
"Build",
"a",
"well",
"-",
"formatted",
"iptables",
"rule",
"based",
"on",
"kwargs",
".",
"A",
"table",
"and",
"chain",
"are",
"not",
"required",
"unless",
"full",
"is",
"True",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L195-L545 | [
"def",
"build_rule",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"None",
",",
"command",
"=",
"None",
",",
"position",
"=",
"''",
",",
"full",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'target'",
"in... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_saved_policy | Return the current policy for the specified table/chain
CLI Examples:
.. code-block:: bash
salt '*' iptables.get_saved_policy filter INPUT
salt '*' iptables.get_saved_policy filter INPUT \\
conf_file=/etc/iptables.saved
IPv6:
salt '*' iptables.get_saved_policy fil... | salt/modules/iptables.py | def get_saved_policy(table='filter', chain=None, conf_file=None, family='ipv4'):
'''
Return the current policy for the specified table/chain
CLI Examples:
.. code-block:: bash
salt '*' iptables.get_saved_policy filter INPUT
salt '*' iptables.get_saved_policy filter INPUT \\
... | def get_saved_policy(table='filter', chain=None, conf_file=None, family='ipv4'):
'''
Return the current policy for the specified table/chain
CLI Examples:
.. code-block:: bash
salt '*' iptables.get_saved_policy filter INPUT
salt '*' iptables.get_saved_policy filter INPUT \\
... | [
"Return",
"the",
"current",
"policy",
"for",
"the",
"specified",
"table",
"/",
"chain"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/iptables.py#L581-L606 | [
"def",
"get_saved_policy",
"(",
"table",
"=",
"'filter'",
",",
"chain",
"=",
"None",
",",
"conf_file",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"not",
"chain",
":",
"return",
"'Error: Chain needs to be specified'",
"rules",
"=",
"_parse_conf"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.