repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/boto_cloudtrail.py | list | def list(region=None, key=None, keyid=None, profile=None):
'''
List all trails
Returns list of trails
CLI Example:
.. code-block:: yaml
policies:
- {...}
- {...}
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
t... | python | def list(region=None, key=None, keyid=None, profile=None):
'''
List all trails
Returns list of trails
CLI Example:
.. code-block:: yaml
policies:
- {...}
- {...}
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
t... | [
"def",
"list",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
... | List all trails
Returns list of trails
CLI Example:
.. code-block:: yaml
policies:
- {...}
- {...} | [
"List",
"all",
"trails"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L273-L295 | train |
saltstack/salt | salt/modules/boto_cloudtrail.py | update | def update(Name,
S3BucketName, S3KeyPrefix=None,
SnsTopicName=None,
IncludeGlobalServiceEvents=None,
IsMultiRegionTrail=None,
EnableLogFileValidation=None,
CloudWatchLogsLogGroupArn=None,
CloudWatchLogsRoleArn=None,
KmsKeyId=None,
... | python | def update(Name,
S3BucketName, S3KeyPrefix=None,
SnsTopicName=None,
IncludeGlobalServiceEvents=None,
IsMultiRegionTrail=None,
EnableLogFileValidation=None,
CloudWatchLogsLogGroupArn=None,
CloudWatchLogsRoleArn=None,
KmsKeyId=None,
... | [
"def",
"update",
"(",
"Name",
",",
"S3BucketName",
",",
"S3KeyPrefix",
"=",
"None",
",",
"SnsTopicName",
"=",
"None",
",",
"IncludeGlobalServiceEvents",
"=",
"None",
",",
"IsMultiRegionTrail",
"=",
"None",
",",
"EnableLogFileValidation",
"=",
"None",
",",
"Cloud... | Given a valid config, update a trail.
Returns {created: true} if the trail was created and returns
{created: False} if the trail was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.update my_trail my_bucket | [
"Given",
"a",
"valid",
"config",
"update",
"a",
"trail",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L298-L342 | train |
saltstack/salt | salt/modules/boto_cloudtrail.py | start_logging | def start_logging(Name,
region=None, key=None, keyid=None, profile=None):
'''
Start logging for a trail
Returns {started: true} if the trail was started and returns
{started: False} if the trail was not started.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtra... | python | def start_logging(Name,
region=None, key=None, keyid=None, profile=None):
'''
Start logging for a trail
Returns {started: true} if the trail was started and returns
{started: False} if the trail was not started.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtra... | [
"def",
"start_logging",
"(",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
... | Start logging for a trail
Returns {started: true} if the trail was started and returns
{started: False} if the trail was not started.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.start_logging my_trail | [
"Start",
"logging",
"for",
"a",
"trail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L345-L366 | train |
saltstack/salt | salt/modules/boto_cloudtrail.py | add_tags | def add_tags(Name,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.ad... | python | def add_tags(Name,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.ad... | [
"def",
"add_tags",
"(",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",... | Add tags to a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.add_tags my_trail tag_a=tag_value tag_b=tag_value | [
"Add",
"tags",
"to",
"a",
"trail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L407-L435 | train |
saltstack/salt | salt/modules/boto_cloudtrail.py | list_tags | def list_tags(Name,
region=None, key=None, keyid=None, profile=None):
'''
List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail
'''
try:
conn = _get_c... | python | def list_tags(Name,
region=None, key=None, keyid=None, profile=None):
'''
List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail
'''
try:
conn = _get_c... | [
"def",
"list_tags",
"(",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",... | List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail | [
"List",
"tags",
"of",
"a",
"trail"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L469-L499 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | _list_distributions | def _list_distributions(
conn,
name=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Private function that returns an iterator over all CloudFront distributions.
The caller is responsible for all boto-related error handling.
name
(Optional) Only yield the di... | python | def _list_distributions(
conn,
name=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Private function that returns an iterator over all CloudFront distributions.
The caller is responsible for all boto-related error handling.
name
(Optional) Only yield the di... | [
"def",
"_list_distributions",
"(",
"conn",
",",
"name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
")",
":",
"for",
"dl_",
"in",
"conn",
".",
"get_paginator",
"(",
... | Private function that returns an iterator over all CloudFront distributions.
The caller is responsible for all boto-related error handling.
name
(Optional) Only yield the distribution with the given name | [
"Private",
"function",
"that",
"returns",
"an",
"iterator",
"over",
"all",
"CloudFront",
"distributions",
".",
"The",
"caller",
"is",
"responsible",
"for",
"all",
"boto",
"-",
"related",
"error",
"handling",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L87-L156 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | get_distribution | def get_distribution(name, region=None, key=None, keyid=None, profile=None):
'''
Get information about a CloudFront distribution (configuration, tags) with a given name.
name
Name of the CloudFront distribution
region
Region to connect to
key
Secret key to use
keyid
... | python | def get_distribution(name, region=None, key=None, keyid=None, profile=None):
'''
Get information about a CloudFront distribution (configuration, tags) with a given name.
name
Name of the CloudFront distribution
region
Region to connect to
key
Secret key to use
keyid
... | [
"def",
"get_distribution",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"distribution",
"=",
"_cache_id",
"(",
"'cloudfront'",
",",
"sub_resource",
"=",
"name",
",",
... | Get information about a CloudFront distribution (configuration, tags) with a given name.
name
Name of the CloudFront distribution
region
Region to connect to
key
Secret key to use
keyid
Access key to use
profile
A dict with region, key, and keyid,
... | [
"Get",
"information",
"about",
"a",
"CloudFront",
"distribution",
"(",
"configuration",
"tags",
")",
"with",
"a",
"given",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L159-L231 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | export_distributions | def export_distributions(region=None, key=None, keyid=None, profile=None):
'''
Get details of all CloudFront distributions.
Produces results that can be used to create an SLS file.
CLI Example:
.. code-block:: bash
salt-call boto_cloudfront.export_distributions --out=txt |\
se... | python | def export_distributions(region=None, key=None, keyid=None, profile=None):
'''
Get details of all CloudFront distributions.
Produces results that can be used to create an SLS file.
CLI Example:
.. code-block:: bash
salt-call boto_cloudfront.export_distributions --out=txt |\
se... | [
"def",
"export_distributions",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"results",
"=",
"OrderedDict",
"(",
")",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
... | Get details of all CloudFront distributions.
Produces results that can be used to create an SLS file.
CLI Example:
.. code-block:: bash
salt-call boto_cloudfront.export_distributions --out=txt |\
sed "s/local: //" > cloudfront_distributions.sls | [
"Get",
"details",
"of",
"all",
"CloudFront",
"distributions",
".",
"Produces",
"results",
"that",
"can",
"be",
"used",
"to",
"create",
"an",
"SLS",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L234-L278 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | create_distribution | def create_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Create a CloudFront distribution with the given name, config, and (optionally) tags.
name
Name for the CloudFront distribution
config
Configuration for ... | python | def create_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Create a CloudFront distribution with the given name, config, and (optionally) tags.
name
Name for the CloudFront distribution
config
Configuration for ... | [
"def",
"create_distribution",
"(",
"name",
",",
"config",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
")",
":",
"if",
"tags",
"is",
"None",
":",
"tags",... | Create a CloudFront distribution with the given name, config, and (optionally) tags.
name
Name for the CloudFront distribution
config
Configuration for the distribution
tags
Tags to associate with the distribution
region
Region to connect to
key
Secret ke... | [
"Create",
"a",
"CloudFront",
"distribution",
"with",
"the",
"given",
"name",
"config",
"and",
"(",
"optionally",
")",
"tags",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L281-L353 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | update_distribution | def update_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Update the config (and optionally tags) for the CloudFront distribution with the given name.
name
Name of the CloudFront distribution
config
Configurati... | python | def update_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Update the config (and optionally tags) for the CloudFront distribution with the given name.
name
Name of the CloudFront distribution
config
Configurati... | [
"def",
"update_distribution",
"(",
"name",
",",
"config",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
")",
":",
"### FIXME - BUG. This function can NEVER work as... | Update the config (and optionally tags) for the CloudFront distribution with the given name.
name
Name of the CloudFront distribution
config
Configuration for the distribution
tags
Tags to associate with the distribution
region
Region to connect to
key
Se... | [
"Update",
"the",
"config",
"(",
"and",
"optionally",
"tags",
")",
"for",
"the",
"CloudFront",
"distribution",
"with",
"the",
"given",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L356-L461 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | list_distributions | def list_distributions(region=None, key=None, keyid=None, profile=None):
'''
List, with moderate information, all CloudFront distributions in the bound account.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pilla... | python | def list_distributions(region=None, key=None, keyid=None, profile=None):
'''
List, with moderate information, all CloudFront distributions in the bound account.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pilla... | [
"def",
"list_distributions",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"retries",
"=",
"10",
"sleep",
"=",
"6",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
... | List, with moderate information, all CloudFront distributions in the bound account.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pillar key pointing to a dict, containing AWS region/key/keyid.
CLI Example:
.. ... | [
"List",
"with",
"moderate",
"information",
"all",
"CloudFront",
"distributions",
"in",
"the",
"bound",
"account",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L564-L609 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | distribution_exists | def distribution_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront distribution exists with the given Resource ID or False otherwise.
Id
Resource ID of the CloudFront distribution.
region
Region to connect to.
key
Secret key to us... | python | def distribution_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront distribution exists with the given Resource ID or False otherwise.
Id
Resource ID of the CloudFront distribution.
region
Region to connect to.
key
Secret key to us... | [
"def",
"distribution_exists",
"(",
"Id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"authargs",
"=",
"{",
"'region'",
":",
"region",
",",
"'key'",
":",
"key",
",",
"'keyid'",... | Return True if a CloudFront distribution exists with the given Resource ID or False otherwise.
Id
Resource ID of the CloudFront distribution.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pillar key pointing... | [
"Return",
"True",
"if",
"a",
"CloudFront",
"distribution",
"exists",
"with",
"the",
"given",
"Resource",
"ID",
"or",
"False",
"otherwise",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L612-L640 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | get_distributions_by_comment | def get_distributions_by_comment(Comment, region=None, key=None, keyid=None, profile=None):
'''
Find and return any CloudFront distributions which happen to have a Comment sub-field
either exactly matching the given Comment, or beginning with it AND with the remainder
separated by a colon.
Comment
... | python | def get_distributions_by_comment(Comment, region=None, key=None, keyid=None, profile=None):
'''
Find and return any CloudFront distributions which happen to have a Comment sub-field
either exactly matching the given Comment, or beginning with it AND with the remainder
separated by a colon.
Comment
... | [
"def",
"get_distributions_by_comment",
"(",
"Comment",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Dereferincing CloudFront distribution(s) by Comment `%s`.'",
... | Find and return any CloudFront distributions which happen to have a Comment sub-field
either exactly matching the given Comment, or beginning with it AND with the remainder
separated by a colon.
Comment
The string to be matched when searching for the given Distribution. Note that this
will... | [
"Find",
"and",
"return",
"any",
"CloudFront",
"distributions",
"which",
"happen",
"to",
"have",
"a",
"Comment",
"sub",
"-",
"field",
"either",
"exactly",
"matching",
"the",
"given",
"Comment",
"or",
"beginning",
"with",
"it",
"AND",
"with",
"the",
"remainder",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L643-L688 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | disable_distribution | def disable_distribution(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Set a CloudFront distribution to be disabled.
Id
Id of the distribution to update.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profil... | python | def disable_distribution(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Set a CloudFront distribution to be disabled.
Id
Id of the distribution to update.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profil... | [
"def",
"disable_distribution",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"retries",
"=",
"10",
"sleep",
"=",
"6",
"kwargs",
"=",
"{",
"k",
":",
... | Set a CloudFront distribution to be disabled.
Id
Id of the distribution to update.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pillar key pointing to a dict, containing AWS region/key/keyid.
CLI Examp... | [
"Set",
"a",
"CloudFront",
"distribution",
"to",
"be",
"disabled",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L978-L1036 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | get_cloud_front_origin_access_identities_by_comment | def get_cloud_front_origin_access_identities_by_comment(Comment, region=None, key=None, keyid=None,
profile=None):
'''
Find and return any CloudFront Origin Access Identities which happen to have a Comment
sub-field either exactly matching the given Co... | python | def get_cloud_front_origin_access_identities_by_comment(Comment, region=None, key=None, keyid=None,
profile=None):
'''
Find and return any CloudFront Origin Access Identities which happen to have a Comment
sub-field either exactly matching the given Co... | [
"def",
"get_cloud_front_origin_access_identities_by_comment",
"(",
"Comment",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Dereferincing CloudFront origin access ... | Find and return any CloudFront Origin Access Identities which happen to have a Comment
sub-field either exactly matching the given Comment, or beginning with it AND with the
remainder separate by a colon.
Comment
The string to be matched when searching for the given Origin Access Identity. Note
... | [
"Find",
"and",
"return",
"any",
"CloudFront",
"Origin",
"Access",
"Identities",
"which",
"happen",
"to",
"have",
"a",
"Comment",
"sub",
"-",
"field",
"either",
"exactly",
"matching",
"the",
"given",
"Comment",
"or",
"beginning",
"with",
"it",
"AND",
"with",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1237-L1283 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | cloud_front_origin_access_identity_exists | def cloud_front_origin_access_identity_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront origin access identity exists with the given Resource ID or False
otherwise.
Id
Resource ID of the CloudFront origin access identity.
region
Region to... | python | def cloud_front_origin_access_identity_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront origin access identity exists with the given Resource ID or False
otherwise.
Id
Resource ID of the CloudFront origin access identity.
region
Region to... | [
"def",
"cloud_front_origin_access_identity_exists",
"(",
"Id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"authargs",
"=",
"{",
"'region'",
":",
"region",
",",
"'key'",
":",
"key... | Return True if a CloudFront origin access identity exists with the given Resource ID or False
otherwise.
Id
Resource ID of the CloudFront origin access identity.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict... | [
"Return",
"True",
"if",
"a",
"CloudFront",
"origin",
"access",
"identity",
"exists",
"with",
"the",
"given",
"Resource",
"ID",
"or",
"False",
"otherwise",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1455-L1484 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | tag_resource | def tag_resource(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a CloudFront resource.
Resource
The ARN of the affected CloudFront resource.
Tags
Dict of {'Tag': 'Value', ...} providing the tags to be set.
region
Region to connect to.
key
... | python | def tag_resource(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a CloudFront resource.
Resource
The ARN of the affected CloudFront resource.
Tags
Dict of {'Tag': 'Value', ...} providing the tags to be set.
region
Region to connect to.
key
... | [
"def",
"tag_resource",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"retries",
"=",
"10",
"sleep",
"=",
"6",
"kwargs",
"=",
"{",
"k",
":",
"v",
"... | Add tags to a CloudFront resource.
Resource
The ARN of the affected CloudFront resource.
Tags
Dict of {'Tag': 'Value', ...} providing the tags to be set.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dic... | [
"Add",
"tags",
"to",
"a",
"CloudFront",
"resource",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1537-L1588 | train |
saltstack/salt | salt/modules/boto_cloudfront.py | enforce_tags | def enforce_tags(Resource, Tags, region=None, key=None, keyid=None, profile=None):
'''
Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them
as necessary to ensure the resource's tags are exactly and only those specified.
Resource
The ARN of the affected Clou... | python | def enforce_tags(Resource, Tags, region=None, key=None, keyid=None, profile=None):
'''
Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them
as necessary to ensure the resource's tags are exactly and only those specified.
Resource
The ARN of the affected Clou... | [
"def",
"enforce_tags",
"(",
"Resource",
",",
"Tags",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"authargs",
"=",
"{",
"'region'",
":",
"region",
",",
"'key'",
":",
"key",
"... | Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them
as necessary to ensure the resource's tags are exactly and only those specified.
Resource
The ARN of the affected CloudFront resource.
Tags
Dict of {'Tag': 'Value', ...} providing the tags to be enfor... | [
"Enforce",
"a",
"given",
"set",
"of",
"tags",
"on",
"a",
"CloudFront",
"resource",
":",
"adding",
"removing",
"or",
"changing",
"them",
"as",
"necessary",
"to",
"ensure",
"the",
"resource",
"s",
"tags",
"are",
"exactly",
"and",
"only",
"those",
"specified",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1644-L1692 | train |
saltstack/salt | salt/states/pcs.py | _file_read | def _file_read(path):
'''
Read a file and return content
'''
content = False
if os.path.exists(path):
with salt.utils.files.fopen(path, 'r+') as fp_:
content = salt.utils.stringutils.to_unicode(fp_.read())
fp_.close()
return content | python | def _file_read(path):
'''
Read a file and return content
'''
content = False
if os.path.exists(path):
with salt.utils.files.fopen(path, 'r+') as fp_:
content = salt.utils.stringutils.to_unicode(fp_.read())
fp_.close()
return content | [
"def",
"_file_read",
"(",
"path",
")",
":",
"content",
"=",
"False",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"path",
",",
"'r+'",
")",
"as",
"fp_",
":",
"conten... | Read a file and return content | [
"Read",
"a",
"file",
"and",
"return",
"content"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L191-L200 | train |
saltstack/salt | salt/states/pcs.py | _file_write | def _file_write(path, content):
'''
Write content to a file
'''
with salt.utils.files.fopen(path, 'w+') as fp_:
fp_.write(salt.utils.stringutils.to_str(content))
fp_.close() | python | def _file_write(path, content):
'''
Write content to a file
'''
with salt.utils.files.fopen(path, 'w+') as fp_:
fp_.write(salt.utils.stringutils.to_str(content))
fp_.close() | [
"def",
"_file_write",
"(",
"path",
",",
"content",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"path",
",",
"'w+'",
")",
"as",
"fp_",
":",
"fp_",
".",
"write",
"(",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_str... | Write content to a file | [
"Write",
"content",
"to",
"a",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L203-L209 | train |
saltstack/salt | salt/states/pcs.py | _get_cibpath | def _get_cibpath():
'''
Get the path to the directory on the minion where CIB's are saved
'''
cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__)
log.trace('cibpath: %s', cibpath)
return cibpath | python | def _get_cibpath():
'''
Get the path to the directory on the minion where CIB's are saved
'''
cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__)
log.trace('cibpath: %s', cibpath)
return cibpath | [
"def",
"_get_cibpath",
"(",
")",
":",
"cibpath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__opts__",
"[",
"'cachedir'",
"]",
",",
"'pcs'",
",",
"__env__",
")",
"log",
".",
"trace",
"(",
"'cibpath: %s'",
",",
"cibpath",
")",
"return",
"cibpath"
] | Get the path to the directory on the minion where CIB's are saved | [
"Get",
"the",
"path",
"to",
"the",
"directory",
"on",
"the",
"minion",
"where",
"CIB",
"s",
"are",
"saved"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L212-L218 | train |
saltstack/salt | salt/states/pcs.py | _get_cibfile | def _get_cibfile(cibname):
'''
Get the full path of a cached CIB-file with the name of the CIB
'''
cibfile = os.path.join(_get_cibpath(), '{0}.{1}'.format(cibname, 'cib'))
log.trace('cibfile: %s', cibfile)
return cibfile | python | def _get_cibfile(cibname):
'''
Get the full path of a cached CIB-file with the name of the CIB
'''
cibfile = os.path.join(_get_cibpath(), '{0}.{1}'.format(cibname, 'cib'))
log.trace('cibfile: %s', cibfile)
return cibfile | [
"def",
"_get_cibfile",
"(",
"cibname",
")",
":",
"cibfile",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_get_cibpath",
"(",
")",
",",
"'{0}.{1}'",
".",
"format",
"(",
"cibname",
",",
"'cib'",
")",
")",
"log",
".",
"trace",
"(",
"'cibfile: %s'",
",",
"... | Get the full path of a cached CIB-file with the name of the CIB | [
"Get",
"the",
"full",
"path",
"of",
"a",
"cached",
"CIB",
"-",
"file",
"with",
"the",
"name",
"of",
"the",
"CIB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L221-L227 | train |
saltstack/salt | salt/states/pcs.py | _get_cibfile_tmp | def _get_cibfile_tmp(cibname):
'''
Get the full path of a temporary CIB-file with the name of the CIB
'''
cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname))
log.trace('cibfile_tmp: %s', cibfile_tmp)
return cibfile_tmp | python | def _get_cibfile_tmp(cibname):
'''
Get the full path of a temporary CIB-file with the name of the CIB
'''
cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname))
log.trace('cibfile_tmp: %s', cibfile_tmp)
return cibfile_tmp | [
"def",
"_get_cibfile_tmp",
"(",
"cibname",
")",
":",
"cibfile_tmp",
"=",
"'{0}.tmp'",
".",
"format",
"(",
"_get_cibfile",
"(",
"cibname",
")",
")",
"log",
".",
"trace",
"(",
"'cibfile_tmp: %s'",
",",
"cibfile_tmp",
")",
"return",
"cibfile_tmp"
] | Get the full path of a temporary CIB-file with the name of the CIB | [
"Get",
"the",
"full",
"path",
"of",
"a",
"temporary",
"CIB",
"-",
"file",
"with",
"the",
"name",
"of",
"the",
"CIB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L230-L236 | train |
saltstack/salt | salt/states/pcs.py | _get_cibfile_cksum | def _get_cibfile_cksum(cibname):
'''
Get the full path of the file containing a checksum of a CIB-file with the name of the CIB
'''
cibfile_cksum = '{0}.cksum'.format(_get_cibfile(cibname))
log.trace('cibfile_cksum: %s', cibfile_cksum)
return cibfile_cksum | python | def _get_cibfile_cksum(cibname):
'''
Get the full path of the file containing a checksum of a CIB-file with the name of the CIB
'''
cibfile_cksum = '{0}.cksum'.format(_get_cibfile(cibname))
log.trace('cibfile_cksum: %s', cibfile_cksum)
return cibfile_cksum | [
"def",
"_get_cibfile_cksum",
"(",
"cibname",
")",
":",
"cibfile_cksum",
"=",
"'{0}.cksum'",
".",
"format",
"(",
"_get_cibfile",
"(",
"cibname",
")",
")",
"log",
".",
"trace",
"(",
"'cibfile_cksum: %s'",
",",
"cibfile_cksum",
")",
"return",
"cibfile_cksum"
] | Get the full path of the file containing a checksum of a CIB-file with the name of the CIB | [
"Get",
"the",
"full",
"path",
"of",
"the",
"file",
"containing",
"a",
"checksum",
"of",
"a",
"CIB",
"-",
"file",
"with",
"the",
"name",
"of",
"the",
"CIB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L239-L245 | train |
saltstack/salt | salt/states/pcs.py | _item_present | def _item_present(name, item, item_id, item_type, show='show', create='create', extra_args=None, cibname=None):
'''
Ensure that an item is created
name
Irrelevant, not used
item
config, property, resource, constraint etc.
item_id
id of the item
item_type
item typ... | python | def _item_present(name, item, item_id, item_type, show='show', create='create', extra_args=None, cibname=None):
'''
Ensure that an item is created
name
Irrelevant, not used
item
config, property, resource, constraint etc.
item_id
id of the item
item_type
item typ... | [
"def",
"_item_present",
"(",
"name",
",",
"item",
",",
"item_id",
",",
"item_type",
",",
"show",
"=",
"'show'",
",",
"create",
"=",
"'create'",
",",
"extra_args",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"na... | Ensure that an item is created
name
Irrelevant, not used
item
config, property, resource, constraint etc.
item_id
id of the item
item_type
item type
show
show command (probably None, default: show)
create
create command (create or set f.e., defaul... | [
"Ensure",
"that",
"an",
"item",
"is",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L248-L357 | train |
saltstack/salt | salt/states/pcs.py | auth | def auth(name, nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None):
'''
Ensure all nodes are authorized to the cluster
name
Irrelevant, not used (recommended: pcs_auth__auth)
nodes
a list of nodes which should be authorized to the cluster
pcsuser
user for com... | python | def auth(name, nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None):
'''
Ensure all nodes are authorized to the cluster
name
Irrelevant, not used (recommended: pcs_auth__auth)
nodes
a list of nodes which should be authorized to the cluster
pcsuser
user for com... | [
"def",
"auth",
"(",
"name",
",",
"nodes",
",",
"pcsuser",
"=",
"'hacluster'",
",",
"pcspasswd",
"=",
"'hacluster'",
",",
"extra_args",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
... | Ensure all nodes are authorized to the cluster
name
Irrelevant, not used (recommended: pcs_auth__auth)
nodes
a list of nodes which should be authorized to the cluster
pcsuser
user for communication with pcs (default: hacluster)
pcspasswd
password for pcsuser (default: ha... | [
"Ensure",
"all",
"nodes",
"are",
"authorized",
"to",
"the",
"cluster"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L360-L444 | train |
saltstack/salt | salt/states/pcs.py | cluster_setup | def cluster_setup(name, nodes, pcsclustername='pcscluster', extra_args=None):
'''
Setup Pacemaker cluster on nodes.
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_setup__setup)
nodes
a list of nodes which should be set up
... | python | def cluster_setup(name, nodes, pcsclustername='pcscluster', extra_args=None):
'''
Setup Pacemaker cluster on nodes.
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_setup__setup)
nodes
a list of nodes which should be set up
... | [
"def",
"cluster_setup",
"(",
"name",
",",
"nodes",
",",
"pcsclustername",
"=",
"'pcscluster'",
",",
"extra_args",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
... | Setup Pacemaker cluster on nodes.
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_setup__setup)
nodes
a list of nodes which should be set up
pcsclustername
Name of the Pacemaker cluster
extra_args
list of ex... | [
"Setup",
"Pacemaker",
"cluster",
"on",
"nodes",
".",
"Should",
"be",
"run",
"on",
"one",
"cluster",
"node",
"only",
"(",
"there",
"may",
"be",
"races",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L447-L533 | train |
saltstack/salt | salt/states/pcs.py | cluster_node_present | def cluster_node_present(name, node, extra_args=None):
'''
Add a node to the Pacemaker cluster via PCS
Should be run on one cluster node only
(there may be races)
Can only be run on a already setup/added node
name
Irrelevant, not used (recommended: pcs_setup__node_add_{{node}})
node... | python | def cluster_node_present(name, node, extra_args=None):
'''
Add a node to the Pacemaker cluster via PCS
Should be run on one cluster node only
(there may be races)
Can only be run on a already setup/added node
name
Irrelevant, not used (recommended: pcs_setup__node_add_{{node}})
node... | [
"def",
"cluster_node_present",
"(",
"name",
",",
"node",
",",
"extra_args",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"node_add_requir... | Add a node to the Pacemaker cluster via PCS
Should be run on one cluster node only
(there may be races)
Can only be run on a already setup/added node
name
Irrelevant, not used (recommended: pcs_setup__node_add_{{node}})
node
node that should be added
extra_args
list of e... | [
"Add",
"a",
"node",
"to",
"the",
"Pacemaker",
"cluster",
"via",
"PCS",
"Should",
"be",
"run",
"on",
"one",
"cluster",
"node",
"only",
"(",
"there",
"may",
"be",
"races",
")",
"Can",
"only",
"be",
"run",
"on",
"a",
"already",
"setup",
"/",
"added",
"n... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L536-L632 | train |
saltstack/salt | salt/states/pcs.py | cib_present | def cib_present(name, cibname, scope=None, extra_args=None):
'''
Ensure that a CIB-file with the content of the current live CIB is created
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}})
cibn... | python | def cib_present(name, cibname, scope=None, extra_args=None):
'''
Ensure that a CIB-file with the content of the current live CIB is created
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}})
cibn... | [
"def",
"cib_present",
"(",
"name",
",",
"cibname",
",",
"scope",
"=",
"None",
",",
"extra_args",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"... | Ensure that a CIB-file with the content of the current live CIB is created
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_present_{{cibname}})
cibname
name/path of the file containing the CIB
scope
sp... | [
"Ensure",
"that",
"a",
"CIB",
"-",
"file",
"with",
"the",
"content",
"of",
"the",
"current",
"live",
"CIB",
"is",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L635-L748 | train |
saltstack/salt | salt/states/pcs.py | cib_pushed | def cib_pushed(name, cibname, scope=None, extra_args=None):
'''
Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{... | python | def cib_pushed(name, cibname, scope=None, extra_args=None):
'''
Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{... | [
"def",
"cib_pushed",
"(",
"name",
",",
"cibname",
",",
"scope",
"=",
"None",
",",
"extra_args",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}... | Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: {{formulaname}}__cib_pushed_{{cibname}})
cibname
name/path of the file containing the CIB
... | [
"Ensure",
"that",
"a",
"CIB",
"-",
"file",
"is",
"pushed",
"if",
"it",
"is",
"changed",
"since",
"the",
"creation",
"of",
"it",
"with",
"pcs",
".",
"cib_present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L751-L821 | train |
saltstack/salt | salt/states/pcs.py | prop_has_value | def prop_has_value(name, prop, value, extra_args=None, cibname=None):
'''
Ensure that a property in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}})
prop
... | python | def prop_has_value(name, prop, value, extra_args=None, cibname=None):
'''
Ensure that a property in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}})
prop
... | [
"def",
"prop_has_value",
"(",
"name",
",",
"prop",
",",
"value",
",",
"extra_args",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'property'",
",",
"item_id",
"=",
"'{0}={1}'",... | Ensure that a property in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
name
Irrelevant, not used (recommended: pcs_properties__prop_has_value_{{prop}})
prop
name of the property
value
value of the property
extra_args
... | [
"Ensure",
"that",
"a",
"property",
"in",
"the",
"cluster",
"is",
"set",
"to",
"a",
"given",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L824-L858 | train |
saltstack/salt | salt/states/pcs.py | resource_defaults_to | def resource_defaults_to(name, default, value, extra_args=None, cibname=None):
'''
Ensure a resource default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant... | python | def resource_defaults_to(name, default, value, extra_args=None, cibname=None):
'''
Ensure a resource default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant... | [
"def",
"resource_defaults_to",
"(",
"name",
",",
"default",
",",
"value",
",",
"extra_args",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'resource'",
",",
"item_id",
"=",
"'{... | Ensure a resource default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recommended: pcs_properties__resource_defaults_to_{{default}})
default
... | [
"Ensure",
"a",
"resource",
"default",
"in",
"the",
"cluster",
"is",
"set",
"to",
"a",
"given",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L861-L897 | train |
saltstack/salt | salt/states/pcs.py | resource_op_defaults_to | def resource_op_defaults_to(name, op_default, value, extra_args=None, cibname=None):
'''
Ensure a resource operation default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
... | python | def resource_op_defaults_to(name, op_default, value, extra_args=None, cibname=None):
'''
Ensure a resource operation default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
... | [
"def",
"resource_op_defaults_to",
"(",
"name",
",",
"op_default",
",",
"value",
",",
"extra_args",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'resource'",
",",
"item_id",
"=",... | Ensure a resource operation default in the cluster is set to a given value
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recommended: pcs_properties__resource_op_defaults_to_{{op_default}})
... | [
"Ensure",
"a",
"resource",
"operation",
"default",
"in",
"the",
"cluster",
"is",
"set",
"to",
"a",
"given",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L900-L936 | train |
saltstack/salt | salt/states/pcs.py | stonith_present | def stonith_present(name, stonith_id, stonith_device_type, stonith_device_options=None, cibname=None):
'''
Ensure that a fencing resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevan... | python | def stonith_present(name, stonith_id, stonith_device_type, stonith_device_options=None, cibname=None):
'''
Ensure that a fencing resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevan... | [
"def",
"stonith_present",
"(",
"name",
",",
"stonith_id",
",",
"stonith_device_type",
",",
"stonith_device_options",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'stonith'",
",",
... | Ensure that a fencing resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recommended: pcs_stonith__created_{{stonith_id}})
stonith_id
name for the stonith resource... | [
"Ensure",
"that",
"a",
"fencing",
"resource",
"is",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L939-L981 | train |
saltstack/salt | salt/states/pcs.py | resource_present | def resource_present(name, resource_id, resource_type, resource_options=None, cibname=None):
'''
Ensure that a resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recom... | python | def resource_present(name, resource_id, resource_type, resource_options=None, cibname=None):
'''
Ensure that a resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recom... | [
"def",
"resource_present",
"(",
"name",
",",
"resource_id",
",",
"resource_type",
",",
"resource_options",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'resource'",
",",
"item_id"... | Ensure that a resource is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recommended: {{formulaname}}__resource_present_{{resource_id}})
resource_id
name for the resource
... | [
"Ensure",
"that",
"a",
"resource",
"is",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L984-L1021 | train |
saltstack/salt | salt/states/pcs.py | constraint_present | def constraint_present(name, constraint_id, constraint_type, constraint_options=None, cibname=None):
'''
Ensure that a constraint is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not u... | python | def constraint_present(name, constraint_id, constraint_type, constraint_options=None, cibname=None):
'''
Ensure that a constraint is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not u... | [
"def",
"constraint_present",
"(",
"name",
",",
"constraint_id",
",",
"constraint_type",
",",
"constraint_options",
"=",
"None",
",",
"cibname",
"=",
"None",
")",
":",
"return",
"_item_present",
"(",
"name",
"=",
"name",
",",
"item",
"=",
"'constraint'",
",",
... | Ensure that a constraint is created
Should be run on one cluster node only
(there may be races)
Can only be run on a node with a functional pacemaker/corosync
name
Irrelevant, not used (recommended: {{formulaname}}__constraint_present_{{constraint_id}})
constraint_id
name for the c... | [
"Ensure",
"that",
"a",
"constraint",
"is",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L1024-L1064 | train |
saltstack/salt | salt/pillar/makostack.py | _parse_top_cfg | def _parse_top_cfg(content, filename):
'''
Allow top_cfg to be YAML
'''
try:
obj = salt.utils.yaml.safe_load(content)
if isinstance(obj, list):
log.debug('MakoStack cfg `%s` parsed as YAML', filename)
return obj
except Exception as err:
pass
log.de... | python | def _parse_top_cfg(content, filename):
'''
Allow top_cfg to be YAML
'''
try:
obj = salt.utils.yaml.safe_load(content)
if isinstance(obj, list):
log.debug('MakoStack cfg `%s` parsed as YAML', filename)
return obj
except Exception as err:
pass
log.de... | [
"def",
"_parse_top_cfg",
"(",
"content",
",",
"filename",
")",
":",
"try",
":",
"obj",
"=",
"salt",
".",
"utils",
".",
"yaml",
".",
"safe_load",
"(",
"content",
")",
"if",
"isinstance",
"(",
"obj",
",",
"list",
")",
":",
"log",
".",
"debug",
"(",
"... | Allow top_cfg to be YAML | [
"Allow",
"top_cfg",
"to",
"be",
"YAML"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/makostack.py#L564-L576 | train |
saltstack/salt | salt/modules/freebsdjail.py | is_enabled | def is_enabled():
'''
See if jail service is actually enabled on boot
CLI Example:
.. code-block:: bash
salt '*' jail.is_enabled <jail name>
'''
cmd = 'service -e'
services = __salt__['cmd.run'](cmd, python_shell=False)
for service in services.split('\\n'):
if re.searc... | python | def is_enabled():
'''
See if jail service is actually enabled on boot
CLI Example:
.. code-block:: bash
salt '*' jail.is_enabled <jail name>
'''
cmd = 'service -e'
services = __salt__['cmd.run'](cmd, python_shell=False)
for service in services.split('\\n'):
if re.searc... | [
"def",
"is_enabled",
"(",
")",
":",
"cmd",
"=",
"'service -e'",
"services",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"for",
"service",
"in",
"services",
".",
"split",
"(",
"'\\\\n'",
")",
":",
"if",
"r... | See if jail service is actually enabled on boot
CLI Example:
.. code-block:: bash
salt '*' jail.is_enabled <jail name> | [
"See",
"if",
"jail",
"service",
"is",
"actually",
"enabled",
"on",
"boot"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L73-L88 | train |
saltstack/salt | salt/modules/freebsdjail.py | get_enabled | def get_enabled():
'''
Return which jails are set to be run
CLI Example:
.. code-block:: bash
salt '*' jail.get_enabled
'''
ret = []
for rconf in ('/etc/rc.conf', '/etc/rc.conf.local'):
if os.access(rconf, os.R_OK):
with salt.utils.files.fopen(rconf, 'r') as _f... | python | def get_enabled():
'''
Return which jails are set to be run
CLI Example:
.. code-block:: bash
salt '*' jail.get_enabled
'''
ret = []
for rconf in ('/etc/rc.conf', '/etc/rc.conf.local'):
if os.access(rconf, os.R_OK):
with salt.utils.files.fopen(rconf, 'r') as _f... | [
"def",
"get_enabled",
"(",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"rconf",
"in",
"(",
"'/etc/rc.conf'",
",",
"'/etc/rc.conf.local'",
")",
":",
"if",
"os",
".",
"access",
"(",
"rconf",
",",
"os",
".",
"R_OK",
")",
":",
"with",
"salt",
".",
"utils",
... | Return which jails are set to be run
CLI Example:
.. code-block:: bash
salt '*' jail.get_enabled | [
"Return",
"which",
"jails",
"are",
"set",
"to",
"be",
"run"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L91-L114 | train |
saltstack/salt | salt/modules/freebsdjail.py | show_config | def show_config(jail):
'''
Display specified jail's configuration
CLI Example:
.. code-block:: bash
salt '*' jail.show_config <jail name>
'''
ret = {}
if subprocess.call(["jls", "-nq", "-j", jail]) == 0:
jls = subprocess.check_output(["jls", "-nq", "-j", jail]) # pylint: ... | python | def show_config(jail):
'''
Display specified jail's configuration
CLI Example:
.. code-block:: bash
salt '*' jail.show_config <jail name>
'''
ret = {}
if subprocess.call(["jls", "-nq", "-j", jail]) == 0:
jls = subprocess.check_output(["jls", "-nq", "-j", jail]) # pylint: ... | [
"def",
"show_config",
"(",
"jail",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"subprocess",
".",
"call",
"(",
"[",
"\"jls\"",
",",
"\"-nq\"",
",",
"\"-j\"",
",",
"jail",
"]",
")",
"==",
"0",
":",
"jls",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
... | Display specified jail's configuration
CLI Example:
.. code-block:: bash
salt '*' jail.show_config <jail name> | [
"Display",
"specified",
"jail",
"s",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L117-L172 | train |
saltstack/salt | salt/modules/freebsdjail.py | fstab | def fstab(jail):
'''
Display contents of a fstab(5) file defined in specified
jail's configuration. If no file is defined, return False.
CLI Example:
.. code-block:: bash
salt '*' jail.fstab <jail name>
'''
ret = []
config = show_config(jail)
if 'fstab' in config:
... | python | def fstab(jail):
'''
Display contents of a fstab(5) file defined in specified
jail's configuration. If no file is defined, return False.
CLI Example:
.. code-block:: bash
salt '*' jail.fstab <jail name>
'''
ret = []
config = show_config(jail)
if 'fstab' in config:
... | [
"def",
"fstab",
"(",
"jail",
")",
":",
"ret",
"=",
"[",
"]",
"config",
"=",
"show_config",
"(",
"jail",
")",
"if",
"'fstab'",
"in",
"config",
":",
"c_fstab",
"=",
"config",
"[",
"'fstab'",
"]",
"elif",
"'mount.fstab'",
"in",
"config",
":",
"c_fstab",
... | Display contents of a fstab(5) file defined in specified
jail's configuration. If no file is defined, return False.
CLI Example:
.. code-block:: bash
salt '*' jail.fstab <jail name> | [
"Display",
"contents",
"of",
"a",
"fstab",
"(",
"5",
")",
"file",
"defined",
"in",
"specified",
"jail",
"s",
"configuration",
".",
"If",
"no",
"file",
"is",
"defined",
"return",
"False",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L175-L217 | train |
saltstack/salt | salt/modules/freebsdjail.py | status | def status(jail):
'''
See if specified jail is currently running
CLI Example:
.. code-block:: bash
salt '*' jail.status <jail name>
'''
cmd = 'jls'
found_jails = __salt__['cmd.run'](cmd, python_shell=False)
for found_jail in found_jails.split('\\n'):
if re.search(jail,... | python | def status(jail):
'''
See if specified jail is currently running
CLI Example:
.. code-block:: bash
salt '*' jail.status <jail name>
'''
cmd = 'jls'
found_jails = __salt__['cmd.run'](cmd, python_shell=False)
for found_jail in found_jails.split('\\n'):
if re.search(jail,... | [
"def",
"status",
"(",
"jail",
")",
":",
"cmd",
"=",
"'jls'",
"found_jails",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"for",
"found_jail",
"in",
"found_jails",
".",
"split",
"(",
"'\\\\n'",
")",
":",
"i... | See if specified jail is currently running
CLI Example:
.. code-block:: bash
salt '*' jail.status <jail name> | [
"See",
"if",
"specified",
"jail",
"is",
"currently",
"running"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L220-L235 | train |
saltstack/salt | salt/modules/freebsdjail.py | sysctl | def sysctl():
'''
Dump all jail related kernel states (sysctl)
CLI Example:
.. code-block:: bash
salt '*' jail.sysctl
'''
ret = {}
sysctl_jail = __salt__['cmd.run']('sysctl security.jail')
for line in sysctl_jail.splitlines():
key, value = line.split(':', 1)
re... | python | def sysctl():
'''
Dump all jail related kernel states (sysctl)
CLI Example:
.. code-block:: bash
salt '*' jail.sysctl
'''
ret = {}
sysctl_jail = __salt__['cmd.run']('sysctl security.jail')
for line in sysctl_jail.splitlines():
key, value = line.split(':', 1)
re... | [
"def",
"sysctl",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"sysctl_jail",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'sysctl security.jail'",
")",
"for",
"line",
"in",
"sysctl_jail",
".",
"splitlines",
"(",
")",
":",
"key",
",",
"value",
"=",
"line",
"."... | Dump all jail related kernel states (sysctl)
CLI Example:
.. code-block:: bash
salt '*' jail.sysctl | [
"Dump",
"all",
"jail",
"related",
"kernel",
"states",
"(",
"sysctl",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdjail.py#L238-L253 | train |
saltstack/salt | salt/modules/pecl.py | _pecl | def _pecl(command, defaults=False):
'''
Execute the command passed with pecl
'''
cmdline = 'pecl {0}'.format(command)
if salt.utils.data.is_true(defaults):
cmdline = 'yes ' "''" + ' | ' + cmdline
ret = __salt__['cmd.run_all'](cmdline, python_shell=True)
if ret['retcode'] == 0:
... | python | def _pecl(command, defaults=False):
'''
Execute the command passed with pecl
'''
cmdline = 'pecl {0}'.format(command)
if salt.utils.data.is_true(defaults):
cmdline = 'yes ' "''" + ' | ' + cmdline
ret = __salt__['cmd.run_all'](cmdline, python_shell=True)
if ret['retcode'] == 0:
... | [
"def",
"_pecl",
"(",
"command",
",",
"defaults",
"=",
"False",
")",
":",
"cmdline",
"=",
"'pecl {0}'",
".",
"format",
"(",
"command",
")",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"defaults",
")",
":",
"cmdline",
"=",
"'yes '",
"... | Execute the command passed with pecl | [
"Execute",
"the",
"command",
"passed",
"with",
"pecl"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L40-L54 | train |
saltstack/salt | salt/modules/pecl.py | install | def install(pecls, defaults=False, force=False, preferred_state='stable'):
'''
.. versionadded:: 0.17.0
Installs one or several pecl extensions.
pecls
The pecl extensions to install.
defaults
Use default answers for extensions such as pecl_http which ask
questions before i... | python | def install(pecls, defaults=False, force=False, preferred_state='stable'):
'''
.. versionadded:: 0.17.0
Installs one or several pecl extensions.
pecls
The pecl extensions to install.
defaults
Use default answers for extensions such as pecl_http which ask
questions before i... | [
"def",
"install",
"(",
"pecls",
",",
"defaults",
"=",
"False",
",",
"force",
"=",
"False",
",",
"preferred_state",
"=",
"'stable'",
")",
":",
"if",
"isinstance",
"(",
"pecls",
",",
"six",
".",
"string_types",
")",
":",
"pecls",
"=",
"[",
"pecls",
"]",
... | .. versionadded:: 0.17.0
Installs one or several pecl extensions.
pecls
The pecl extensions to install.
defaults
Use default answers for extensions such as pecl_http which ask
questions before installation. Without this option, the pecl.installed
state will hang indefinite... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L57-L107 | train |
saltstack/salt | salt/modules/pecl.py | uninstall | def uninstall(pecls):
'''
Uninstall one or several pecl extensions.
pecls
The pecl extensions to uninstall.
CLI Example:
.. code-block:: bash
salt '*' pecl.uninstall fuse
'''
if isinstance(pecls, six.string_types):
pecls = [pecls]
return _pecl('uninstall {0}'.... | python | def uninstall(pecls):
'''
Uninstall one or several pecl extensions.
pecls
The pecl extensions to uninstall.
CLI Example:
.. code-block:: bash
salt '*' pecl.uninstall fuse
'''
if isinstance(pecls, six.string_types):
pecls = [pecls]
return _pecl('uninstall {0}'.... | [
"def",
"uninstall",
"(",
"pecls",
")",
":",
"if",
"isinstance",
"(",
"pecls",
",",
"six",
".",
"string_types",
")",
":",
"pecls",
"=",
"[",
"pecls",
"]",
"return",
"_pecl",
"(",
"'uninstall {0}'",
".",
"format",
"(",
"_cmd_quote",
"(",
"' '",
".",
"joi... | Uninstall one or several pecl extensions.
pecls
The pecl extensions to uninstall.
CLI Example:
.. code-block:: bash
salt '*' pecl.uninstall fuse | [
"Uninstall",
"one",
"or",
"several",
"pecl",
"extensions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L110-L125 | train |
saltstack/salt | salt/modules/pecl.py | list_ | def list_(channel=None):
'''
List installed pecl extensions.
CLI Example:
.. code-block:: bash
salt '*' pecl.list
'''
pecl_channel_pat = re.compile('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)')
pecls = {}
command = 'list'
if channel:
command = '{0} -c {1}'.format(command, _cmd... | python | def list_(channel=None):
'''
List installed pecl extensions.
CLI Example:
.. code-block:: bash
salt '*' pecl.list
'''
pecl_channel_pat = re.compile('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)')
pecls = {}
command = 'list'
if channel:
command = '{0} -c {1}'.format(command, _cmd... | [
"def",
"list_",
"(",
"channel",
"=",
"None",
")",
":",
"pecl_channel_pat",
"=",
"re",
".",
"compile",
"(",
"'^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)'",
")",
"pecls",
"=",
"{",
"}",
"command",
"=",
"'list'",
"if",
"channel",
":",
"command",
"=",
"'{0} -c {1}'",
".",
... | List installed pecl extensions.
CLI Example:
.. code-block:: bash
salt '*' pecl.list | [
"List",
"installed",
"pecl",
"extensions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pecl.py#L146-L169 | train |
saltstack/salt | salt/runners/cloud.py | _get_client | def _get_client():
'''
Return cloud client
'''
client = salt.cloud.CloudClient(
os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud')
)
return client | python | def _get_client():
'''
Return cloud client
'''
client = salt.cloud.CloudClient(
os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud')
)
return client | [
"def",
"_get_client",
"(",
")",
":",
"client",
"=",
"salt",
".",
"cloud",
".",
"CloudClient",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
",",
"'cloud'",
")",
")",
"ret... | Return cloud client | [
"Return",
"cloud",
"client"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L24-L31 | train |
saltstack/salt | salt/runners/cloud.py | profile | def profile(prof=None, instances=None, opts=None, **kwargs):
'''
Create a cloud vm with the given profile and instances, instances can be a
list or comma-delimited string
CLI Example:
.. code-block:: bash
salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3
'''
if prof i... | python | def profile(prof=None, instances=None, opts=None, **kwargs):
'''
Create a cloud vm with the given profile and instances, instances can be a
list or comma-delimited string
CLI Example:
.. code-block:: bash
salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3
'''
if prof i... | [
"def",
"profile",
"(",
"prof",
"=",
"None",
",",
"instances",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"prof",
"is",
"None",
"and",
"'profile'",
"in",
"kwargs",
":",
"prof",
"=",
"kwargs",
"[",
"'profile'",
"]... | Create a cloud vm with the given profile and instances, instances can be a
list or comma-delimited string
CLI Example:
.. code-block:: bash
salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3 | [
"Create",
"a",
"cloud",
"vm",
"with",
"the",
"given",
"profile",
"and",
"instances",
"instances",
"can",
"be",
"a",
"list",
"or",
"comma",
"-",
"delimited",
"string"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L88-L115 | train |
saltstack/salt | salt/runners/cloud.py | map_run | def map_run(path=None, opts=None, **kwargs):
'''
Execute a salt cloud map file
'''
client = _get_client()
if isinstance(opts, dict):
client.opts.update(opts)
info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs))
return info | python | def map_run(path=None, opts=None, **kwargs):
'''
Execute a salt cloud map file
'''
client = _get_client()
if isinstance(opts, dict):
client.opts.update(opts)
info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs))
return info | [
"def",
"map_run",
"(",
"path",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_client",
"(",
")",
"if",
"isinstance",
"(",
"opts",
",",
"dict",
")",
":",
"client",
".",
"opts",
".",
"update",
"(",
"o... | Execute a salt cloud map file | [
"Execute",
"a",
"salt",
"cloud",
"map",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L118-L126 | train |
saltstack/salt | salt/runners/cloud.py | destroy | def destroy(instances, opts=None):
'''
Destroy the named vm(s)
'''
client = _get_client()
if isinstance(opts, dict):
client.opts.update(opts)
info = client.destroy(instances)
return info | python | def destroy(instances, opts=None):
'''
Destroy the named vm(s)
'''
client = _get_client()
if isinstance(opts, dict):
client.opts.update(opts)
info = client.destroy(instances)
return info | [
"def",
"destroy",
"(",
"instances",
",",
"opts",
"=",
"None",
")",
":",
"client",
"=",
"_get_client",
"(",
")",
"if",
"isinstance",
"(",
"opts",
",",
"dict",
")",
":",
"client",
".",
"opts",
".",
"update",
"(",
"opts",
")",
"info",
"=",
"client",
"... | Destroy the named vm(s) | [
"Destroy",
"the",
"named",
"vm",
"(",
"s",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L129-L137 | train |
saltstack/salt | salt/runners/cloud.py | action | def action(func=None,
cloudmap=None,
instances=None,
provider=None,
instance=None,
opts=None,
**kwargs):
'''
Execute a single action on the given map/provider/instance
CLI Example:
.. code-block:: bash
salt-run cloud.action sta... | python | def action(func=None,
cloudmap=None,
instances=None,
provider=None,
instance=None,
opts=None,
**kwargs):
'''
Execute a single action on the given map/provider/instance
CLI Example:
.. code-block:: bash
salt-run cloud.action sta... | [
"def",
"action",
"(",
"func",
"=",
"None",
",",
"cloudmap",
"=",
"None",
",",
"instances",
"=",
"None",
",",
"provider",
"=",
"None",
",",
"instance",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"info",
"=",
"{",
"}"... | Execute a single action on the given map/provider/instance
CLI Example:
.. code-block:: bash
salt-run cloud.action start my-salt-vm | [
"Execute",
"a",
"single",
"action",
"on",
"the",
"given",
"map",
"/",
"provider",
"/",
"instance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L140-L171 | train |
saltstack/salt | salt/runners/cloud.py | create | def create(provider, instances, opts=None, **kwargs):
'''
Create an instance using Salt Cloud
CLI Example:
.. code-block:: bash
salt-run cloud.create my-ec2-config myinstance \
image=ami-1624987f size='t1.micro' ssh_username=ec2-user \
securitygroup=default delvol_on_d... | python | def create(provider, instances, opts=None, **kwargs):
'''
Create an instance using Salt Cloud
CLI Example:
.. code-block:: bash
salt-run cloud.create my-ec2-config myinstance \
image=ami-1624987f size='t1.micro' ssh_username=ec2-user \
securitygroup=default delvol_on_d... | [
"def",
"create",
"(",
"provider",
",",
"instances",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_client",
"(",
")",
"if",
"isinstance",
"(",
"opts",
",",
"dict",
")",
":",
"client",
".",
"opts",
".",
"update",
"... | Create an instance using Salt Cloud
CLI Example:
.. code-block:: bash
salt-run cloud.create my-ec2-config myinstance \
image=ami-1624987f size='t1.micro' ssh_username=ec2-user \
securitygroup=default delvol_on_destroy=True | [
"Create",
"an",
"instance",
"using",
"Salt",
"Cloud"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/cloud.py#L174-L190 | train |
saltstack/salt | salt/modules/splunk_search.py | _get_splunk_search_props | def _get_splunk_search_props(search):
'''
Get splunk search properties from an object
'''
props = search.content
props["app"] = search.access.app
props["sharing"] = search.access.sharing
return props | python | def _get_splunk_search_props(search):
'''
Get splunk search properties from an object
'''
props = search.content
props["app"] = search.access.app
props["sharing"] = search.access.sharing
return props | [
"def",
"_get_splunk_search_props",
"(",
"search",
")",
":",
"props",
"=",
"search",
".",
"content",
"props",
"[",
"\"app\"",
"]",
"=",
"search",
".",
"access",
".",
"app",
"props",
"[",
"\"sharing\"",
"]",
"=",
"search",
".",
"access",
".",
"sharing",
"r... | Get splunk search properties from an object | [
"Get",
"splunk",
"search",
"properties",
"from",
"an",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L82-L89 | train |
saltstack/salt | salt/modules/splunk_search.py | get | def get(name, profile="splunk"):
'''
Get a splunk search
CLI Example:
splunk_search.get 'my search name'
'''
client = _get_splunk(profile)
search = None
# uglyness of splunk lib
try:
search = client.saved_searches[name]
except KeyError:
pass
return searc... | python | def get(name, profile="splunk"):
'''
Get a splunk search
CLI Example:
splunk_search.get 'my search name'
'''
client = _get_splunk(profile)
search = None
# uglyness of splunk lib
try:
search = client.saved_searches[name]
except KeyError:
pass
return searc... | [
"def",
"get",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"search",
"=",
"None",
"# uglyness of splunk lib",
"try",
":",
"search",
"=",
"client",
".",
"saved_searches",
"[",
"name",
"]",
"exc... | Get a splunk search
CLI Example:
splunk_search.get 'my search name' | [
"Get",
"a",
"splunk",
"search"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L92-L107 | train |
saltstack/salt | salt/modules/splunk_search.py | update | def update(name, profile="splunk", **kwargs):
'''
Update a splunk search
CLI Example:
splunk_search.update 'my search name' sharing=app
'''
client = _get_splunk(profile)
search = client.saved_searches[name]
props = _get_splunk_search_props(search)
updates = kwargs
update_ne... | python | def update(name, profile="splunk", **kwargs):
'''
Update a splunk search
CLI Example:
splunk_search.update 'my search name' sharing=app
'''
client = _get_splunk(profile)
search = client.saved_searches[name]
props = _get_splunk_search_props(search)
updates = kwargs
update_ne... | [
"def",
"update",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"search",
"=",
"client",
".",
"saved_searches",
"[",
"name",
"]",
"props",
"=",
"_get_splunk_search_props... | Update a splunk search
CLI Example:
splunk_search.update 'my search name' sharing=app | [
"Update",
"a",
"splunk",
"search"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L110-L141 | train |
saltstack/salt | salt/modules/splunk_search.py | create | def create(name, profile="splunk", **kwargs):
'''
Create a splunk search
CLI Example:
splunk_search.create 'my search name' search='error msg'
'''
client = _get_splunk(profile)
search = client.saved_searches.create(name, **kwargs)
# use the REST API to set owner and permissions
... | python | def create(name, profile="splunk", **kwargs):
'''
Create a splunk search
CLI Example:
splunk_search.create 'my search name' search='error msg'
'''
client = _get_splunk(profile)
search = client.saved_searches.create(name, **kwargs)
# use the REST API to set owner and permissions
... | [
"def",
"create",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"search",
"=",
"client",
".",
"saved_searches",
".",
"create",
"(",
"name",
",",
"*",
"*",
"kwargs",
... | Create a splunk search
CLI Example:
splunk_search.create 'my search name' search='error msg' | [
"Create",
"a",
"splunk",
"search"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L144-L170 | train |
saltstack/salt | salt/modules/splunk_search.py | delete | def delete(name, profile="splunk"):
'''
Delete a splunk search
CLI Example:
splunk_search.delete 'my search name'
'''
client = _get_splunk(profile)
try:
client.saved_searches.delete(name)
return True
except KeyError:
return None | python | def delete(name, profile="splunk"):
'''
Delete a splunk search
CLI Example:
splunk_search.delete 'my search name'
'''
client = _get_splunk(profile)
try:
client.saved_searches.delete(name)
return True
except KeyError:
return None | [
"def",
"delete",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"try",
":",
"client",
".",
"saved_searches",
".",
"delete",
"(",
"name",
")",
"return",
"True",
"except",
"KeyError",
":",
"retu... | Delete a splunk search
CLI Example:
splunk_search.delete 'my search name' | [
"Delete",
"a",
"splunk",
"search"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L173-L186 | train |
saltstack/salt | salt/modules/splunk_search.py | list_ | def list_(profile="splunk"):
'''
List splunk searches (names only)
CLI Example:
splunk_search.list
'''
client = _get_splunk(profile)
searches = [x['name'] for x in client.saved_searches]
return searches | python | def list_(profile="splunk"):
'''
List splunk searches (names only)
CLI Example:
splunk_search.list
'''
client = _get_splunk(profile)
searches = [x['name'] for x in client.saved_searches]
return searches | [
"def",
"list_",
"(",
"profile",
"=",
"\"splunk\"",
")",
":",
"client",
"=",
"_get_splunk",
"(",
"profile",
")",
"searches",
"=",
"[",
"x",
"[",
"'name'",
"]",
"for",
"x",
"in",
"client",
".",
"saved_searches",
"]",
"return",
"searches"
] | List splunk searches (names only)
CLI Example:
splunk_search.list | [
"List",
"splunk",
"searches",
"(",
"names",
"only",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L189-L198 | train |
saltstack/salt | salt/modules/splunk_search.py | list_all | def list_all(prefix=None, app=None, owner=None, description_contains=None,
name_not_contains=None, profile="splunk"):
'''
Get all splunk search details. Produces results that can be used to create
an sls file.
if app or owner are specified, results will be limited to matching saved
sea... | python | def list_all(prefix=None, app=None, owner=None, description_contains=None,
name_not_contains=None, profile="splunk"):
'''
Get all splunk search details. Produces results that can be used to create
an sls file.
if app or owner are specified, results will be limited to matching saved
sea... | [
"def",
"list_all",
"(",
"prefix",
"=",
"None",
",",
"app",
"=",
"None",
",",
"owner",
"=",
"None",
",",
"description_contains",
"=",
"None",
",",
"name_not_contains",
"=",
"None",
",",
"profile",
"=",
"\"splunk\"",
")",
":",
"client",
"=",
"_get_splunk",
... | Get all splunk search details. Produces results that can be used to create
an sls file.
if app or owner are specified, results will be limited to matching saved
searches.
if description_contains is specified, results will be limited to those
where "description_contains in description" is true if n... | [
"Get",
"all",
"splunk",
"search",
"details",
".",
"Produces",
"results",
"that",
"can",
"be",
"used",
"to",
"create",
"an",
"sls",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/splunk_search.py#L201-L300 | train |
saltstack/salt | salt/states/ipset.py | set_present | def set_present(name, set_type, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Verify the set exists.
name
A user-defined set name.
set_type
The type for the set.
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'cha... | python | def set_present(name, set_type, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Verify the set exists.
name
A user-defined set name.
set_type
The type for the set.
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'cha... | [
"def",
"set_present",
"(",
"name",
",",
"set_type",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",... | .. versionadded:: 2014.7.0
Verify the set exists.
name
A user-defined set name.
set_type
The type for the set.
family
Networking family, either ipv4 or ipv6 | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L68-L115 | train |
saltstack/salt | salt/states/ipset.py | set_absent | def set_absent(name, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Verify the set is absent.
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
set_check = __salt__['ipse... | python | def set_absent(name, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Verify the set is absent.
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
set_check = __salt__['ipse... | [
"def",
"set_absent",
"(",
"name",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"set_check",... | .. versionadded:: 2014.7.0
Verify the set is absent.
family
Networking family, either ipv4 or ipv6 | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L118-L163 | train |
saltstack/salt | salt/states/ipset.py | absent | def absent(name, entry=None, entries=None, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Remove a entry or entries from a chain
name
A user-defined name to call this entry by in another part of a state or
formula. This should not be an actual entry.
family
Netwo... | python | def absent(name, entry=None, entries=None, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Remove a entry or entries from a chain
name
A user-defined name to call this entry by in another part of a state or
formula. This should not be an actual entry.
family
Netwo... | [
"def",
"absent",
"(",
"name",
",",
"entry",
"=",
"None",
",",
"entries",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
... | .. versionadded:: 2014.7.0
Remove a entry or entries from a chain
name
A user-defined name to call this entry by in another part of a state or
formula. This should not be an actual entry.
family
Network family, ipv4 or ipv6. | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L239-L309 | train |
saltstack/salt | salt/states/ipset.py | flush | def flush(name, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Flush current ipset set
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
set_check = __salt__['ipset.check... | python | def flush(name, family='ipv4', **kwargs):
'''
.. versionadded:: 2014.7.0
Flush current ipset set
family
Networking family, either ipv4 or ipv6
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
set_check = __salt__['ipset.check... | [
"def",
"flush",
"(",
"name",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"set_check",
"=... | .. versionadded:: 2014.7.0
Flush current ipset set
family
Networking family, either ipv4 or ipv6 | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipset.py#L312-L351 | train |
saltstack/salt | salt/states/gem.py | installed | def installed(name, # pylint: disable=C0103
ruby=None,
gem_bin=None,
user=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C... | python | def installed(name, # pylint: disable=C0103
ruby=None,
gem_bin=None,
user=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C... | [
"def",
"installed",
"(",
"name",
",",
"# pylint: disable=C0103",
"ruby",
"=",
"None",
",",
"gem_bin",
"=",
"None",
",",
"user",
"=",
"None",
",",
"version",
"=",
"None",
",",
"rdoc",
"=",
"False",
",",
"ri",
"=",
"False",
",",
"pre_releases",
"=",
"Fal... | Make sure that a gem is installed.
name
The name of the gem to install
ruby: None
Only for RVM or rbenv installations: the ruby version and gemset to
target.
gem_bin: None
Custom ``gem`` command to run instead of the default.
Use this to install gems to a non-defau... | [
"Make",
"sure",
"that",
"a",
"gem",
"is",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L33-L143 | train |
saltstack/salt | salt/states/gem.py | removed | def removed(name, ruby=None, user=None, gem_bin=None):
'''
Make sure that a gem is not installed.
name
The name of the gem to uninstall
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
... | python | def removed(name, ruby=None, user=None, gem_bin=None):
'''
Make sure that a gem is not installed.
name
The name of the gem to uninstall
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
... | [
"def",
"removed",
"(",
"name",
",",
"ruby",
"=",
"None",
",",
"user",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{... | Make sure that a gem is not installed.
name
The name of the gem to uninstall
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
user: None
The u... | [
"Make",
"sure",
"that",
"a",
"gem",
"is",
"not",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L146-L182 | train |
saltstack/salt | salt/states/gem.py | sources_add | def sources_add(name, ruby=None, user=None):
'''
Make sure that a gem source is added.
name
The URL of the gem source to be added
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` command
... | python | def sources_add(name, ruby=None, user=None):
'''
Make sure that a gem source is added.
name
The URL of the gem source to be added
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` command
... | [
"def",
"sources_add",
"(",
"name",
",",
"ruby",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"name"... | Make sure that a gem source is added.
name
The URL of the gem source to be added
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` command
.. versionadded:: 0.17.0 | [
"Make",
"sure",
"that",
"a",
"gem",
"source",
"is",
"added",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L185-L216 | train |
saltstack/salt | salt/states/gem.py | sources_remove | def sources_remove(name, ruby=None, user=None):
'''
Make sure that a gem source is removed.
name
The URL of the gem source to be removed
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` com... | python | def sources_remove(name, ruby=None, user=None):
'''
Make sure that a gem source is removed.
name
The URL of the gem source to be removed
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` com... | [
"def",
"sources_remove",
"(",
"name",
",",
"ruby",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"na... | Make sure that a gem source is removed.
name
The URL of the gem source to be removed
ruby: None
For RVM or rbenv installations: the ruby version and gemset to target.
user: None
The user under which to run the ``gem`` command
.. versionadded:: 0.17.0 | [
"Make",
"sure",
"that",
"a",
"gem",
"source",
"is",
"removed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gem.py#L219-L252 | train |
saltstack/salt | salt/states/rabbitmq_cluster.py | joined | def joined(name, host, user='rabbit', ram_node=None, runas='root'):
'''
Ensure the current node joined to a cluster with node user@host
name
Irrelevant, not used (recommended: user@host)
user
The user of node to join to (default: rabbit)
host
The host of node to join to
... | python | def joined(name, host, user='rabbit', ram_node=None, runas='root'):
'''
Ensure the current node joined to a cluster with node user@host
name
Irrelevant, not used (recommended: user@host)
user
The user of node to join to (default: rabbit)
host
The host of node to join to
... | [
"def",
"joined",
"(",
"name",
",",
"host",
",",
"user",
"=",
"'rabbit'",
",",
"ram_node",
"=",
"None",
",",
"runas",
"=",
"'root'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
... | Ensure the current node joined to a cluster with node user@host
name
Irrelevant, not used (recommended: user@host)
user
The user of node to join to (default: rabbit)
host
The host of node to join to
ram_node
Join node as a RAM node
runas
The user to run the r... | [
"Ensure",
"the",
"current",
"node",
"joined",
"to",
"a",
"cluster",
"with",
"node",
"user@host"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_cluster.py#L34-L77 | train |
saltstack/salt | salt/modules/glanceng.py | image_create | def image_create(auth=None, **kwargs):
'''
Create an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi... | python | def image_create(auth=None, **kwargs):
'''
Create an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi... | [
"def",
"image_create",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"keep_name",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".... | Create an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw
salt '*' glanceng.image_create name=cirros file=cirros.raw disk_format=raw hw_scsi_model=virtio-scsi hw_disk_bus=scsi | [
"Create",
"an",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L108-L121 | train |
saltstack/salt | salt/modules/glanceng.py | image_delete | def image_delete(auth=None, **kwargs):
'''
Delete an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_delete name=image1
salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs... | python | def image_delete(auth=None, **kwargs):
'''
Delete an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_delete name=image1
salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs... | [
"def",
"image_delete",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".",
"delete_image",
"(",
"*",
"*... | Delete an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_delete name=image1
salt '*' glanceng.image_delete name=0e4febc2a5ab4f2c8f374b054162506d | [
"Delete",
"an",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L124-L137 | train |
saltstack/salt | salt/modules/glanceng.py | image_list | def image_list(auth=None, **kwargs):
'''
List images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_list
salt '*' glanceng.image_list
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
return cloud.list_images(**kwargs) | python | def image_list(auth=None, **kwargs):
'''
List images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_list
salt '*' glanceng.image_list
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
return cloud.list_images(**kwargs) | [
"def",
"image_list",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".",
"list_images",
"(",
"*",
"*",
... | List images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_list
salt '*' glanceng.image_list | [
"List",
"images"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L140-L153 | train |
saltstack/salt | salt/modules/glanceng.py | image_search | def image_search(auth=None, **kwargs):
'''
Search for images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_search name=image1
salt '*' glanceng.image_search
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
return cloud.search_images(**k... | python | def image_search(auth=None, **kwargs):
'''
Search for images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_search name=image1
salt '*' glanceng.image_search
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
return cloud.search_images(**k... | [
"def",
"image_search",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".",
"search_images",
"(",
"*",
"... | Search for images
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_search name=image1
salt '*' glanceng.image_search | [
"Search",
"for",
"images"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L156-L169 | train |
saltstack/salt | salt/modules/glanceng.py | image_get | def image_get(auth=None, **kwargs):
'''
Get a single image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_get name=image1
salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
... | python | def image_get(auth=None, **kwargs):
'''
Get a single image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_get name=image1
salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
... | [
"def",
"image_get",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".",
"get_image",
"(",
"*",
"*",
"... | Get a single image
CLI Example:
.. code-block:: bash
salt '*' glanceng.image_get name=image1
salt '*' glanceng.image_get name=0e4febc2a5ab4f2c8f374b054162506d | [
"Get",
"a",
"single",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L172-L185 | train |
saltstack/salt | salt/modules/glanceng.py | update_image_properties | def update_image_properties(auth=None, **kwargs):
'''
Update properties for an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi
salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b... | python | def update_image_properties(auth=None, **kwargs):
'''
Update properties for an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi
salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b... | [
"def",
"update_image_properties",
"(",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cloud",
"=",
"get_operator_cloud",
"(",
"auth",
")",
"kwargs",
"=",
"_clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"return",
"cloud",
".",
"update_image_propertie... | Update properties for an image
CLI Example:
.. code-block:: bash
salt '*' glanceng.update_image_properties name=image1 hw_scsi_model=virtio-scsi hw_disk_bus=scsi
salt '*' glanceng.update_image_properties name=0e4febc2a5ab4f2c8f374b054162506d min_ram=1024 | [
"Update",
"properties",
"for",
"an",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glanceng.py#L188-L201 | train |
saltstack/salt | salt/runners/vistara.py | delete_device | def delete_device(name, safety_on=True):
'''
Deletes a device from Vistara based on DNS name or partial name. By default,
delete_device will only perform the delete if a single host is returned. Set
safety_on=False to delete all matches (up to default API search page size)
CLI Example:
.. code... | python | def delete_device(name, safety_on=True):
'''
Deletes a device from Vistara based on DNS name or partial name. By default,
delete_device will only perform the delete if a single host is returned. Set
safety_on=False to delete all matches (up to default API search page size)
CLI Example:
.. code... | [
"def",
"delete_device",
"(",
"name",
",",
"safety_on",
"=",
"True",
")",
":",
"config",
"=",
"_get_vistara_configuration",
"(",
")",
"if",
"not",
"config",
":",
"return",
"False",
"access_token",
"=",
"_get_oath2_access_token",
"(",
"config",
"[",
"'client_key'"... | Deletes a device from Vistara based on DNS name or partial name. By default,
delete_device will only perform the delete if a single host is returned. Set
safety_on=False to delete all matches (up to default API search page size)
CLI Example:
.. code-block:: bash
salt-run vistara.delete_device... | [
"Deletes",
"a",
"device",
"from",
"Vistara",
"based",
"on",
"DNS",
"name",
"or",
"partial",
"name",
".",
"By",
"default",
"delete_device",
"will",
"only",
"perform",
"the",
"delete",
"if",
"a",
"single",
"host",
"is",
"returned",
".",
"Set",
"safety_on",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vistara.py#L67-L114 | train |
saltstack/salt | salt/runners/vistara.py | _get_oath2_access_token | def _get_oath2_access_token(client_key, client_secret):
'''
Query the vistara API and get an access_token
'''
if not client_key and not client_secret:
log.error(
"client_key and client_secret have not been specified "
"and are required parameters."
)
retu... | python | def _get_oath2_access_token(client_key, client_secret):
'''
Query the vistara API and get an access_token
'''
if not client_key and not client_secret:
log.error(
"client_key and client_secret have not been specified "
"and are required parameters."
)
retu... | [
"def",
"_get_oath2_access_token",
"(",
"client_key",
",",
"client_secret",
")",
":",
"if",
"not",
"client_key",
"and",
"not",
"client_secret",
":",
"log",
".",
"error",
"(",
"\"client_key and client_secret have not been specified \"",
"\"and are required parameters.\"",
")"... | Query the vistara API and get an access_token | [
"Query",
"the",
"vistara",
"API",
"and",
"get",
"an",
"access_token"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vistara.py#L181-L220 | train |
saltstack/salt | salt/modules/apache.py | version | def version():
'''
Return server version (``apachectl -v``)
CLI Example:
.. code-block:: bash
salt '*' apache.version
'''
cmd = '{0} -v'.format(_detect_os())
out = __salt__['cmd.run'](cmd).splitlines()
ret = out[0].split(': ')
return ret[1] | python | def version():
'''
Return server version (``apachectl -v``)
CLI Example:
.. code-block:: bash
salt '*' apache.version
'''
cmd = '{0} -v'.format(_detect_os())
out = __salt__['cmd.run'](cmd).splitlines()
ret = out[0].split(': ')
return ret[1] | [
"def",
"version",
"(",
")",
":",
"cmd",
"=",
"'{0} -v'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")",
"ret",
"=",
"out",
"[",
"0",
"]",
".",
"split",... | Return server version (``apachectl -v``)
CLI Example:
.. code-block:: bash
salt '*' apache.version | [
"Return",
"server",
"version",
"(",
"apachectl",
"-",
"v",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L65-L78 | train |
saltstack/salt | salt/modules/apache.py | fullversion | def fullversion():
'''
Return server version (``apachectl -V``)
CLI Example:
.. code-block:: bash
salt '*' apache.fullversion
'''
cmd = '{0} -V'.format(_detect_os())
ret = {}
ret['compiled_with'] = []
out = __salt__['cmd.run'](cmd).splitlines()
# Example
# -D APR_... | python | def fullversion():
'''
Return server version (``apachectl -V``)
CLI Example:
.. code-block:: bash
salt '*' apache.fullversion
'''
cmd = '{0} -V'.format(_detect_os())
ret = {}
ret['compiled_with'] = []
out = __salt__['cmd.run'](cmd).splitlines()
# Example
# -D APR_... | [
"def",
"fullversion",
"(",
")",
":",
"cmd",
"=",
"'{0} -V'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'compiled_with'",
"]",
"=",
"[",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
... | Return server version (``apachectl -V``)
CLI Example:
.. code-block:: bash
salt '*' apache.fullversion | [
"Return",
"server",
"version",
"(",
"apachectl",
"-",
"V",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L81-L107 | train |
saltstack/salt | salt/modules/apache.py | modules | def modules():
'''
Return list of static and shared modules (``apachectl -M``)
CLI Example:
.. code-block:: bash
salt '*' apache.modules
'''
cmd = '{0} -M'.format(_detect_os())
ret = {}
ret['static'] = []
ret['shared'] = []
out = __salt__['cmd.run'](cmd).splitlines()
... | python | def modules():
'''
Return list of static and shared modules (``apachectl -M``)
CLI Example:
.. code-block:: bash
salt '*' apache.modules
'''
cmd = '{0} -M'.format(_detect_os())
ret = {}
ret['static'] = []
ret['shared'] = []
out = __salt__['cmd.run'](cmd).splitlines()
... | [
"def",
"modules",
"(",
")",
":",
"cmd",
"=",
"'{0} -M'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'static'",
"]",
"=",
"[",
"]",
"ret",
"[",
"'shared'",
"]",
"=",
"[",
"]",
"out",
"=",
"__salt__",
"[",... | Return list of static and shared modules (``apachectl -M``)
CLI Example:
.. code-block:: bash
salt '*' apache.modules | [
"Return",
"list",
"of",
"static",
"and",
"shared",
"modules",
"(",
"apachectl",
"-",
"M",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L110-L133 | train |
saltstack/salt | salt/modules/apache.py | servermods | def servermods():
'''
Return list of modules compiled into the server (``apachectl -l``)
CLI Example:
.. code-block:: bash
salt '*' apache.servermods
'''
cmd = '{0} -l'.format(_detect_os())
ret = []
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
if no... | python | def servermods():
'''
Return list of modules compiled into the server (``apachectl -l``)
CLI Example:
.. code-block:: bash
salt '*' apache.servermods
'''
cmd = '{0} -l'.format(_detect_os())
ret = []
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
if no... | [
"def",
"servermods",
"(",
")",
":",
"cmd",
"=",
"'{0} -l'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"ret",
"=",
"[",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"... | Return list of modules compiled into the server (``apachectl -l``)
CLI Example:
.. code-block:: bash
salt '*' apache.servermods | [
"Return",
"list",
"of",
"modules",
"compiled",
"into",
"the",
"server",
"(",
"apachectl",
"-",
"l",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L136-L154 | train |
saltstack/salt | salt/modules/apache.py | directives | def directives():
'''
Return list of directives together with expected arguments
and places where the directive is valid (``apachectl -L``)
CLI Example:
.. code-block:: bash
salt '*' apache.directives
'''
cmd = '{0} -L'.format(_detect_os())
ret = {}
out = __salt__['cmd.run... | python | def directives():
'''
Return list of directives together with expected arguments
and places where the directive is valid (``apachectl -L``)
CLI Example:
.. code-block:: bash
salt '*' apache.directives
'''
cmd = '{0} -L'.format(_detect_os())
ret = {}
out = __salt__['cmd.run... | [
"def",
"directives",
"(",
")",
":",
"cmd",
"=",
"'{0} -L'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"out",
"=",
"out",
".",
"replace",
"(",
"'\\n\\t'",
... | Return list of directives together with expected arguments
and places where the directive is valid (``apachectl -L``)
CLI Example:
.. code-block:: bash
salt '*' apache.directives | [
"Return",
"list",
"of",
"directives",
"together",
"with",
"expected",
"arguments",
"and",
"places",
"where",
"the",
"directive",
"is",
"valid",
"(",
"apachectl",
"-",
"L",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L157-L178 | train |
saltstack/salt | salt/modules/apache.py | vhosts | def vhosts():
'''
Show the settings as parsed from the config file (currently
only shows the virtualhost settings) (``apachectl -S``).
Because each additional virtual host adds to the execution
time, this command may require a long timeout be specified
by using ``-t 10``.
CLI Example:
... | python | def vhosts():
'''
Show the settings as parsed from the config file (currently
only shows the virtualhost settings) (``apachectl -S``).
Because each additional virtual host adds to the execution
time, this command may require a long timeout be specified
by using ``-t 10``.
CLI Example:
... | [
"def",
"vhosts",
"(",
")",
":",
"cmd",
"=",
"'{0} -S'",
".",
"format",
"(",
"_detect_os",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"namevhost",
"=",
"''",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"for",
"line",
"in",
"out",
"."... | Show the settings as parsed from the config file (currently
only shows the virtualhost settings) (``apachectl -S``).
Because each additional virtual host adds to the execution
time, this command may require a long timeout be specified
by using ``-t 10``.
CLI Example:
.. code-block:: bash
... | [
"Show",
"the",
"settings",
"as",
"parsed",
"from",
"the",
"config",
"file",
"(",
"currently",
"only",
"shows",
"the",
"virtualhost",
"settings",
")",
"(",
"apachectl",
"-",
"S",
")",
".",
"Because",
"each",
"additional",
"virtual",
"host",
"adds",
"to",
"t... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L181-L224 | train |
saltstack/salt | salt/modules/apache.py | signal | def signal(signal=None):
'''
Signals httpd to start, restart, or stop.
CLI Example:
.. code-block:: bash
salt '*' apache.signal restart
'''
no_extra_args = ('configtest', 'status', 'fullstatus')
valid_signals = ('start', 'stop', 'restart', 'graceful', 'graceful-stop')
if sign... | python | def signal(signal=None):
'''
Signals httpd to start, restart, or stop.
CLI Example:
.. code-block:: bash
salt '*' apache.signal restart
'''
no_extra_args = ('configtest', 'status', 'fullstatus')
valid_signals = ('start', 'stop', 'restart', 'graceful', 'graceful-stop')
if sign... | [
"def",
"signal",
"(",
"signal",
"=",
"None",
")",
":",
"no_extra_args",
"=",
"(",
"'configtest'",
",",
"'status'",
",",
"'fullstatus'",
")",
"valid_signals",
"=",
"(",
"'start'",
",",
"'stop'",
",",
"'restart'",
",",
"'graceful'",
",",
"'graceful-stop'",
")"... | Signals httpd to start, restart, or stop.
CLI Example:
.. code-block:: bash
salt '*' apache.signal restart | [
"Signals",
"httpd",
"to",
"start",
"restart",
"or",
"stop",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L227-L261 | train |
saltstack/salt | salt/modules/apache.py | useradd | def useradd(pwfile, user, password, opts=''):
'''
Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not
exist, it will be created. Valid options that can be passed are:
.. code-block:: text
n Don't update file; display results on stdout.
m Force MD5 hashing ... | python | def useradd(pwfile, user, password, opts=''):
'''
Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not
exist, it will be created. Valid options that can be passed are:
.. code-block:: text
n Don't update file; display results on stdout.
m Force MD5 hashing ... | [
"def",
"useradd",
"(",
"pwfile",
",",
"user",
",",
"password",
",",
"opts",
"=",
"''",
")",
":",
"return",
"__salt__",
"[",
"'webutil.useradd'",
"]",
"(",
"pwfile",
",",
"user",
",",
"password",
",",
"opts",
")"
] | Add HTTP user using the ``htpasswd`` command. If the ``htpasswd`` file does not
exist, it will be created. Valid options that can be passed are:
.. code-block:: text
n Don't update file; display results on stdout.
m Force MD5 hashing of the password (default).
d Force CRYPT(3) hashi... | [
"Add",
"HTTP",
"user",
"using",
"the",
"htpasswd",
"command",
".",
"If",
"the",
"htpasswd",
"file",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
".",
"Valid",
"options",
"that",
"can",
"be",
"passed",
"are",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L264-L284 | train |
saltstack/salt | salt/modules/apache.py | server_status | def server_status(profile='default'):
'''
Get Information from the Apache server-status handler
.. note::
The server-status handler is disabled by default.
In order for this function to work it needs to be enabled.
See http://httpd.apache.org/docs/2.2/mod/mod_status.html
The f... | python | def server_status(profile='default'):
'''
Get Information from the Apache server-status handler
.. note::
The server-status handler is disabled by default.
In order for this function to work it needs to be enabled.
See http://httpd.apache.org/docs/2.2/mod/mod_status.html
The f... | [
"def",
"server_status",
"(",
"profile",
"=",
"'default'",
")",
":",
"ret",
"=",
"{",
"'Scoreboard'",
":",
"{",
"'_'",
":",
"0",
",",
"'S'",
":",
"0",
",",
"'R'",
":",
"0",
",",
"'W'",
":",
"0",
",",
"'K'",
":",
"0",
",",
"'D'",
":",
"0",
",",... | Get Information from the Apache server-status handler
.. note::
The server-status handler is disabled by default.
In order for this function to work it needs to be enabled.
See http://httpd.apache.org/docs/2.2/mod/mod_status.html
The following configuration needs to exists in pillar/g... | [
"Get",
"Information",
"from",
"the",
"Apache",
"server",
"-",
"status",
"handler"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L300-L400 | train |
saltstack/salt | salt/modules/apache.py | _parse_config | def _parse_config(conf, slot=None):
'''
Recursively goes through config structure and builds final Apache configuration
:param conf: defined config structure
:param slot: name of section container if needed
'''
ret = cStringIO()
if isinstance(conf, six.string_types):
if slot:
... | python | def _parse_config(conf, slot=None):
'''
Recursively goes through config structure and builds final Apache configuration
:param conf: defined config structure
:param slot: name of section container if needed
'''
ret = cStringIO()
if isinstance(conf, six.string_types):
if slot:
... | [
"def",
"_parse_config",
"(",
"conf",
",",
"slot",
"=",
"None",
")",
":",
"ret",
"=",
"cStringIO",
"(",
")",
"if",
"isinstance",
"(",
"conf",
",",
"six",
".",
"string_types",
")",
":",
"if",
"slot",
":",
"print",
"(",
"'{0} {1}'",
".",
"format",
"(",
... | Recursively goes through config structure and builds final Apache configuration
:param conf: defined config structure
:param slot: name of section container if needed | [
"Recursively",
"goes",
"through",
"config",
"structure",
"and",
"builds",
"final",
"Apache",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L403-L449 | train |
saltstack/salt | salt/modules/apache.py | config | def config(name, config, edit=True):
'''
Create VirtualHost configuration files
name
File for the virtual host
config
VirtualHost configurations
.. note::
This function is not meant to be used from the command line.
Config is meant to be an ordered dict of all of t... | python | def config(name, config, edit=True):
'''
Create VirtualHost configuration files
name
File for the virtual host
config
VirtualHost configurations
.. note::
This function is not meant to be used from the command line.
Config is meant to be an ordered dict of all of t... | [
"def",
"config",
"(",
"name",
",",
"config",
",",
"edit",
"=",
"True",
")",
":",
"configs",
"=",
"[",
"]",
"for",
"entry",
"in",
"config",
":",
"key",
"=",
"next",
"(",
"six",
".",
"iterkeys",
"(",
"entry",
")",
")",
"configs",
".",
"append",
"("... | Create VirtualHost configuration files
name
File for the virtual host
config
VirtualHost configurations
.. note::
This function is not meant to be used from the command line.
Config is meant to be an ordered dict of all of the apache configs.
CLI Example:
.. code... | [
"Create",
"VirtualHost",
"configuration",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apache.py#L452-L484 | train |
saltstack/salt | salt/states/boto_sqs.py | present | def present(
name,
attributes=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Ensure the SQS queue exists.
name
Name of the SQS queue.
attributes
A dict of key/value SQS attributes.
region
Region to connect to.
... | python | def present(
name,
attributes=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Ensure the SQS queue exists.
name
Name of the SQS queue.
attributes
A dict of key/value SQS attributes.
region
Region to connect to.
... | [
"def",
"present",
"(",
"name",
",",
"attributes",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":... | Ensure the SQS queue exists.
name
Name of the SQS queue.
attributes
A dict of key/value SQS attributes.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
A dict with region, key and keyid, or a pilla... | [
"Ensure",
"the",
"SQS",
"queue",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sqs.py#L82-L250 | train |
saltstack/salt | salt/states/boto_sqs.py | absent | def absent(
name,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Ensure the named sqs queue is deleted.
name
Name of the SQS queue.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be ... | python | def absent(
name,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Ensure the named sqs queue is deleted.
name
Name of the SQS queue.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be ... | [
"def",
"absent",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",... | Ensure the named sqs queue is deleted.
name
Name of the SQS queue.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
A dict with region, key and keyid, or a pillar key (string)
that contains a dict with r... | [
"Ensure",
"the",
"named",
"sqs",
"queue",
"is",
"deleted",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sqs.py#L253-L321 | train |
saltstack/salt | salt/states/user.py | _group_changes | def _group_changes(cur, wanted, remove=False):
'''
Determine if the groups need to be changed
'''
old = set(cur)
new = set(wanted)
if (remove and old != new) or (not remove and not new.issubset(old)):
return True
return False | python | def _group_changes(cur, wanted, remove=False):
'''
Determine if the groups need to be changed
'''
old = set(cur)
new = set(wanted)
if (remove and old != new) or (not remove and not new.issubset(old)):
return True
return False | [
"def",
"_group_changes",
"(",
"cur",
",",
"wanted",
",",
"remove",
"=",
"False",
")",
":",
"old",
"=",
"set",
"(",
"cur",
")",
"new",
"=",
"set",
"(",
"wanted",
")",
"if",
"(",
"remove",
"and",
"old",
"!=",
"new",
")",
"or",
"(",
"not",
"remove",... | Determine if the groups need to be changed | [
"Determine",
"if",
"the",
"groups",
"need",
"to",
"be",
"changed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L44-L52 | train |
saltstack/salt | salt/states/user.py | _changes | def _changes(name,
uid=None,
gid=None,
groups=None,
optional_groups=None,
remove_groups=True,
home=None,
createhome=True,
password=None,
enforce_password=True,
empty_password=False,
... | python | def _changes(name,
uid=None,
gid=None,
groups=None,
optional_groups=None,
remove_groups=True,
home=None,
createhome=True,
password=None,
enforce_password=True,
empty_password=False,
... | [
"def",
"_changes",
"(",
"name",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"optional_groups",
"=",
"None",
",",
"remove_groups",
"=",
"True",
",",
"home",
"=",
"None",
",",
"createhome",
"=",
"True",
",",
"pass... | Return a dict of the changes required for a user if the user is present,
otherwise return False.
Updated in 2015.8.0 to include support for windows homedrive, profile,
logonscript, and description fields.
Updated in 2014.7.0 to include support for shadow attributes, all
attributes supported as int... | [
"Return",
"a",
"dict",
"of",
"the",
"changes",
"required",
"for",
"a",
"user",
"if",
"the",
"user",
"is",
"present",
"otherwise",
"return",
"False",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L55-L222 | train |
saltstack/salt | salt/states/user.py | present | def present(name,
uid=None,
gid=None,
usergroup=None,
groups=None,
optional_groups=None,
remove_groups=True,
home=None,
createhome=True,
password=None,
hash_password=False,
enforce_passwor... | python | def present(name,
uid=None,
gid=None,
usergroup=None,
groups=None,
optional_groups=None,
remove_groups=True,
home=None,
createhome=True,
password=None,
hash_password=False,
enforce_passwor... | [
"def",
"present",
"(",
"name",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"usergroup",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"optional_groups",
"=",
"None",
",",
"remove_groups",
"=",
"True",
",",
"home",
"=",
"None",
",",
"create... | Ensure that the named user is present with the specified properties
name
The name of the user to manage
uid
The user id to assign. If not specified, and the user does not exist,
then the next available uid will be assigned.
gid
The id of the default group to assign to the ... | [
"Ensure",
"that",
"the",
"named",
"user",
"is",
"present",
"with",
"the",
"specified",
"properties"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L225-L872 | train |
saltstack/salt | salt/states/user.py | absent | def absent(name, purge=False, force=False):
'''
Ensure that the named user is absent
name
The name of the user to remove
purge
Set purge to True to delete all of the user's files as well as the user,
Default is ``False``.
force
If the user is logged in, the absent ... | python | def absent(name, purge=False, force=False):
'''
Ensure that the named user is absent
name
The name of the user to remove
purge
Set purge to True to delete all of the user's files as well as the user,
Default is ``False``.
force
If the user is logged in, the absent ... | [
"def",
"absent",
"(",
"name",
",",
"purge",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"lusr",
"=",
... | Ensure that the named user is absent
name
The name of the user to remove
purge
Set purge to True to delete all of the user's files as well as the user,
Default is ``False``.
force
If the user is logged in, the absent state will fail. Set the force
option to True to... | [
"Ensure",
"that",
"the",
"named",
"user",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/user.py#L875-L919 | train |
saltstack/salt | salt/utils/url.py | parse | def parse(url):
'''
Parse a salt:// URL; return the path and a possible saltenv query.
'''
if not url.startswith('salt://'):
return url, None
# urlparse will split on valid filename chars such as '?' and '&'
resource = url.split('salt://', 1)[-1]
if '?env=' in resource:
# "... | python | def parse(url):
'''
Parse a salt:// URL; return the path and a possible saltenv query.
'''
if not url.startswith('salt://'):
return url, None
# urlparse will split on valid filename chars such as '?' and '&'
resource = url.split('salt://', 1)[-1]
if '?env=' in resource:
# "... | [
"def",
"parse",
"(",
"url",
")",
":",
"if",
"not",
"url",
".",
"startswith",
"(",
"'salt://'",
")",
":",
"return",
"url",
",",
"None",
"# urlparse will split on valid filename chars such as '?' and '&'",
"resource",
"=",
"url",
".",
"split",
"(",
"'salt://'",
",... | Parse a salt:// URL; return the path and a possible saltenv query. | [
"Parse",
"a",
"salt",
":",
"//",
"URL",
";",
"return",
"the",
"path",
"and",
"a",
"possible",
"saltenv",
"query",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L19-L40 | train |
saltstack/salt | salt/utils/url.py | create | def create(path, saltenv=None):
'''
join `path` and `saltenv` into a 'salt://' URL.
'''
if salt.utils.platform.is_windows():
path = salt.utils.path.sanitize_win_path(path)
path = salt.utils.data.decode(path)
query = 'saltenv={0}'.format(saltenv) if saltenv else ''
url = salt.utils.d... | python | def create(path, saltenv=None):
'''
join `path` and `saltenv` into a 'salt://' URL.
'''
if salt.utils.platform.is_windows():
path = salt.utils.path.sanitize_win_path(path)
path = salt.utils.data.decode(path)
query = 'saltenv={0}'.format(saltenv) if saltenv else ''
url = salt.utils.d... | [
"def",
"create",
"(",
"path",
",",
"saltenv",
"=",
"None",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"path",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"sanitize_win_path",
"(",
"path",
")",
"path",
... | join `path` and `saltenv` into a 'salt://' URL. | [
"join",
"path",
"and",
"saltenv",
"into",
"a",
"salt",
":",
"//",
"URL",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L43-L53 | train |
saltstack/salt | salt/utils/url.py | is_escaped | def is_escaped(url):
'''
test whether `url` is escaped with `|`
'''
scheme = urlparse(url).scheme
if not scheme:
return url.startswith('|')
elif scheme == 'salt':
path, saltenv = parse(url)
if salt.utils.platform.is_windows() and '|' in url:
return path.starts... | python | def is_escaped(url):
'''
test whether `url` is escaped with `|`
'''
scheme = urlparse(url).scheme
if not scheme:
return url.startswith('|')
elif scheme == 'salt':
path, saltenv = parse(url)
if salt.utils.platform.is_windows() and '|' in url:
return path.starts... | [
"def",
"is_escaped",
"(",
"url",
")",
":",
"scheme",
"=",
"urlparse",
"(",
"url",
")",
".",
"scheme",
"if",
"not",
"scheme",
":",
"return",
"url",
".",
"startswith",
"(",
"'|'",
")",
"elif",
"scheme",
"==",
"'salt'",
":",
"path",
",",
"saltenv",
"=",... | test whether `url` is escaped with `|` | [
"test",
"whether",
"url",
"is",
"escaped",
"with",
"|"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L56-L70 | train |
saltstack/salt | salt/utils/url.py | escape | def escape(url):
'''
add escape character `|` to `url`
'''
if salt.utils.platform.is_windows():
return url
scheme = urlparse(url).scheme
if not scheme:
if url.startswith('|'):
return url
else:
return '|{0}'.format(url)
elif scheme == 'salt':
... | python | def escape(url):
'''
add escape character `|` to `url`
'''
if salt.utils.platform.is_windows():
return url
scheme = urlparse(url).scheme
if not scheme:
if url.startswith('|'):
return url
else:
return '|{0}'.format(url)
elif scheme == 'salt':
... | [
"def",
"escape",
"(",
"url",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"return",
"url",
"scheme",
"=",
"urlparse",
"(",
"url",
")",
".",
"scheme",
"if",
"not",
"scheme",
":",
"if",
"url",
".",
"startsw... | add escape character `|` to `url` | [
"add",
"escape",
"character",
"|",
"to",
"url"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L73-L93 | train |
saltstack/salt | salt/utils/url.py | unescape | def unescape(url):
'''
remove escape character `|` from `url`
'''
scheme = urlparse(url).scheme
if not scheme:
return url.lstrip('|')
elif scheme == 'salt':
path, saltenv = parse(url)
if salt.utils.platform.is_windows() and '|' in url:
return create(path.lstri... | python | def unescape(url):
'''
remove escape character `|` from `url`
'''
scheme = urlparse(url).scheme
if not scheme:
return url.lstrip('|')
elif scheme == 'salt':
path, saltenv = parse(url)
if salt.utils.platform.is_windows() and '|' in url:
return create(path.lstri... | [
"def",
"unescape",
"(",
"url",
")",
":",
"scheme",
"=",
"urlparse",
"(",
"url",
")",
".",
"scheme",
"if",
"not",
"scheme",
":",
"return",
"url",
".",
"lstrip",
"(",
"'|'",
")",
"elif",
"scheme",
"==",
"'salt'",
":",
"path",
",",
"saltenv",
"=",
"pa... | remove escape character `|` from `url` | [
"remove",
"escape",
"character",
"|",
"from",
"url"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L96-L110 | train |
saltstack/salt | salt/utils/url.py | add_env | def add_env(url, saltenv):
'''
append `saltenv` to `url` as a query parameter to a 'salt://' url
'''
if not url.startswith('salt://'):
return url
path, senv = parse(url)
return create(path, saltenv) | python | def add_env(url, saltenv):
'''
append `saltenv` to `url` as a query parameter to a 'salt://' url
'''
if not url.startswith('salt://'):
return url
path, senv = parse(url)
return create(path, saltenv) | [
"def",
"add_env",
"(",
"url",
",",
"saltenv",
")",
":",
"if",
"not",
"url",
".",
"startswith",
"(",
"'salt://'",
")",
":",
"return",
"url",
"path",
",",
"senv",
"=",
"parse",
"(",
"url",
")",
"return",
"create",
"(",
"path",
",",
"saltenv",
")"
] | append `saltenv` to `url` as a query parameter to a 'salt://' url | [
"append",
"saltenv",
"to",
"url",
"as",
"a",
"query",
"parameter",
"to",
"a",
"salt",
":",
"//",
"url"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/url.py#L113-L121 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.