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 | match | Runs the compound target check | salt/matchers/compound_match.py | def match(tgt, opts=None):
'''
Runs the compound target check
'''
if not opts:
opts = __opts__
nodegroups = opts.get('nodegroups', {})
matchers = salt.loader.matchers(opts)
if not isinstance(tgt, six.string_types) and not isinstance(tgt, (list, tuple)):
log.error('Compound t... | def match(tgt, opts=None):
'''
Runs the compound target check
'''
if not opts:
opts = __opts__
nodegroups = opts.get('nodegroups', {})
matchers = salt.loader.matchers(opts)
if not isinstance(tgt, six.string_types) and not isinstance(tgt, (list, tuple)):
log.error('Compound t... | [
"Runs",
"the",
"compound",
"target",
"check"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/compound_match.py#L22-L114 | [
"def",
"match",
"(",
"tgt",
",",
"opts",
"=",
"None",
")",
":",
"if",
"not",
"opts",
":",
"opts",
"=",
"__opts__",
"nodegroups",
"=",
"opts",
".",
"get",
"(",
"'nodegroups'",
",",
"{",
"}",
")",
"matchers",
"=",
"salt",
".",
"loader",
".",
"matcher... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | config | Ensure that the marathon app with the given id is present and is configured
to match the given config values.
:param name: The app name/id
:param config: The configuration to apply (dict)
:return: A standard Salt changes dictionary | salt/states/marathon_app.py | def config(name, config):
'''
Ensure that the marathon app with the given id is present and is configured
to match the given config values.
:param name: The app name/id
:param config: The configuration to apply (dict)
:return: A standard Salt changes dictionary
'''
# setup return struct... | def config(name, config):
'''
Ensure that the marathon app with the given id is present and is configured
to match the given config values.
:param name: The app name/id
:param config: The configuration to apply (dict)
:return: A standard Salt changes dictionary
'''
# setup return struct... | [
"Ensure",
"that",
"the",
"marathon",
"app",
"with",
"the",
"given",
"id",
"is",
"present",
"and",
"is",
"configured",
"to",
"match",
"the",
"given",
"config",
"values",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/marathon_app.py#L27-L89 | [
"def",
"config",
"(",
"name",
",",
"config",
")",
":",
"# setup return structure",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"}",
"# get existing config if app ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | running | Ensure that the marathon app with the given id is present and restart if set.
:param name: The app name/id
:param restart: Restart the app
:param force: Override the current deployment
:return: A standard Salt changes dictionary | salt/states/marathon_app.py | def running(name, restart=False, force=True):
'''
Ensure that the marathon app with the given id is present and restart if set.
:param name: The app name/id
:param restart: Restart the app
:param force: Override the current deployment
:return: A standard Salt changes dictionary
'''
ret ... | def running(name, restart=False, force=True):
'''
Ensure that the marathon app with the given id is present and restart if set.
:param name: The app name/id
:param restart: Restart the app
:param force: Override the current deployment
:return: A standard Salt changes dictionary
'''
ret ... | [
"Ensure",
"that",
"the",
"marathon",
"app",
"with",
"the",
"given",
"id",
"is",
"present",
"and",
"restart",
"if",
"set",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/marathon_app.py#L122-L157 | [
"def",
"running",
"(",
"name",
",",
"restart",
"=",
"False",
",",
"force",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"if",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure cloud formation stack is present.
name (string) - Name of the stack.
template_body (string) – Structure containing the template body. Can also be loaded from a file by using salt://.
template_url (string) – Location of file containing the template body. The URL must point to a template located in
... | salt/states/boto_cfn.py | def present(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None,
timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None,
stack_policy_url=None, use_previous_template=None, stack_policy_during_update_b... | def present(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None,
timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None,
stack_policy_url=None, use_previous_template=None, stack_policy_during_update_b... | [
"Ensure",
"cloud",
"formation",
"stack",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cfn.py#L75-L203 | [
"def",
"present",
"(",
"name",
",",
"template_body",
"=",
"None",
",",
"template_url",
"=",
"None",
",",
"parameters",
"=",
"None",
",",
"notification_arns",
"=",
"None",
",",
"disable_rollback",
"=",
"None",
",",
"timeout_in_minutes",
"=",
"None",
",",
"cap... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure cloud formation stack is absent.
name (string) – The name of the stack to delete.
region (string) - Region to connect to.
key (string) - Secret key to be used.
keyid (string) - Access key to be used.
profile (dict) - A dict with region, key and keyid, or a pillar key (string) that contai... | salt/states/boto_cfn.py | def absent(name, region=None, key=None, keyid=None, profile=None):
'''
Ensure cloud formation stack is absent.
name (string) – The name of the stack to delete.
region (string) - Region to connect to.
key (string) - Secret key to be used.
keyid (string) - Access key to be used.
profile (... | def absent(name, region=None, key=None, keyid=None, profile=None):
'''
Ensure cloud formation stack is absent.
name (string) – The name of the stack to delete.
region (string) - Region to connect to.
key (string) - Secret key to be used.
keyid (string) - Access key to be used.
profile (... | [
"Ensure",
"cloud",
"formation",
"stack",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cfn.py#L206-L240 | [
"def",
"absent",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that given continuous query is present.
name
Name of the continuous query to create.
database
Database to create continuous query on.
query
The query content
resample_time : None
Duration between continuous query resampling.
coverage_period : None
... | salt/states/influxdb_continuous_query.py | def present(name, database, query, resample_time=None, coverage_period=None, **client_args):
'''
Ensure that given continuous query is present.
name
Name of the continuous query to create.
database
Database to create continuous query on.
query
The query content
resamp... | def present(name, database, query, resample_time=None, coverage_period=None, **client_args):
'''
Ensure that given continuous query is present.
name
Name of the continuous query to create.
database
Database to create continuous query on.
query
The query content
resamp... | [
"Ensure",
"that",
"given",
"continuous",
"query",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_continuous_query.py#L24-L69 | [
"def",
"present",
"(",
"name",
",",
"database",
",",
"query",
",",
"resample_time",
"=",
"None",
",",
"coverage_period",
"=",
"None",
",",
"*",
"*",
"client_args",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | system | Set the timezone for the system.
name
The name of the timezone to use (e.g.: America/Denver)
utc
Whether or not to set the hardware clock to UTC (default is True) | salt/states/timezone.py | def system(name, utc=True):
'''
Set the timezone for the system.
name
The name of the timezone to use (e.g.: America/Denver)
utc
Whether or not to set the hardware clock to UTC (default is True)
'''
ret = {'name': name,
'changes': {},
'result': None,
... | def system(name, utc=True):
'''
Set the timezone for the system.
name
The name of the timezone to use (e.g.: America/Denver)
utc
Whether or not to set the hardware clock to UTC (default is True)
'''
ret = {'name': name,
'changes': {},
'result': None,
... | [
"Set",
"the",
"timezone",
"for",
"the",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/timezone.py#L43-L127 | [
"def",
"system",
"(",
"name",
",",
"utc",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"# Set up metadata",
"do_utc",
"=",
"False",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _auth | Set up nova credentials | salt/modules/nova.py | def _auth(profile=None, **kwargs):
'''
Set up nova credentials
'''
keystone_api_args = None
if kwargs is not None:
if kwargs.get('keystone_api_args') is not None:
keystone_api_args = kwargs['keystone_api_args']
if profile:
credentials = __salt__['config.option'](prof... | def _auth(profile=None, **kwargs):
'''
Set up nova credentials
'''
keystone_api_args = None
if kwargs is not None:
if kwargs.get('keystone_api_args') is not None:
keystone_api_args = kwargs['keystone_api_args']
if profile:
credentials = __salt__['config.option'](prof... | [
"Set",
"up",
"nova",
"credentials"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L124-L210 | [
"def",
"_auth",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"keystone_api_args",
"=",
"None",
"if",
"kwargs",
"is",
"not",
"None",
":",
"if",
"kwargs",
".",
"get",
"(",
"'keystone_api_args'",
")",
"is",
"not",
"None",
":",
"keystone... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | boot | Boot (create) a new instance
name
Name of the new instance (must be first)
flavor_id
Unique integer ID for the flavor
image_id
Unique integer ID for the image
timeout
How long to wait, after creating the instance, for the provider to
return information about i... | salt/modules/nova.py | def boot(name, flavor_id=0, image_id=0, profile=None, timeout=300, **kwargs):
'''
Boot (create) a new instance
name
Name of the new instance (must be first)
flavor_id
Unique integer ID for the flavor
image_id
Unique integer ID for the image
timeout
How long to... | def boot(name, flavor_id=0, image_id=0, profile=None, timeout=300, **kwargs):
'''
Boot (create) a new instance
name
Name of the new instance (must be first)
flavor_id
Unique integer ID for the flavor
image_id
Unique integer ID for the image
timeout
How long to... | [
"Boot",
"(",
"create",
")",
"a",
"new",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L213-L247 | [
"def",
"boot",
"(",
"name",
",",
"flavor_id",
"=",
"0",
",",
"image_id",
"=",
"0",
",",
"profile",
"=",
"None",
",",
"timeout",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_list | List storage volumes
search_opts
Dictionary of search options
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack | salt/modules/nova.py | def volume_list(search_opts=None, profile=None, **kwargs):
'''
List storage volumes
search_opts
Dictionary of search options
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack... | def volume_list(search_opts=None, profile=None, **kwargs):
'''
List storage volumes
search_opts
Dictionary of search options
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack... | [
"List",
"storage",
"volumes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L250-L268 | [
"def",
"volume_list",
"(",
"search_opts",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"volume_list",
"(",
"search_opts",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_show | Create a block storage volume
name
Name of the volume
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_show myblock profile=openstack | salt/modules/nova.py | def volume_show(name, profile=None, **kwargs):
'''
Create a block storage volume
name
Name of the volume
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_show myblock profile=openstack
'''
conn = _auth(profile, **kwargs)
retu... | def volume_show(name, profile=None, **kwargs):
'''
Create a block storage volume
name
Name of the volume
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_show myblock profile=openstack
'''
conn = _auth(profile, **kwargs)
retu... | [
"Create",
"a",
"block",
"storage",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L271-L289 | [
"def",
"volume_show",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"volume_show",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_create | Create a block storage volume
name
Name of the new volume (must be first)
size
Volume size
snapshot
Block storage snapshot id
voltype
Type of storage
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_cre... | salt/modules/nova.py | def volume_create(name, size=100, snapshot=None, voltype=None, profile=None, **kwargs):
'''
Create a block storage volume
name
Name of the new volume (must be first)
size
Volume size
snapshot
Block storage snapshot id
voltype
Type of storage
profile
... | def volume_create(name, size=100, snapshot=None, voltype=None, profile=None, **kwargs):
'''
Create a block storage volume
name
Name of the new volume (must be first)
size
Volume size
snapshot
Block storage snapshot id
voltype
Type of storage
profile
... | [
"Create",
"a",
"block",
"storage",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L292-L324 | [
"def",
"volume_create",
"(",
"name",
",",
"size",
"=",
"100",
",",
"snapshot",
"=",
"None",
",",
"voltype",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_delete | Destroy the volume
name
Name of the volume
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_delete myblock profile=openstack | salt/modules/nova.py | def volume_delete(name, profile=None, **kwargs):
'''
Destroy the volume
name
Name of the volume
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_delete myblock profile=openstack
'''
conn = _auth(profile, **kwargs)
return... | def volume_delete(name, profile=None, **kwargs):
'''
Destroy the volume
name
Name of the volume
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_delete myblock profile=openstack
'''
conn = _auth(profile, **kwargs)
return... | [
"Destroy",
"the",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L327-L345 | [
"def",
"volume_delete",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"volume_delete",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_detach | Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to detach from
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_detach myblock profile=openstack | salt/modules/nova.py | def volume_detach(name, profile=None, timeout=300, **kwargs):
'''
Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to detach from
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nov... | def volume_detach(name, profile=None, timeout=300, **kwargs):
'''
Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to detach from
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nov... | [
"Attach",
"a",
"block",
"storage",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L348-L372 | [
"def",
"volume_detach",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"timeout",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"volume_detach",
"(",
"name",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_attach | Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to attach to
device
Name of the device on the server
profile
Profile to build on
CLI Example:
.. code-block:: bash
salt '*' nova.volume_attach myblock... | salt/modules/nova.py | def volume_attach(name,
server_name,
device='/dev/xvdb',
profile=None,
timeout=300, **kwargs):
'''
Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to attach to
... | def volume_attach(name,
server_name,
device='/dev/xvdb',
profile=None,
timeout=300, **kwargs):
'''
Attach a block storage volume
name
Name of the new volume to attach
server_name
Name of the server to attach to
... | [
"Attach",
"a",
"block",
"storage",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L375-L409 | [
"def",
"volume_attach",
"(",
"name",
",",
"server_name",
",",
"device",
"=",
"'/dev/xvdb'",
",",
"profile",
"=",
"None",
",",
"timeout",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | suspend | Suspend an instance
instance_id
ID of the instance to be suspended
CLI Example:
.. code-block:: bash
salt '*' nova.suspend 1138 | salt/modules/nova.py | def suspend(instance_id, profile=None, **kwargs):
'''
Suspend an instance
instance_id
ID of the instance to be suspended
CLI Example:
.. code-block:: bash
salt '*' nova.suspend 1138
'''
conn = _auth(profile, **kwargs)
return conn.suspend(instance_id) | def suspend(instance_id, profile=None, **kwargs):
'''
Suspend an instance
instance_id
ID of the instance to be suspended
CLI Example:
.. code-block:: bash
salt '*' nova.suspend 1138
'''
conn = _auth(profile, **kwargs)
return conn.suspend(instance_id) | [
"Suspend",
"an",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L412-L427 | [
"def",
"suspend",
"(",
"instance_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"suspend",
"(",
"instance_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resume | Resume an instance
instance_id
ID of the instance to be resumed
CLI Example:
.. code-block:: bash
salt '*' nova.resume 1138 | salt/modules/nova.py | def resume(instance_id, profile=None, **kwargs):
'''
Resume an instance
instance_id
ID of the instance to be resumed
CLI Example:
.. code-block:: bash
salt '*' nova.resume 1138
'''
conn = _auth(profile, **kwargs)
return conn.resume(instance_id) | def resume(instance_id, profile=None, **kwargs):
'''
Resume an instance
instance_id
ID of the instance to be resumed
CLI Example:
.. code-block:: bash
salt '*' nova.resume 1138
'''
conn = _auth(profile, **kwargs)
return conn.resume(instance_id) | [
"Resume",
"an",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L430-L445 | [
"def",
"resume",
"(",
"instance_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"resume",
"(",
"instance_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | lock | Lock an instance
instance_id
ID of the instance to be locked
CLI Example:
.. code-block:: bash
salt '*' nova.lock 1138 | salt/modules/nova.py | def lock(instance_id, profile=None, **kwargs):
'''
Lock an instance
instance_id
ID of the instance to be locked
CLI Example:
.. code-block:: bash
salt '*' nova.lock 1138
'''
conn = _auth(profile, **kwargs)
return conn.lock(instance_id) | def lock(instance_id, profile=None, **kwargs):
'''
Lock an instance
instance_id
ID of the instance to be locked
CLI Example:
.. code-block:: bash
salt '*' nova.lock 1138
'''
conn = _auth(profile, **kwargs)
return conn.lock(instance_id) | [
"Lock",
"an",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L448-L463 | [
"def",
"lock",
"(",
"instance_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"lock",
"(",
"instance_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete an instance
instance_id
ID of the instance to be deleted
CLI Example:
.. code-block:: bash
salt '*' nova.delete 1138 | salt/modules/nova.py | def delete(instance_id, profile=None, **kwargs):
'''
Delete an instance
instance_id
ID of the instance to be deleted
CLI Example:
.. code-block:: bash
salt '*' nova.delete 1138
'''
conn = _auth(profile, **kwargs)
return conn.delete(instance_id) | def delete(instance_id, profile=None, **kwargs):
'''
Delete an instance
instance_id
ID of the instance to be deleted
CLI Example:
.. code-block:: bash
salt '*' nova.delete 1138
'''
conn = _auth(profile, **kwargs)
return conn.delete(instance_id) | [
"Delete",
"an",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L466-L481 | [
"def",
"delete",
"(",
"instance_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"delete",
"(",
"instance_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_list | Return a list of available flavors (nova flavor-list)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_list | salt/modules/nova.py | def flavor_list(profile=None, **kwargs):
'''
Return a list of available flavors (nova flavor-list)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_list
'''
filters = kwargs.get('filter', {})
conn = _auth(profile, **kwargs)
return conn.flavor_list(**filters) | def flavor_list(profile=None, **kwargs):
'''
Return a list of available flavors (nova flavor-list)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_list
'''
filters = kwargs.get('filter', {})
conn = _auth(profile, **kwargs)
return conn.flavor_list(**filters) | [
"Return",
"a",
"list",
"of",
"available",
"flavors",
"(",
"nova",
"flavor",
"-",
"list",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L484-L496 | [
"def",
"flavor_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"filters",
"=",
"kwargs",
".",
"get",
"(",
"'filter'",
",",
"{",
"}",
")",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_create | Add a flavor to nova (nova flavor-create). The following parameters are
required:
name
Name of the new flavor (must be first)
flavor_id
Unique integer ID for the new flavor
ram
Memory size in MB
disk
Disk size in GB
vcpus
Number of vcpus
is_public
... | salt/modules/nova.py | def flavor_create(name, # pylint: disable=C0103
flavor_id=0, # pylint: disable=C0103
ram=0,
disk=0,
vcpus=1,
is_public=True,
profile=None, **kwargs):
'''
Add a flavor to nova (nova flavor-create... | def flavor_create(name, # pylint: disable=C0103
flavor_id=0, # pylint: disable=C0103
ram=0,
disk=0,
vcpus=1,
is_public=True,
profile=None, **kwargs):
'''
Add a flavor to nova (nova flavor-create... | [
"Add",
"a",
"flavor",
"to",
"nova",
"(",
"nova",
"flavor",
"-",
"create",
")",
".",
"The",
"following",
"parameters",
"are",
"required",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L499-L537 | [
"def",
"flavor_create",
"(",
"name",
",",
"# pylint: disable=C0103",
"flavor_id",
"=",
"0",
",",
"# pylint: disable=C0103",
"ram",
"=",
"0",
",",
"disk",
"=",
"0",
",",
"vcpus",
"=",
"1",
",",
"is_public",
"=",
"True",
",",
"profile",
"=",
"None",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_delete | Delete a flavor from nova by id (nova flavor-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_delete 7 | salt/modules/nova.py | def flavor_delete(flavor_id, profile=None, **kwargs): # pylint: disable=C0103
'''
Delete a flavor from nova by id (nova flavor-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_delete 7
'''
conn = _auth(profile, **kwargs)
return conn.flavor_delete(flavor_id) | def flavor_delete(flavor_id, profile=None, **kwargs): # pylint: disable=C0103
'''
Delete a flavor from nova by id (nova flavor-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_delete 7
'''
conn = _auth(profile, **kwargs)
return conn.flavor_delete(flavor_id) | [
"Delete",
"a",
"flavor",
"from",
"nova",
"by",
"id",
"(",
"nova",
"flavor",
"-",
"delete",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L540-L551 | [
"def",
"flavor_delete",
"(",
"flavor_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=C0103",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"flavor_delete",
"(",
"flavor_id... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_access_list | Return a list of project IDs assigned to flavor ID
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_list flavor_id=ID | salt/modules/nova.py | def flavor_access_list(flavor_id, profile=None, **kwargs):
'''
Return a list of project IDs assigned to flavor ID
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_list flavor_id=ID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access_list(flavor_id=flavor_id,... | def flavor_access_list(flavor_id, profile=None, **kwargs):
'''
Return a list of project IDs assigned to flavor ID
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_list flavor_id=ID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access_list(flavor_id=flavor_id,... | [
"Return",
"a",
"list",
"of",
"project",
"IDs",
"assigned",
"to",
"flavor",
"ID"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L554-L565 | [
"def",
"flavor_access_list",
"(",
"flavor_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"flavor_access_list",
"(",
"flavor_id",
"=",
"flavor... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_access_add | Add a project to the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_add flavor_id=fID project_id=pID | salt/modules/nova.py | def flavor_access_add(flavor_id, project_id, profile=None, **kwargs):
'''
Add a project to the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_add flavor_id=fID project_id=pID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access_add(flavor... | def flavor_access_add(flavor_id, project_id, profile=None, **kwargs):
'''
Add a project to the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_add flavor_id=fID project_id=pID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access_add(flavor... | [
"Add",
"a",
"project",
"to",
"the",
"flavor",
"access",
"list"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L568-L579 | [
"def",
"flavor_access_add",
"(",
"flavor_id",
",",
"project_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"flavor_access_add",
"(",
"flavor_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flavor_access_remove | Remove a project from the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_remove flavor_id=fID project_id=pID | salt/modules/nova.py | def flavor_access_remove(flavor_id, project_id, profile=None, **kwargs):
'''
Remove a project from the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_remove flavor_id=fID project_id=pID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access... | def flavor_access_remove(flavor_id, project_id, profile=None, **kwargs):
'''
Remove a project from the flavor access list
CLI Example:
.. code-block:: bash
salt '*' nova.flavor_access_remove flavor_id=fID project_id=pID
'''
conn = _auth(profile, **kwargs)
return conn.flavor_access... | [
"Remove",
"a",
"project",
"from",
"the",
"flavor",
"access",
"list"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L582-L593 | [
"def",
"flavor_access_remove",
"(",
"flavor_id",
",",
"project_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"flavor_access_remove",
"(",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | keypair_add | Add a keypair to nova (nova keypair-add)
CLI Examples:
.. code-block:: bash
salt '*' nova.keypair_add mykey pubfile='/home/myuser/.ssh/id_rsa.pub'
salt '*' nova.keypair_add mykey pubkey='ssh-rsa <key> myuser@mybox' | salt/modules/nova.py | def keypair_add(name, pubfile=None, pubkey=None, profile=None, **kwargs):
'''
Add a keypair to nova (nova keypair-add)
CLI Examples:
.. code-block:: bash
salt '*' nova.keypair_add mykey pubfile='/home/myuser/.ssh/id_rsa.pub'
salt '*' nova.keypair_add mykey pubkey='ssh-rsa <key> myuser... | def keypair_add(name, pubfile=None, pubkey=None, profile=None, **kwargs):
'''
Add a keypair to nova (nova keypair-add)
CLI Examples:
.. code-block:: bash
salt '*' nova.keypair_add mykey pubfile='/home/myuser/.ssh/id_rsa.pub'
salt '*' nova.keypair_add mykey pubkey='ssh-rsa <key> myuser... | [
"Add",
"a",
"keypair",
"to",
"nova",
"(",
"nova",
"keypair",
"-",
"add",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L610-L626 | [
"def",
"keypair_add",
"(",
"name",
",",
"pubfile",
"=",
"None",
",",
"pubkey",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | keypair_delete | Add a keypair to nova (nova keypair-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.keypair_delete mykey | salt/modules/nova.py | def keypair_delete(name, profile=None, **kwargs):
'''
Add a keypair to nova (nova keypair-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.keypair_delete mykey
'''
conn = _auth(profile, **kwargs)
return conn.keypair_delete(name) | def keypair_delete(name, profile=None, **kwargs):
'''
Add a keypair to nova (nova keypair-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.keypair_delete mykey
'''
conn = _auth(profile, **kwargs)
return conn.keypair_delete(name) | [
"Add",
"a",
"keypair",
"to",
"nova",
"(",
"nova",
"keypair",
"-",
"delete",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L629-L640 | [
"def",
"keypair_delete",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"keypair_delete",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | image_list | Return a list of available images (nova images-list + nova image-show)
If a name is provided, only that image will be displayed.
CLI Examples:
.. code-block:: bash
salt '*' nova.image_list
salt '*' nova.image_list myimage | salt/modules/nova.py | def image_list(name=None, profile=None, **kwargs):
'''
Return a list of available images (nova images-list + nova image-show)
If a name is provided, only that image will be displayed.
CLI Examples:
.. code-block:: bash
salt '*' nova.image_list
salt '*' nova.image_list myimage
... | def image_list(name=None, profile=None, **kwargs):
'''
Return a list of available images (nova images-list + nova image-show)
If a name is provided, only that image will be displayed.
CLI Examples:
.. code-block:: bash
salt '*' nova.image_list
salt '*' nova.image_list myimage
... | [
"Return",
"a",
"list",
"of",
"available",
"images",
"(",
"nova",
"images",
"-",
"list",
"+",
"nova",
"image",
"-",
"show",
")",
"If",
"a",
"name",
"is",
"provided",
"only",
"that",
"image",
"will",
"be",
"displayed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L643-L656 | [
"def",
"image_list",
"(",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"image_list",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | image_meta_set | Sets a key=value pair in the metadata for an image (nova image-meta set)
CLI Examples:
.. code-block:: bash
salt '*' nova.image_meta_set 6f52b2ff-0b31-4d84-8fd1-af45b84824f6 cheese=gruyere
salt '*' nova.image_meta_set name=myimage salad=pasta beans=baked | salt/modules/nova.py | def image_meta_set(image_id=None,
name=None,
profile=None,
**kwargs): # pylint: disable=C0103
'''
Sets a key=value pair in the metadata for an image (nova image-meta set)
CLI Examples:
.. code-block:: bash
salt '*' nova.image_meta_set ... | def image_meta_set(image_id=None,
name=None,
profile=None,
**kwargs): # pylint: disable=C0103
'''
Sets a key=value pair in the metadata for an image (nova image-meta set)
CLI Examples:
.. code-block:: bash
salt '*' nova.image_meta_set ... | [
"Sets",
"a",
"key",
"=",
"value",
"pair",
"in",
"the",
"metadata",
"for",
"an",
"image",
"(",
"nova",
"image",
"-",
"meta",
"set",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L659-L678 | [
"def",
"image_meta_set",
"(",
"image_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=C0103",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | image_meta_delete | Delete a key=value pair from the metadata for an image
(nova image-meta set)
CLI Examples:
.. code-block:: bash
salt '*' nova.image_meta_delete 6f52b2ff-0b31-4d84-8fd1-af45b84824f6 keys=cheese
salt '*' nova.image_meta_delete name=myimage keys=salad,beans | salt/modules/nova.py | def image_meta_delete(image_id=None, # pylint: disable=C0103
name=None,
keys=None,
profile=None, **kwargs):
'''
Delete a key=value pair from the metadata for an image
(nova image-meta set)
CLI Examples:
.. code-block:: bash
... | def image_meta_delete(image_id=None, # pylint: disable=C0103
name=None,
keys=None,
profile=None, **kwargs):
'''
Delete a key=value pair from the metadata for an image
(nova image-meta set)
CLI Examples:
.. code-block:: bash
... | [
"Delete",
"a",
"key",
"=",
"value",
"pair",
"from",
"the",
"metadata",
"for",
"an",
"image",
"(",
"nova",
"image",
"-",
"meta",
"set",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L681-L701 | [
"def",
"image_meta_delete",
"(",
"image_id",
"=",
"None",
",",
"# pylint: disable=C0103",
"name",
"=",
"None",
",",
"keys",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_show | Return detailed information for an active server
CLI Example:
.. code-block:: bash
salt '*' nova.server_show <server_id> | salt/modules/nova.py | def server_show(server_id, profile=None, **kwargs):
'''
Return detailed information for an active server
CLI Example:
.. code-block:: bash
salt '*' nova.server_show <server_id>
'''
conn = _auth(profile, **kwargs)
return conn.server_show(server_id) | def server_show(server_id, profile=None, **kwargs):
'''
Return detailed information for an active server
CLI Example:
.. code-block:: bash
salt '*' nova.server_show <server_id>
'''
conn = _auth(profile, **kwargs)
return conn.server_show(server_id) | [
"Return",
"detailed",
"information",
"for",
"an",
"active",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L760-L771 | [
"def",
"server_show",
"(",
"server_id",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"server_show",
"(",
"server_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | secgroup_create | Add a secgroup to nova (nova secgroup-create)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_create mygroup 'This is my security group' | salt/modules/nova.py | def secgroup_create(name, description, profile=None, **kwargs):
'''
Add a secgroup to nova (nova secgroup-create)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_create mygroup 'This is my security group'
'''
conn = _auth(profile, **kwargs)
return conn.secgroup_create(nam... | def secgroup_create(name, description, profile=None, **kwargs):
'''
Add a secgroup to nova (nova secgroup-create)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_create mygroup 'This is my security group'
'''
conn = _auth(profile, **kwargs)
return conn.secgroup_create(nam... | [
"Add",
"a",
"secgroup",
"to",
"nova",
"(",
"nova",
"secgroup",
"-",
"create",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L774-L785 | [
"def",
"secgroup_create",
"(",
"name",
",",
"description",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"secgroup_create",
"(",
"name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | secgroup_delete | Delete a secgroup to nova (nova secgroup-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_delete mygroup | salt/modules/nova.py | def secgroup_delete(name, profile=None, **kwargs):
'''
Delete a secgroup to nova (nova secgroup-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_delete mygroup
'''
conn = _auth(profile, **kwargs)
return conn.secgroup_delete(name) | def secgroup_delete(name, profile=None, **kwargs):
'''
Delete a secgroup to nova (nova secgroup-delete)
CLI Example:
.. code-block:: bash
salt '*' nova.secgroup_delete mygroup
'''
conn = _auth(profile, **kwargs)
return conn.secgroup_delete(name) | [
"Delete",
"a",
"secgroup",
"to",
"nova",
"(",
"nova",
"secgroup",
"-",
"delete",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L788-L799 | [
"def",
"secgroup_delete",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"secgroup_delete",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | server_by_name | Return information about a server
name
Server Name
CLI Example:
.. code-block:: bash
salt '*' nova.server_by_name myserver profile=openstack | salt/modules/nova.py | def server_by_name(name, profile=None, **kwargs):
'''
Return information about a server
name
Server Name
CLI Example:
.. code-block:: bash
salt '*' nova.server_by_name myserver profile=openstack
'''
conn = _auth(profile, **kwargs)
return conn.server_by_name(name) | def server_by_name(name, profile=None, **kwargs):
'''
Return information about a server
name
Server Name
CLI Example:
.. code-block:: bash
salt '*' nova.server_by_name myserver profile=openstack
'''
conn = _auth(profile, **kwargs)
return conn.server_by_name(name) | [
"Return",
"information",
"about",
"a",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L816-L830 | [
"def",
"server_by_name",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
",",
"*",
"*",
"kwargs",
")",
"return",
"conn",
".",
"server_by_name",
"(",
"name",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_root_object | Read list of models and returns a Root object with the proper models added. | salt/modules/napalm_yang_mod.py | def _get_root_object(models):
'''
Read list of models and returns a Root object with the proper models added.
'''
root = napalm_yang.base.Root()
for model in models:
current = napalm_yang
for part in model.split('.'):
current = getattr(current, part)
root.add_mode... | def _get_root_object(models):
'''
Read list of models and returns a Root object with the proper models added.
'''
root = napalm_yang.base.Root()
for model in models:
current = napalm_yang
for part in model.split('.'):
current = getattr(current, part)
root.add_mode... | [
"Read",
"list",
"of",
"models",
"and",
"returns",
"a",
"Root",
"object",
"with",
"the",
"proper",
"models",
"added",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L55-L65 | [
"def",
"_get_root_object",
"(",
"models",
")",
":",
"root",
"=",
"napalm_yang",
".",
"base",
".",
"Root",
"(",
")",
"for",
"model",
"in",
"models",
":",
"current",
"=",
"napalm_yang",
"for",
"part",
"in",
"model",
".",
"split",
"(",
"'.'",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | diff | Returns the difference between two configuration entities structured
according to the YANG model.
.. note::
This function is recommended to be used mostly as a state helper.
candidate
First model to compare.
running
Second model to compare.
models
A list of models... | salt/modules/napalm_yang_mod.py | def diff(candidate, running, *models):
'''
Returns the difference between two configuration entities structured
according to the YANG model.
.. note::
This function is recommended to be used mostly as a state helper.
candidate
First model to compare.
running
Second mod... | def diff(candidate, running, *models):
'''
Returns the difference between two configuration entities structured
according to the YANG model.
.. note::
This function is recommended to be used mostly as a state helper.
candidate
First model to compare.
running
Second mod... | [
"Returns",
"the",
"difference",
"between",
"two",
"configuration",
"entities",
"structured",
"according",
"to",
"the",
"YANG",
"model",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L72-L129 | [
"def",
"diff",
"(",
"candidate",
",",
"running",
",",
"*",
"models",
")",
":",
"if",
"isinstance",
"(",
"models",
",",
"tuple",
")",
"and",
"isinstance",
"(",
"models",
"[",
"0",
"]",
",",
"list",
")",
":",
"models",
"=",
"models",
"[",
"0",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | parse | Parse configuration from the device.
models
A list of models to be used when parsing.
config: ``False``
Parse config.
state: ``False``
Parse state.
profiles: ``None``
Use certain profiles to parse. If not specified, will use the device
default profile(s).
... | salt/modules/napalm_yang_mod.py | def parse(*models, **kwargs):
'''
Parse configuration from the device.
models
A list of models to be used when parsing.
config: ``False``
Parse config.
state: ``False``
Parse state.
profiles: ``None``
Use certain profiles to parse. If not specified, will use t... | def parse(*models, **kwargs):
'''
Parse configuration from the device.
models
A list of models to be used when parsing.
config: ``False``
Parse config.
state: ``False``
Parse state.
profiles: ``None``
Use certain profiles to parse. If not specified, will use t... | [
"Parse",
"configuration",
"from",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L133-L364 | [
"def",
"parse",
"(",
"*",
"models",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"models",
",",
"tuple",
")",
"and",
"isinstance",
"(",
"models",
"[",
"0",
"]",
",",
"list",
")",
":",
"models",
"=",
"models",
"[",
"0",
"]",
"config... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_config | Return the native config.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
profiles: ``None``
Use certain profiles to generate the config.
If not specified, will use the platform default profil... | salt/modules/napalm_yang_mod.py | def get_config(data, *models, **kwargs):
'''
Return the native config.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
profiles: ``None``
Use certain profiles to generate the config.
I... | def get_config(data, *models, **kwargs):
'''
Return the native config.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
profiles: ``None``
Use certain profiles to generate the config.
I... | [
"Return",
"the",
"native",
"config",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L368-L416 | [
"def",
"get_config",
"(",
"data",
",",
"*",
"models",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"models",
",",
"tuple",
")",
"and",
"isinstance",
"(",
"models",
"[",
"0",
"]",
",",
"list",
")",
":",
"models",
"=",
"models",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | load_config | Generate and load the config on the device using the OpenConfig or IETF
models and device profiles.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
profiles: ``None``
Use certain profiles to gener... | salt/modules/napalm_yang_mod.py | def load_config(data, *models, **kwargs):
'''
Generate and load the config on the device using the OpenConfig or IETF
models and device profiles.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
pr... | def load_config(data, *models, **kwargs):
'''
Generate and load the config on the device using the OpenConfig or IETF
models and device profiles.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
pr... | [
"Generate",
"and",
"load",
"the",
"config",
"on",
"the",
"device",
"using",
"the",
"OpenConfig",
"or",
"IETF",
"models",
"and",
"device",
"profiles",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L420-L567 | [
"def",
"load_config",
"(",
"data",
",",
"*",
"models",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"models",
",",
"tuple",
")",
"and",
"isinstance",
"(",
"models",
"[",
"0",
"]",
",",
"list",
")",
":",
"models",
"=",
"models",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | compliance_report | Return the compliance report using YANG objects.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
filepath
The absolute path to the validation file.
CLI Example:
.. code-block:: bash
... | salt/modules/napalm_yang_mod.py | def compliance_report(data, *models, **kwargs):
'''
Return the compliance report using YANG objects.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
filepath
The absolute path to the validatio... | def compliance_report(data, *models, **kwargs):
'''
Return the compliance report using YANG objects.
data
Dictionary structured with respect to the models referenced.
models
A list of models to be used when generating the config.
filepath
The absolute path to the validatio... | [
"Return",
"the",
"compliance",
"report",
"using",
"YANG",
"objects",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L571-L615 | [
"def",
"compliance_report",
"(",
"data",
",",
"*",
"models",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"models",
",",
"tuple",
")",
"and",
"isinstance",
"(",
"models",
"[",
"0",
"]",
",",
"list",
")",
":",
"models",
"=",
"models",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | value_present | Ensure a specific value exists at a given path
:param name: The name for this rule
:type name: ``str``
:param datastore: The datastore, e.g. running, operational.
One of the NETCONF store IETF types
:type datastore: :class:`DatastoreType` (``str`` enum).
:param path: The device path to ... | salt/states/cisconso.py | def value_present(name, datastore, path, config):
'''
Ensure a specific value exists at a given path
:param name: The name for this rule
:type name: ``str``
:param datastore: The datastore, e.g. running, operational.
One of the NETCONF store IETF types
:type datastore: :class:`Datast... | def value_present(name, datastore, path, config):
'''
Ensure a specific value exists at a given path
:param name: The name for this rule
:type name: ``str``
:param datastore: The datastore, e.g. running, operational.
One of the NETCONF store IETF types
:type datastore: :class:`Datast... | [
"Ensure",
"a",
"specific",
"value",
"exists",
"at",
"a",
"given",
"path"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cisconso.py#L22-L83 | [
"def",
"value_present",
"(",
"name",
",",
"datastore",
",",
"path",
",",
"config",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"existing",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | managed | Manage RBAC properties for user
name : string
username
roles : list
list of roles for user
profiles : list
list of profiles for user
authorizations : list
list of authorizations for user
.. warning::
All existing roles, profiles and authorizations will be re... | salt/states/rbac_solaris.py | def managed(name, roles=None, profiles=None, authorizations=None):
'''
Manage RBAC properties for user
name : string
username
roles : list
list of roles for user
profiles : list
list of profiles for user
authorizations : list
list of authorizations for user
... | def managed(name, roles=None, profiles=None, authorizations=None):
'''
Manage RBAC properties for user
name : string
username
roles : list
list of roles for user
profiles : list
list of profiles for user
authorizations : list
list of authorizations for user
... | [
"Manage",
"RBAC",
"properties",
"for",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbac_solaris.py#L51-L184 | [
"def",
"managed",
"(",
"name",
",",
"roles",
"=",
"None",
",",
"profiles",
"=",
"None",
",",
"authorizations",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pillar | Return True if the minion matches the given pillar target. The
``delimiter`` argument can be used to specify a different delimiter.
CLI Example:
.. code-block:: bash
salt '*' match.pillar 'cheese:foo'
salt '*' match.pillar 'clone_url|https://github.com/saltstack/salt.git' delimiter='|'
... | salt/modules/match.py | def pillar(tgt, delimiter=DEFAULT_TARGET_DELIM):
'''
Return True if the minion matches the given pillar target. The
``delimiter`` argument can be used to specify a different delimiter.
CLI Example:
.. code-block:: bash
salt '*' match.pillar 'cheese:foo'
salt '*' match.pillar 'clon... | def pillar(tgt, delimiter=DEFAULT_TARGET_DELIM):
'''
Return True if the minion matches the given pillar target. The
``delimiter`` argument can be used to specify a different delimiter.
CLI Example:
.. code-block:: bash
salt '*' match.pillar 'cheese:foo'
salt '*' match.pillar 'clon... | [
"Return",
"True",
"if",
"the",
"minion",
"matches",
"the",
"given",
"pillar",
"target",
".",
"The",
"delimiter",
"argument",
"can",
"be",
"used",
"to",
"specify",
"a",
"different",
"delimiter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L117-L145 | [
"def",
"pillar",
"(",
"tgt",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
")",
":",
"matchers",
"=",
"salt",
".",
"loader",
".",
"matchers",
"(",
"__opts__",
")",
"try",
":",
"return",
"matchers",
"[",
"'pillar_match.match'",
"]",
"(",
"tgt",
",",
"delim... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | data | Return True if the minion matches the given data target
CLI Example:
.. code-block:: bash
salt '*' match.data 'spam:eggs' | salt/modules/match.py | def data(tgt):
'''
Return True if the minion matches the given data target
CLI Example:
.. code-block:: bash
salt '*' match.data 'spam:eggs'
'''
matchers = salt.loader.matchers(__opts__)
try:
return matchers['data_match.match'](tgt, opts=__opts__)
except Exception as e... | def data(tgt):
'''
Return True if the minion matches the given data target
CLI Example:
.. code-block:: bash
salt '*' match.data 'spam:eggs'
'''
matchers = salt.loader.matchers(__opts__)
try:
return matchers['data_match.match'](tgt, opts=__opts__)
except Exception as e... | [
"Return",
"True",
"if",
"the",
"minion",
"matches",
"the",
"given",
"data",
"target"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L148-L163 | [
"def",
"data",
"(",
"tgt",
")",
":",
"matchers",
"=",
"salt",
".",
"loader",
".",
"matchers",
"(",
"__opts__",
")",
"try",
":",
"return",
"matchers",
"[",
"'data_match.match'",
"]",
"(",
"tgt",
",",
"opts",
"=",
"__opts__",
")",
"except",
"Exception",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pcre | Return True if the minion ID matches the given pcre target
minion_id
Specify the minion ID to match against the target expression
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' match.pcre '.*' | salt/modules/match.py | def pcre(tgt, minion_id=None):
'''
Return True if the minion ID matches the given pcre target
minion_id
Specify the minion ID to match against the target expression
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' match.pcre '.*'
'''
if minio... | def pcre(tgt, minion_id=None):
'''
Return True if the minion ID matches the given pcre target
minion_id
Specify the minion ID to match against the target expression
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' match.pcre '.*'
'''
if minio... | [
"Return",
"True",
"if",
"the",
"minion",
"ID",
"matches",
"the",
"given",
"pcre",
"target"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L258-L285 | [
"def",
"pcre",
"(",
"tgt",
",",
"minion_id",
"=",
"None",
")",
":",
"if",
"minion_id",
"is",
"not",
"None",
":",
"opts",
"=",
"copy",
".",
"copy",
"(",
"__opts__",
")",
"if",
"not",
"isinstance",
"(",
"minion_id",
",",
"six",
".",
"string_types",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | filter_by | Return the first match in a dictionary of target patterns
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' match.filter_by '{foo*: Foo!, bar*: Bar!}' minion_id=bar03
Pillar Example:
.. code-block:: jinja
# Filter the data for the current minion into a vari... | salt/modules/match.py | def filter_by(lookup,
tgt_type='compound',
minion_id=None,
merge=None,
merge_lists=False,
default='default'):
'''
Return the first match in a dictionary of target patterns
.. versionadded:: 2014.7.0
CLI Example:
.. code-block::... | def filter_by(lookup,
tgt_type='compound',
minion_id=None,
merge=None,
merge_lists=False,
default='default'):
'''
Return the first match in a dictionary of target patterns
.. versionadded:: 2014.7.0
CLI Example:
.. code-block::... | [
"Return",
"the",
"first",
"match",
"in",
"a",
"dictionary",
"of",
"target",
"patterns"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L319-L367 | [
"def",
"filter_by",
"(",
"lookup",
",",
"tgt_type",
"=",
"'compound'",
",",
"minion_id",
"=",
"None",
",",
"merge",
"=",
"None",
",",
"merge_lists",
"=",
"False",
",",
"default",
"=",
"'default'",
")",
":",
"expr_funcs",
"=",
"dict",
"(",
"inspect",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | search_by | Search a dictionary of target strings for matching targets
This is the inverse of :py:func:`match.filter_by
<salt.modules.match.filter_by>` and allows matching values instead of
matching keys. A minion can be matched by multiple entries.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:... | salt/modules/match.py | def search_by(lookup, tgt_type='compound', minion_id=None):
'''
Search a dictionary of target strings for matching targets
This is the inverse of :py:func:`match.filter_by
<salt.modules.match.filter_by>` and allows matching values instead of
matching keys. A minion can be matched by multiple entrie... | def search_by(lookup, tgt_type='compound', minion_id=None):
'''
Search a dictionary of target strings for matching targets
This is the inverse of :py:func:`match.filter_by
<salt.modules.match.filter_by>` and allows matching values instead of
matching keys. A minion can be matched by multiple entrie... | [
"Search",
"a",
"dictionary",
"of",
"target",
"strings",
"for",
"matching",
"targets"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L370-L409 | [
"def",
"search_by",
"(",
"lookup",
",",
"tgt_type",
"=",
"'compound'",
",",
"minion_id",
"=",
"None",
")",
":",
"expr_funcs",
"=",
"dict",
"(",
"inspect",
".",
"getmembers",
"(",
"sys",
".",
"modules",
"[",
"__name__",
"]",
",",
"predicate",
"=",
"inspec... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _run_varnishadm | Execute varnishadm command
return the output of the command
cmd
The command to run in varnishadm
params
Any additional args to add to the command line
kwargs
Additional options to pass to the salt cmd.run_all function | salt/modules/varnish.py | def _run_varnishadm(cmd, params=(), **kwargs):
'''
Execute varnishadm command
return the output of the command
cmd
The command to run in varnishadm
params
Any additional args to add to the command line
kwargs
Additional options to pass to the salt cmd.run_all function
... | def _run_varnishadm(cmd, params=(), **kwargs):
'''
Execute varnishadm command
return the output of the command
cmd
The command to run in varnishadm
params
Any additional args to add to the command line
kwargs
Additional options to pass to the salt cmd.run_all function
... | [
"Execute",
"varnishadm",
"command",
"return",
"the",
"output",
"of",
"the",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/varnish.py#L37-L54 | [
"def",
"_run_varnishadm",
"(",
"cmd",
",",
"params",
"=",
"(",
")",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"[",
"'varnishadm'",
",",
"cmd",
"]",
"cmd",
".",
"extend",
"(",
"[",
"param",
"for",
"param",
"in",
"params",
"if",
"param",
"is",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | Return server version from varnishd -V
CLI Example:
.. code-block:: bash
salt '*' varnish.version | salt/modules/varnish.py | def version():
'''
Return server version from varnishd -V
CLI Example:
.. code-block:: bash
salt '*' varnish.version
'''
cmd = ['varnishd', '-V']
out = __salt__['cmd.run'](cmd, python_shell=False)
ret = re.search(r'\(varnish-([^\)]+)\)', out).group(1)
return ret | def version():
'''
Return server version from varnishd -V
CLI Example:
.. code-block:: bash
salt '*' varnish.version
'''
cmd = ['varnishd', '-V']
out = __salt__['cmd.run'](cmd, python_shell=False)
ret = re.search(r'\(varnish-([^\)]+)\)', out).group(1)
return ret | [
"Return",
"server",
"version",
"from",
"varnishd",
"-",
"V"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/varnish.py#L57-L70 | [
"def",
"version",
"(",
")",
":",
"cmd",
"=",
"[",
"'varnishd'",
",",
"'-V'",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"ret",
"=",
"re",
".",
"search",
"(",
"r'\\(varnish-([^\\)]+)\\)'",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | param_show | Show params of varnish cache
CLI Example:
.. code-block:: bash
salt '*' varnish.param_show param | salt/modules/varnish.py | def param_show(param=None):
'''
Show params of varnish cache
CLI Example:
.. code-block:: bash
salt '*' varnish.param_show param
'''
ret = _run_varnishadm('param.show', [param])
if ret['retcode']:
return False
else:
result = {}
for line in ret['stdout']... | def param_show(param=None):
'''
Show params of varnish cache
CLI Example:
.. code-block:: bash
salt '*' varnish.param_show param
'''
ret = _run_varnishadm('param.show', [param])
if ret['retcode']:
return False
else:
result = {}
for line in ret['stdout']... | [
"Show",
"params",
"of",
"varnish",
"cache"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/varnish.py#L129-L152 | [
"def",
"param_show",
"(",
"param",
"=",
"None",
")",
":",
"ret",
"=",
"_run_varnishadm",
"(",
"'param.show'",
",",
"[",
"param",
"]",
")",
"if",
"ret",
"[",
"'retcode'",
"]",
":",
"return",
"False",
"else",
":",
"result",
"=",
"{",
"}",
"for",
"line"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _strip_dirty | Removes dirtyID tags from the candidate config result. Palo Alto devices will make the candidate configuration with
a dirty ID after a change. This can cause unexpected results when parsing. | salt/proxy/panos.py | def _strip_dirty(xmltree):
'''
Removes dirtyID tags from the candidate config result. Palo Alto devices will make the candidate configuration with
a dirty ID after a change. This can cause unexpected results when parsing.
'''
dirty = xmltree.attrib.pop('dirtyId', None)
if dirty:
xmltree.... | def _strip_dirty(xmltree):
'''
Removes dirtyID tags from the candidate config result. Palo Alto devices will make the candidate configuration with
a dirty ID after a change. This can cause unexpected results when parsing.
'''
dirty = xmltree.attrib.pop('dirtyId', None)
if dirty:
xmltree.... | [
"Removes",
"dirtyID",
"tags",
"from",
"the",
"candidate",
"config",
"result",
".",
"Palo",
"Alto",
"devices",
"will",
"make",
"the",
"candidate",
"configuration",
"with",
"a",
"dirty",
"ID",
"after",
"a",
"change",
".",
"This",
"can",
"cause",
"unexpected",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/panos.py#L238-L251 | [
"def",
"_strip_dirty",
"(",
"xmltree",
")",
":",
"dirty",
"=",
"xmltree",
".",
"attrib",
".",
"pop",
"(",
"'dirtyId'",
",",
"None",
")",
"if",
"dirty",
":",
"xmltree",
".",
"attrib",
".",
"pop",
"(",
"'admin'",
",",
"None",
")",
"xmltree",
".",
"attr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | This function gets called when the proxy starts up. For
panos devices, a determination is made on the connection type
and the appropriate connection details that must be cached. | salt/proxy/panos.py | def init(opts):
'''
This function gets called when the proxy starts up. For
panos devices, a determination is made on the connection type
and the appropriate connection details that must be cached.
'''
if 'host' not in opts['proxy']:
log.critical('No \'host\' key found in pillar for this... | def init(opts):
'''
This function gets called when the proxy starts up. For
panos devices, a determination is made on the connection type
and the appropriate connection details that must be cached.
'''
if 'host' not in opts['proxy']:
log.critical('No \'host\' key found in pillar for this... | [
"This",
"function",
"gets",
"called",
"when",
"the",
"proxy",
"starts",
"up",
".",
"For",
"panos",
"devices",
"a",
"determination",
"is",
"made",
"on",
"the",
"connection",
"type",
"and",
"the",
"appropriate",
"connection",
"details",
"that",
"must",
"be",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/panos.py#L254-L304 | [
"def",
"init",
"(",
"opts",
")",
":",
"if",
"'host'",
"not",
"in",
"opts",
"[",
"'proxy'",
"]",
":",
"log",
".",
"critical",
"(",
"'No \\'host\\' key found in pillar for this proxy.'",
")",
"return",
"False",
"if",
"'apikey'",
"not",
"in",
"opts",
"[",
"'pro... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | call | This function captures the query string and sends it to the Palo Alto device. | salt/proxy/panos.py | def call(payload=None):
'''
This function captures the query string and sends it to the Palo Alto device.
'''
r = None
try:
if DETAILS['method'] == 'dev_key':
# Pass the api key without the target declaration
conditional_payload = {'key': DETAILS['apikey']}
... | def call(payload=None):
'''
This function captures the query string and sends it to the Palo Alto device.
'''
r = None
try:
if DETAILS['method'] == 'dev_key':
# Pass the api key without the target declaration
conditional_payload = {'key': DETAILS['apikey']}
... | [
"This",
"function",
"captures",
"the",
"query",
"string",
"and",
"sends",
"it",
"to",
"the",
"Palo",
"Alto",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/panos.py#L307-L394 | [
"def",
"call",
"(",
"payload",
"=",
"None",
")",
":",
"r",
"=",
"None",
"try",
":",
"if",
"DETAILS",
"[",
"'method'",
"]",
"==",
"'dev_key'",
":",
"# Pass the api key without the target declaration",
"conditional_payload",
"=",
"{",
"'key'",
":",
"DETAILS",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | is_required_version | Because different versions of Palo Alto support different command sets, this function
will return true if the current version of Palo Alto supports the required command. | salt/proxy/panos.py | def is_required_version(required_version='0.0.0'):
'''
Because different versions of Palo Alto support different command sets, this function
will return true if the current version of Palo Alto supports the required command.
'''
if 'sw-version' in DETAILS['grains_cache']:
current_version = D... | def is_required_version(required_version='0.0.0'):
'''
Because different versions of Palo Alto support different command sets, this function
will return true if the current version of Palo Alto supports the required command.
'''
if 'sw-version' in DETAILS['grains_cache']:
current_version = D... | [
"Because",
"different",
"versions",
"of",
"Palo",
"Alto",
"support",
"different",
"command",
"sets",
"this",
"function",
"will",
"return",
"true",
"if",
"the",
"current",
"version",
"of",
"Palo",
"Alto",
"supports",
"the",
"required",
"command",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/panos.py#L397-L430 | [
"def",
"is_required_version",
"(",
"required_version",
"=",
"'0.0.0'",
")",
":",
"if",
"'sw-version'",
"in",
"DETAILS",
"[",
"'grains_cache'",
"]",
":",
"current_version",
"=",
"DETAILS",
"[",
"'grains_cache'",
"]",
"[",
"'sw-version'",
"]",
"else",
":",
"# If w... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | grains | Get the grains from the proxied device | salt/proxy/panos.py | def grains():
'''
Get the grains from the proxied device
'''
if not DETAILS.get('grains_cache', {}):
DETAILS['grains_cache'] = GRAINS_CACHE
try:
query = {'type': 'op', 'cmd': '<show><system><info></info></system></show>'}
DETAILS['grains_cache'] = call(query)['res... | def grains():
'''
Get the grains from the proxied device
'''
if not DETAILS.get('grains_cache', {}):
DETAILS['grains_cache'] = GRAINS_CACHE
try:
query = {'type': 'op', 'cmd': '<show><system><info></info></system></show>'}
DETAILS['grains_cache'] = call(query)['res... | [
"Get",
"the",
"grains",
"from",
"the",
"proxied",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/panos.py#L442-L453 | [
"def",
"grains",
"(",
")",
":",
"if",
"not",
"DETAILS",
".",
"get",
"(",
"'grains_cache'",
",",
"{",
"}",
")",
":",
"DETAILS",
"[",
"'grains_cache'",
"]",
"=",
"GRAINS_CACHE",
"try",
":",
"query",
"=",
"{",
"'type'",
":",
"'op'",
",",
"'cmd'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _append_comment | append ``comment`` to ``ret['comment']`` | salt/states/kmod.py | def _append_comment(ret, comment):
'''
append ``comment`` to ``ret['comment']``
'''
if ret['comment']:
ret['comment'] = ret['comment'].rstrip() + '\n' + comment
else:
ret['comment'] = comment
return ret | def _append_comment(ret, comment):
'''
append ``comment`` to ``ret['comment']``
'''
if ret['comment']:
ret['comment'] = ret['comment'].rstrip() + '\n' + comment
else:
ret['comment'] = comment
return ret | [
"append",
"comment",
"to",
"ret",
"[",
"comment",
"]"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kmod.py#L43-L52 | [
"def",
"_append_comment",
"(",
"ret",
",",
"comment",
")",
":",
"if",
"ret",
"[",
"'comment'",
"]",
":",
"ret",
"[",
"'comment'",
"]",
"=",
"ret",
"[",
"'comment'",
"]",
".",
"rstrip",
"(",
")",
"+",
"'\\n'",
"+",
"comment",
"else",
":",
"ret",
"["... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that the specified kernel module is loaded
name
The name of the kernel module to verify is loaded
persist
Also add module to ``/etc/modules``
mods
A list of modules to verify are loaded. If this argument is used, the
``name`` argument, although still required, is n... | salt/states/kmod.py | def present(name, persist=False, mods=None):
'''
Ensure that the specified kernel module is loaded
name
The name of the kernel module to verify is loaded
persist
Also add module to ``/etc/modules``
mods
A list of modules to verify are loaded. If this argument is used, the... | def present(name, persist=False, mods=None):
'''
Ensure that the specified kernel module is loaded
name
The name of the kernel module to verify is loaded
persist
Also add module to ``/etc/modules``
mods
A list of modules to verify are loaded. If this argument is used, the... | [
"Ensure",
"that",
"the",
"specified",
"kernel",
"module",
"is",
"loaded"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kmod.py#L55-L159 | [
"def",
"present",
"(",
"name",
",",
"persist",
"=",
"False",
",",
"mods",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"mods",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"mods",
"=",
"[",
"name",
"]",
"ret",
"=",
"{",
"'name'",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Verify that the named kernel module is not loaded
name
The name of the kernel module to verify is not loaded
persist
Remove module from ``/etc/modules``
comment
Comment out module in ``/etc/modules`` rather than remove it
mods
A list of modules to verify are unloaded.... | salt/states/kmod.py | def absent(name, persist=False, comment=True, mods=None):
'''
Verify that the named kernel module is not loaded
name
The name of the kernel module to verify is not loaded
persist
Remove module from ``/etc/modules``
comment
Comment out module in ``/etc/modules`` rather than... | def absent(name, persist=False, comment=True, mods=None):
'''
Verify that the named kernel module is not loaded
name
The name of the kernel module to verify is not loaded
persist
Remove module from ``/etc/modules``
comment
Comment out module in ``/etc/modules`` rather than... | [
"Verify",
"that",
"the",
"named",
"kernel",
"module",
"is",
"not",
"loaded"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kmod.py#L162-L245 | [
"def",
"absent",
"(",
"name",
",",
"persist",
"=",
"False",
",",
"comment",
"=",
"True",
",",
"mods",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"mods",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"mods",
"=",
"[",
"name",
"]",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _do | Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0 | salt/runners/lxc.py | def _do(name, fun, path=None):
'''
Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
host = find_guest(name, quiet=True, path=path)
if not host:
return False
... | def _do(name, fun, path=None):
'''
Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
host = find_guest(name, quiet=True, path=path)
if not host:
return False
... | [
"Invoke",
"a",
"function",
"in",
"the",
"lxc",
"module",
"with",
"no",
"args"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L36-L61 | [
"def",
"_do",
"(",
"name",
",",
"fun",
",",
"path",
"=",
"None",
")",
":",
"host",
"=",
"find_guest",
"(",
"name",
",",
"quiet",
"=",
"True",
",",
"path",
"=",
"path",
")",
"if",
"not",
"host",
":",
"return",
"False",
"client",
"=",
"salt",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _do_names | Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0 | salt/runners/lxc.py | def _do_names(names, fun, path=None):
'''
Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
ret = {}
hosts = find_guests(names, path=path)
if not hosts:
re... | def _do_names(names, fun, path=None):
'''
Invoke a function in the lxc module with no args
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
ret = {}
hosts = find_guests(names, path=path)
if not hosts:
re... | [
"Invoke",
"a",
"function",
"in",
"the",
"lxc",
"module",
"with",
"no",
"args"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L64-L94 | [
"def",
"_do_names",
"(",
"names",
",",
"fun",
",",
"path",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"hosts",
"=",
"find_guests",
"(",
"names",
",",
"path",
"=",
"path",
")",
"if",
"not",
"hosts",
":",
"return",
"False",
"client",
"=",
"salt",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_guest | Returns the host for a container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.find_guest name | salt/runners/lxc.py | def find_guest(name, quiet=False, path=None):
'''
Returns the host for a container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.find_guest name
'''
if quiet:
log... | def find_guest(name, quiet=False, path=None):
'''
Returns the host for a container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.find_guest name
'''
if quiet:
log... | [
"Returns",
"the",
"host",
"for",
"a",
"container",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L97-L125 | [
"def",
"find_guest",
"(",
"name",
",",
"quiet",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"if",
"quiet",
":",
"log",
".",
"warning",
"(",
"\"'quiet' argument is being deprecated.\"",
"' Please migrate to --quiet'",
")",
"for",
"data",
"in",
"_list_iter",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_guests | Return a dict of hosts and named guests
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0 | salt/runners/lxc.py | def find_guests(names, path=None):
'''
Return a dict of hosts and named guests
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
ret = {}
names = names.split(',')
for data in _list_iter(path=path):
host,... | def find_guests(names, path=None):
'''
Return a dict of hosts and named guests
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
ret = {}
names = names.split(',')
for data in _list_iter(path=path):
host,... | [
"Return",
"a",
"dict",
"of",
"hosts",
"and",
"named",
"guests"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L128-L150 | [
"def",
"find_guests",
"(",
"names",
",",
"path",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"names",
"=",
"names",
".",
"split",
"(",
"','",
")",
"for",
"data",
"in",
"_list_iter",
"(",
"path",
"=",
"path",
")",
":",
"host",
",",
"stat",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Initialize a new container
.. code-block:: bash
salt-run lxc.init name host=minion_id [cpuset=cgroups_cpuset] \\
[cpushare=cgroups_cpushare] [memory=cgroups_memory] \\
[template=lxc_template_name] [clone=original name] \\
[profile=lxc_profile] [network_prof... | salt/runners/lxc.py | def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs):
'''
Initialize a new container
.. code-block:: bash
salt-run lxc.init name host=minion_id [cpuset=cgroups_cpuset] \\
[cpushare=cgroups_cpushare] [memory=cgroups_memory] \\
[template=lxc_templa... | def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs):
'''
Initialize a new container
.. code-block:: bash
salt-run lxc.init name host=minion_id [cpuset=cgroups_cpuset] \\
[cpushare=cgroups_cpushare] [memory=cgroups_memory] \\
[template=lxc_templa... | [
"Initialize",
"a",
"new",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L153-L405 | [
"def",
"init",
"(",
"names",
",",
"host",
"=",
"None",
",",
"saltcloud_mode",
"=",
"False",
",",
"quiet",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"kwargs",
".",
"get",
"(",
"'path'",
",",
"None",
")",
"if",
"quiet",
":",
"lo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cloud_init | Wrapper for using lxc.init in saltcloud compatibility mode
names
Name of the containers, supports a single name or a comma delimited
list of names.
host
Minion to start the container on. Required.
path
path to the container parent
default: /var/lib/lxc (system defa... | salt/runners/lxc.py | def cloud_init(names, host=None, quiet=False, **kwargs):
'''
Wrapper for using lxc.init in saltcloud compatibility mode
names
Name of the containers, supports a single name or a comma delimited
list of names.
host
Minion to start the container on. Required.
path
pa... | def cloud_init(names, host=None, quiet=False, **kwargs):
'''
Wrapper for using lxc.init in saltcloud compatibility mode
names
Name of the containers, supports a single name or a comma delimited
list of names.
host
Minion to start the container on. Required.
path
pa... | [
"Wrapper",
"for",
"using",
"lxc",
".",
"init",
"in",
"saltcloud",
"compatibility",
"mode"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L408-L431 | [
"def",
"cloud_init",
"(",
"names",
",",
"host",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"quiet",
":",
"log",
".",
"warning",
"(",
"\"'quiet' argument is being deprecated. Please migrate to --quiet\"",
")",
"return",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _list_iter | Return a generator iterating over hosts
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0 | salt/runners/lxc.py | def _list_iter(host=None, path=None):
'''
Return a generator iterating over hosts
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
tgt = host or '*'
client = salt.client.get_local_client(__opts__['conf_file'])
f... | def _list_iter(host=None, path=None):
'''
Return a generator iterating over hosts
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
'''
tgt = host or '*'
client = salt.client.get_local_client(__opts__['conf_file'])
f... | [
"Return",
"a",
"generator",
"iterating",
"over",
"hosts"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L434-L464 | [
"def",
"_list_iter",
"(",
"host",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"tgt",
"=",
"host",
"or",
"'*'",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"for",
"container_info",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | List defined containers (running, stopped, and frozen) for the named
(or all) host(s).
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.list [host=minion_id] | salt/runners/lxc.py | def list_(host=None, quiet=False, path=None):
'''
List defined containers (running, stopped, and frozen) for the named
(or all) host(s).
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-r... | def list_(host=None, quiet=False, path=None):
'''
List defined containers (running, stopped, and frozen) for the named
(or all) host(s).
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-r... | [
"List",
"defined",
"containers",
"(",
"running",
"stopped",
"and",
"frozen",
")",
"for",
"the",
"named",
"(",
"or",
"all",
")",
"host",
"(",
"s",
")",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L467-L489 | [
"def",
"list_",
"(",
"host",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"it",
"=",
"_list_iter",
"(",
"host",
",",
"path",
"=",
"path",
")",
"ret",
"=",
"{",
"}",
"for",
"chunk",
"in",
"it",
":",
"ret",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | purge | Purge the named container and delete its minion key if present.
WARNING: Destroys all data associated with the container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.purge name | salt/runners/lxc.py | def purge(name, delete_key=True, quiet=False, path=None):
'''
Purge the named container and delete its minion key if present.
WARNING: Destroys all data associated with the container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 201... | def purge(name, delete_key=True, quiet=False, path=None):
'''
Purge the named container and delete its minion key if present.
WARNING: Destroys all data associated with the container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 201... | [
"Purge",
"the",
"named",
"container",
"and",
"delete",
"its",
"minion",
"key",
"if",
"present",
".",
"WARNING",
":",
"Destroys",
"all",
"data",
"associated",
"with",
"the",
"container",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L492-L521 | [
"def",
"purge",
"(",
"name",
",",
"delete_key",
"=",
"True",
",",
"quiet",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"data",
"=",
"_do_names",
"(",
"name",
",",
"'destroy'",
",",
"path",
"=",
"path",
")",
"if",
"data",
"is",
"False",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Start the named container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.start name | salt/runners/lxc.py | def start(name, quiet=False, path=None):
'''
Start the named container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.start name
'''
data = _do_names(name, 'start', path=pa... | def start(name, quiet=False, path=None):
'''
Start the named container.
path
path to the container parent
default: /var/lib/lxc (system default)
.. versionadded:: 2015.8.0
.. code-block:: bash
salt-run lxc.start name
'''
data = _do_names(name, 'start', path=pa... | [
"Start",
"the",
"named",
"container",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/lxc.py#L524-L542 | [
"def",
"start",
"(",
"name",
",",
"quiet",
"=",
"False",
",",
"path",
"=",
"None",
")",
":",
"data",
"=",
"_do_names",
"(",
"name",
",",
"'start'",
",",
"path",
"=",
"path",
")",
"if",
"data",
"and",
"not",
"quiet",
":",
"__jid_event__",
".",
"fire... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | selinux_fs_path | Return the location of the SELinux VFS directory
CLI Example:
.. code-block:: bash
salt '*' selinux.selinux_fs_path | salt/modules/selinux.py | def selinux_fs_path():
'''
Return the location of the SELinux VFS directory
CLI Example:
.. code-block:: bash
salt '*' selinux.selinux_fs_path
'''
# systems running systemd (e.g. Fedora 15 and newer)
# have the selinux filesystem in a different location
try:
for direct... | def selinux_fs_path():
'''
Return the location of the SELinux VFS directory
CLI Example:
.. code-block:: bash
salt '*' selinux.selinux_fs_path
'''
# systems running systemd (e.g. Fedora 15 and newer)
# have the selinux filesystem in a different location
try:
for direct... | [
"Return",
"the",
"location",
"of",
"the",
"SELinux",
"VFS",
"directory"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L62-L82 | [
"def",
"selinux_fs_path",
"(",
")",
":",
"# systems running systemd (e.g. Fedora 15 and newer)",
"# have the selinux filesystem in a different location",
"try",
":",
"for",
"directory",
"in",
"(",
"'/sys/fs/selinux'",
",",
"'/selinux'",
")",
":",
"if",
"os",
".",
"path",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getenforce | Return the mode selinux is running in
CLI Example:
.. code-block:: bash
salt '*' selinux.getenforce | salt/modules/selinux.py | def getenforce():
'''
Return the mode selinux is running in
CLI Example:
.. code-block:: bash
salt '*' selinux.getenforce
'''
_selinux_fs_path = selinux_fs_path()
if _selinux_fs_path is None:
return 'Disabled'
try:
enforce = os.path.join(_selinux_fs_path, 'enfo... | def getenforce():
'''
Return the mode selinux is running in
CLI Example:
.. code-block:: bash
salt '*' selinux.getenforce
'''
_selinux_fs_path = selinux_fs_path()
if _selinux_fs_path is None:
return 'Disabled'
try:
enforce = os.path.join(_selinux_fs_path, 'enfo... | [
"Return",
"the",
"mode",
"selinux",
"is",
"running",
"in"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L85-L106 | [
"def",
"getenforce",
"(",
")",
":",
"_selinux_fs_path",
"=",
"selinux_fs_path",
"(",
")",
"if",
"_selinux_fs_path",
"is",
"None",
":",
"return",
"'Disabled'",
"try",
":",
"enforce",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_selinux_fs_path",
",",
"'enforce... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getconfig | Return the selinux mode from the config file
CLI Example:
.. code-block:: bash
salt '*' selinux.getconfig | salt/modules/selinux.py | def getconfig():
'''
Return the selinux mode from the config file
CLI Example:
.. code-block:: bash
salt '*' selinux.getconfig
'''
try:
config = '/etc/selinux/config'
with salt.utils.files.fopen(config, 'r') as _fp:
for line in _fp:
line = s... | def getconfig():
'''
Return the selinux mode from the config file
CLI Example:
.. code-block:: bash
salt '*' selinux.getconfig
'''
try:
config = '/etc/selinux/config'
with salt.utils.files.fopen(config, 'r') as _fp:
for line in _fp:
line = s... | [
"Return",
"the",
"selinux",
"mode",
"from",
"the",
"config",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L109-L128 | [
"def",
"getconfig",
"(",
")",
":",
"try",
":",
"config",
"=",
"'/etc/selinux/config'",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"config",
",",
"'r'",
")",
"as",
"_fp",
":",
"for",
"line",
"in",
"_fp",
":",
"line",
"=",
"salt",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | setenforce | Set the SELinux enforcing mode
CLI Example:
.. code-block:: bash
salt '*' selinux.setenforce enforcing | salt/modules/selinux.py | def setenforce(mode):
'''
Set the SELinux enforcing mode
CLI Example:
.. code-block:: bash
salt '*' selinux.setenforce enforcing
'''
if isinstance(mode, six.string_types):
if mode.lower() == 'enforcing':
mode = '1'
modestring = 'Enforcing'
elif ... | def setenforce(mode):
'''
Set the SELinux enforcing mode
CLI Example:
.. code-block:: bash
salt '*' selinux.setenforce enforcing
'''
if isinstance(mode, six.string_types):
if mode.lower() == 'enforcing':
mode = '1'
modestring = 'Enforcing'
elif ... | [
"Set",
"the",
"SELinux",
"enforcing",
"mode"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L131-L186 | [
"def",
"setenforce",
"(",
"mode",
")",
":",
"if",
"isinstance",
"(",
"mode",
",",
"six",
".",
"string_types",
")",
":",
"if",
"mode",
".",
"lower",
"(",
")",
"==",
"'enforcing'",
":",
"mode",
"=",
"'1'",
"modestring",
"=",
"'Enforcing'",
"elif",
"mode"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | setsebool | Set the value for a boolean
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebool virt_use_usb off | salt/modules/selinux.py | def setsebool(boolean, value, persist=False):
'''
Set the value for a boolean
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebool virt_use_usb off
'''
if persist:
cmd = 'setsebool -P {0} {1}'.format(boolean, value)
else:
cmd = 'setsebool {0} {1}'.format(bo... | def setsebool(boolean, value, persist=False):
'''
Set the value for a boolean
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebool virt_use_usb off
'''
if persist:
cmd = 'setsebool -P {0} {1}'.format(boolean, value)
else:
cmd = 'setsebool {0} {1}'.format(bo... | [
"Set",
"the",
"value",
"for",
"a",
"boolean"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L202-L216 | [
"def",
"setsebool",
"(",
"boolean",
",",
"value",
",",
"persist",
"=",
"False",
")",
":",
"if",
"persist",
":",
"cmd",
"=",
"'setsebool -P {0} {1}'",
".",
"format",
"(",
"boolean",
",",
"value",
")",
"else",
":",
"cmd",
"=",
"'setsebool {0} {1}'",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | setsebools | Set the value of multiple booleans
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebools '{virt_use_usb: on, squid_use_tproxy: off}' | salt/modules/selinux.py | def setsebools(pairs, persist=False):
'''
Set the value of multiple booleans
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebools '{virt_use_usb: on, squid_use_tproxy: off}'
'''
if not isinstance(pairs, dict):
return {}
if persist:
cmd = 'setsebool -P '
... | def setsebools(pairs, persist=False):
'''
Set the value of multiple booleans
CLI Example:
.. code-block:: bash
salt '*' selinux.setsebools '{virt_use_usb: on, squid_use_tproxy: off}'
'''
if not isinstance(pairs, dict):
return {}
if persist:
cmd = 'setsebool -P '
... | [
"Set",
"the",
"value",
"of",
"multiple",
"booleans"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L219-L237 | [
"def",
"setsebools",
"(",
"pairs",
",",
"persist",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"pairs",
",",
"dict",
")",
":",
"return",
"{",
"}",
"if",
"persist",
":",
"cmd",
"=",
"'setsebool -P '",
"else",
":",
"cmd",
"=",
"'setsebool '",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_sebool | Return a structure listing all of the selinux booleans on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_sebool | salt/modules/selinux.py | def list_sebool():
'''
Return a structure listing all of the selinux booleans on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_sebool
'''
bdata = __salt__['cmd.run']('semanage boolean -l').splitlines()
ret = {}
for line in bd... | def list_sebool():
'''
Return a structure listing all of the selinux booleans on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_sebool
'''
bdata = __salt__['cmd.run']('semanage boolean -l').splitlines()
ret = {}
for line in bd... | [
"Return",
"a",
"structure",
"listing",
"all",
"of",
"the",
"selinux",
"booleans",
"on",
"the",
"system",
"and",
"what",
"state",
"they",
"are",
"in"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L240-L260 | [
"def",
"list_sebool",
"(",
")",
":",
"bdata",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'semanage boolean -l'",
")",
".",
"splitlines",
"(",
")",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"bdata",
"[",
"1",
":",
"]",
":",
"if",
"not",
"line",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | setsemod | Enable or disable an SELinux module.
CLI Example:
.. code-block:: bash
salt '*' selinux.setsemod nagios Enabled
.. versionadded:: 2016.3.0 | salt/modules/selinux.py | def setsemod(module, state):
'''
Enable or disable an SELinux module.
CLI Example:
.. code-block:: bash
salt '*' selinux.setsemod nagios Enabled
.. versionadded:: 2016.3.0
'''
if state.lower() == 'enabled':
cmd = 'semodule -e {0}'.format(module)
elif state.lower() == ... | def setsemod(module, state):
'''
Enable or disable an SELinux module.
CLI Example:
.. code-block:: bash
salt '*' selinux.setsemod nagios Enabled
.. versionadded:: 2016.3.0
'''
if state.lower() == 'enabled':
cmd = 'semodule -e {0}'.format(module)
elif state.lower() == ... | [
"Enable",
"or",
"disable",
"an",
"SELinux",
"module",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L278-L294 | [
"def",
"setsemod",
"(",
"module",
",",
"state",
")",
":",
"if",
"state",
".",
"lower",
"(",
")",
"==",
"'enabled'",
":",
"cmd",
"=",
"'semodule -e {0}'",
".",
"format",
"(",
"module",
")",
"elif",
"state",
".",
"lower",
"(",
")",
"==",
"'disabled'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install_semod | Install custom SELinux module from file
CLI Example:
.. code-block:: bash
salt '*' selinux.install_semod [salt://]path/to/module.pp
.. versionadded:: 2016.11.6 | salt/modules/selinux.py | def install_semod(module_path):
'''
Install custom SELinux module from file
CLI Example:
.. code-block:: bash
salt '*' selinux.install_semod [salt://]path/to/module.pp
.. versionadded:: 2016.11.6
'''
if module_path.find('salt://') == 0:
module_path = __salt__['cp.cache_fi... | def install_semod(module_path):
'''
Install custom SELinux module from file
CLI Example:
.. code-block:: bash
salt '*' selinux.install_semod [salt://]path/to/module.pp
.. versionadded:: 2016.11.6
'''
if module_path.find('salt://') == 0:
module_path = __salt__['cp.cache_fi... | [
"Install",
"custom",
"SELinux",
"module",
"from",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L297-L312 | [
"def",
"install_semod",
"(",
"module_path",
")",
":",
"if",
"module_path",
".",
"find",
"(",
"'salt://'",
")",
"==",
"0",
":",
"module_path",
"=",
"__salt__",
"[",
"'cp.cache_file'",
"]",
"(",
"module_path",
")",
"cmd",
"=",
"'semodule -i {0}'",
".",
"format... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_semod | Return a structure listing all of the selinux modules on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_semod
.. versionadded:: 2016.3.0 | salt/modules/selinux.py | def list_semod():
'''
Return a structure listing all of the selinux modules on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_semod
.. versionadded:: 2016.3.0
'''
helptext = __salt__['cmd.run']('semodule -h').splitlines()
sem... | def list_semod():
'''
Return a structure listing all of the selinux modules on the system and
what state they are in
CLI Example:
.. code-block:: bash
salt '*' selinux.list_semod
.. versionadded:: 2016.3.0
'''
helptext = __salt__['cmd.run']('semodule -h').splitlines()
sem... | [
"Return",
"a",
"structure",
"listing",
"all",
"of",
"the",
"selinux",
"modules",
"on",
"the",
"system",
"and",
"what",
"state",
"they",
"are",
"in"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L331-L376 | [
"def",
"list_semod",
"(",
")",
":",
"helptext",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'semodule -h'",
")",
".",
"splitlines",
"(",
")",
"semodule_version",
"=",
"''",
"for",
"line",
"in",
"helptext",
":",
"if",
"line",
".",
"strip",
"(",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_protocol_port | .. versionadded:: 2019.2.0
Validates and parses the protocol and port/port range from the name
if both protocol and port are not provided.
If the name is in a valid format, the protocol and port are ignored if provided
Examples: tcp/8080 or udp/20-21 | salt/modules/selinux.py | def _parse_protocol_port(name, protocol, port):
'''
.. versionadded:: 2019.2.0
Validates and parses the protocol and port/port range from the name
if both protocol and port are not provided.
If the name is in a valid format, the protocol and port are ignored if provided
Examples: tcp/8080 or ... | def _parse_protocol_port(name, protocol, port):
'''
.. versionadded:: 2019.2.0
Validates and parses the protocol and port/port range from the name
if both protocol and port are not provided.
If the name is in a valid format, the protocol and port are ignored if provided
Examples: tcp/8080 or ... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L391-L410 | [
"def",
"_parse_protocol_port",
"(",
"name",
",",
"protocol",
",",
"port",
")",
":",
"protocol_port_pattern",
"=",
"r'^(tcp|udp)\\/(([\\d]+)\\-?[\\d]+)$'",
"name_parts",
"=",
"re",
".",
"match",
"(",
"protocol_port_pattern",
",",
"name",
")",
"if",
"not",
"name_parts... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _context_string_to_dict | .. versionadded:: 2017.7.0
Converts an SELinux file context from string to dict. | salt/modules/selinux.py | def _context_string_to_dict(context):
'''
.. versionadded:: 2017.7.0
Converts an SELinux file context from string to dict.
'''
if not re.match('[^:]+:[^:]+:[^:]+:[^:]+$', context):
raise SaltInvocationError('Invalid SELinux context string: {0}. ' +
'Expecte... | def _context_string_to_dict(context):
'''
.. versionadded:: 2017.7.0
Converts an SELinux file context from string to dict.
'''
if not re.match('[^:]+:[^:]+:[^:]+:[^:]+$', context):
raise SaltInvocationError('Invalid SELinux context string: {0}. ' +
'Expecte... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L422-L435 | [
"def",
"_context_string_to_dict",
"(",
"context",
")",
":",
"if",
"not",
"re",
".",
"match",
"(",
"'[^:]+:[^:]+:[^:]+:[^:]+$'",
",",
"context",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'Invalid SELinux context string: {0}. '",
"+",
"'Expected \"sel_user:sel_role:se... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_get_policy | .. versionadded:: 2017.7.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* filespec (the name supplied and matched)
* filetype (the descriptive name of the filetype supplied)
* sel_user, sel_role, sel_type, s... | salt/modules/selinux.py | def fcontext_get_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2017.7.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* filespec (the name supplied and match... | def fcontext_get_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2017.7.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* filespec (the name supplied and match... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L450-L503 | [
"def",
"fcontext_get_policy",
"(",
"name",
",",
"filetype",
"=",
"None",
",",
"sel_type",
"=",
"None",
",",
"sel_user",
"=",
"None",
",",
"sel_level",
"=",
"None",
")",
":",
"if",
"filetype",
":",
"_validate_filetype",
"(",
"filetype",
")",
"re_spacer",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_add_policy | .. versionadded:: 2019.2.0
Adds the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry before setting a new
one for a given filespec and filetype, as adding one with semanage
automatically over... | salt/modules/selinux.py | def fcontext_add_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Adds the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry before set... | def fcontext_add_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Adds the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry before set... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L506-L542 | [
"def",
"fcontext_add_policy",
"(",
"name",
",",
"filetype",
"=",
"None",
",",
"sel_type",
"=",
"None",
",",
"sel_user",
"=",
"None",
",",
"sel_level",
"=",
"None",
")",
":",
"return",
"_fcontext_add_or_delete_policy",
"(",
"'add'",
",",
"name",
",",
"filetyp... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_delete_policy | .. versionadded:: 2019.2.0
Deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry before setting a new
one for a given filespec and filetype, as adding one with semanage
automatically o... | salt/modules/selinux.py | def fcontext_delete_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry befo... | def fcontext_delete_policy(name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry befo... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L545-L581 | [
"def",
"fcontext_delete_policy",
"(",
"name",
",",
"filetype",
"=",
"None",
",",
"sel_type",
"=",
"None",
",",
"sel_user",
"=",
"None",
",",
"sel_level",
"=",
"None",
")",
":",
"return",
"_fcontext_add_or_delete_policy",
"(",
"'delete'",
",",
"name",
",",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_add_or_delete_policy | .. versionadded:: 2017.7.0
Adds or deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have to remove an entry before setting a new
one for a given filespec and filetype, as adding one with semanage
automat... | salt/modules/selinux.py | def fcontext_add_or_delete_policy(action, name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2017.7.0
Adds or deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have ... | def fcontext_add_or_delete_policy(action, name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2017.7.0
Adds or deletes the SELinux policy for a given filespec and other optional parameters.
Returns the result of the call to semanage.
Note that you don't have ... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L584-L637 | [
"def",
"fcontext_add_or_delete_policy",
"(",
"action",
",",
"name",
",",
"filetype",
"=",
"None",
",",
"sel_type",
"=",
"None",
",",
"sel_user",
"=",
"None",
",",
"sel_level",
"=",
"None",
")",
":",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _fcontext_add_or_delete_policy | .. versionadded:: 2019.2.0
Performs the action as called from ``fcontext_add_policy`` or ``fcontext_delete_policy``.
Returns the result of the call to semanage. | salt/modules/selinux.py | def _fcontext_add_or_delete_policy(action, name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Performs the action as called from ``fcontext_add_policy`` or ``fcontext_delete_policy``.
Returns the result of the call to semanage.
'''
if action not ... | def _fcontext_add_or_delete_policy(action, name, filetype=None, sel_type=None, sel_user=None, sel_level=None):
'''
.. versionadded:: 2019.2.0
Performs the action as called from ``fcontext_add_policy`` or ``fcontext_delete_policy``.
Returns the result of the call to semanage.
'''
if action not ... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L640-L663 | [
"def",
"_fcontext_add_or_delete_policy",
"(",
"action",
",",
"name",
",",
"filetype",
"=",
"None",
",",
"sel_type",
"=",
"None",
",",
"sel_user",
"=",
"None",
",",
"sel_level",
"=",
"None",
")",
":",
"if",
"action",
"not",
"in",
"[",
"'add'",
",",
"'dele... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_policy_is_applied | .. versionadded:: 2017.7.0
Returns an empty string if the SELinux policy for a given filespec
is applied, returns string with differences in policy and actual
situation otherwise.
name
filespec of the file or directory. Regex syntax is allowed.
CLI Example:
.. code-block:: bash
... | salt/modules/selinux.py | def fcontext_policy_is_applied(name, recursive=False):
'''
.. versionadded:: 2017.7.0
Returns an empty string if the SELinux policy for a given filespec
is applied, returns string with differences in policy and actual
situation otherwise.
name
filespec of the file or directory. Regex s... | def fcontext_policy_is_applied(name, recursive=False):
'''
.. versionadded:: 2017.7.0
Returns an empty string if the SELinux policy for a given filespec
is applied, returns string with differences in policy and actual
situation otherwise.
name
filespec of the file or directory. Regex s... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L666-L687 | [
"def",
"fcontext_policy_is_applied",
"(",
"name",
",",
"recursive",
"=",
"False",
")",
":",
"cmd",
"=",
"'restorecon -n -v '",
"if",
"recursive",
":",
"cmd",
"+=",
"'-R '",
"cmd",
"+=",
"re",
".",
"escape",
"(",
"name",
")",
"return",
"__salt__",
"[",
"'cm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fcontext_apply_policy | .. versionadded:: 2017.7.0
Applies SElinux policies to filespec using `restorecon [-R]
filespec`. Returns dict with changes if successful, the output of
the restorecon command otherwise.
name
filespec of the file or directory. Regex syntax is allowed.
recursive
Recursively apply S... | salt/modules/selinux.py | def fcontext_apply_policy(name, recursive=False):
'''
.. versionadded:: 2017.7.0
Applies SElinux policies to filespec using `restorecon [-R]
filespec`. Returns dict with changes if successful, the output of
the restorecon command otherwise.
name
filespec of the file or directory. Regex... | def fcontext_apply_policy(name, recursive=False):
'''
.. versionadded:: 2017.7.0
Applies SElinux policies to filespec using `restorecon [-R]
filespec`. Returns dict with changes if successful, the output of
the restorecon command otherwise.
name
filespec of the file or directory. Regex... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L690-L734 | [
"def",
"fcontext_apply_policy",
"(",
"name",
",",
"recursive",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"changes_text",
"=",
"fcontext_policy_is_applied",
"(",
"name",
",",
"recursive",
")",
"cmd",
"=",
"'restorecon -v -F '",
"if",
"recursive",
":",
"cmd"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_get_policy | .. versionadded:: 2019.2.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* sel_type (the selinux type)
* proto (the protocol)
* port (the port(s) and/or port range(s))
name
The protocol and port ... | salt/modules/selinux.py | def port_get_policy(name, sel_type=None, protocol=None, port=None):
'''
.. versionadded:: 2019.2.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* sel_type (the selinux type)
* proto (the protocol)
* ... | def port_get_policy(name, sel_type=None, protocol=None, port=None):
'''
.. versionadded:: 2019.2.0
Returns the current entry in the SELinux policy list as a
dictionary. Returns None if no exact match was found.
Returned keys are:
* sel_type (the selinux type)
* proto (the protocol)
* ... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L737-L786 | [
"def",
"port_get_policy",
"(",
"name",
",",
"sel_type",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"(",
"protocol",
",",
"port",
")",
"=",
"_parse_protocol_port",
"(",
"name",
",",
"protocol",
",",
"port",
")",
"re_s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_add_policy | .. versionadded:: 2019.2.0
Adds the SELinux policy for a given protocol and port.
Returns the result of the call to semanage.
name
The protocol and port spec. Can be formatted as ``(tcp|udp)/(port|port-range)``.
sel_type
The SELinux Type. Required.
protocol
The protocol ... | salt/modules/selinux.py | def port_add_policy(name, sel_type=None, protocol=None, port=None, sel_range=None):
'''
.. versionadded:: 2019.2.0
Adds the SELinux policy for a given protocol and port.
Returns the result of the call to semanage.
name
The protocol and port spec. Can be formatted as ``(tcp|udp)/(port|port... | def port_add_policy(name, sel_type=None, protocol=None, port=None, sel_range=None):
'''
.. versionadded:: 2019.2.0
Adds the SELinux policy for a given protocol and port.
Returns the result of the call to semanage.
name
The protocol and port spec. Can be formatted as ``(tcp|udp)/(port|port... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L789-L819 | [
"def",
"port_add_policy",
"(",
"name",
",",
"sel_type",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"sel_range",
"=",
"None",
")",
":",
"return",
"_port_add_or_delete_policy",
"(",
"'add'",
",",
"name",
",",
"sel_type",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _port_add_or_delete_policy | .. versionadded:: 2019.2.0
Performs the action as called from ``port_add_policy`` or ``port_delete_policy``.
Returns the result of the call to semanage. | salt/modules/selinux.py | def _port_add_or_delete_policy(action, name, sel_type=None, protocol=None, port=None, sel_range=None):
'''
.. versionadded:: 2019.2.0
Performs the action as called from ``port_add_policy`` or ``port_delete_policy``.
Returns the result of the call to semanage.
'''
if action not in ['add', 'dele... | def _port_add_or_delete_policy(action, name, sel_type=None, protocol=None, port=None, sel_range=None):
'''
.. versionadded:: 2019.2.0
Performs the action as called from ``port_add_policy`` or ``port_delete_policy``.
Returns the result of the call to semanage.
'''
if action not in ['add', 'dele... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/selinux.py#L849-L868 | [
"def",
"_port_add_or_delete_policy",
"(",
"action",
",",
"name",
",",
"sel_type",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"sel_range",
"=",
"None",
")",
":",
"if",
"action",
"not",
"in",
"[",
"'add'",
",",
"'delete'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_conn | Establish a connection to etcd | salt/returners/etcd_return.py | def _get_conn(opts, profile=None):
'''
Establish a connection to etcd
'''
if profile is None:
profile = opts.get('etcd.returner')
path = opts.get('etcd.returner_root', '/salt/return')
return salt.utils.etcd_util.get_conn(opts, profile), path | def _get_conn(opts, profile=None):
'''
Establish a connection to etcd
'''
if profile is None:
profile = opts.get('etcd.returner')
path = opts.get('etcd.returner_root', '/salt/return')
return salt.utils.etcd_util.get_conn(opts, profile), path | [
"Establish",
"a",
"connection",
"to",
"etcd"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L97-L104 | [
"def",
"_get_conn",
"(",
"opts",
",",
"profile",
"=",
"None",
")",
":",
"if",
"profile",
"is",
"None",
":",
"profile",
"=",
"opts",
".",
"get",
"(",
"'etcd.returner'",
")",
"path",
"=",
"opts",
".",
"get",
"(",
"'etcd.returner_root'",
",",
"'/salt/return... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Return data to an etcd server or cluster | salt/returners/etcd_return.py | def returner(ret):
'''
Return data to an etcd server or cluster
'''
write_profile = __opts__.get('etcd.returner_write_profile')
if write_profile:
ttl = __opts__.get(write_profile, {}).get('etcd.ttl')
else:
ttl = __opts__.get('etcd.ttl')
client, path = _get_conn(__opts__, wri... | def returner(ret):
'''
Return data to an etcd server or cluster
'''
write_profile = __opts__.get('etcd.returner_write_profile')
if write_profile:
ttl = __opts__.get(write_profile, {}).get('etcd.ttl')
else:
ttl = __opts__.get('etcd.ttl')
client, path = _get_conn(__opts__, wri... | [
"Return",
"data",
"to",
"an",
"etcd",
"server",
"or",
"cluster"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L107-L134 | [
"def",
"returner",
"(",
"ret",
")",
":",
"write_profile",
"=",
"__opts__",
".",
"get",
"(",
"'etcd.returner_write_profile'",
")",
"if",
"write_profile",
":",
"ttl",
"=",
"__opts__",
".",
"get",
"(",
"write_profile",
",",
"{",
"}",
")",
".",
"get",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save_load | Save the load to the specified jid | salt/returners/etcd_return.py | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
log.debug('sdstack_etcd returner <save_load> called jid: %s', jid)
write_profile = __opts__.get('etcd.returner_write_profile')
client, path = _get_conn(__opts__, write_profile)
if write_profile:
ttl = ... | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
log.debug('sdstack_etcd returner <save_load> called jid: %s', jid)
write_profile = __opts__.get('etcd.returner_write_profile')
client, path = _get_conn(__opts__, write_profile)
if write_profile:
ttl = ... | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L137-L152 | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <save_load> called jid: %s'",
",",
"jid",
")",
"write_profile",
"=",
"__opts__",
".",
"get",
"(",
"'etcd.returner_write_profile'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_load | Return the load data that marks a specified jid | salt/returners/etcd_return.py | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
log.debug('sdstack_etcd returner <get_load> called jid: %s', jid)
read_profile = __opts__.get('etcd.returner_read_profile')
client, path = _get_conn(__opts__, read_profile)
return salt.utils.json.loads(client.get('/'.... | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
log.debug('sdstack_etcd returner <get_load> called jid: %s', jid)
read_profile = __opts__.get('etcd.returner_read_profile')
client, path = _get_conn(__opts__, read_profile)
return salt.utils.json.loads(client.get('/'.... | [
"Return",
"the",
"load",
"data",
"that",
"marks",
"a",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L169-L176 | [
"def",
"get_load",
"(",
"jid",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <get_load> called jid: %s'",
",",
"jid",
")",
"read_profile",
"=",
"__opts__",
".",
"get",
"(",
"'etcd.returner_read_profile'",
")",
"client",
",",
"path",
"=",
"_get_conn",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jid | Return the information returned when the specified job id was executed | salt/returners/etcd_return.py | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
log.debug('sdstack_etcd returner <get_jid> called jid: %s', jid)
ret = {}
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'jobs', jid)))
for item in items.children:
... | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
log.debug('sdstack_etcd returner <get_jid> called jid: %s', jid)
ret = {}
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'jobs', jid)))
for item in items.children:
... | [
"Return",
"the",
"information",
"returned",
"when",
"the",
"specified",
"job",
"id",
"was",
"executed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L179-L193 | [
"def",
"get_jid",
"(",
"jid",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <get_jid> called jid: %s'",
",",
"jid",
")",
"ret",
"=",
"{",
"}",
"client",
",",
"path",
"=",
"_get_conn",
"(",
"__opts__",
")",
"items",
"=",
"client",
".",
"get",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_fun | Return a dict of the last function called for all minions | salt/returners/etcd_return.py | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
log.debug('sdstack_etcd returner <get_fun> called fun: %s', fun)
ret = {}
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'minions')))
for item in items.children:
comps = str... | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
log.debug('sdstack_etcd returner <get_fun> called fun: %s', fun)
ret = {}
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'minions')))
for item in items.children:
comps = str... | [
"Return",
"a",
"dict",
"of",
"the",
"last",
"function",
"called",
"for",
"all",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L196-L209 | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <get_fun> called fun: %s'",
",",
"fun",
")",
"ret",
"=",
"{",
"}",
"client",
",",
"path",
"=",
"_get_conn",
"(",
"__opts__",
")",
"items",
"=",
"client",
".",
"get",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jids | Return a list of all job ids | salt/returners/etcd_return.py | def get_jids():
'''
Return a list of all job ids
'''
log.debug('sdstack_etcd returner <get_jids> called')
ret = []
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'jobs')))
for item in items.children:
if item.dir is True:
jid = str(item.key).spli... | def get_jids():
'''
Return a list of all job ids
'''
log.debug('sdstack_etcd returner <get_jids> called')
ret = []
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'jobs')))
for item in items.children:
if item.dir is True:
jid = str(item.key).spli... | [
"Return",
"a",
"list",
"of",
"all",
"job",
"ids"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L212-L224 | [
"def",
"get_jids",
"(",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <get_jids> called'",
")",
"ret",
"=",
"[",
"]",
"client",
",",
"path",
"=",
"_get_conn",
"(",
"__opts__",
")",
"items",
"=",
"client",
".",
"get",
"(",
"'/'",
".",
"join"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_minions | Return a list of minions | salt/returners/etcd_return.py | def get_minions():
'''
Return a list of minions
'''
log.debug('sdstack_etcd returner <get_minions> called')
ret = []
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'minions')))
for item in items.children:
comps = str(item.key).split('/')
ret.append(... | def get_minions():
'''
Return a list of minions
'''
log.debug('sdstack_etcd returner <get_minions> called')
ret = []
client, path = _get_conn(__opts__)
items = client.get('/'.join((path, 'minions')))
for item in items.children:
comps = str(item.key).split('/')
ret.append(... | [
"Return",
"a",
"list",
"of",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/etcd_return.py#L227-L238 | [
"def",
"get_minions",
"(",
")",
":",
"log",
".",
"debug",
"(",
"'sdstack_etcd returner <get_minions> called'",
")",
"ret",
"=",
"[",
"]",
"client",
",",
"path",
"=",
"_get_conn",
"(",
"__opts__",
")",
"items",
"=",
"client",
".",
"get",
"(",
"'/'",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure a Linux ACL is present
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_name
The user or group
perms
Set the permissions eg.: rwx
recurse
Set the permissions recursive in the path
force
Wipe o... | salt/states/linux_acl.py | def present(name, acl_type, acl_name='', perms='', recurse=False, force=False):
'''
Ensure a Linux ACL is present
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_name
The user or group
perms
Set the permissions eg.: ... | def present(name, acl_type, acl_name='', perms='', recurse=False, force=False):
'''
Ensure a Linux ACL is present
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_name
The user or group
perms
Set the permissions eg.: ... | [
"Ensure",
"a",
"Linux",
"ACL",
"is",
"present"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/linux_acl.py#L82-L219 | [
"def",
"present",
"(",
"name",
",",
"acl_type",
",",
"acl_name",
"=",
"''",
",",
"perms",
"=",
"''",
",",
"recurse",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure a Linux ACL does not exist
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
The user or group
perms
Remove the permissions eg.: rwx
recurse
Set the permissions recursive in the path | salt/states/linux_acl.py | def absent(name, acl_type, acl_name='', perms='', recurse=False):
'''
Ensure a Linux ACL does not exist
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
The user or group
perms
Remove the permissions eg.: rwx
... | def absent(name, acl_type, acl_name='', perms='', recurse=False):
'''
Ensure a Linux ACL does not exist
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
The user or group
perms
Remove the permissions eg.: rwx
... | [
"Ensure",
"a",
"Linux",
"ACL",
"does",
"not",
"exist"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/linux_acl.py#L222-L307 | [
"def",
"absent",
"(",
"name",
",",
"acl_type",
",",
"acl_name",
"=",
"''",
",",
"perms",
"=",
"''",
",",
"recurse",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.