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 | read_secret | Return the value of key at path in vault, or entire secret
Jinja Example:
.. code-block:: jinja
my-secret: {{ salt['vault'].read_secret('secret/my/secret', 'some-key') }}
.. code-block:: jinja
{% set supersecret = salt['vault'].read_secret('secret/my/secret') %}
secrets:
... | salt/modules/vault.py | def read_secret(path, key=None):
'''
Return the value of key at path in vault, or entire secret
Jinja Example:
.. code-block:: jinja
my-secret: {{ salt['vault'].read_secret('secret/my/secret', 'some-key') }}
.. code-block:: jinja
{% set supersecret = salt['vault'].read_secret('s... | def read_secret(path, key=None):
'''
Return the value of key at path in vault, or entire secret
Jinja Example:
.. code-block:: jinja
my-secret: {{ salt['vault'].read_secret('secret/my/secret', 'some-key') }}
.. code-block:: jinja
{% set supersecret = salt['vault'].read_secret('s... | [
"Return",
"the",
"value",
"of",
"key",
"at",
"path",
"in",
"vault",
"or",
"entire",
"secret"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vault.py#L142-L172 | [
"def",
"read_secret",
"(",
"path",
",",
"key",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Reading Vault secret for %s at %s'",
",",
"__grains__",
"[",
"'id'",
"]",
",",
"path",
")",
"try",
":",
"url",
"=",
"'v1/{0}'",
".",
"format",
"(",
"path",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | write_secret | Set secret at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_secret "secret/my/secret" user="foo" password="bar" | salt/modules/vault.py | def write_secret(path, **kwargs):
'''
Set secret at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_secret "secret/my/secret" user="foo" password="bar"
'''
log.debug('Writing vault secrets for %s at %s', __grains__['... | def write_secret(path, **kwargs):
'''
Set secret at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_secret "secret/my/secret" user="foo" password="bar"
'''
log.debug('Writing vault secrets for %s at %s', __grains__['... | [
"Set",
"secret",
"at",
"the",
"path",
"in",
"vault",
".",
"The",
"vault",
"policy",
"used",
"must",
"allow",
"this",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vault.py#L175-L197 | [
"def",
"write_secret",
"(",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"log",
".",
"debug",
"(",
"'Writing vault secrets for %s at %s'",
",",
"__grains__",
"[",
"'id'",
"]",
",",
"path",
")",
"data",
"=",
"dict",
"(",
"[",
"(",
"x",
",",
"y",
")",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | write_raw | Set raw data at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_raw "secret/my/secret" '{"user":"foo","password": "bar"}' | salt/modules/vault.py | def write_raw(path, raw):
'''
Set raw data at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_raw "secret/my/secret" '{"user":"foo","password": "bar"}'
'''
log.debug('Writing vault secrets for %s at %s', __grains__['... | def write_raw(path, raw):
'''
Set raw data at the path in vault. The vault policy used must allow this.
CLI Example:
.. code-block:: bash
salt '*' vault.write_raw "secret/my/secret" '{"user":"foo","password": "bar"}'
'''
log.debug('Writing vault secrets for %s at %s', __grains__['... | [
"Set",
"raw",
"data",
"at",
"the",
"path",
"in",
"vault",
".",
"The",
"vault",
"policy",
"used",
"must",
"allow",
"this",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vault.py#L200-L221 | [
"def",
"write_raw",
"(",
"path",
",",
"raw",
")",
":",
"log",
".",
"debug",
"(",
"'Writing vault secrets for %s at %s'",
",",
"__grains__",
"[",
"'id'",
"]",
",",
"path",
")",
"try",
":",
"url",
"=",
"'v1/{0}'",
".",
"format",
"(",
"path",
")",
"response... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Verify that the raid is present
.. versionchanged:: 2014.7.0
name
The name of raid device to be created
level
The RAID level to use when creating the raid.
devices
A list of devices used to build the array.
kwargs
Optional arguments to be passed to mdadm.... | salt/states/mdadm_raid.py | def present(name,
level,
devices,
**kwargs):
'''
Verify that the raid is present
.. versionchanged:: 2014.7.0
name
The name of raid device to be created
level
The RAID level to use when creating the raid.
devices
A list of d... | def present(name,
level,
devices,
**kwargs):
'''
Verify that the raid is present
.. versionchanged:: 2014.7.0
name
The name of raid device to be created
level
The RAID level to use when creating the raid.
devices
A list of d... | [
"Verify",
"that",
"the",
"raid",
"is",
"present"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mdadm_raid.py#L48-L212 | [
"def",
"present",
"(",
"name",
",",
"level",
",",
"devices",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
"}",
"# Device exist... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | render | Accepts HJSON as a string or as a file object and runs it through the HJSON
parser.
:rtype: A Python data structure | salt/renderers/hjson.py | def render(hjson_data, saltenv='base', sls='', **kws):
'''
Accepts HJSON as a string or as a file object and runs it through the HJSON
parser.
:rtype: A Python data structure
'''
if not isinstance(hjson_data, six.string_types):
hjson_data = hjson_data.read()
if hjson_data.startswit... | def render(hjson_data, saltenv='base', sls='', **kws):
'''
Accepts HJSON as a string or as a file object and runs it through the HJSON
parser.
:rtype: A Python data structure
'''
if not isinstance(hjson_data, six.string_types):
hjson_data = hjson_data.read()
if hjson_data.startswit... | [
"Accepts",
"HJSON",
"as",
"a",
"string",
"or",
"as",
"a",
"file",
"object",
"and",
"runs",
"it",
"through",
"the",
"HJSON",
"parser",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/hjson.py#L23-L37 | [
"def",
"render",
"(",
"hjson_data",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"*",
"*",
"kws",
")",
":",
"if",
"not",
"isinstance",
"(",
"hjson_data",
",",
"six",
".",
"string_types",
")",
":",
"hjson_data",
"=",
"hjson_data",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | function_present | Ensure function exists.
name
The name of the state definition
FunctionName
Name of the Function.
Runtime
The Runtime environment for the function. One of
'nodejs', 'java8', or 'python2.7'
Role
The name or ARN of the IAM role that the function assumes when it e... | salt/states/boto_lambda.py | def function_present(name, FunctionName, Runtime, Role, Handler, ZipFile=None,
S3Bucket=None, S3Key=None, S3ObjectVersion=None,
Description='', Timeout=3, MemorySize=128,
Permissions=None, RoleRetries=5, region=None, key=None,
keyid=Non... | def function_present(name, FunctionName, Runtime, Role, Handler, ZipFile=None,
S3Bucket=None, S3Key=None, S3ObjectVersion=None,
Description='', Timeout=3, MemorySize=128,
Permissions=None, RoleRetries=5, region=None, key=None,
keyid=Non... | [
"Ensure",
"function",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lambda.py#L87-L311 | [
"def",
"function_present",
"(",
"name",
",",
"FunctionName",
",",
"Runtime",
",",
"Role",
",",
"Handler",
",",
"ZipFile",
"=",
"None",
",",
"S3Bucket",
"=",
"None",
",",
"S3Key",
"=",
"None",
",",
"S3ObjectVersion",
"=",
"None",
",",
"Description",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_present | Ensure alias exists.
name
The name of the state definition.
FunctionName
Name of the function for which you want to create an alias.
Name
The name of the alias to be created.
FunctionVersion
Function version for which you are creating the alias.
Description
... | salt/states/boto_lambda.py | def alias_present(name, FunctionName, Name, FunctionVersion, Description='',
region=None, key=None, keyid=None, profile=None):
'''
Ensure alias exists.
name
The name of the state definition.
FunctionName
Name of the function for which you want to create an alias.
... | def alias_present(name, FunctionName, Name, FunctionVersion, Description='',
region=None, key=None, keyid=None, profile=None):
'''
Ensure alias exists.
name
The name of the state definition.
FunctionName
Name of the function for which you want to create an alias.
... | [
"Ensure",
"alias",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lambda.py#L572-L675 | [
"def",
"alias_present",
"(",
"name",
",",
"FunctionName",
",",
"Name",
",",
"FunctionVersion",
",",
"Description",
"=",
"''",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event_source_mapping_present | Ensure event source mapping exists.
name
The name of the state definition.
EventSourceArn
The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB stream that is the event source.
FunctionName
The Lambda function to invoke when AWS Lambda detects an even... | salt/states/boto_lambda.py | def event_source_mapping_present(name, EventSourceArn, FunctionName,
StartingPosition, Enabled=True, BatchSize=100,
region=None, key=None, keyid=None,
profile=None):
'''
Ensure event source mapping exists.
na... | def event_source_mapping_present(name, EventSourceArn, FunctionName,
StartingPosition, Enabled=True, BatchSize=100,
region=None, key=None, keyid=None,
profile=None):
'''
Ensure event source mapping exists.
na... | [
"Ensure",
"event",
"source",
"mapping",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lambda.py#L756-L897 | [
"def",
"event_source_mapping_present",
"(",
"name",
",",
"EventSourceArn",
",",
"FunctionName",
",",
"StartingPosition",
",",
"Enabled",
"=",
"True",
",",
"BatchSize",
"=",
"100",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event_source_mapping_absent | Ensure event source mapping with passed properties is absent.
name
The name of the state definition.
EventSourceArn
ARN of the event source.
FunctionName
Name of the lambda function.
region
Region to connect to.
key
Secret key to be used.
keyid
... | salt/states/boto_lambda.py | def event_source_mapping_absent(name, EventSourceArn, FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
Ensure event source mapping with passed properties is absent.
name
The name of the state definition.
EventSourceArn
ARN of the event... | def event_source_mapping_absent(name, EventSourceArn, FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
Ensure event source mapping with passed properties is absent.
name
The name of the state definition.
EventSourceArn
ARN of the event... | [
"Ensure",
"event",
"source",
"mapping",
"with",
"passed",
"properties",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lambda.py#L900-L963 | [
"def",
"event_source_mapping_absent",
"(",
"name",
",",
"EventSourceArn",
",",
"FunctionName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_balancers | Return a list of load balancers.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_balancers method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt myminion libcloud_storage.list_balancers pr... | salt/modules/libcloud_loadbalancer.py | def list_balancers(profile, **libcloud_kwargs):
'''
Return a list of load balancers.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_balancers method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: ba... | def list_balancers(profile, **libcloud_kwargs):
'''
Return a list of load balancers.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_balancers method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: ba... | [
"Return",
"a",
"list",
"of",
"load",
"balancers",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L104-L126 | [
"def",
"list_balancers",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_protocols | Return a list of supported protocols.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_protocols method
:type libcloud_kwargs: ``dict``
:return: a list of supported protocols
:rtype: ``list`` of ``str``
CLI Example:
... | salt/modules/libcloud_loadbalancer.py | def list_protocols(profile, **libcloud_kwargs):
'''
Return a list of supported protocols.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_protocols method
:type libcloud_kwargs: ``dict``
:return: a list of supported pr... | def list_protocols(profile, **libcloud_kwargs):
'''
Return a list of supported protocols.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_protocols method
:type libcloud_kwargs: ``dict``
:return: a list of supported pr... | [
"Return",
"a",
"list",
"of",
"supported",
"protocols",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L129-L150 | [
"def",
"list_protocols",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_balancer | Create a new load balancer instance
:param name: Name of the new load balancer (required)
:type name: ``str``
:param port: Port the load balancer should listen on, defaults to 80
:type port: ``str``
:param protocol: Loadbalancer protocol, defaults to http.
:type protocol: ``str``
:par... | salt/modules/libcloud_loadbalancer.py | def create_balancer(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs):
'''
Create a new load balancer instance
:param name: Name of the new load balancer (required)
:type name: ``str``
:param port: Port the load balancer should listen on, defaults to 80
:type po... | def create_balancer(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs):
'''
Create a new load balancer instance
:param name: Name of the new load balancer (required)
:type name: ``str``
:param port: Port the load balancer should listen on, defaults to 80
:type po... | [
"Create",
"a",
"new",
"load",
"balancer",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L153-L200 | [
"def",
"create_balancer",
"(",
"name",
",",
"port",
",",
"protocol",
",",
"profile",
",",
"algorithm",
"=",
"None",
",",
"members",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"if",
"algorithm",
"is",
"None",
":",
"algorithm",
"=",
"Algorith... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy_balancer | Destroy a load balancer
:param balancer_id: LoadBalancer ID which should be used
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's destroy_balancer method
:type libcloud_kwargs: ``dict``
:return: ... | salt/modules/libcloud_loadbalancer.py | def destroy_balancer(balancer_id, profile, **libcloud_kwargs):
'''
Destroy a load balancer
:param balancer_id: LoadBalancer ID which should be used
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's ... | def destroy_balancer(balancer_id, profile, **libcloud_kwargs):
'''
Destroy a load balancer
:param balancer_id: LoadBalancer ID which should be used
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's ... | [
"Destroy",
"a",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L203-L228 | [
"def",
"destroy_balancer",
"(",
"balancer_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_balancer_by_name | Get the details for a load balancer by name
:param name: Name of a load balancer you want to fetch
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_balancers method
:type libcloud_kwargs: ``dict``
... | salt/modules/libcloud_loadbalancer.py | def get_balancer_by_name(name, profile, **libcloud_kwargs):
'''
Get the details for a load balancer by name
:param name: Name of a load balancer you want to fetch
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the d... | def get_balancer_by_name(name, profile, **libcloud_kwargs):
'''
Get the details for a load balancer by name
:param name: Name of a load balancer you want to fetch
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the d... | [
"Get",
"the",
"details",
"for",
"a",
"load",
"balancer",
"by",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L231-L261 | [
"def",
"get_balancer_by_name",
"(",
"name",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | balancer_attach_member | Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param port: Port for the new member
:type port: ``int``
:param profile: The profile key
:type p... | salt/modules/libcloud_loadbalancer.py | def balancer_attach_member(balancer_id, ip, port, profile, extra=None, **libcloud_kwargs):
'''
Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param p... | def balancer_attach_member(balancer_id, ip, port, profile, extra=None, **libcloud_kwargs):
'''
Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param p... | [
"Add",
"a",
"new",
"member",
"to",
"the",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L314-L344 | [
"def",
"balancer_attach_member",
"(",
"balancer_id",
",",
"ip",
",",
"port",
",",
"profile",
",",
"extra",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"sa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | balancer_detach_member | Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param port: Port for the new member
:type port: ``int``
:param profile: The profile key
:type p... | salt/modules/libcloud_loadbalancer.py | def balancer_detach_member(balancer_id, member_id, profile, **libcloud_kwargs):
'''
Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param port: Port f... | def balancer_detach_member(balancer_id, member_id, profile, **libcloud_kwargs):
'''
Add a new member to the load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param ip: IP address for the new member
:type ip: ``str``
:param port: Port f... | [
"Add",
"a",
"new",
"member",
"to",
"the",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L347-L383 | [
"def",
"balancer_detach_member",
"(",
"balancer_id",
",",
"member_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"balancer",
"=",
"conn",
".",
"get_balancer",
"(",
"balancer_id"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_balancer_members | List the members of a load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_balancer_members method
:type libcloud_kwargs: ``d... | salt/modules/libcloud_loadbalancer.py | def list_balancer_members(balancer_id, profile, **libcloud_kwargs):
'''
List the members of a load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra argumen... | def list_balancer_members(balancer_id, profile, **libcloud_kwargs):
'''
List the members of a load balancer
:param balancer_id: id of a load balancer you want to fetch
:type balancer_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra argumen... | [
"List",
"the",
"members",
"of",
"a",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L386-L409 | [
"def",
"list_balancer_members",
"(",
"balancer_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"balancer",
"=",
"conn",
".",
"get_balancer",
"(",
"balancer_id",
")",
"libcloud_kw... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | extra | Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash... | salt/modules/libcloud_loadbalancer.py | def extra(method, profile, **libcloud_kwargs):
'''
Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's method
:type libcloud_k... | def extra(method, profile, **libcloud_kwargs):
'''
Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's method
:type libcloud_k... | [
"Call",
"an",
"extended",
"method",
"on",
"the",
"driver"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_loadbalancer.py#L412-L434 | [
"def",
"extra",
"(",
"method",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_kwargs",
")",
"conn",
"=",
"_get_driver",
"(",
"profile",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | Install new alternative for defined <name>
name
is the master name for this link group
(e.g. pager)
link
is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
path
is the location of the new alternative target.
NB: This file / directory... | salt/states/alternatives.py | def install(name, link, path, priority):
'''
Install new alternative for defined <name>
name
is the master name for this link group
(e.g. pager)
link
is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
path
is the location of the new ... | def install(name, link, path, priority):
'''
Install new alternative for defined <name>
name
is the master name for this link group
(e.g. pager)
link
is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
path
is the location of the new ... | [
"Install",
"new",
"alternative",
"for",
"defined",
"<name",
">"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/alternatives.py#L44-L103 | [
"def",
"install",
"(",
"name",
",",
"link",
",",
"path",
",",
"priority",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'link'",
":",
"link",
",",
"'path'",
":",
"path",
",",
"'priority'",
":",
"priority",
",",
"'result'",
":",
"True",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | Removes installed alternative for defined <name> and <path>
or fallback to default alternative, if some defined before.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
(e.g. /usr/bin/less) | salt/states/alternatives.py | def remove(name, path):
'''
Removes installed alternative for defined <name> and <path>
or fallback to default alternative, if some defined before.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
... | def remove(name, path):
'''
Removes installed alternative for defined <name> and <path>
or fallback to default alternative, if some defined before.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
... | [
"Removes",
"installed",
"alternative",
"for",
"defined",
"<name",
">",
"and",
"<path",
">",
"or",
"fallback",
"to",
"default",
"alternative",
"if",
"some",
"defined",
"before",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/alternatives.py#L106-L159 | [
"def",
"remove",
"(",
"name",
",",
"path",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'path'",
":",
"path",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"isinstalled",
"=",
"__salt__"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auto | .. versionadded:: 0.17.0
Instruct alternatives to use the highest priority
path for <name>
name
is the master name for this link group
(e.g. pager) | salt/states/alternatives.py | def auto(name):
'''
.. versionadded:: 0.17.0
Instruct alternatives to use the highest priority
path for <name>
name
is the master name for this link group
(e.g. pager)
'''
ret = {'name': name,
'result': True,
'comment': '',
'changes': {}}
... | def auto(name):
'''
.. versionadded:: 0.17.0
Instruct alternatives to use the highest priority
path for <name>
name
is the master name for this link group
(e.g. pager)
'''
ret = {'name': name,
'result': True,
'comment': '',
'changes': {}}
... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/alternatives.py#L162-L190 | [
"def",
"auto",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"display",
"=",
"__salt__",
"[",
"'alternatives.display'",
"]",
"(",
"name"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_ | .. versionadded:: 0.17.0
Sets alternative for <name> to <path>, if <path> is defined
as an alternative for <name>.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
(e.g. /usr/bin/less)
.. code-bl... | salt/states/alternatives.py | def set_(name, path):
'''
.. versionadded:: 0.17.0
Sets alternative for <name> to <path>, if <path> is defined
as an alternative for <name>.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
(e... | def set_(name, path):
'''
.. versionadded:: 0.17.0
Sets alternative for <name> to <path>, if <path> is defined
as an alternative for <name>.
name
is the master name for this link group
(e.g. pager)
path
is the location of one of the alternative target files.
(e... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/alternatives.py#L193-L257 | [
"def",
"set_",
"(",
"name",
",",
"path",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'path'",
":",
"path",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"current",
"=",
"__salt__",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that a data source is present.
name
Name of the data source.
type
Type of the datasource ('graphite', 'influxdb' etc.).
access
Use proxy or direct. Default: proxy
url
The URL to the data source API.
user
Optional - user to authenticate with the dat... | salt/states/grafana4_datasource.py | def present(name,
type,
url,
access=None,
user=None,
password=None,
database=None,
basic_auth=None,
basic_auth_user=None,
basic_auth_password=None,
tls_auth=None,
json_data=None,
... | def present(name,
type,
url,
access=None,
user=None,
password=None,
database=None,
basic_auth=None,
basic_auth_user=None,
basic_auth_password=None,
tls_auth=None,
json_data=None,
... | [
"Ensure",
"that",
"a",
"data",
"source",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_datasource.py#L57-L180 | [
"def",
"present",
"(",
"name",
",",
"type",
",",
"url",
",",
"access",
"=",
"None",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"database",
"=",
"None",
",",
"basic_auth",
"=",
"None",
",",
"basic_auth_user",
"=",
"None",
",",
"basic... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that a data source is present.
name
Name of the data source to remove.
orgname
Name of the organization from which the data source should be absent.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'. | salt/states/grafana4_datasource.py | def absent(name, orgname=None, profile='grafana'):
'''
Ensure that a data source is present.
name
Name of the data source to remove.
orgname
Name of the organization from which the data source should be absent.
profile
Configuration profile used to connect to the Grafana i... | def absent(name, orgname=None, profile='grafana'):
'''
Ensure that a data source is present.
name
Name of the data source to remove.
orgname
Name of the organization from which the data source should be absent.
profile
Configuration profile used to connect to the Grafana i... | [
"Ensure",
"that",
"a",
"data",
"source",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_datasource.py#L183-L217 | [
"def",
"absent",
"(",
"name",
",",
"orgname",
"=",
"None",
",",
"profile",
"=",
"'grafana'",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"ret",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.load_name | Return the primary name associate with the load, if an empty string
is returned then the load does not match the function | salt/auth/__init__.py | def load_name(self, load):
'''
Return the primary name associate with the load, if an empty string
is returned then the load does not match the function
'''
if 'eauth' not in load:
return ''
fstr = '{0}.auth'.format(load['eauth'])
if fstr not in self.a... | def load_name(self, load):
'''
Return the primary name associate with the load, if an empty string
is returned then the load does not match the function
'''
if 'eauth' not in load:
return ''
fstr = '{0}.auth'.format(load['eauth'])
if fstr not in self.a... | [
"Return",
"the",
"primary",
"name",
"associate",
"with",
"the",
"load",
"if",
"an",
"empty",
"string",
"is",
"returned",
"then",
"the",
"load",
"does",
"not",
"match",
"the",
"function"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L70-L84 | [
"def",
"load_name",
"(",
"self",
",",
"load",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"return",
"''",
"fstr",
"=",
"'{0}.auth'",
".",
"format",
"(",
"load",
"[",
"'eauth'",
"]",
")",
"if",
"fstr",
"not",
"in",
"self",
".",
"auth",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.__auth_call | Return the token and set the cache data for use
Do not call this directly! Use the time_auth method to overcome timing
attacks | salt/auth/__init__.py | def __auth_call(self, load):
'''
Return the token and set the cache data for use
Do not call this directly! Use the time_auth method to overcome timing
attacks
'''
if 'eauth' not in load:
return False
fstr = '{0}.auth'.format(load['eauth'])
if... | def __auth_call(self, load):
'''
Return the token and set the cache data for use
Do not call this directly! Use the time_auth method to overcome timing
attacks
'''
if 'eauth' not in load:
return False
fstr = '{0}.auth'.format(load['eauth'])
if... | [
"Return",
"the",
"token",
"and",
"set",
"the",
"cache",
"data",
"for",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L86-L114 | [
"def",
"__auth_call",
"(",
"self",
",",
"load",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"return",
"False",
"fstr",
"=",
"'{0}.auth'",
".",
"format",
"(",
"load",
"[",
"'eauth'",
"]",
")",
"if",
"fstr",
"not",
"in",
"self",
".",
"auth",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.time_auth | Make sure that all failures happen in the same amount of time | salt/auth/__init__.py | def time_auth(self, load):
'''
Make sure that all failures happen in the same amount of time
'''
start = time.time()
ret = self.__auth_call(load)
if ret:
return ret
f_time = time.time() - start
if f_time > self.max_fail:
self.max_fa... | def time_auth(self, load):
'''
Make sure that all failures happen in the same amount of time
'''
start = time.time()
ret = self.__auth_call(load)
if ret:
return ret
f_time = time.time() - start
if f_time > self.max_fail:
self.max_fa... | [
"Make",
"sure",
"that",
"all",
"failures",
"happen",
"in",
"the",
"same",
"amount",
"of",
"time"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L116-L134 | [
"def",
"time_auth",
"(",
"self",
",",
"load",
")",
":",
"start",
"=",
"time",
".",
"time",
"(",
")",
"ret",
"=",
"self",
".",
"__auth_call",
"(",
"load",
")",
"if",
"ret",
":",
"return",
"ret",
"f_time",
"=",
"time",
".",
"time",
"(",
")",
"-",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.__get_acl | Returns ACL for a specific user.
Returns None if eauth doesn't provide any for the user. I. e. None means: use acl declared
in master config. | salt/auth/__init__.py | def __get_acl(self, load):
'''
Returns ACL for a specific user.
Returns None if eauth doesn't provide any for the user. I. e. None means: use acl declared
in master config.
'''
if 'eauth' not in load:
return None
mod = self.opts['eauth_acl_module']
... | def __get_acl(self, load):
'''
Returns ACL for a specific user.
Returns None if eauth doesn't provide any for the user. I. e. None means: use acl declared
in master config.
'''
if 'eauth' not in load:
return None
mod = self.opts['eauth_acl_module']
... | [
"Returns",
"ACL",
"for",
"a",
"specific",
"user",
".",
"Returns",
"None",
"if",
"eauth",
"doesn",
"t",
"provide",
"any",
"for",
"the",
"user",
".",
"I",
".",
"e",
".",
"None",
"means",
":",
"use",
"acl",
"declared",
"in",
"master",
"config",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L136-L158 | [
"def",
"__get_acl",
"(",
"self",
",",
"load",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"return",
"None",
"mod",
"=",
"self",
".",
"opts",
"[",
"'eauth_acl_module'",
"]",
"if",
"not",
"mod",
":",
"mod",
"=",
"load",
"[",
"'eauth'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.__process_acl | Allows eauth module to modify the access list right before it'll be applied to the request.
For example ldap auth module expands entries | salt/auth/__init__.py | def __process_acl(self, load, auth_list):
'''
Allows eauth module to modify the access list right before it'll be applied to the request.
For example ldap auth module expands entries
'''
if 'eauth' not in load:
return auth_list
fstr = '{0}.process_acl'.format(... | def __process_acl(self, load, auth_list):
'''
Allows eauth module to modify the access list right before it'll be applied to the request.
For example ldap auth module expands entries
'''
if 'eauth' not in load:
return auth_list
fstr = '{0}.process_acl'.format(... | [
"Allows",
"eauth",
"module",
"to",
"modify",
"the",
"access",
"list",
"right",
"before",
"it",
"ll",
"be",
"applied",
"to",
"the",
"request",
".",
"For",
"example",
"ldap",
"auth",
"module",
"expands",
"entries"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L160-L174 | [
"def",
"__process_acl",
"(",
"self",
",",
"load",
",",
"auth_list",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"return",
"auth_list",
"fstr",
"=",
"'{0}.process_acl'",
".",
"format",
"(",
"load",
"[",
"'eauth'",
"]",
")",
"if",
"fstr",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.get_groups | Read in a load and return the groups a user is a member of
by asking the appropriate provider | salt/auth/__init__.py | def get_groups(self, load):
'''
Read in a load and return the groups a user is a member of
by asking the appropriate provider
'''
if 'eauth' not in load:
return False
fstr = '{0}.groups'.format(load['eauth'])
if fstr not in self.auth:
retur... | def get_groups(self, load):
'''
Read in a load and return the groups a user is a member of
by asking the appropriate provider
'''
if 'eauth' not in load:
return False
fstr = '{0}.groups'.format(load['eauth'])
if fstr not in self.auth:
retur... | [
"Read",
"in",
"a",
"load",
"and",
"return",
"the",
"groups",
"a",
"user",
"is",
"a",
"member",
"of",
"by",
"asking",
"the",
"appropriate",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L176-L195 | [
"def",
"get_groups",
"(",
"self",
",",
"load",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"return",
"False",
"fstr",
"=",
"'{0}.groups'",
".",
"format",
"(",
"load",
"[",
"'eauth'",
"]",
")",
"if",
"fstr",
"not",
"in",
"self",
".",
"auth",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth._allow_custom_expire | Return bool if requesting user is allowed to set custom expire | salt/auth/__init__.py | def _allow_custom_expire(self, load):
'''
Return bool if requesting user is allowed to set custom expire
'''
expire_override = self.opts.get('token_expire_user_override', False)
if expire_override is True:
return True
if isinstance(expire_override, collectio... | def _allow_custom_expire(self, load):
'''
Return bool if requesting user is allowed to set custom expire
'''
expire_override = self.opts.get('token_expire_user_override', False)
if expire_override is True:
return True
if isinstance(expire_override, collectio... | [
"Return",
"bool",
"if",
"requesting",
"user",
"is",
"allowed",
"to",
"set",
"custom",
"expire"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L197-L212 | [
"def",
"_allow_custom_expire",
"(",
"self",
",",
"load",
")",
":",
"expire_override",
"=",
"self",
".",
"opts",
".",
"get",
"(",
"'token_expire_user_override'",
",",
"False",
")",
"if",
"expire_override",
"is",
"True",
":",
"return",
"True",
"if",
"isinstance"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.mk_token | Run time_auth and create a token. Return False or the token | salt/auth/__init__.py | def mk_token(self, load):
'''
Run time_auth and create a token. Return False or the token
'''
if not self.authenticate_eauth(load):
return {}
if self._allow_custom_expire(load):
token_expire = load.pop('token_expire', self.opts['token_expire'])
el... | def mk_token(self, load):
'''
Run time_auth and create a token. Return False or the token
'''
if not self.authenticate_eauth(load):
return {}
if self._allow_custom_expire(load):
token_expire = load.pop('token_expire', self.opts['token_expire'])
el... | [
"Run",
"time_auth",
"and",
"create",
"a",
"token",
".",
"Return",
"False",
"or",
"the",
"token"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L214-L240 | [
"def",
"mk_token",
"(",
"self",
",",
"load",
")",
":",
"if",
"not",
"self",
".",
"authenticate_eauth",
"(",
"load",
")",
":",
"return",
"{",
"}",
"if",
"self",
".",
"_allow_custom_expire",
"(",
"load",
")",
":",
"token_expire",
"=",
"load",
".",
"pop",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.get_tok | Return the name associated with the token, or False if the token is
not valid | salt/auth/__init__.py | def get_tok(self, tok):
'''
Return the name associated with the token, or False if the token is
not valid
'''
tdata = self.tokens["{0}.get_token".format(self.opts['eauth_tokens'])](self.opts, tok)
if not tdata:
return {}
rm_tok = False
if 'exp... | def get_tok(self, tok):
'''
Return the name associated with the token, or False if the token is
not valid
'''
tdata = self.tokens["{0}.get_token".format(self.opts['eauth_tokens'])](self.opts, tok)
if not tdata:
return {}
rm_tok = False
if 'exp... | [
"Return",
"the",
"name",
"associated",
"with",
"the",
"token",
"or",
"False",
"if",
"the",
"token",
"is",
"not",
"valid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L242-L260 | [
"def",
"get_tok",
"(",
"self",
",",
"tok",
")",
":",
"tdata",
"=",
"self",
".",
"tokens",
"[",
"\"{0}.get_token\"",
".",
"format",
"(",
"self",
".",
"opts",
"[",
"'eauth_tokens'",
"]",
")",
"]",
"(",
"self",
".",
"opts",
",",
"tok",
")",
"if",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.rm_token | Remove the given token from token storage. | salt/auth/__init__.py | def rm_token(self, tok):
'''
Remove the given token from token storage.
'''
self.tokens["{0}.rm_token".format(self.opts['eauth_tokens'])](self.opts, tok) | def rm_token(self, tok):
'''
Remove the given token from token storage.
'''
self.tokens["{0}.rm_token".format(self.opts['eauth_tokens'])](self.opts, tok) | [
"Remove",
"the",
"given",
"token",
"from",
"token",
"storage",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L268-L272 | [
"def",
"rm_token",
"(",
"self",
",",
"tok",
")",
":",
"self",
".",
"tokens",
"[",
"\"{0}.rm_token\"",
".",
"format",
"(",
"self",
".",
"opts",
"[",
"'eauth_tokens'",
"]",
")",
"]",
"(",
"self",
".",
"opts",
",",
"tok",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.authenticate_token | Authenticate a user by the token specified in load.
Return the token object or False if auth failed. | salt/auth/__init__.py | def authenticate_token(self, load):
'''
Authenticate a user by the token specified in load.
Return the token object or False if auth failed.
'''
token = self.get_tok(load['token'])
# Bail if the token is empty or if the eauth type specified is not allowed
if not ... | def authenticate_token(self, load):
'''
Authenticate a user by the token specified in load.
Return the token object or False if auth failed.
'''
token = self.get_tok(load['token'])
# Bail if the token is empty or if the eauth type specified is not allowed
if not ... | [
"Authenticate",
"a",
"user",
"by",
"the",
"token",
"specified",
"in",
"load",
".",
"Return",
"the",
"token",
"object",
"or",
"False",
"if",
"auth",
"failed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L274-L286 | [
"def",
"authenticate_token",
"(",
"self",
",",
"load",
")",
":",
"token",
"=",
"self",
".",
"get_tok",
"(",
"load",
"[",
"'token'",
"]",
")",
"# Bail if the token is empty or if the eauth type specified is not allowed",
"if",
"not",
"token",
"or",
"token",
"[",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.authenticate_eauth | Authenticate a user by the external auth module specified in load.
Return True on success or False on failure. | salt/auth/__init__.py | def authenticate_eauth(self, load):
'''
Authenticate a user by the external auth module specified in load.
Return True on success or False on failure.
'''
if 'eauth' not in load:
log.warning('Authentication failure of type "eauth" occurred.')
return False
... | def authenticate_eauth(self, load):
'''
Authenticate a user by the external auth module specified in load.
Return True on success or False on failure.
'''
if 'eauth' not in load:
log.warning('Authentication failure of type "eauth" occurred.')
return False
... | [
"Authenticate",
"a",
"user",
"by",
"the",
"external",
"auth",
"module",
"specified",
"in",
"load",
".",
"Return",
"True",
"on",
"success",
"or",
"False",
"on",
"failure",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L288-L308 | [
"def",
"authenticate_eauth",
"(",
"self",
",",
"load",
")",
":",
"if",
"'eauth'",
"not",
"in",
"load",
":",
"log",
".",
"warning",
"(",
"'Authentication failure of type \"eauth\" occurred.'",
")",
"return",
"False",
"if",
"load",
"[",
"'eauth'",
"]",
"not",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.authenticate_key | Authenticate a user by the key passed in load.
Return the effective user id (name) if it's different from the specified one (for sudo).
If the effective user id is the same as the passed one, return True on success or False on
failure. | salt/auth/__init__.py | def authenticate_key(self, load, key):
'''
Authenticate a user by the key passed in load.
Return the effective user id (name) if it's different from the specified one (for sudo).
If the effective user id is the same as the passed one, return True on success or False on
failure.
... | def authenticate_key(self, load, key):
'''
Authenticate a user by the key passed in load.
Return the effective user id (name) if it's different from the specified one (for sudo).
If the effective user id is the same as the passed one, return True on success or False on
failure.
... | [
"Authenticate",
"a",
"user",
"by",
"the",
"key",
"passed",
"in",
"load",
".",
"Return",
"the",
"effective",
"user",
"id",
"(",
"name",
")",
"if",
"it",
"s",
"different",
"from",
"the",
"specified",
"one",
"(",
"for",
"sudo",
")",
".",
"If",
"the",
"e... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L310-L355 | [
"def",
"authenticate_key",
"(",
"self",
",",
"load",
",",
"key",
")",
":",
"error_msg",
"=",
"'Authentication failure of type \"user\" occurred.'",
"auth_key",
"=",
"load",
".",
"pop",
"(",
"'key'",
",",
"None",
")",
"if",
"auth_key",
"is",
"None",
":",
"log",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.get_auth_list | Retrieve access list for the user specified in load.
The list is built by eauth module or from master eauth configuration.
Return None if current configuration doesn't provide any ACL for the user. Return an empty
list if the user has no rights to execute anything on this master and returns non-... | salt/auth/__init__.py | def get_auth_list(self, load, token=None):
'''
Retrieve access list for the user specified in load.
The list is built by eauth module or from master eauth configuration.
Return None if current configuration doesn't provide any ACL for the user. Return an empty
list if the user ha... | def get_auth_list(self, load, token=None):
'''
Retrieve access list for the user specified in load.
The list is built by eauth module or from master eauth configuration.
Return None if current configuration doesn't provide any ACL for the user. Return an empty
list if the user ha... | [
"Retrieve",
"access",
"list",
"for",
"the",
"user",
"specified",
"in",
"load",
".",
"The",
"list",
"is",
"built",
"by",
"eauth",
"module",
"or",
"from",
"master",
"eauth",
"configuration",
".",
"Return",
"None",
"if",
"current",
"configuration",
"doesn",
"t"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L357-L404 | [
"def",
"get_auth_list",
"(",
"self",
",",
"load",
",",
"token",
"=",
"None",
")",
":",
"# Get auth list from token",
"if",
"token",
"and",
"self",
".",
"opts",
"[",
"'keep_acl_in_token'",
"]",
"and",
"'auth_list'",
"in",
"token",
":",
"return",
"token",
"[",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | LoadAuth.check_authentication | .. versionadded:: 2018.3.0
Go through various checks to see if the token/eauth/user can be authenticated.
Returns a dictionary containing the following keys:
- auth_list
- username
- error
If an error is encountered, return immediately with the relevant error dictiona... | salt/auth/__init__.py | def check_authentication(self, load, auth_type, key=None, show_username=False):
'''
.. versionadded:: 2018.3.0
Go through various checks to see if the token/eauth/user can be authenticated.
Returns a dictionary containing the following keys:
- auth_list
- username
... | def check_authentication(self, load, auth_type, key=None, show_username=False):
'''
.. versionadded:: 2018.3.0
Go through various checks to see if the token/eauth/user can be authenticated.
Returns a dictionary containing the following keys:
- auth_list
- username
... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L406-L477 | [
"def",
"check_authentication",
"(",
"self",
",",
"load",
",",
"auth_type",
",",
"key",
"=",
"None",
",",
"show_username",
"=",
"False",
")",
":",
"auth_list",
"=",
"[",
"]",
"username",
"=",
"load",
".",
"get",
"(",
"'username'",
",",
"'UNKNOWN'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Authorize.auth_data | Gather and create the authorization data sets
We're looking at several constructs here.
Standard eauth: allow jsmith to auth via pam, and execute any command
on server web1
external_auth:
pam:
jsmith:
- web1:
- .*
Django eaut... | salt/auth/__init__.py | def auth_data(self):
'''
Gather and create the authorization data sets
We're looking at several constructs here.
Standard eauth: allow jsmith to auth via pam, and execute any command
on server web1
external_auth:
pam:
jsmith:
- web1:
... | def auth_data(self):
'''
Gather and create the authorization data sets
We're looking at several constructs here.
Standard eauth: allow jsmith to auth via pam, and execute any command
on server web1
external_auth:
pam:
jsmith:
- web1:
... | [
"Gather",
"and",
"create",
"the",
"authorization",
"data",
"sets"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L501-L560 | [
"def",
"auth_data",
"(",
"self",
")",
":",
"auth_data",
"=",
"self",
".",
"opts",
"[",
"'external_auth'",
"]",
"merge_lists",
"=",
"self",
".",
"opts",
"[",
"'pillar_merge_lists'",
"]",
"if",
"'django'",
"in",
"auth_data",
"and",
"'^model'",
"in",
"auth_data... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Authorize.token | Determine if token auth is valid and yield the adata | salt/auth/__init__.py | def token(self, adata, load):
'''
Determine if token auth is valid and yield the adata
'''
try:
token = self.loadauth.get_tok(load['token'])
except Exception as exc:
log.error('Exception occurred when generating auth token: %s', exc)
yield {}
... | def token(self, adata, load):
'''
Determine if token auth is valid and yield the adata
'''
try:
token = self.loadauth.get_tok(load['token'])
except Exception as exc:
log.error('Exception occurred when generating auth token: %s', exc)
yield {}
... | [
"Determine",
"if",
"token",
"auth",
"is",
"valid",
"and",
"yield",
"the",
"adata"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L562-L582 | [
"def",
"token",
"(",
"self",
",",
"adata",
",",
"load",
")",
":",
"try",
":",
"token",
"=",
"self",
".",
"loadauth",
".",
"get_tok",
"(",
"load",
"[",
"'token'",
"]",
")",
"except",
"Exception",
"as",
"exc",
":",
"log",
".",
"error",
"(",
"'Excepti... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Authorize.eauth | Determine if the given eauth is valid and yield the adata | salt/auth/__init__.py | def eauth(self, adata, load):
'''
Determine if the given eauth is valid and yield the adata
'''
for sub_auth in [adata]:
if load['eauth'] not in sub_auth:
continue
try:
name = self.loadauth.load_name(load)
if not ((n... | def eauth(self, adata, load):
'''
Determine if the given eauth is valid and yield the adata
'''
for sub_auth in [adata]:
if load['eauth'] not in sub_auth:
continue
try:
name = self.loadauth.load_name(load)
if not ((n... | [
"Determine",
"if",
"the",
"given",
"eauth",
"is",
"valid",
"and",
"yield",
"the",
"adata"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L584-L602 | [
"def",
"eauth",
"(",
"self",
",",
"adata",
",",
"load",
")",
":",
"for",
"sub_auth",
"in",
"[",
"adata",
"]",
":",
"if",
"load",
"[",
"'eauth'",
"]",
"not",
"in",
"sub_auth",
":",
"continue",
"try",
":",
"name",
"=",
"self",
".",
"loadauth",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Authorize.rights_check | Read in the access system to determine if the validated user has
requested rights | salt/auth/__init__.py | def rights_check(self, form, sub_auth, name, load, eauth=None):
'''
Read in the access system to determine if the validated user has
requested rights
'''
if load.get('eauth'):
sub_auth = sub_auth[load['eauth']]
good = self.ckminions.any_auth(
f... | def rights_check(self, form, sub_auth, name, load, eauth=None):
'''
Read in the access system to determine if the validated user has
requested rights
'''
if load.get('eauth'):
sub_auth = sub_auth[load['eauth']]
good = self.ckminions.any_auth(
f... | [
"Read",
"in",
"the",
"access",
"system",
"to",
"determine",
"if",
"the",
"validated",
"user",
"has",
"requested",
"rights"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L604-L631 | [
"def",
"rights_check",
"(",
"self",
",",
"form",
",",
"sub_auth",
",",
"name",
",",
"load",
",",
"eauth",
"=",
"None",
")",
":",
"if",
"load",
".",
"get",
"(",
"'eauth'",
")",
":",
"sub_auth",
"=",
"sub_auth",
"[",
"load",
"[",
"'eauth'",
"]",
"]",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Authorize.rights | Determine what type of authentication is being requested and pass
authorization
Note: this will check that the user has at least one right that will let
the user execute "load", this does not deal with conflicting rules | salt/auth/__init__.py | def rights(self, form, load):
'''
Determine what type of authentication is being requested and pass
authorization
Note: this will check that the user has at least one right that will let
the user execute "load", this does not deal with conflicting rules
'''
adat... | def rights(self, form, load):
'''
Determine what type of authentication is being requested and pass
authorization
Note: this will check that the user has at least one right that will let
the user execute "load", this does not deal with conflicting rules
'''
adat... | [
"Determine",
"what",
"type",
"of",
"authentication",
"is",
"being",
"requested",
"and",
"pass",
"authorization"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L633-L670 | [
"def",
"rights",
"(",
"self",
",",
"form",
",",
"load",
")",
":",
"adata",
"=",
"self",
".",
"auth_data",
"good",
"=",
"False",
"if",
"load",
".",
"get",
"(",
"'token'",
",",
"False",
")",
":",
"for",
"sub_auth",
"in",
"self",
".",
"token",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Resolver.cli | Execute the CLI options to fill in the extra data needed for the
defined eauth system | salt/auth/__init__.py | def cli(self, eauth):
'''
Execute the CLI options to fill in the extra data needed for the
defined eauth system
'''
ret = {}
if not eauth:
print('External authentication system has not been specified')
return ret
fstr = '{0}.auth'.format(ea... | def cli(self, eauth):
'''
Execute the CLI options to fill in the extra data needed for the
defined eauth system
'''
ret = {}
if not eauth:
print('External authentication system has not been specified')
return ret
fstr = '{0}.auth'.format(ea... | [
"Execute",
"the",
"CLI",
"options",
"to",
"fill",
"in",
"the",
"extra",
"data",
"needed",
"for",
"the",
"defined",
"eauth",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L690-L724 | [
"def",
"cli",
"(",
"self",
",",
"eauth",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"eauth",
":",
"print",
"(",
"'External authentication system has not been specified'",
")",
"return",
"ret",
"fstr",
"=",
"'{0}.auth'",
".",
"format",
"(",
"eauth",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Resolver.token_cli | Create the token from the CLI and request the correct data to
authenticate via the passed authentication mechanism | salt/auth/__init__.py | def token_cli(self, eauth, load):
'''
Create the token from the CLI and request the correct data to
authenticate via the passed authentication mechanism
'''
load['cmd'] = 'mk_token'
load['eauth'] = eauth
tdata = self._send_token_request(load)
if 'token' no... | def token_cli(self, eauth, load):
'''
Create the token from the CLI and request the correct data to
authenticate via the passed authentication mechanism
'''
load['cmd'] = 'mk_token'
load['eauth'] = eauth
tdata = self._send_token_request(load)
if 'token' no... | [
"Create",
"the",
"token",
"from",
"the",
"CLI",
"and",
"request",
"the",
"correct",
"data",
"to",
"authenticate",
"via",
"the",
"passed",
"authentication",
"mechanism"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L726-L742 | [
"def",
"token_cli",
"(",
"self",
",",
"eauth",
",",
"load",
")",
":",
"load",
"[",
"'cmd'",
"]",
"=",
"'mk_token'",
"load",
"[",
"'eauth'",
"]",
"=",
"eauth",
"tdata",
"=",
"self",
".",
"_send_token_request",
"(",
"load",
")",
"if",
"'token'",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Resolver.get_token | Request a token from the master | salt/auth/__init__.py | def get_token(self, token):
'''
Request a token from the master
'''
load = {}
load['token'] = token
load['cmd'] = 'get_token'
tdata = self._send_token_request(load)
return tdata | def get_token(self, token):
'''
Request a token from the master
'''
load = {}
load['token'] = token
load['cmd'] = 'get_token'
tdata = self._send_token_request(load)
return tdata | [
"Request",
"a",
"token",
"from",
"the",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/__init__.py#L752-L760 | [
"def",
"get_token",
"(",
"self",
",",
"token",
")",
":",
"load",
"=",
"{",
"}",
"load",
"[",
"'token'",
"]",
"=",
"token",
"load",
"[",
"'cmd'",
"]",
"=",
"'get_token'",
"tdata",
"=",
"self",
".",
"_send_token_request",
"(",
"load",
")",
"return",
"t... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_topics | Returns a list of the requester's topics
CLI example::
salt myminion boto3_sns.list_topics | salt/modules/boto3_sns.py | def list_topics(region=None, key=None, keyid=None, profile=None):
'''
Returns a list of the requester's topics
CLI example::
salt myminion boto3_sns.list_topics
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
res = {}
NextToken = ''
while NextToken is... | def list_topics(region=None, key=None, keyid=None, profile=None):
'''
Returns a list of the requester's topics
CLI example::
salt myminion boto3_sns.list_topics
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
res = {}
NextToken = ''
while NextToken is... | [
"Returns",
"a",
"list",
"of",
"the",
"requester",
"s",
"topics"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L78-L96 | [
"def",
"list_topics",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyid",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_topic | Returns details about a specific SNS topic, specified by name or ARN.
CLI example::
salt my_favorite_client boto3_sns.describe_topic a_sns_topic_of_my_choice | salt/modules/boto3_sns.py | def describe_topic(name, region=None, key=None, keyid=None, profile=None):
'''
Returns details about a specific SNS topic, specified by name or ARN.
CLI example::
salt my_favorite_client boto3_sns.describe_topic a_sns_topic_of_my_choice
'''
topics = list_topics(region=region, key=key, keyi... | def describe_topic(name, region=None, key=None, keyid=None, profile=None):
'''
Returns details about a specific SNS topic, specified by name or ARN.
CLI example::
salt my_favorite_client boto3_sns.describe_topic a_sns_topic_of_my_choice
'''
topics = list_topics(region=region, key=key, keyi... | [
"Returns",
"details",
"about",
"a",
"specific",
"SNS",
"topic",
"specified",
"by",
"name",
"or",
"ARN",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L99-L127 | [
"def",
"describe_topic",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"topics",
"=",
"list_topics",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | topic_exists | Check to see if an SNS topic exists.
CLI example::
salt myminion boto3_sns.topic_exists mytopic region=us-east-1 | salt/modules/boto3_sns.py | def topic_exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an SNS topic exists.
CLI example::
salt myminion boto3_sns.topic_exists mytopic region=us-east-1
'''
topics = list_topics(region=region, key=key, keyid=keyid, profile=profile)
return name in li... | def topic_exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an SNS topic exists.
CLI example::
salt myminion boto3_sns.topic_exists mytopic region=us-east-1
'''
topics = list_topics(region=region, key=key, keyid=keyid, profile=profile)
return name in li... | [
"Check",
"to",
"see",
"if",
"an",
"SNS",
"topic",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L130-L139 | [
"def",
"topic_exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"topics",
"=",
"list_topics",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_topic | Create an SNS topic.
CLI example::
salt myminion boto3_sns.create_topic mytopic region=us-east-1 | salt/modules/boto3_sns.py | def create_topic(Name, region=None, key=None, keyid=None, profile=None):
'''
Create an SNS topic.
CLI example::
salt myminion boto3_sns.create_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
ret = conn.create_topic(... | def create_topic(Name, region=None, key=None, keyid=None, profile=None):
'''
Create an SNS topic.
CLI example::
salt myminion boto3_sns.create_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
ret = conn.create_topic(... | [
"Create",
"an",
"SNS",
"topic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L142-L160 | [
"def",
"create_topic",
"(",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_topic | Delete an SNS topic.
CLI example::
salt myminion boto3_sns.delete_topic mytopic region=us-east-1 | salt/modules/boto3_sns.py | def delete_topic(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Delete an SNS topic.
CLI example::
salt myminion boto3_sns.delete_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
conn.delete_topic(To... | def delete_topic(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Delete an SNS topic.
CLI example::
salt myminion boto3_sns.delete_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
conn.delete_topic(To... | [
"Delete",
"an",
"SNS",
"topic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L163-L178 | [
"def",
"delete_topic",
"(",
"TopicArn",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_topic_attributes | Returns all of the properties of a topic. Topic properties returned might differ based on the
authorization of the user.
CLI example::
salt myminion boto3_sns.get_topic_attributes someTopic region=us-west-1 | salt/modules/boto3_sns.py | def get_topic_attributes(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Returns all of the properties of a topic. Topic properties returned might differ based on the
authorization of the user.
CLI example::
salt myminion boto3_sns.get_topic_attributes someTopic region=us-west... | def get_topic_attributes(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Returns all of the properties of a topic. Topic properties returned might differ based on the
authorization of the user.
CLI example::
salt myminion boto3_sns.get_topic_attributes someTopic region=us-west... | [
"Returns",
"all",
"of",
"the",
"properties",
"of",
"a",
"topic",
".",
"Topic",
"properties",
"returned",
"might",
"differ",
"based",
"on",
"the",
"authorization",
"of",
"the",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L181-L195 | [
"def",
"get_topic_attributes",
"(",
"TopicArn",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_topic_attributes | Set an attribute of a topic to a new value.
CLI example::
salt myminion boto3_sns.set_topic_attributes someTopic DisplayName myDisplayNameValue | salt/modules/boto3_sns.py | def set_topic_attributes(TopicArn, AttributeName, AttributeValue, region=None, key=None, keyid=None,
profile=None):
'''
Set an attribute of a topic to a new value.
CLI example::
salt myminion boto3_sns.set_topic_attributes someTopic DisplayName myDisplayNameValue
'''
... | def set_topic_attributes(TopicArn, AttributeName, AttributeValue, region=None, key=None, keyid=None,
profile=None):
'''
Set an attribute of a topic to a new value.
CLI example::
salt myminion boto3_sns.set_topic_attributes someTopic DisplayName myDisplayNameValue
'''
... | [
"Set",
"an",
"attribute",
"of",
"a",
"topic",
"to",
"a",
"new",
"value",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L198-L217 | [
"def",
"set_topic_attributes",
"(",
"TopicArn",
",",
"AttributeName",
",",
"AttributeValue",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_subscriptions_by_topic | Returns a list of the subscriptions to a specific topic
CLI example::
salt myminion boto3_sns.list_subscriptions_by_topic mytopic region=us-east-1 | salt/modules/boto3_sns.py | def list_subscriptions_by_topic(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Returns a list of the subscriptions to a specific topic
CLI example::
salt myminion boto3_sns.list_subscriptions_by_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, ke... | def list_subscriptions_by_topic(TopicArn, region=None, key=None, keyid=None, profile=None):
'''
Returns a list of the subscriptions to a specific topic
CLI example::
salt myminion boto3_sns.list_subscriptions_by_topic mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, ke... | [
"Returns",
"a",
"list",
"of",
"the",
"subscriptions",
"to",
"a",
"specific",
"topic"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L220-L240 | [
"def",
"list_subscriptions_by_topic",
"(",
"TopicArn",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_subscription_attributes | Returns all of the properties of a subscription.
CLI example::
salt myminion boto3_sns.get_subscription_attributes somesubscription region=us-west-1 | salt/modules/boto3_sns.py | def get_subscription_attributes(SubscriptionArn, region=None, key=None, keyid=None, profile=None):
'''
Returns all of the properties of a subscription.
CLI example::
salt myminion boto3_sns.get_subscription_attributes somesubscription region=us-west-1
'''
conn = _get_conn(region=region, ke... | def get_subscription_attributes(SubscriptionArn, region=None, key=None, keyid=None, profile=None):
'''
Returns all of the properties of a subscription.
CLI example::
salt myminion boto3_sns.get_subscription_attributes somesubscription region=us-west-1
'''
conn = _get_conn(region=region, ke... | [
"Returns",
"all",
"of",
"the",
"properties",
"of",
"a",
"subscription",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L266-L285 | [
"def",
"get_subscription_attributes",
"(",
"SubscriptionArn",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subscribe | Subscribe to a Topic.
CLI example::
salt myminion boto3_sns.subscribe mytopic https https://www.example.com/sns-endpoint | salt/modules/boto3_sns.py | def subscribe(TopicArn=None, Protocol=None, Endpoint=None,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Subscribe to a Topic.
CLI example::
salt myminion boto3_sns.subscribe mytopic https https://www.example.com/sns-endpoint
'''
conn = _get_conn(region=regi... | def subscribe(TopicArn=None, Protocol=None, Endpoint=None,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Subscribe to a Topic.
CLI example::
salt myminion boto3_sns.subscribe mytopic https https://www.example.com/sns-endpoint
'''
conn = _get_conn(region=regi... | [
"Subscribe",
"to",
"a",
"Topic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L310-L347 | [
"def",
"subscribe",
"(",
"TopicArn",
"=",
"None",
",",
"Protocol",
"=",
"None",
",",
"Endpoint",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unsubscribe | Unsubscribe a specific SubscriptionArn of a topic.
CLI Example:
.. code-block:: bash
salt myminion boto3_sns.unsubscribe my_subscription_arn region=us-east-1 | salt/modules/boto3_sns.py | def unsubscribe(SubscriptionArn, region=None, key=None, keyid=None, profile=None):
'''
Unsubscribe a specific SubscriptionArn of a topic.
CLI Example:
.. code-block:: bash
salt myminion boto3_sns.unsubscribe my_subscription_arn region=us-east-1
'''
if not SubscriptionArn.startswith('a... | def unsubscribe(SubscriptionArn, region=None, key=None, keyid=None, profile=None):
'''
Unsubscribe a specific SubscriptionArn of a topic.
CLI Example:
.. code-block:: bash
salt myminion boto3_sns.unsubscribe my_subscription_arn region=us-east-1
'''
if not SubscriptionArn.startswith('a... | [
"Unsubscribe",
"a",
"specific",
"SubscriptionArn",
"of",
"a",
"topic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_sns.py#L350-L383 | [
"def",
"unsubscribe",
"(",
"SubscriptionArn",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"SubscriptionArn",
".",
"startswith",
"(",
"'arn:aws:sns:'",
")",
":",
"# Gr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | needs_reboot | Determines if the system needs to be rebooted.
Returns:
bool: True if the system requires a reboot, False if not
CLI Examples:
.. code-block:: bash
import salt.utils.win_update
salt.utils.win_update.needs_reboot() | salt/utils/win_update.py | def needs_reboot():
'''
Determines if the system needs to be rebooted.
Returns:
bool: True if the system requires a reboot, False if not
CLI Examples:
.. code-block:: bash
import salt.utils.win_update
salt.utils.win_update.needs_reboot()
'''
# Initialize the Py... | def needs_reboot():
'''
Determines if the system needs to be rebooted.
Returns:
bool: True if the system requires a reboot, False if not
CLI Examples:
.. code-block:: bash
import salt.utils.win_update
salt.utils.win_update.needs_reboot()
'''
# Initialize the Py... | [
"Determines",
"if",
"the",
"system",
"needs",
"to",
"be",
"rebooted",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L998-L1019 | [
"def",
"needs_reboot",
"(",
")",
":",
"# Initialize the PyCom system",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"# Create an AutoUpdate object",
"obj_sys",
"=",
"win32com",
".",
"client",
".",
"Dispatch",
"(",
"'Microsoft.Update.Syst... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Updates.list | Create a dictionary with the details for the updates in the collection.
Returns:
dict: Details about each update
.. code-block:: cfg
List of Updates:
{'<GUID>': {'Title': <title>,
'KB': <KB>,
'GUID': <the globally uni... | salt/utils/win_update.py | def list(self):
'''
Create a dictionary with the details for the updates in the collection.
Returns:
dict: Details about each update
.. code-block:: cfg
List of Updates:
{'<GUID>': {'Title': <title>,
'KB': <KB>,
... | def list(self):
'''
Create a dictionary with the details for the updates in the collection.
Returns:
dict: Details about each update
.. code-block:: cfg
List of Updates:
{'<GUID>': {'Title': <title>,
'KB': <KB>,
... | [
"Create",
"a",
"dictionary",
"with",
"the",
"details",
"for",
"the",
"updates",
"in",
"the",
"collection",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L101-L167 | [
"def",
"list",
"(",
"self",
")",
":",
"# https://msdn.microsoft.com/en-us/library/windows/desktop/aa386099(v=vs.85).aspx",
"if",
"self",
".",
"count",
"(",
")",
"==",
"0",
":",
"return",
"'Nothing to return'",
"log",
".",
"debug",
"(",
"'Building a detailed report of the ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Updates.summary | Create a dictionary with a summary of the updates in the collection.
Returns:
dict: Summary of the contents of the collection
.. code-block:: cfg
Summary of Updates:
{'Total': <total number of updates returned>,
'Available': <updates that are not downl... | salt/utils/win_update.py | def summary(self):
'''
Create a dictionary with a summary of the updates in the collection.
Returns:
dict: Summary of the contents of the collection
.. code-block:: cfg
Summary of Updates:
{'Total': <total number of updates returned>,
'... | def summary(self):
'''
Create a dictionary with a summary of the updates in the collection.
Returns:
dict: Summary of the contents of the collection
.. code-block:: cfg
Summary of Updates:
{'Total': <total number of updates returned>,
'... | [
"Create",
"a",
"dictionary",
"with",
"a",
"summary",
"of",
"the",
"updates",
"in",
"the",
"collection",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L169-L242 | [
"def",
"summary",
"(",
"self",
")",
":",
"# https://msdn.microsoft.com/en-us/library/windows/desktop/aa386099(v=vs.85).aspx",
"if",
"self",
".",
"count",
"(",
")",
"==",
"0",
":",
"return",
"'Nothing to return'",
"# Build a dictionary containing a summary of updates available",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.updates | Get the contents of ``_updates`` (all updates) and puts them in an
Updates class to expose the list and summary functions.
Returns:
Updates: An instance of the Updates class with all updates for the
system.
.. code-block:: python
import salt.utils.win_updat... | salt/utils/win_update.py | def updates(self):
'''
Get the contents of ``_updates`` (all updates) and puts them in an
Updates class to expose the list and summary functions.
Returns:
Updates: An instance of the Updates class with all updates for the
system.
.. code-block:: python
... | def updates(self):
'''
Get the contents of ``_updates`` (all updates) and puts them in an
Updates class to expose the list and summary functions.
Returns:
Updates: An instance of the Updates class with all updates for the
system.
.. code-block:: python
... | [
"Get",
"the",
"contents",
"of",
"_updates",
"(",
"all",
"updates",
")",
"and",
"puts",
"them",
"in",
"an",
"Updates",
"class",
"to",
"expose",
"the",
"list",
"and",
"summary",
"functions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L298-L325 | [
"def",
"updates",
"(",
"self",
")",
":",
"updates",
"=",
"Updates",
"(",
")",
"found",
"=",
"updates",
".",
"updates",
"for",
"update",
"in",
"self",
".",
"_updates",
":",
"found",
".",
"Add",
"(",
"update",
")",
"return",
"updates"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.refresh | Refresh the contents of the ``_updates`` collection. This gets all
updates in the Windows Update system and loads them into the collection.
This is the part that is slow.
Code Example:
.. code-block:: python
import salt.utils.win_update
wua = salt.utils.win_upd... | salt/utils/win_update.py | def refresh(self):
'''
Refresh the contents of the ``_updates`` collection. This gets all
updates in the Windows Update system and loads them into the collection.
This is the part that is slow.
Code Example:
.. code-block:: python
import salt.utils.win_upda... | def refresh(self):
'''
Refresh the contents of the ``_updates`` collection. This gets all
updates in the Windows Update system and loads them into the collection.
This is the part that is slow.
Code Example:
.. code-block:: python
import salt.utils.win_upda... | [
"Refresh",
"the",
"contents",
"of",
"the",
"_updates",
"collection",
".",
"This",
"gets",
"all",
"updates",
"in",
"the",
"Windows",
"Update",
"system",
"and",
"loads",
"them",
"into",
"the",
"collection",
".",
"This",
"is",
"the",
"part",
"that",
"is",
"sl... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L327-L366 | [
"def",
"refresh",
"(",
"self",
")",
":",
"# https://msdn.microsoft.com/en-us/library/windows/desktop/aa386526(v=vs.85).aspx",
"search_string",
"=",
"'Type=\\'Software\\' or '",
"'Type=\\'Driver\\''",
"# Create searcher object",
"searcher",
"=",
"self",
".",
"_session",
".",
"Crea... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.available | Gets a list of all updates available on the system that match the passed
criteria.
Args:
skip_hidden (bool): Skip hidden updates. Default is True
skip_installed (bool): Skip installed updates. Default is True
skip_mandatory (bool): Skip mandatory updates. Default ... | salt/utils/win_update.py | def available(self,
skip_hidden=True,
skip_installed=True,
skip_mandatory=False,
skip_reboot=False,
software=True,
drivers=True,
categories=None,
severities=None):
'''
... | def available(self,
skip_hidden=True,
skip_installed=True,
skip_mandatory=False,
skip_reboot=False,
software=True,
drivers=True,
categories=None,
severities=None):
'''
... | [
"Gets",
"a",
"list",
"of",
"all",
"updates",
"available",
"on",
"the",
"system",
"that",
"match",
"the",
"passed",
"criteria",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L368-L484 | [
"def",
"available",
"(",
"self",
",",
"skip_hidden",
"=",
"True",
",",
"skip_installed",
"=",
"True",
",",
"skip_mandatory",
"=",
"False",
",",
"skip_reboot",
"=",
"False",
",",
"software",
"=",
"True",
",",
"drivers",
"=",
"True",
",",
"categories",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.search | Search for either a single update or a specific list of updates. GUIDs
are searched first, then KB numbers, and finally Titles.
Args:
search_string (str, list): The search string to use to find the
update. This can be the GUID or KB of the update (preferred). It can
... | salt/utils/win_update.py | def search(self, search_string):
'''
Search for either a single update or a specific list of updates. GUIDs
are searched first, then KB numbers, and finally Titles.
Args:
search_string (str, list): The search string to use to find the
update. This can be the GUI... | def search(self, search_string):
'''
Search for either a single update or a specific list of updates. GUIDs
are searched first, then KB numbers, and finally Titles.
Args:
search_string (str, list): The search string to use to find the
update. This can be the GUI... | [
"Search",
"for",
"either",
"a",
"single",
"update",
"or",
"a",
"specific",
"list",
"of",
"updates",
".",
"GUIDs",
"are",
"searched",
"first",
"then",
"KB",
"numbers",
"and",
"finally",
"Titles",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L486-L550 | [
"def",
"search",
"(",
"self",
",",
"search_string",
")",
":",
"updates",
"=",
"Updates",
"(",
")",
"found",
"=",
"updates",
".",
"updates",
"if",
"isinstance",
"(",
"search_string",
",",
"six",
".",
"string_types",
")",
":",
"search_string",
"=",
"[",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.download | Download the updates passed in the updates collection. Load the updates
collection using ``search`` or ``available``
Args:
updates (Updates): An instance of the Updates class containing a
the updates to be downloaded.
Returns:
dict: A dictionary containing ... | salt/utils/win_update.py | def download(self, updates):
'''
Download the updates passed in the updates collection. Load the updates
collection using ``search`` or ``available``
Args:
updates (Updates): An instance of the Updates class containing a
the updates to be downloaded.
Re... | def download(self, updates):
'''
Download the updates passed in the updates collection. Load the updates
collection using ``search`` or ``available``
Args:
updates (Updates): An instance of the Updates class containing a
the updates to be downloaded.
Re... | [
"Download",
"the",
"updates",
"passed",
"in",
"the",
"updates",
"collection",
".",
"Load",
"the",
"updates",
"collection",
"using",
"search",
"or",
"available"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L552-L662 | [
"def",
"download",
"(",
"self",
",",
"updates",
")",
":",
"# Check for empty list",
"if",
"updates",
".",
"count",
"(",
")",
"==",
"0",
":",
"ret",
"=",
"{",
"'Success'",
":",
"False",
",",
"'Updates'",
":",
"'Nothing to download'",
"}",
"return",
"ret",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.install | Install the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions. If the
updates need to be downloaded, use the ``download`` function.
Args:
updates (Updates): An instance of the Updates class containing a
... | salt/utils/win_update.py | def install(self, updates):
'''
Install the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions. If the
updates need to be downloaded, use the ``download`` function.
Args:
updates (Updates): An instan... | def install(self, updates):
'''
Install the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions. If the
updates need to be downloaded, use the ``download`` function.
Args:
updates (Updates): An instan... | [
"Install",
"the",
"updates",
"passed",
"in",
"the",
"updates",
"collection",
".",
"Load",
"the",
"updates",
"collection",
"using",
"the",
"search",
"or",
"available",
"functions",
".",
"If",
"the",
"updates",
"need",
"to",
"be",
"downloaded",
"use",
"the",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L664-L773 | [
"def",
"install",
"(",
"self",
",",
"updates",
")",
":",
"# Check for empty list",
"if",
"updates",
".",
"count",
"(",
")",
"==",
"0",
":",
"ret",
"=",
"{",
"'Success'",
":",
"False",
",",
"'Updates'",
":",
"'Nothing to install'",
"}",
"return",
"ret",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent.uninstall | Uninstall the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions.
.. note:: Starting with Windows 10 the Windows Update Agent is unable to
uninstall updates. An ``Uninstall Not Allowed`` error is returned. If
this error ... | salt/utils/win_update.py | def uninstall(self, updates):
'''
Uninstall the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions.
.. note:: Starting with Windows 10 the Windows Update Agent is unable to
uninstall updates. An ``Uninstall Not A... | def uninstall(self, updates):
'''
Uninstall the updates passed in the updates collection. Load the updates
collection using the ``search`` or ``available`` functions.
.. note:: Starting with Windows 10 the Windows Update Agent is unable to
uninstall updates. An ``Uninstall Not A... | [
"Uninstall",
"the",
"updates",
"passed",
"in",
"the",
"updates",
"collection",
".",
"Load",
"the",
"updates",
"collection",
"using",
"the",
"search",
"or",
"available",
"functions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L775-L967 | [
"def",
"uninstall",
"(",
"self",
",",
"updates",
")",
":",
"# This doesn't work with the WUA API since Windows 10. It always returns",
"# \"0x80240028 # Uninstall not allowed\". The full message is: \"The update",
"# could not be uninstalled because the request did not originate from a",
"# Wi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | WindowsUpdateAgent._run | Internal function for running commands. Used by the uninstall function.
Args:
cmd (str, list): The command to run
Returns:
str: The stdout of the command | salt/utils/win_update.py | def _run(self, cmd):
'''
Internal function for running commands. Used by the uninstall function.
Args:
cmd (str, list): The command to run
Returns:
str: The stdout of the command
'''
if isinstance(cmd, six.string_types):
cmd = salt.u... | def _run(self, cmd):
'''
Internal function for running commands. Used by the uninstall function.
Args:
cmd (str, list): The command to run
Returns:
str: The stdout of the command
'''
if isinstance(cmd, six.string_types):
cmd = salt.u... | [
"Internal",
"function",
"for",
"running",
"commands",
".",
"Used",
"by",
"the",
"uninstall",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_update.py#L969-L995 | [
"def",
"_run",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"isinstance",
"(",
"cmd",
",",
"six",
".",
"string_types",
")",
":",
"cmd",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"shlex_split",
"(",
"cmd",
")",
"try",
":",
"log",
".",
"debug",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | render | Accepts YAML as a string or as a file object and runs it through the YAML
parser.
:rtype: A Python data structure | salt/renderers/yaml.py | def render(yaml_data, saltenv='base', sls='', argline='', **kws):
'''
Accepts YAML as a string or as a file object and runs it through the YAML
parser.
:rtype: A Python data structure
'''
if not isinstance(yaml_data, string_types):
yaml_data = yaml_data.read()
with warnings.catch_wa... | def render(yaml_data, saltenv='base', sls='', argline='', **kws):
'''
Accepts YAML as a string or as a file object and runs it through the YAML
parser.
:rtype: A Python data structure
'''
if not isinstance(yaml_data, string_types):
yaml_data = yaml_data.read()
with warnings.catch_wa... | [
"Accepts",
"YAML",
"as",
"a",
"string",
"or",
"as",
"a",
"file",
"object",
"and",
"runs",
"it",
"through",
"the",
"YAML",
"parser",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/yaml.py#L42-L88 | [
"def",
"render",
"(",
"yaml_data",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"argline",
"=",
"''",
",",
"*",
"*",
"kws",
")",
":",
"if",
"not",
"isinstance",
"(",
"yaml_data",
",",
"string_types",
")",
":",
"yaml_data",
"=",
"yaml_da... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | write | Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.write com.apple.CrashReporter DialogType Server
salt '*' macdefaults.write NSGlobalDomain ApplePersistence True type=bool
domain
The name of the domain to write to
key
The key of th... | salt/modules/macdefaults.py | def write(domain, key, value, type='string', user=None):
'''
Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.write com.apple.CrashReporter DialogType Server
salt '*' macdefaults.write NSGlobalDomain ApplePersistence True type=bool
domain
... | def write(domain, key, value, type='string', user=None):
'''
Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.write com.apple.CrashReporter DialogType Server
salt '*' macdefaults.write NSGlobalDomain ApplePersistence True type=bool
domain
... | [
"Write",
"a",
"default",
"to",
"the",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macdefaults.py#L27-L64 | [
"def",
"write",
"(",
"domain",
",",
"key",
",",
"value",
",",
"type",
"=",
"'string'",
",",
"user",
"=",
"None",
")",
":",
"if",
"type",
"==",
"'bool'",
"or",
"type",
"==",
"'boolean'",
":",
"if",
"value",
"is",
"True",
":",
"value",
"=",
"'TRUE'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read | Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.read com.apple.CrashReporter DialogType
salt '*' macdefaults.read NSGlobalDomain ApplePersistence
domain
The name of the domain to read from
key
The key of the given domain to read ... | salt/modules/macdefaults.py | def read(domain, key, user=None):
'''
Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.read com.apple.CrashReporter DialogType
salt '*' macdefaults.read NSGlobalDomain ApplePersistence
domain
The name of the domain to read from
ke... | def read(domain, key, user=None):
'''
Write a default to the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.read com.apple.CrashReporter DialogType
salt '*' macdefaults.read NSGlobalDomain ApplePersistence
domain
The name of the domain to read from
ke... | [
"Write",
"a",
"default",
"to",
"the",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macdefaults.py#L67-L90 | [
"def",
"read",
"(",
"domain",
",",
"key",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"'defaults read \"{0}\" \"{1}\"'",
".",
"format",
"(",
"domain",
",",
"key",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"runas",
"=",
"use... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete a default from the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.delete com.apple.CrashReporter DialogType
salt '*' macdefaults.delete NSGlobalDomain ApplePersistence
domain
The name of the domain to delete from
key
The key of the given domain... | salt/modules/macdefaults.py | def delete(domain, key, user=None):
'''
Delete a default from the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.delete com.apple.CrashReporter DialogType
salt '*' macdefaults.delete NSGlobalDomain ApplePersistence
domain
The name of the domain to delete f... | def delete(domain, key, user=None):
'''
Delete a default from the system
CLI Example:
.. code-block:: bash
salt '*' macdefaults.delete com.apple.CrashReporter DialogType
salt '*' macdefaults.delete NSGlobalDomain ApplePersistence
domain
The name of the domain to delete f... | [
"Delete",
"a",
"default",
"from",
"the",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macdefaults.py#L93-L116 | [
"def",
"delete",
"(",
"domain",
",",
"key",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"'defaults delete \"{0}\" \"{1}\"'",
".",
"format",
"(",
"domain",
",",
"key",
")",
"return",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"runas",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | computer_desc | Manage the computer's description field
name
The desired computer description | salt/states/win_system.py | def computer_desc(name):
'''
Manage the computer's description field
name
The desired computer description
'''
# Just in case someone decides to enter a numeric description
name = six.text_type(name)
ret = {'name': name,
'changes': {},
'result': True,
... | def computer_desc(name):
'''
Manage the computer's description field
name
The desired computer description
'''
# Just in case someone decides to enter a numeric description
name = six.text_type(name)
ret = {'name': name,
'changes': {},
'result': True,
... | [
"Manage",
"the",
"computer",
"s",
"description",
"field"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L47-L82 | [
"def",
"computer_desc",
"(",
"name",
")",
":",
"# Just in case someone decides to enter a numeric description",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | computer_name | Manage the computer's name
name
The desired computer name | salt/states/win_system.py | def computer_name(name):
'''
Manage the computer's name
name
The desired computer name
'''
# Just in case someone decides to enter a numeric description
name = six.text_type(name)
ret = {'name': name,
'changes': {},
'result': True,
'comment': 'Compu... | def computer_name(name):
'''
Manage the computer's name
name
The desired computer name
'''
# Just in case someone decides to enter a numeric description
name = six.text_type(name)
ret = {'name': name,
'changes': {},
'result': True,
'comment': 'Compu... | [
"Manage",
"the",
"computer",
"s",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L88-L132 | [
"def",
"computer_name",
"(",
"name",
")",
":",
"# Just in case someone decides to enter a numeric description",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostname | .. versionadded:: 2016.3.0
Manage the hostname of the computer
name
The hostname to set | salt/states/win_system.py | def hostname(name):
'''
.. versionadded:: 2016.3.0
Manage the hostname of the computer
name
The hostname to set
'''
ret = {
'name': name,
'changes': {},
'result': True,
'comment': ''
}
current_hostname = __salt__['system.get_hostname']()
if... | def hostname(name):
'''
.. versionadded:: 2016.3.0
Manage the hostname of the computer
name
The hostname to set
'''
ret = {
'name': name,
'changes': {},
'result': True,
'comment': ''
}
current_hostname = __salt__['system.get_hostname']()
if... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L135-L167 | [
"def",
"hostname",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"current_hostname",
"=",
"__salt__",
"[",
"'system.get_hostname'",
"]",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | workgroup | .. versionadded:: 2019.2.0
Manage the workgroup of the computer
name
The workgroup to set
Example:
.. code-block:: yaml
set workgroup:
system.workgroup:
- name: local | salt/states/win_system.py | def workgroup(name):
'''
.. versionadded:: 2019.2.0
Manage the workgroup of the computer
name
The workgroup to set
Example:
.. code-block:: yaml
set workgroup:
system.workgroup:
- name: local
'''
ret = {'name': name.upper(), 'result': False, 'ch... | def workgroup(name):
'''
.. versionadded:: 2019.2.0
Manage the workgroup of the computer
name
The workgroup to set
Example:
.. code-block:: yaml
set workgroup:
system.workgroup:
- name: local
'''
ret = {'name': name.upper(), 'result': False, 'ch... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L170-L225 | [
"def",
"workgroup",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
".",
"upper",
"(",
")",
",",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"# Grab the current domain/workgroup",
"out",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | join_domain | Checks if a computer is joined to the Domain. If the computer is not in the
Domain, it will be joined.
Args:
name (str):
The name of the Domain.
username (str):
Username of an account which is authorized to join computers to the
specified domain. Need to be... | salt/states/win_system.py | def join_domain(name,
username=None,
password=None,
account_ou=None,
account_exists=False,
restart=False):
'''
Checks if a computer is joined to the Domain. If the computer is not in the
Domain, it will be joined.
Args:
... | def join_domain(name,
username=None,
password=None,
account_ou=None,
account_exists=False,
restart=False):
'''
Checks if a computer is joined to the Domain. If the computer is not in the
Domain, it will be joined.
Args:
... | [
"Checks",
"if",
"a",
"computer",
"is",
"joined",
"to",
"the",
"Domain",
".",
"If",
"the",
"computer",
"is",
"not",
"in",
"the",
"Domain",
"it",
"will",
"be",
"joined",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L228-L315 | [
"def",
"join_domain",
"(",
"name",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"account_ou",
"=",
"None",
",",
"account_exists",
"=",
"False",
",",
"restart",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
The default value is None.
:param int timeout:
The number of minutes or seconds before a reboot will occur. Whether
this number re... | salt/states/win_system.py | def reboot(name, message=None, timeout=5, force_close=True, in_seconds=False,
only_on_pending_reboot=True):
'''
Reboot the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
The default value is... | def reboot(name, message=None, timeout=5, force_close=True, in_seconds=False,
only_on_pending_reboot=True):
'''
Reboot the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
The default value is... | [
"Reboot",
"the",
"computer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L318-L361 | [
"def",
"reboot",
"(",
"name",
",",
"message",
"=",
"None",
",",
"timeout",
"=",
"5",
",",
"force_close",
"=",
"True",
",",
"in_seconds",
"=",
"False",
",",
"only_on_pending_reboot",
"=",
"True",
")",
":",
"return",
"shutdown",
"(",
"name",
",",
"message"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | shutdown | Shutdown the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
The default value is None.
:param int timeout:
The number of minutes or seconds before a shutdown will occur. Whether
this numbe... | salt/states/win_system.py | def shutdown(name, message=None, timeout=5, force_close=True, reboot=False,
in_seconds=False, only_on_pending_reboot=False):
'''
Shutdown the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
... | def shutdown(name, message=None, timeout=5, force_close=True, reboot=False,
in_seconds=False, only_on_pending_reboot=False):
'''
Shutdown the computer
:param str message:
An optional message to display to users. It will also be used as a
comment in the event log entry.
... | [
"Shutdown",
"the",
"computer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_system.py#L364-L449 | [
"def",
"shutdown",
"(",
"name",
",",
"message",
"=",
"None",
",",
"timeout",
"=",
"5",
",",
"force_close",
"=",
"True",
",",
"reboot",
"=",
"False",
",",
"in_seconds",
"=",
"False",
",",
"only_on_pending_reboot",
"=",
"False",
")",
":",
"ret",
"=",
"{"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | post_message | Send a message to a Slack channel.
.. code-block:: yaml
slack-message:
slack.post_message:
- channel: '#general'
- from_name: SuperAdmin
- message: 'This state was executed successfully.'
- api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
The followi... | salt/states/slack.py | def post_message(name,
channel,
from_name,
message,
api_key=None,
icon=None):
'''
Send a message to a Slack channel.
.. code-block:: yaml
slack-message:
slack.post_message:
- channel: '#gener... | def post_message(name,
channel,
from_name,
message,
api_key=None,
icon=None):
'''
Send a message to a Slack channel.
.. code-block:: yaml
slack-message:
slack.post_message:
- channel: '#gener... | [
"Send",
"a",
"message",
"to",
"a",
"Slack",
"channel",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/slack.py#L42-L122 | [
"def",
"post_message",
"(",
"name",
",",
"channel",
",",
"from_name",
",",
"message",
",",
"api_key",
"=",
"None",
",",
"icon",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"F... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_btrfs_info | Parse BTRFS device info data. | salt/modules/btrfs.py | def _parse_btrfs_info(data):
'''
Parse BTRFS device info data.
'''
ret = {}
for line in [line for line in data.split("\n") if line][:-1]:
if line.startswith("Label:"):
line = re.sub(r"Label:\s+", "", line)
label, uuid_ = [tkn.strip() for tkn in line.split("uuid:")]
... | def _parse_btrfs_info(data):
'''
Parse BTRFS device info data.
'''
ret = {}
for line in [line for line in data.split("\n") if line][:-1]:
if line.startswith("Label:"):
line = re.sub(r"Label:\s+", "", line)
label, uuid_ = [tkn.strip() for tkn in line.split("uuid:")]
... | [
"Parse",
"BTRFS",
"device",
"info",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L60-L82 | [
"def",
"_parse_btrfs_info",
"(",
"data",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"[",
"line",
"for",
"line",
"in",
"data",
".",
"split",
"(",
"\"\\n\"",
")",
"if",
"line",
"]",
"[",
":",
"-",
"1",
"]",
":",
"if",
"line",
".",
"star... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info | Get BTRFS filesystem information.
CLI Example:
.. code-block:: bash
salt '*' btrfs.info /dev/sda1 | salt/modules/btrfs.py | def info(device):
'''
Get BTRFS filesystem information.
CLI Example:
.. code-block:: bash
salt '*' btrfs.info /dev/sda1
'''
out = __salt__['cmd.run_all']("btrfs filesystem show {0}".format(device))
salt.utils.fsutils._verify_run(out)
return _parse_btrfs_info(out['stdout']) | def info(device):
'''
Get BTRFS filesystem information.
CLI Example:
.. code-block:: bash
salt '*' btrfs.info /dev/sda1
'''
out = __salt__['cmd.run_all']("btrfs filesystem show {0}".format(device))
salt.utils.fsutils._verify_run(out)
return _parse_btrfs_info(out['stdout']) | [
"Get",
"BTRFS",
"filesystem",
"information",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L85-L98 | [
"def",
"info",
"(",
"device",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"btrfs filesystem show {0}\"",
".",
"format",
"(",
"device",
")",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run",
"(",
"out",
")",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | devices | Get known BTRFS formatted devices on the system.
CLI Example:
.. code-block:: bash
salt '*' btrfs.devices | salt/modules/btrfs.py | def devices():
'''
Get known BTRFS formatted devices on the system.
CLI Example:
.. code-block:: bash
salt '*' btrfs.devices
'''
out = __salt__['cmd.run_all']("blkid -o export")
salt.utils.fsutils._verify_run(out)
return salt.utils.fsutils._blkid_output(out['stdout'], fs_type... | def devices():
'''
Get known BTRFS formatted devices on the system.
CLI Example:
.. code-block:: bash
salt '*' btrfs.devices
'''
out = __salt__['cmd.run_all']("blkid -o export")
salt.utils.fsutils._verify_run(out)
return salt.utils.fsutils._blkid_output(out['stdout'], fs_type... | [
"Get",
"known",
"BTRFS",
"formatted",
"devices",
"on",
"the",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L101-L114 | [
"def",
"devices",
"(",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"blkid -o export\"",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run",
"(",
"out",
")",
"return",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_blkid_o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _defragment_mountpoint | Defragment only one BTRFS mountpoint. | salt/modules/btrfs.py | def _defragment_mountpoint(mountpoint):
'''
Defragment only one BTRFS mountpoint.
'''
out = __salt__['cmd.run_all']("btrfs filesystem defragment -f {0}".format(mountpoint))
return {
'mount_point': mountpoint,
'passed': not out['stderr'],
'log': out['stderr'] or False,
... | def _defragment_mountpoint(mountpoint):
'''
Defragment only one BTRFS mountpoint.
'''
out = __salt__['cmd.run_all']("btrfs filesystem defragment -f {0}".format(mountpoint))
return {
'mount_point': mountpoint,
'passed': not out['stderr'],
'log': out['stderr'] or False,
... | [
"Defragment",
"only",
"one",
"BTRFS",
"mountpoint",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L117-L127 | [
"def",
"_defragment_mountpoint",
"(",
"mountpoint",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"btrfs filesystem defragment -f {0}\"",
".",
"format",
"(",
"mountpoint",
")",
")",
"return",
"{",
"'mount_point'",
":",
"mountpoint",
",",
"'pa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | defragment | Defragment mounted BTRFS filesystem.
In order to defragment a filesystem, device should be properly mounted and writable.
If passed a device name, then defragmented whole filesystem, mounted on in.
If passed a moun tpoint of the filesystem, then only this mount point is defragmented.
CLI Example:
... | salt/modules/btrfs.py | def defragment(path):
'''
Defragment mounted BTRFS filesystem.
In order to defragment a filesystem, device should be properly mounted and writable.
If passed a device name, then defragmented whole filesystem, mounted on in.
If passed a moun tpoint of the filesystem, then only this mount point is de... | def defragment(path):
'''
Defragment mounted BTRFS filesystem.
In order to defragment a filesystem, device should be properly mounted and writable.
If passed a device name, then defragmented whole filesystem, mounted on in.
If passed a moun tpoint of the filesystem, then only this mount point is de... | [
"Defragment",
"mounted",
"BTRFS",
"filesystem",
".",
"In",
"order",
"to",
"defragment",
"a",
"filesystem",
"device",
"should",
"be",
"properly",
"mounted",
"and",
"writable",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L130-L171 | [
"def",
"defragment",
"(",
"path",
")",
":",
"is_device",
"=",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_is_device",
"(",
"path",
")",
"mounts",
"=",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_get_mounts",
"(",
"\"btrfs\"",
")",
"if",
"is_device",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | features | List currently available BTRFS features.
CLI Example:
.. code-block:: bash
salt '*' btrfs.mkfs_features | salt/modules/btrfs.py | def features():
'''
List currently available BTRFS features.
CLI Example:
.. code-block:: bash
salt '*' btrfs.mkfs_features
'''
out = __salt__['cmd.run_all']("mkfs.btrfs -O list-all")
salt.utils.fsutils._verify_run(out)
ret = {}
for line in [re.sub(r"\s+", " ", line) for ... | def features():
'''
List currently available BTRFS features.
CLI Example:
.. code-block:: bash
salt '*' btrfs.mkfs_features
'''
out = __salt__['cmd.run_all']("mkfs.btrfs -O list-all")
salt.utils.fsutils._verify_run(out)
ret = {}
for line in [re.sub(r"\s+", " ", line) for ... | [
"List",
"currently",
"available",
"BTRFS",
"features",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L174-L192 | [
"def",
"features",
"(",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"mkfs.btrfs -O list-all\"",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run",
"(",
"out",
")",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"[",
"re"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _usage_overall | Parse usage/overall. | salt/modules/btrfs.py | def _usage_overall(raw):
'''
Parse usage/overall.
'''
data = {}
for line in raw.split("\n")[1:]:
keyset = [item.strip() for item in re.sub(r"\s+", " ", line).split(":", 1) if item.strip()]
if len(keyset) == 2:
key = re.sub(r"[()]", "", keyset[0]).replace(" ", "_").lower()... | def _usage_overall(raw):
'''
Parse usage/overall.
'''
data = {}
for line in raw.split("\n")[1:]:
keyset = [item.strip() for item in re.sub(r"\s+", " ", line).split(":", 1) if item.strip()]
if len(keyset) == 2:
key = re.sub(r"[()]", "", keyset[0]).replace(" ", "_").lower()... | [
"Parse",
"usage",
"/",
"overall",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L195-L212 | [
"def",
"_usage_overall",
"(",
"raw",
")",
":",
"data",
"=",
"{",
"}",
"for",
"line",
"in",
"raw",
".",
"split",
"(",
"\"\\n\"",
")",
"[",
"1",
":",
"]",
":",
"keyset",
"=",
"[",
"item",
".",
"strip",
"(",
")",
"for",
"item",
"in",
"re",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _usage_specific | Parse usage/specific. | salt/modules/btrfs.py | def _usage_specific(raw):
'''
Parse usage/specific.
'''
get_key = lambda val: dict([tuple(val.split(":")), ])
raw = raw.split("\n")
section, size, used = raw[0].split(" ")
section = section.replace(",", "_").replace(":", "").lower()
data = {}
data[section] = {}
for val in [size... | def _usage_specific(raw):
'''
Parse usage/specific.
'''
get_key = lambda val: dict([tuple(val.split(":")), ])
raw = raw.split("\n")
section, size, used = raw[0].split(" ")
section = section.replace(",", "_").replace(":", "").lower()
data = {}
data[section] = {}
for val in [size... | [
"Parse",
"usage",
"/",
"specific",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L215-L233 | [
"def",
"_usage_specific",
"(",
"raw",
")",
":",
"get_key",
"=",
"lambda",
"val",
":",
"dict",
"(",
"[",
"tuple",
"(",
"val",
".",
"split",
"(",
"\":\"",
")",
")",
",",
"]",
")",
"raw",
"=",
"raw",
".",
"split",
"(",
"\"\\n\"",
")",
"section",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _usage_unallocated | Parse usage/unallocated. | salt/modules/btrfs.py | def _usage_unallocated(raw):
'''
Parse usage/unallocated.
'''
ret = {}
for line in raw.split("\n")[1:]:
keyset = re.sub(r"\s+", " ", line.strip()).split(" ")
if len(keyset) == 2:
ret[keyset[0]] = keyset[1]
return ret | def _usage_unallocated(raw):
'''
Parse usage/unallocated.
'''
ret = {}
for line in raw.split("\n")[1:]:
keyset = re.sub(r"\s+", " ", line.strip()).split(" ")
if len(keyset) == 2:
ret[keyset[0]] = keyset[1]
return ret | [
"Parse",
"usage",
"/",
"unallocated",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L236-L246 | [
"def",
"_usage_unallocated",
"(",
"raw",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"raw",
".",
"split",
"(",
"\"\\n\"",
")",
"[",
"1",
":",
"]",
":",
"keyset",
"=",
"re",
".",
"sub",
"(",
"r\"\\s+\"",
",",
"\" \"",
",",
"line",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usage | Show in which disk the chunks are allocated.
CLI Example:
.. code-block:: bash
salt '*' btrfs.usage /your/mountpoint | salt/modules/btrfs.py | def usage(path):
'''
Show in which disk the chunks are allocated.
CLI Example:
.. code-block:: bash
salt '*' btrfs.usage /your/mountpoint
'''
out = __salt__['cmd.run_all']("btrfs filesystem usage {0}".format(path))
salt.utils.fsutils._verify_run(out)
ret = {}
for section ... | def usage(path):
'''
Show in which disk the chunks are allocated.
CLI Example:
.. code-block:: bash
salt '*' btrfs.usage /your/mountpoint
'''
out = __salt__['cmd.run_all']("btrfs filesystem usage {0}".format(path))
salt.utils.fsutils._verify_run(out)
ret = {}
for section ... | [
"Show",
"in",
"which",
"disk",
"the",
"chunks",
"are",
"allocated",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L249-L271 | [
"def",
"usage",
"(",
"path",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"btrfs filesystem usage {0}\"",
".",
"format",
"(",
"path",
")",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run",
"(",
"out",
")",
"ret",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mkfs | Create a file system on the specified device. By default wipes out with force.
General options:
* **allocsize**: Specify the BTRFS offset from the start of the device.
* **bytecount**: Specify the size of the resultant filesystem.
* **nodesize**: Node size.
* **leafsize**: Specify the nodesize, th... | salt/modules/btrfs.py | def mkfs(*devices, **kwargs):
'''
Create a file system on the specified device. By default wipes out with force.
General options:
* **allocsize**: Specify the BTRFS offset from the start of the device.
* **bytecount**: Specify the size of the resultant filesystem.
* **nodesize**: Node size.
... | def mkfs(*devices, **kwargs):
'''
Create a file system on the specified device. By default wipes out with force.
General options:
* **allocsize**: Specify the BTRFS offset from the start of the device.
* **bytecount**: Specify the size of the resultant filesystem.
* **nodesize**: Node size.
... | [
"Create",
"a",
"file",
"system",
"on",
"the",
"specified",
"device",
".",
"By",
"default",
"wipes",
"out",
"with",
"force",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L274-L354 | [
"def",
"mkfs",
"(",
"*",
"devices",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"devices",
":",
"raise",
"CommandExecutionError",
"(",
"\"No devices specified\"",
")",
"mounts",
"=",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_get_mounts",
"(",
"\"btr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resize | Resize filesystem.
General options:
* **mountpoint**: Specify the BTRFS mountpoint to resize.
* **size**: ([+/-]<newsize>[kKmMgGtTpPeE]|max) Specify the new size of the target.
CLI Example:
.. code-block:: bash
salt '*' btrfs.resize /mountpoint size=+1g
salt '*' btrfs.resize /de... | salt/modules/btrfs.py | def resize(mountpoint, size):
'''
Resize filesystem.
General options:
* **mountpoint**: Specify the BTRFS mountpoint to resize.
* **size**: ([+/-]<newsize>[kKmMgGtTpPeE]|max) Specify the new size of the target.
CLI Example:
.. code-block:: bash
salt '*' btrfs.resize /mountpoint ... | def resize(mountpoint, size):
'''
Resize filesystem.
General options:
* **mountpoint**: Specify the BTRFS mountpoint to resize.
* **size**: ([+/-]<newsize>[kKmMgGtTpPeE]|max) Specify the new size of the target.
CLI Example:
.. code-block:: bash
salt '*' btrfs.resize /mountpoint ... | [
"Resize",
"filesystem",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L357-L389 | [
"def",
"resize",
"(",
"mountpoint",
",",
"size",
")",
":",
"if",
"size",
"==",
"'max'",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_is_device",
"(",
"mountpoint",
")",
":",
"raise",
"CommandExecutionError",
"(",
"\"Mountpoint \\\"{0}\\\" s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | convert | Convert ext2/3/4 to BTRFS. Device should be mounted.
Filesystem can be converted temporarily so the further processing and rollback is possible,
or permanently, where previous extended filesystem image gets deleted. Please note, permanent
conversion takes a while as BTRFS filesystem needs to be properly re... | salt/modules/btrfs.py | def convert(device, permanent=False, keeplf=False):
'''
Convert ext2/3/4 to BTRFS. Device should be mounted.
Filesystem can be converted temporarily so the further processing and rollback is possible,
or permanently, where previous extended filesystem image gets deleted. Please note, permanent
conv... | def convert(device, permanent=False, keeplf=False):
'''
Convert ext2/3/4 to BTRFS. Device should be mounted.
Filesystem can be converted temporarily so the further processing and rollback is possible,
or permanently, where previous extended filesystem image gets deleted. Please note, permanent
conv... | [
"Convert",
"ext2",
"/",
"3",
"/",
"4",
"to",
"BTRFS",
".",
"Device",
"should",
"be",
"mounted",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L413-L511 | [
"def",
"convert",
"(",
"device",
",",
"permanent",
"=",
"False",
",",
"keeplf",
"=",
"False",
")",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"\"blkid -o export\"",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run",
"(",
"ou... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _restripe | Restripe BTRFS: add or remove devices from the particular mounted filesystem. | salt/modules/btrfs.py | def _restripe(mountpoint, direction, *devices, **kwargs):
'''
Restripe BTRFS: add or remove devices from the particular mounted filesystem.
'''
fs_log = []
if salt.utils.fsutils._is_device(mountpoint):
raise CommandExecutionError(
"Mountpount expected, while device \"{0}\" speci... | def _restripe(mountpoint, direction, *devices, **kwargs):
'''
Restripe BTRFS: add or remove devices from the particular mounted filesystem.
'''
fs_log = []
if salt.utils.fsutils._is_device(mountpoint):
raise CommandExecutionError(
"Mountpount expected, while device \"{0}\" speci... | [
"Restripe",
"BTRFS",
":",
"add",
"or",
"remove",
"devices",
"from",
"the",
"particular",
"mounted",
"filesystem",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L514-L580 | [
"def",
"_restripe",
"(",
"mountpoint",
",",
"direction",
",",
"*",
"devices",
",",
"*",
"*",
"kwargs",
")",
":",
"fs_log",
"=",
"[",
"]",
"if",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_is_device",
"(",
"mountpoint",
")",
":",
"raise",
"CommandExecu... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_proplist | Parse properties list. | salt/modules/btrfs.py | def _parse_proplist(data):
'''
Parse properties list.
'''
out = {}
for line in data.split("\n"):
line = re.split(r"\s+", line, 1)
if len(line) == 2:
out[line[0]] = line[1]
return out | def _parse_proplist(data):
'''
Parse properties list.
'''
out = {}
for line in data.split("\n"):
line = re.split(r"\s+", line, 1)
if len(line) == 2:
out[line[0]] = line[1]
return out | [
"Parse",
"properties",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L614-L624 | [
"def",
"_parse_proplist",
"(",
"data",
")",
":",
"out",
"=",
"{",
"}",
"for",
"line",
"in",
"data",
".",
"split",
"(",
"\"\\n\"",
")",
":",
"line",
"=",
"re",
".",
"split",
"(",
"r\"\\s+\"",
",",
"line",
",",
"1",
")",
"if",
"len",
"(",
"line",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | properties | List properties for given btrfs object. The object can be path of BTRFS device,
mount point, or any directories/files inside the BTRFS filesystem.
General options:
* **type**: Possible types are s[ubvol], f[ilesystem], i[node] and d[evice].
* **force**: Force overwrite existing filesystem on the disk
... | salt/modules/btrfs.py | def properties(obj, type=None, set=None):
'''
List properties for given btrfs object. The object can be path of BTRFS device,
mount point, or any directories/files inside the BTRFS filesystem.
General options:
* **type**: Possible types are s[ubvol], f[ilesystem], i[node] and d[evice].
* **for... | def properties(obj, type=None, set=None):
'''
List properties for given btrfs object. The object can be path of BTRFS device,
mount point, or any directories/files inside the BTRFS filesystem.
General options:
* **type**: Possible types are s[ubvol], f[ilesystem], i[node] and d[evice].
* **for... | [
"List",
"properties",
"for",
"given",
"btrfs",
"object",
".",
"The",
"object",
"can",
"be",
"path",
"of",
"BTRFS",
"device",
"mount",
"point",
"or",
"any",
"directories",
"/",
"files",
"inside",
"the",
"BTRFS",
"filesystem",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L627-L675 | [
"def",
"properties",
"(",
"obj",
",",
"type",
"=",
"None",
",",
"set",
"=",
"None",
")",
":",
"if",
"type",
"and",
"type",
"not",
"in",
"[",
"'s'",
",",
"'subvol'",
",",
"'f'",
",",
"'filesystem'",
",",
"'i'",
",",
"'inode'",
",",
"'d'",
",",
"'d... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_create | Create subvolume `name` in `dest`.
Return True if the subvolume is created, False is the subvolume is
already there.
name
Name of the new subvolume
dest
If not given, the subvolume will be created in the current
directory, if given will be in /dest/name
qgroupids
... | salt/modules/btrfs.py | def subvolume_create(name, dest=None, qgroupids=None):
'''
Create subvolume `name` in `dest`.
Return True if the subvolume is created, False is the subvolume is
already there.
name
Name of the new subvolume
dest
If not given, the subvolume will be created in the current
... | def subvolume_create(name, dest=None, qgroupids=None):
'''
Create subvolume `name` in `dest`.
Return True if the subvolume is created, False is the subvolume is
already there.
name
Name of the new subvolume
dest
If not given, the subvolume will be created in the current
... | [
"Create",
"subvolume",
"name",
"in",
"dest",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L696-L741 | [
"def",
"subvolume_create",
"(",
"name",
",",
"dest",
"=",
"None",
",",
"qgroupids",
"=",
"None",
")",
":",
"if",
"qgroupids",
"and",
"type",
"(",
"qgroupids",
")",
"is",
"not",
"list",
":",
"raise",
"CommandExecutionError",
"(",
"'Qgroupids parameter must be a... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_delete | Delete the subvolume(s) from the filesystem
The user can remove one single subvolume (name) or multiple of
then at the same time (names). One of the two parameters needs to
specified.
Please, refer to the documentation to understand the implication
on the transactions, and when the subvolume is re... | salt/modules/btrfs.py | def subvolume_delete(name=None, names=None, commit=None):
'''
Delete the subvolume(s) from the filesystem
The user can remove one single subvolume (name) or multiple of
then at the same time (names). One of the two parameters needs to
specified.
Please, refer to the documentation to understand... | def subvolume_delete(name=None, names=None, commit=None):
'''
Delete the subvolume(s) from the filesystem
The user can remove one single subvolume (name) or multiple of
then at the same time (names). One of the two parameters needs to
specified.
Please, refer to the documentation to understand... | [
"Delete",
"the",
"subvolume",
"(",
"s",
")",
"from",
"the",
"filesystem"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L744-L799 | [
"def",
"subvolume_delete",
"(",
"name",
"=",
"None",
",",
"names",
"=",
"None",
",",
"commit",
"=",
"None",
")",
":",
"if",
"not",
"name",
"and",
"not",
"(",
"names",
"and",
"type",
"(",
"names",
")",
"is",
"list",
")",
":",
"raise",
"CommandExecutio... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_find_new | List the recently modified files in a subvolume
name
Name of the subvolume
last_gen
Last transid marker from where to compare
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_find_new /var/volumes/tmp 1024 | salt/modules/btrfs.py | def subvolume_find_new(name, last_gen):
'''
List the recently modified files in a subvolume
name
Name of the subvolume
last_gen
Last transid marker from where to compare
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_find_new /var/volumes/tmp 1024
''... | def subvolume_find_new(name, last_gen):
'''
List the recently modified files in a subvolume
name
Name of the subvolume
last_gen
Last transid marker from where to compare
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_find_new /var/volumes/tmp 1024
''... | [
"List",
"the",
"recently",
"modified",
"files",
"in",
"a",
"subvolume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L802-L832 | [
"def",
"subvolume_find_new",
"(",
"name",
",",
"last_gen",
")",
":",
"cmd",
"=",
"[",
"'btrfs'",
",",
"'subvolume'",
",",
"'find-new'",
",",
"name",
",",
"last_gen",
"]",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"salt",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.