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/debian_service.py | disable | def disable(name, **kwargs):
'''
Disable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name>
'''
osmajor = _osrel()[0]
if osmajor < '6':
cmd = 'update-rc.d -f {0} remove'.format(name)
else:
cmd = 'update-... | python | def disable(name, **kwargs):
'''
Disable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name>
'''
osmajor = _osrel()[0]
if osmajor < '6':
cmd = 'update-rc.d -f {0} remove'.format(name)
else:
cmd = 'update-... | [
"def",
"disable",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"osmajor",
"=",
"_osrel",
"(",
")",
"[",
"0",
"]",
"if",
"osmajor",
"<",
"'6'",
":",
"cmd",
"=",
"'update-rc.d -f {0} remove'",
".",
"format",
"(",
"name",
")",
"else",
":",
"cmd",
"... | Disable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name> | [
"Disable",
"the",
"named",
"service",
"to",
"start",
"at",
"boot"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L298-L313 | train |
saltstack/salt | salt/modules/keystone.py | _get_kwargs | def _get_kwargs(profile=None, **connection_args):
'''
get connection args
'''
if profile:
prefix = profile + ":keystone."
else:
prefix = "keystone."
def get(key, default=None):
'''
look in connection_args first, then default to config file
'''
ret... | python | def _get_kwargs(profile=None, **connection_args):
'''
get connection args
'''
if profile:
prefix = profile + ":keystone."
else:
prefix = "keystone."
def get(key, default=None):
'''
look in connection_args first, then default to config file
'''
ret... | [
"def",
"_get_kwargs",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"if",
"profile",
":",
"prefix",
"=",
"profile",
"+",
"\":keystone.\"",
"else",
":",
"prefix",
"=",
"\"keystone.\"",
"def",
"get",
"(",
"key",
",",
"default",
"... | get connection args | [
"get",
"connection",
"args"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L94-L135 | train |
saltstack/salt | salt/modules/keystone.py | api_version | def api_version(profile=None, **connection_args):
'''
Returns the API version derived from endpoint's response.
CLI Example:
.. code-block:: bash
salt '*' keystone.api_version
'''
kwargs = _get_kwargs(profile=profile, **connection_args)
auth_url = kwargs.get('auth_url', kwargs.get... | python | def api_version(profile=None, **connection_args):
'''
Returns the API version derived from endpoint's response.
CLI Example:
.. code-block:: bash
salt '*' keystone.api_version
'''
kwargs = _get_kwargs(profile=profile, **connection_args)
auth_url = kwargs.get('auth_url', kwargs.get... | [
"def",
"api_version",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kwargs",
"=",
"_get_kwargs",
"(",
"profile",
"=",
"profile",
",",
"*",
"*",
"connection_args",
")",
"auth_url",
"=",
"kwargs",
".",
"get",
"(",
"'auth_url'",
... | Returns the API version derived from endpoint's response.
CLI Example:
.. code-block:: bash
salt '*' keystone.api_version | [
"Returns",
"the",
"API",
"version",
"derived",
"from",
"endpoint",
"s",
"response",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L138-L154 | train |
saltstack/salt | salt/modules/keystone.py | auth | def auth(profile=None, **connection_args):
'''
Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
CLI Example:
.. code-block:: bash
salt '*' keystone.auth
'''
__utils__['versions.warn_until'](
'Neon',
(
'The keystone modu... | python | def auth(profile=None, **connection_args):
'''
Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
CLI Example:
.. code-block:: bash
salt '*' keystone.auth
'''
__utils__['versions.warn_until'](
'Neon',
(
'The keystone modu... | [
"def",
"auth",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"__utils__",
"[",
"'versions.warn_until'",
"]",
"(",
"'Neon'",
",",
"(",
"'The keystone module has been deprecated and will be removed in {version}. '",
"'Please update to using the key... | Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
CLI Example:
.. code-block:: bash
salt '*' keystone.auth | [
"Set",
"up",
"keystone",
"credentials",
".",
"Only",
"intended",
"to",
"be",
"used",
"within",
"Keystone",
"-",
"enabled",
"modules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L157-L192 | train |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_create | def ec2_credentials_create(user_id=None, name=None,
tenant_id=None, tenant=None,
profile=None, **connection_args):
'''
Create EC2-compatible credentials for user per tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentia... | python | def ec2_credentials_create(user_id=None, name=None,
tenant_id=None, tenant=None,
profile=None, **connection_args):
'''
Create EC2-compatible credentials for user per tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentia... | [
"def",
"ec2_credentials_create",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"tenant_id",
"=",
"None",
",",
"tenant",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"pro... | Create EC2-compatible credentials for user per tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_create name=admin tenant=admin
salt '*' keystone.ec2_credentials_create \
user_id=c965f79c4f864eaaa9c3b41904e67082 \
tenant_id=722787eb540849158668370dc6... | [
"Create",
"EC2",
"-",
"compatible",
"credentials",
"for",
"user",
"per",
"tenant"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L195-L229 | train |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_delete | def ec2_credentials_delete(user_id=None, name=None, access_key=None,
profile=None, **connection_args):
'''
Delete EC2-compatible credentials
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_delete \
860f8c2c38ca4fab989f9bc56a061a64 access... | python | def ec2_credentials_delete(user_id=None, name=None, access_key=None,
profile=None, **connection_args):
'''
Delete EC2-compatible credentials
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_delete \
860f8c2c38ca4fab989f9bc56a061a64 access... | [
"def",
"ec2_credentials_delete",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"access_key",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"conn... | Delete EC2-compatible credentials
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_delete \
860f8c2c38ca4fab989f9bc56a061a64 access_key=5f66d2f24f604b8bb9cd28886106f442
salt '*' keystone.ec2_credentials_delete name=admin \
access_key=5f66d2f24f604b8bb9cd28... | [
"Delete",
"EC2",
"-",
"compatible",
"credentials"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L232-L255 | train |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_get | def ec2_credentials_get(user_id=None, name=None, access=None,
profile=None, **connection_args):
'''
Return ec2_credentials for a user (keystone ec2-credentials-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e6708... | python | def ec2_credentials_get(user_id=None, name=None, access=None,
profile=None, **connection_args):
'''
Return ec2_credentials for a user (keystone ec2-credentials-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e6708... | [
"def",
"ec2_credentials_get",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"access",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_... | Return ec2_credentials for a user (keystone ec2-credentials-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e67082 access=722787eb540849158668370
salt '*' keystone.ec2_credentials_get user_id=c965f79c4f864eaaa9c3b41904e67082 access=72278... | [
"Return",
"ec2_credentials",
"for",
"a",
"user",
"(",
"keystone",
"ec2",
"-",
"credentials",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L258-L288 | train |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_list | def ec2_credentials_list(user_id=None, name=None, profile=None,
**connection_args):
'''
Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1... | python | def ec2_credentials_list(user_id=None, name=None, profile=None,
**connection_args):
'''
Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1... | [
"def",
"ec2_credentials_list",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{"... | Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1c639c89e654
salt '*' keystone.ec2_credentials_list user_id=298ce377245c4ec9b70e1c639c89e654
salt '*' keys... | [
"Return",
"a",
"list",
"of",
"ec2_credentials",
"for",
"a",
"specific",
"user",
"(",
"keystone",
"ec2",
"-",
"credentials",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L291-L318 | train |
saltstack/salt | salt/modules/keystone.py | endpoint_get | def endpoint_get(service, region=None, profile=None, interface=None, **connection_args):
'''
Return a specific endpoint (keystone endpoint-get)
CLI Example:
.. code-block:: bash
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=adm... | python | def endpoint_get(service, region=None, profile=None, interface=None, **connection_args):
'''
Return a specific endpoint (keystone endpoint-get)
CLI Example:
.. code-block:: bash
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=adm... | [
"def",
"endpoint_get",
"(",
"service",
",",
"region",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"interface",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"services",
"=",
"... | Return a specific endpoint (keystone endpoint-get)
CLI Example:
.. code-block:: bash
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=admin [region=RegionOne] | [
"Return",
"a",
"specific",
"endpoint",
"(",
"keystone",
"endpoint",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L321-L349 | train |
saltstack/salt | salt/modules/keystone.py | endpoint_list | def endpoint_list(profile=None, **connection_args):
'''
Return a list of available endpoints (keystone endpoints-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.endpoint_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for endpoint in kstone.endpoints.lis... | python | def endpoint_list(profile=None, **connection_args):
'''
Return a list of available endpoints (keystone endpoints-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.endpoint_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for endpoint in kstone.endpoints.lis... | [
"def",
"endpoint_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"for",
"endpoint",
"in",
"kstone",
".",
"endpoints",
".... | Return a list of available endpoints (keystone endpoints-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.endpoint_list | [
"Return",
"a",
"list",
"of",
"available",
"endpoints",
"(",
"keystone",
"endpoints",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L352-L369 | train |
saltstack/salt | salt/modules/keystone.py | endpoint_create | def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None,
region=None, profile=None, url=None, interface=None, **connection_args):
'''
Create an endpoint for an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_create nova... | python | def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None,
region=None, profile=None, url=None, interface=None, **connection_args):
'''
Create an endpoint for an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_create nova... | [
"def",
"endpoint_create",
"(",
"service",
",",
"publicurl",
"=",
"None",
",",
"internalurl",
"=",
"None",
",",
"adminurl",
"=",
"None",
",",
"region",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"url",
"=",
"None",
",",
"interface",
"=",
"None",
","... | Create an endpoint for an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region
salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne' | [
"Create",
"an",
"endpoint",
"for",
"an",
"Openstack",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L372-L402 | train |
saltstack/salt | salt/modules/keystone.py | endpoint_delete | def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args):
'''
Delete endpoints of an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=adm... | python | def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args):
'''
Delete endpoints of an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=adm... | [
"def",
"endpoint_delete",
"(",
"service",
",",
"region",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"interface",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
... | Delete endpoints of an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=admin [region=RegionOne] | [
"Delete",
"endpoints",
"of",
"an",
"Openstack",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L405-L424 | train |
saltstack/salt | salt/modules/keystone.py | role_create | def role_create(name, profile=None, **connection_args):
'''
Create a named role.
CLI Example:
.. code-block:: bash
salt '*' keystone.role_create admin
'''
kstone = auth(profile, **connection_args)
if 'Error' not in role_get(name=name, profile=profile, **connection_args):
... | python | def role_create(name, profile=None, **connection_args):
'''
Create a named role.
CLI Example:
.. code-block:: bash
salt '*' keystone.role_create admin
'''
kstone = auth(profile, **connection_args)
if 'Error' not in role_get(name=name, profile=profile, **connection_args):
... | [
"def",
"role_create",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"'Error'",
"not",
"in",
"role_get",
"(",
"name",
"=",
"name"... | Create a named role.
CLI Example:
.. code-block:: bash
salt '*' keystone.role_create admin | [
"Create",
"a",
"named",
"role",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L427-L442 | train |
saltstack/salt | salt/modules/keystone.py | role_delete | def role_delete(role_id=None, name=None, profile=None,
**connection_args):
'''
Delete a role (keystone role-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete role_id=c965f79c4f864eaa... | python | def role_delete(role_id=None, name=None, profile=None,
**connection_args):
'''
Delete a role (keystone role-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete role_id=c965f79c4f864eaa... | [
"def",
"role_delete",
"(",
"role_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"name",
":",
"fo... | Delete a role (keystone role-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete role_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete name=admin | [
"Delete",
"a",
"role",
"(",
"keystone",
"role",
"-",
"delete",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L445-L475 | train |
saltstack/salt | salt/modules/keystone.py | role_get | def role_get(role_id=None, name=None, profile=None, **connection_args):
'''
Return a specific roles (keystone role-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082
... | python | def role_get(role_id=None, name=None, profile=None, **connection_args):
'''
Return a specific roles (keystone role-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082
... | [
"def",
"role_get",
"(",
"role_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"... | Return a specific roles (keystone role-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get name=nova | [
"Return",
"a",
"specific",
"roles",
"(",
"keystone",
"role",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L478-L503 | train |
saltstack/salt | salt/modules/keystone.py | role_list | def role_list(profile=None, **connection_args):
'''
Return a list of available roles (keystone role-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.role_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for role in kstone.roles.list():
ret[role.name... | python | def role_list(profile=None, **connection_args):
'''
Return a list of available roles (keystone role-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.role_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for role in kstone.roles.list():
ret[role.name... | [
"def",
"role_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"for",
"role",
"in",
"kstone",
".",
"roles",
".",
"list",... | Return a list of available roles (keystone role-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.role_list | [
"Return",
"a",
"list",
"of",
"available",
"roles",
"(",
"keystone",
"role",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L506-L522 | train |
saltstack/salt | salt/modules/keystone.py | service_create | def service_create(name, service_type, description=None, profile=None,
**connection_args):
'''
Add service to Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_create nova compute \
'OpenStack Compute Service'
'''
kstone = auth(pr... | python | def service_create(name, service_type, description=None, profile=None,
**connection_args):
'''
Add service to Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_create nova compute \
'OpenStack Compute Service'
'''
kstone = auth(pr... | [
"def",
"service_create",
"(",
"name",
",",
"service_type",
",",
"description",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"service",
... | Add service to Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_create nova compute \
'OpenStack Compute Service' | [
"Add",
"service",
"to",
"Keystone",
"service",
"catalog"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L525-L539 | train |
saltstack/salt | salt/modules/keystone.py | service_delete | def service_delete(service_id=None, name=None, profile=None, **connection_args):
'''
Delete a service from Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_delete name=nova
'''
... | python | def service_delete(service_id=None, name=None, profile=None, **connection_args):
'''
Delete a service from Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_delete name=nova
'''
... | [
"def",
"service_delete",
"(",
"service_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"name",
":",... | Delete a service from Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_delete name=nova | [
"Delete",
"a",
"service",
"from",
"Keystone",
"service",
"catalog"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L542-L558 | train |
saltstack/salt | salt/modules/keystone.py | service_get | def service_get(service_id=None, name=None, profile=None, **connection_args):
'''
Return a specific services (keystone service-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get service_id=c965f79c4f864e... | python | def service_get(service_id=None, name=None, profile=None, **connection_args):
'''
Return a specific services (keystone service-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get service_id=c965f79c4f864e... | [
"def",
"service_get",
"(",
"service_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}... | Return a specific services (keystone service-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get service_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get name=nova | [
"Return",
"a",
"specific",
"services",
"(",
"keystone",
"service",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L561-L586 | train |
saltstack/salt | salt/modules/keystone.py | service_list | def service_list(profile=None, **connection_args):
'''
Return a list of available services (keystone services-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.service_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for service in kstone.services.list():
... | python | def service_list(profile=None, **connection_args):
'''
Return a list of available services (keystone services-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.service_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for service in kstone.services.list():
... | [
"def",
"service_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"for",
"service",
"in",
"kstone",
".",
"services",
".",
... | Return a list of available services (keystone services-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.service_list | [
"Return",
"a",
"list",
"of",
"available",
"services",
"(",
"keystone",
"services",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L589-L605 | train |
saltstack/salt | salt/modules/keystone.py | tenant_create | def tenant_create(name, description=None, enabled=True, profile=None,
**connection_args):
'''
Create a keystone tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_create nova description='nova tenant'
salt '*' keystone.tenant_create test enabled=False... | python | def tenant_create(name, description=None, enabled=True, profile=None,
**connection_args):
'''
Create a keystone tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_create nova description='nova tenant'
salt '*' keystone.tenant_create test enabled=False... | [
"def",
"tenant_create",
"(",
"name",
",",
"description",
"=",
"None",
",",
"enabled",
"=",
"True",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"n... | Create a keystone tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_create nova description='nova tenant'
salt '*' keystone.tenant_create test enabled=False | [
"Create",
"a",
"keystone",
"tenant"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L608-L622 | train |
saltstack/salt | salt/modules/keystone.py | tenant_delete | def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args):
'''
Delete a tenant (keystone tenant-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c... | python | def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args):
'''
Delete a tenant (keystone tenant-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c... | [
"def",
"tenant_delete",
"(",
"tenant_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"name",
":",
... | Delete a tenant (keystone tenant-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete name=demo | [
"Delete",
"a",
"tenant",
"(",
"keystone",
"tenant",
"-",
"delete",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L661-L686 | train |
saltstack/salt | salt/modules/keystone.py | project_delete | def project_delete(project_id=None, name=None, profile=None, **connection_args):
'''
Delete a project (keystone project-delete).
Overrides keystone tenant-delete form api V2. For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name... | python | def project_delete(project_id=None, name=None, profile=None, **connection_args):
'''
Delete a project (keystone project-delete).
Overrides keystone tenant-delete form api V2. For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name... | [
"def",
"project_delete",
"(",
"project_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"_OS_IDENTITY_API_VERSION",
">"... | Delete a project (keystone project-delete).
Overrides keystone tenant-delete form api V2. For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name.
profile
Configuration profile - if configuration for multiple openstack accoun... | [
"Delete",
"a",
"project",
"(",
"keystone",
"project",
"-",
"delete",
")",
".",
"Overrides",
"keystone",
"tenant",
"-",
"delete",
"form",
"api",
"V2",
".",
"For",
"keystone",
"api",
"V3",
"only",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L689-L718 | train |
saltstack/salt | salt/modules/keystone.py | tenant_get | def tenant_get(tenant_id=None, name=None, profile=None,
**connection_args):
'''
Return a specific tenants (keystone tenant-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get tenant_id=c965f7... | python | def tenant_get(tenant_id=None, name=None, profile=None,
**connection_args):
'''
Return a specific tenants (keystone tenant-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get tenant_id=c965f7... | [
"def",
"tenant_get",
"(",
"tenant_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",... | Return a specific tenants (keystone tenant-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get tenant_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get name=nova | [
"Return",
"a",
"specific",
"tenants",
"(",
"keystone",
"tenant",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L721-L748 | train |
saltstack/salt | salt/modules/keystone.py | project_get | def project_get(project_id=None, name=None, profile=None, **connection_args):
'''
Return a specific projects (keystone project-get)
Overrides keystone tenant-get form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project ... | python | def project_get(project_id=None, name=None, profile=None, **connection_args):
'''
Return a specific projects (keystone project-get)
Overrides keystone tenant-get form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project ... | [
"def",
"project_get",
"(",
"project_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"_OS_IDENTITY_API_VERSION",
">",
... | Return a specific projects (keystone project-get)
Overrides keystone tenant-get form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name.
profile
Configuration profile - if configuration for multiple openstack... | [
"Return",
"a",
"specific",
"projects",
"(",
"keystone",
"project",
"-",
"get",
")",
"Overrides",
"keystone",
"tenant",
"-",
"get",
"form",
"api",
"V2",
".",
"For",
"keystone",
"api",
"V3",
"only",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L751-L781 | train |
saltstack/salt | salt/modules/keystone.py | tenant_list | def tenant_list(profile=None, **connection_args):
'''
Return a list of available tenants (keystone tenants-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.tenant_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for tenant in getattr(kstone, _TENANTS, None... | python | def tenant_list(profile=None, **connection_args):
'''
Return a list of available tenants (keystone tenants-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.tenant_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for tenant in getattr(kstone, _TENANTS, None... | [
"def",
"tenant_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"for",
"tenant",
"in",
"getattr",
"(",
"kstone",
",",
"... | Return a list of available tenants (keystone tenants-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.tenant_list | [
"Return",
"a",
"list",
"of",
"available",
"tenants",
"(",
"keystone",
"tenants",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L784-L801 | train |
saltstack/salt | salt/modules/keystone.py | project_list | def project_list(profile=None, **connection_args):
'''
Return a list of available projects (keystone projects-list).
Overrides keystone tenants-list form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
profile
Configuration profile - if configuration for multiple openstac... | python | def project_list(profile=None, **connection_args):
'''
Return a list of available projects (keystone projects-list).
Overrides keystone tenants-list form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
profile
Configuration profile - if configuration for multiple openstac... | [
"def",
"project_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"_OS_IDENTITY_API_VERSION",
">",
"2",
":",
"return",
"tenant_list",
"(",
"profile",
",",
"*... | Return a list of available projects (keystone projects-list).
Overrides keystone tenants-list form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
profile
Configuration profile - if configuration for multiple openstack accounts required.
CLI Example:
.. code-block:: bas... | [
"Return",
"a",
"list",
"of",
"available",
"projects",
"(",
"keystone",
"projects",
"-",
"list",
")",
".",
"Overrides",
"keystone",
"tenants",
"-",
"list",
"form",
"api",
"V2",
".",
"For",
"keystone",
"api",
"V3",
"only",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L804-L826 | train |
saltstack/salt | salt/modules/keystone.py | tenant_update | def tenant_update(tenant_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone tenant-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
CLI Ex... | python | def tenant_update(tenant_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone tenant-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
CLI Ex... | [
"def",
"tenant_update",
"(",
"tenant_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile... | Update a tenant's information (keystone tenant-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_update name=admin enabled=True
salt '*' keystone.tenant_update c9... | [
"Update",
"a",
"tenant",
"s",
"information",
"(",
"keystone",
"tenant",
"-",
"update",
")",
"The",
"following",
"fields",
"may",
"be",
"updated",
":",
"name",
"description",
"enabled",
".",
"Can",
"only",
"update",
"name",
"if",
"targeting",
"by",
"ID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L829-L864 | train |
saltstack/salt | salt/modules/keystone.py | project_update | def project_update(project_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone project-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
Ov... | python | def project_update(project_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone project-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
Ov... | [
"def",
"project_update",
"(",
"project_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"auth",
"(",
"profile",
",",
"*",
... | Update a tenant's information (keystone project-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
Overrides keystone tenant_update form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project i... | [
"Update",
"a",
"tenant",
"s",
"information",
"(",
"keystone",
"project",
"-",
"update",
")",
"The",
"following",
"fields",
"may",
"be",
"updated",
":",
"name",
"description",
"enabled",
".",
"Can",
"only",
"update",
"name",
"if",
"targeting",
"by",
"ID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L867-L907 | train |
saltstack/salt | salt/modules/keystone.py | token_get | def token_get(profile=None, **connection_args):
'''
Return the configured tokens (keystone token-get)
CLI Example:
.. code-block:: bash
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082
'''
kstone = auth(profile, **connection_args)
token = kstone.service_catalog.get_tok... | python | def token_get(profile=None, **connection_args):
'''
Return the configured tokens (keystone token-get)
CLI Example:
.. code-block:: bash
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082
'''
kstone = auth(profile, **connection_args)
token = kstone.service_catalog.get_tok... | [
"def",
"token_get",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"token",
"=",
"kstone",
".",
"service_catalog",
".",
"get_token",
"(",
")",
"return... | Return the configured tokens (keystone token-get)
CLI Example:
.. code-block:: bash
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082 | [
"Return",
"the",
"configured",
"tokens",
"(",
"keystone",
"token",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L910-L925 | train |
saltstack/salt | salt/modules/keystone.py | user_list | def user_list(profile=None, **connection_args):
'''
Return a list of available users (keystone user-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.user_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for user in kstone.users.list():
ret[user.name... | python | def user_list(profile=None, **connection_args):
'''
Return a list of available users (keystone user-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.user_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for user in kstone.users.list():
ret[user.name... | [
"def",
"user_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"for",
"user",
"in",
"kstone",
".",
"users",
".",
"list",... | Return a list of available users (keystone user-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.user_list | [
"Return",
"a",
"list",
"of",
"available",
"users",
"(",
"keystone",
"user",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L928-L947 | train |
saltstack/salt | salt/modules/keystone.py | user_get | def user_get(user_id=None, name=None, profile=None, **connection_args):
'''
Return a specific users (keystone user-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082
... | python | def user_get(user_id=None, name=None, profile=None, **connection_args):
'''
Return a specific users (keystone user-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082
... | [
"def",
"user_get",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"{",
"}",
"... | Return a specific users (keystone user-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get name=nova | [
"Return",
"a",
"specific",
"users",
"(",
"keystone",
"user",
"-",
"get",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L950-L985 | train |
saltstack/salt | salt/modules/keystone.py | user_create | def user_create(name, password, email, tenant_id=None,
enabled=True, profile=None, project_id=None, description=None, **connection_args):
'''
Create a user (keystone user-create)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_create name=jack password=zero email=jac... | python | def user_create(name, password, email, tenant_id=None,
enabled=True, profile=None, project_id=None, description=None, **connection_args):
'''
Create a user (keystone user-create)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_create name=jack password=zero email=jac... | [
"def",
"user_create",
"(",
"name",
",",
"password",
",",
"email",
",",
"tenant_id",
"=",
"None",
",",
"enabled",
"=",
"True",
",",
"profile",
"=",
"None",
",",
"project_id",
"=",
"None",
",",
"description",
"=",
"None",
",",
"*",
"*",
"connection_args",
... | Create a user (keystone user-create)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_create name=jack password=zero email=jack@halloweentown.org \
tenant_id=a28a7b5a999a455f84b1f5210264375e enabled=True | [
"Create",
"a",
"user",
"(",
"keystone",
"user",
"-",
"create",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L988-L1017 | train |
saltstack/salt | salt/modules/keystone.py | user_delete | def user_delete(user_id=None, name=None, profile=None, **connection_args):
'''
Delete a user (keystone user-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082
... | python | def user_delete(user_id=None, name=None, profile=None, **connection_args):
'''
Delete a user (keystone user-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082
... | [
"def",
"user_delete",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"if",
"name",
":",
"fo... | Delete a user (keystone user-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete name=nova | [
"Delete",
"a",
"user",
"(",
"keystone",
"user",
"-",
"delete",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1020-L1045 | train |
saltstack/salt | salt/modules/keystone.py | user_update | def user_update(user_id=None, name=None, email=None, enabled=None,
tenant=None, profile=None, project=None, description=None, **connection_args):
'''
Update a user's information (keystone user-update)
The following fields may be updated: name, email, enabled, tenant.
Because the name is ... | python | def user_update(user_id=None, name=None, email=None, enabled=None,
tenant=None, profile=None, project=None, description=None, **connection_args):
'''
Update a user's information (keystone user-update)
The following fields may be updated: name, email, enabled, tenant.
Because the name is ... | [
"def",
"user_update",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"email",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"tenant",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"project",
"=",
"None",
",",
"description",
"=",
"None"... | Update a user's information (keystone user-update)
The following fields may be updated: name, email, enabled, tenant.
Because the name is one of the fields, a valid user id is required.
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_update user_id=c965f79c4f864eaaa9c3b41904e67082 n... | [
"Update",
"a",
"user",
"s",
"information",
"(",
"keystone",
"user",
"-",
"update",
")",
"The",
"following",
"fields",
"may",
"be",
"updated",
":",
"name",
"email",
"enabled",
"tenant",
".",
"Because",
"the",
"name",
"is",
"one",
"of",
"the",
"fields",
"a... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1048-L1109 | train |
saltstack/salt | salt/modules/keystone.py | user_verify_password | def user_verify_password(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Verify a user's password
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_verify_password name=test password=foobar
salt '*' keystone.user_verify_pa... | python | def user_verify_password(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Verify a user's password
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_verify_password name=test password=foobar
salt '*' keystone.user_verify_pa... | [
"def",
"user_verify_password",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"password",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connecti... | Verify a user's password
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_verify_password name=test password=foobar
salt '*' keystone.user_verify_password user_id=c965f79c4f864eaaa9c3b41904e67082 password=foobar | [
"Verify",
"a",
"user",
"s",
"password"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1112-L1157 | train |
saltstack/salt | salt/modules/keystone.py | user_password_update | def user_password_update(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Update a user's password (keystone user-password-update)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 p... | python | def user_password_update(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Update a user's password (keystone user-password-update)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 p... | [
"def",
"user_password_update",
"(",
"user_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"password",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connecti... | Update a user's password (keystone user-password-update)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 password=12345
salt '*' keystone.user_password_update user_id=c965f79c4f864eaaa9c3b41904e67082 password=12345
salt '*' ke... | [
"Update",
"a",
"user",
"s",
"password",
"(",
"keystone",
"user",
"-",
"password",
"-",
"update",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1160-L1189 | train |
saltstack/salt | salt/modules/keystone.py | user_role_add | def user_role_add(user_id=None, user=None, tenant_id=None,
tenant=None, role_id=None, role=None, profile=None,
project_id=None, project_name=None, **connection_args):
'''
Add role for user in tenant (keystone user-role-add)
CLI Examples:
.. code-block:: bash
... | python | def user_role_add(user_id=None, user=None, tenant_id=None,
tenant=None, role_id=None, role=None, profile=None,
project_id=None, project_name=None, **connection_args):
'''
Add role for user in tenant (keystone user-role-add)
CLI Examples:
.. code-block:: bash
... | [
"def",
"user_role_add",
"(",
"user_id",
"=",
"None",
",",
"user",
"=",
"None",
",",
"tenant_id",
"=",
"None",
",",
"tenant",
"=",
"None",
",",
"role_id",
"=",
"None",
",",
"role",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"project_id",
"=",
"Non... | Add role for user in tenant (keystone user-role-add)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_role_add \
user_id=298ce377245c4ec9b70e1c639c89e654 \
tenant_id=7167a092ece84bae8cead4bf9d15bb3b \
role_id=ce377245c4ec9b70e1c639c89e8cead4
salt '*' keystone.user_role_add user=admin... | [
"Add",
"role",
"for",
"user",
"in",
"tenant",
"(",
"keystone",
"user",
"-",
"role",
"-",
"add",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1192-L1247 | train |
saltstack/salt | salt/modules/keystone.py | user_role_list | def user_role_list(user_id=None, tenant_id=None, user_name=None,
tenant_name=None, profile=None, project_id=None, project_name=None, **connection_args):
'''
Return a list of available user_roles (keystone user-roles-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone... | python | def user_role_list(user_id=None, tenant_id=None, user_name=None,
tenant_name=None, profile=None, project_id=None, project_name=None, **connection_args):
'''
Return a list of available user_roles (keystone user-roles-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone... | [
"def",
"user_role_list",
"(",
"user_id",
"=",
"None",
",",
"tenant_id",
"=",
"None",
",",
"user_name",
"=",
"None",
",",
"tenant_name",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"project_id",
"=",
"None",
",",
"project_name",
"=",
"None",
",",
"*",
... | Return a list of available user_roles (keystone user-roles-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_role_list \
user_id=298ce377245c4ec9b70e1c639c89e654 \
tenant_id=7167a092ece84bae8cead4bf9d15bb3b
salt '*' keystone.user_role_list user_name=admin tenant_name=admin | [
"Return",
"a",
"list",
"of",
"available",
"user_roles",
"(",
"keystone",
"user",
"-",
"roles",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1307-L1353 | train |
saltstack/salt | salt/modules/keystone.py | _item_list | def _item_list(profile=None, **connection_args):
'''
Template for writing list functions
Return a list of available items (keystone items-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.item_list
'''
kstone = auth(profile, **connection_args)
ret = []
for item in ... | python | def _item_list(profile=None, **connection_args):
'''
Template for writing list functions
Return a list of available items (keystone items-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.item_list
'''
kstone = auth(profile, **connection_args)
ret = []
for item in ... | [
"def",
"_item_list",
"(",
"profile",
"=",
"None",
",",
"*",
"*",
"connection_args",
")",
":",
"kstone",
"=",
"auth",
"(",
"profile",
",",
"*",
"*",
"connection_args",
")",
"ret",
"=",
"[",
"]",
"for",
"item",
"in",
"kstone",
".",
"items",
".",
"list"... | Template for writing list functions
Return a list of available items (keystone items-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.item_list | [
"Template",
"for",
"writing",
"list",
"functions",
"Return",
"a",
"list",
"of",
"available",
"items",
"(",
"keystone",
"items",
"-",
"list",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1356-L1375 | train |
saltstack/salt | salt/roster/sshconfig.py | _get_ssh_config_file | def _get_ssh_config_file(opts):
'''
:return: Path to the .ssh/config file - usually <home>/.ssh/config
'''
ssh_config_file = opts.get('ssh_config_file')
if not os.path.isfile(ssh_config_file):
raise IOError('Cannot find SSH config file')
if not os.access(ssh_config_file, os.R_OK):
... | python | def _get_ssh_config_file(opts):
'''
:return: Path to the .ssh/config file - usually <home>/.ssh/config
'''
ssh_config_file = opts.get('ssh_config_file')
if not os.path.isfile(ssh_config_file):
raise IOError('Cannot find SSH config file')
if not os.access(ssh_config_file, os.R_OK):
... | [
"def",
"_get_ssh_config_file",
"(",
"opts",
")",
":",
"ssh_config_file",
"=",
"opts",
".",
"get",
"(",
"'ssh_config_file'",
")",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"ssh_config_file",
")",
":",
"raise",
"IOError",
"(",
"'Cannot find SSH config ... | :return: Path to the .ssh/config file - usually <home>/.ssh/config | [
":",
"return",
":",
"Path",
"to",
"the",
".",
"ssh",
"/",
"config",
"file",
"-",
"usually",
"<home",
">",
"/",
".",
"ssh",
"/",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L33-L42 | train |
saltstack/salt | salt/roster/sshconfig.py | parse_ssh_config | def parse_ssh_config(lines):
'''
Parses lines from the SSH config to create roster targets.
:param lines: Individual lines from the ssh config file
:return: Dictionary of targets in similar style to the flat roster
'''
# transform the list of individual lines into a list of sublists where each
... | python | def parse_ssh_config(lines):
'''
Parses lines from the SSH config to create roster targets.
:param lines: Individual lines from the ssh config file
:return: Dictionary of targets in similar style to the flat roster
'''
# transform the list of individual lines into a list of sublists where each
... | [
"def",
"parse_ssh_config",
"(",
"lines",
")",
":",
"# transform the list of individual lines into a list of sublists where each",
"# sublist represents a single Host definition",
"hosts",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
":",
"line",
"=",
"salt",
".",
"utils",
... | Parses lines from the SSH config to create roster targets.
:param lines: Individual lines from the ssh config file
:return: Dictionary of targets in similar style to the flat roster | [
"Parses",
"lines",
"from",
"the",
"SSH",
"config",
"to",
"create",
"roster",
"targets",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L45-L94 | train |
saltstack/salt | salt/roster/sshconfig.py | targets | def targets(tgt, tgt_type='glob', **kwargs):
'''
Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster
'''
ssh_config_file = _get_ssh_config_file(__opts__)
with salt.utils.files.fopen(ssh_config_file, 'r') as fp:
all_minions = parse_ssh_con... | python | def targets(tgt, tgt_type='glob', **kwargs):
'''
Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster
'''
ssh_config_file = _get_ssh_config_file(__opts__)
with salt.utils.files.fopen(ssh_config_file, 'r') as fp:
all_minions = parse_ssh_con... | [
"def",
"targets",
"(",
"tgt",
",",
"tgt_type",
"=",
"'glob'",
",",
"*",
"*",
"kwargs",
")",
":",
"ssh_config_file",
"=",
"_get_ssh_config_file",
"(",
"__opts__",
")",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"ssh_config_file",
",",
... | Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster | [
"Return",
"the",
"targets",
"from",
"the",
"flat",
"yaml",
"file",
"checks",
"opts",
"for",
"location",
"but",
"defaults",
"to",
"/",
"etc",
"/",
"salt",
"/",
"roster"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L97-L107 | train |
saltstack/salt | salt/roster/sshconfig.py | RosterMatcher.ret_glob_minions | def ret_glob_minions(self):
'''
Return minions that match via glob
'''
minions = {}
for minion in self.raw:
if fnmatch.fnmatch(minion, self.tgt):
data = self.get_data(minion)
if data:
minions[minion] = data
r... | python | def ret_glob_minions(self):
'''
Return minions that match via glob
'''
minions = {}
for minion in self.raw:
if fnmatch.fnmatch(minion, self.tgt):
data = self.get_data(minion)
if data:
minions[minion] = data
r... | [
"def",
"ret_glob_minions",
"(",
"self",
")",
":",
"minions",
"=",
"{",
"}",
"for",
"minion",
"in",
"self",
".",
"raw",
":",
"if",
"fnmatch",
".",
"fnmatch",
"(",
"minion",
",",
"self",
".",
"tgt",
")",
":",
"data",
"=",
"self",
".",
"get_data",
"("... | Return minions that match via glob | [
"Return",
"minions",
"that",
"match",
"via",
"glob"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L128-L138 | train |
saltstack/salt | salt/roster/sshconfig.py | RosterMatcher.get_data | def get_data(self, minion):
'''
Return the configured ip
'''
if isinstance(self.raw[minion], six.string_types):
return {'host': self.raw[minion]}
if isinstance(self.raw[minion], dict):
return self.raw[minion]
return False | python | def get_data(self, minion):
'''
Return the configured ip
'''
if isinstance(self.raw[minion], six.string_types):
return {'host': self.raw[minion]}
if isinstance(self.raw[minion], dict):
return self.raw[minion]
return False | [
"def",
"get_data",
"(",
"self",
",",
"minion",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"raw",
"[",
"minion",
"]",
",",
"six",
".",
"string_types",
")",
":",
"return",
"{",
"'host'",
":",
"self",
".",
"raw",
"[",
"minion",
"]",
"}",
"if",
... | Return the configured ip | [
"Return",
"the",
"configured",
"ip"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L140-L148 | train |
saltstack/salt | salt/exceptions.py | SaltException.pack | def pack(self):
'''
Pack this exception into a serializable dictionary that is safe for
transport via msgpack
'''
if six.PY3:
return {'message': six.text_type(self), 'args': self.args}
return dict(message=self.__unicode__(), args=self.args) | python | def pack(self):
'''
Pack this exception into a serializable dictionary that is safe for
transport via msgpack
'''
if six.PY3:
return {'message': six.text_type(self), 'args': self.args}
return dict(message=self.__unicode__(), args=self.args) | [
"def",
"pack",
"(",
"self",
")",
":",
"if",
"six",
".",
"PY3",
":",
"return",
"{",
"'message'",
":",
"six",
".",
"text_type",
"(",
"self",
")",
",",
"'args'",
":",
"self",
".",
"args",
"}",
"return",
"dict",
"(",
"message",
"=",
"self",
".",
"__u... | Pack this exception into a serializable dictionary that is safe for
transport via msgpack | [
"Pack",
"this",
"exception",
"into",
"a",
"serializable",
"dictionary",
"that",
"is",
"safe",
"for",
"transport",
"via",
"msgpack"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/exceptions.py#L65-L72 | train |
saltstack/salt | salt/modules/namecheap_domains.py | reactivate | def reactivate(domain_name):
'''
Try to reactivate the expired domain name
Returns the following information:
- Whether or not the domain was reactivated successfully
- The amount charged for reactivation
- The order ID
- The transaction ID
CLI Example:
.. code-block:: bash
... | python | def reactivate(domain_name):
'''
Try to reactivate the expired domain name
Returns the following information:
- Whether or not the domain was reactivated successfully
- The amount charged for reactivation
- The order ID
- The transaction ID
CLI Example:
.. code-block:: bash
... | [
"def",
"reactivate",
"(",
"domain_name",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.domains.reactivate'",
")",
"opts",
"[",
"'DomainName'",
"]",
"=",
"domain_name",
"response_xml",
"=",
"salt",
".",
"utils"... | Try to reactivate the expired domain name
Returns the following information:
- Whether or not the domain was reactivated successfully
- The amount charged for reactivation
- The order ID
- The transaction ID
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.re... | [
"Try",
"to",
"reactivate",
"the",
"expired",
"domain",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L54-L80 | train |
saltstack/salt | salt/modules/namecheap_domains.py | renew | def renew(domain_name, years, promotion_code=None):
'''
Try to renew the specified expiring domain name for a specified number of years
domain_name
The domain name to be renewed
years
Number of years to renew
Returns the following information:
- Whether or not the domain was ... | python | def renew(domain_name, years, promotion_code=None):
'''
Try to renew the specified expiring domain name for a specified number of years
domain_name
The domain name to be renewed
years
Number of years to renew
Returns the following information:
- Whether or not the domain was ... | [
"def",
"renew",
"(",
"domain_name",
",",
"years",
",",
"promotion_code",
"=",
"None",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.domains.renew'",
")",
"opts",
"[",
"'DomainName'",
"]",
"=",
"domain_name",... | Try to renew the specified expiring domain name for a specified number of years
domain_name
The domain name to be renewed
years
Number of years to renew
Returns the following information:
- Whether or not the domain was renewed successfully
- The domain ID
- The order ID
... | [
"Try",
"to",
"renew",
"the",
"specified",
"expiring",
"domain",
"name",
"for",
"a",
"specified",
"number",
"of",
"years"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L83-L120 | train |
saltstack/salt | salt/modules/namecheap_domains.py | create | def create(domain_name, years, **kwargs):
'''
Try to register the specified domain name
domain_name
The domain name to be registered
years
Number of years to register
Returns the following information:
- Whether or not the domain was renewed successfully
- Whether or not ... | python | def create(domain_name, years, **kwargs):
'''
Try to register the specified domain name
domain_name
The domain name to be registered
years
Number of years to register
Returns the following information:
- Whether or not the domain was renewed successfully
- Whether or not ... | [
"def",
"create",
"(",
"domain_name",
",",
"years",
",",
"*",
"*",
"kwargs",
")",
":",
"idn_codes",
"=",
"(",
"'afr'",
",",
"'alb'",
",",
"'ara'",
",",
"'arg'",
",",
"'arm'",
",",
"'asm'",
",",
"'ast'",
",",
"'ave'",
",",
"'awa'",
",",
"'aze'",
",",... | Try to register the specified domain name
domain_name
The domain name to be registered
years
Number of years to register
Returns the following information:
- Whether or not the domain was renewed successfully
- Whether or not WhoisGuard is enabled
- Whether or not registratio... | [
"Try",
"to",
"register",
"the",
"specified",
"domain",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L123-L209 | train |
saltstack/salt | salt/modules/namecheap_domains.py | check | def check(*domains_to_check):
'''
Checks the availability of domains
domains_to_check
array of strings List of domains to check
Returns a dictionary mapping the each domain name to a boolean denoting
whether or not it is available.
CLI Example:
.. code-block:: bash
salt... | python | def check(*domains_to_check):
'''
Checks the availability of domains
domains_to_check
array of strings List of domains to check
Returns a dictionary mapping the each domain name to a boolean denoting
whether or not it is available.
CLI Example:
.. code-block:: bash
salt... | [
"def",
"check",
"(",
"*",
"domains_to_check",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.domains.check'",
")",
"opts",
"[",
"'DomainList'",
"]",
"=",
"','",
".",
"join",
"(",
"domains_to_check",
")",
"r... | Checks the availability of domains
domains_to_check
array of strings List of domains to check
Returns a dictionary mapping the each domain name to a boolean denoting
whether or not it is available.
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.check domai... | [
"Checks",
"the",
"availability",
"of",
"domains"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L212-L241 | train |
saltstack/salt | salt/modules/namecheap_domains.py | get_info | def get_info(domain_name):
'''
Returns information about the requested domain
returns a dictionary of information about the domain_name
domain_name
string Domain name to get information about
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_info my-d... | python | def get_info(domain_name):
'''
Returns information about the requested domain
returns a dictionary of information about the domain_name
domain_name
string Domain name to get information about
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_info my-d... | [
"def",
"get_info",
"(",
"domain_name",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.domains.getinfo'",
")",
"opts",
"[",
"'DomainName'",
"]",
"=",
"domain_name",
"response_xml",
"=",
"salt",
".",
"utils",
"... | Returns information about the requested domain
returns a dictionary of information about the domain_name
domain_name
string Domain name to get information about
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_info my-domain-name | [
"Returns",
"information",
"about",
"the",
"requested",
"domain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L244-L269 | train |
saltstack/salt | salt/modules/namecheap_domains.py | get_tld_list | def get_tld_list():
'''
Returns a list of TLDs as objects
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_tld_list
'''
response_xml = salt.utils.namecheap.get_request(salt.utils.namecheap.get_opts('namecheap.domains.gettldlist'))
if response_xml is None:... | python | def get_tld_list():
'''
Returns a list of TLDs as objects
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_tld_list
'''
response_xml = salt.utils.namecheap.get_request(salt.utils.namecheap.get_opts('namecheap.domains.gettldlist'))
if response_xml is None:... | [
"def",
"get_tld_list",
"(",
")",
":",
"response_xml",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_request",
"(",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.domains.gettldlist'",
")",
")",
"if",
"response_xml",
"is",
... | Returns a list of TLDs as objects
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_tld_list | [
"Returns",
"a",
"list",
"of",
"TLDs",
"as",
"objects"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L272-L301 | train |
saltstack/salt | salt/modules/namecheap_domains.py | get_list | def get_list(list_type=None,
search_term=None,
page=None,
page_size=None,
sort_by=None):
'''
Returns a list of domains for the particular user as a list of objects
offset by ``page`` length of ``page_size``
list_type : ALL
One of ``ALL``, ``EX... | python | def get_list(list_type=None,
search_term=None,
page=None,
page_size=None,
sort_by=None):
'''
Returns a list of domains for the particular user as a list of objects
offset by ``page`` length of ``page_size``
list_type : ALL
One of ``ALL``, ``EX... | [
"def",
"get_list",
"(",
"list_type",
"=",
"None",
",",
"search_term",
"=",
"None",
",",
"page",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"sort_by",
"=",
"None",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"... | Returns a list of domains for the particular user as a list of objects
offset by ``page`` length of ``page_size``
list_type : ALL
One of ``ALL``, ``EXPIRING``, ``EXPIRED``
search_term
Keyword to look for on the domain list
page : 1
Number of result page to return
page_siz... | [
"Returns",
"a",
"list",
"of",
"domains",
"for",
"the",
"particular",
"user",
"as",
"a",
"list",
"of",
"objects",
"offset",
"by",
"page",
"length",
"of",
"page_size"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L304-L376 | train |
saltstack/salt | salt/pillar/reclass_adapter.py | ext_pillar | def ext_pillar(minion_id, pillar, **kwargs):
'''
Obtain the Pillar data from **reclass** for the given ``minion_id``.
'''
# If reclass is installed, __virtual__ put it onto the search path, so we
# don't need to protect against ImportError:
# pylint: disable=3rd-party-module-not-gated
from ... | python | def ext_pillar(minion_id, pillar, **kwargs):
'''
Obtain the Pillar data from **reclass** for the given ``minion_id``.
'''
# If reclass is installed, __virtual__ put it onto the search path, so we
# don't need to protect against ImportError:
# pylint: disable=3rd-party-module-not-gated
from ... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"*",
"kwargs",
")",
":",
"# If reclass is installed, __virtual__ put it onto the search path, so we",
"# don't need to protect against ImportError:",
"# pylint: disable=3rd-party-module-not-gated",
"from",
"reclass",
"... | Obtain the Pillar data from **reclass** for the given ``minion_id``. | [
"Obtain",
"the",
"Pillar",
"data",
"from",
"**",
"reclass",
"**",
"for",
"the",
"given",
"minion_id",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/reclass_adapter.py#L93-L135 | train |
saltstack/salt | salt/modules/zcbuildout.py | _set_status | def _set_status(m,
comment=INVALID_RESPONSE,
status=False,
out=None):
'''
Assign status data to a dict.
'''
m['out'] = out
m['status'] = status
m['logs'] = LOG.messages[:]
m['logs_by_level'] = LOG.by_level.copy()
outlog, outlog_by_level = '... | python | def _set_status(m,
comment=INVALID_RESPONSE,
status=False,
out=None):
'''
Assign status data to a dict.
'''
m['out'] = out
m['status'] = status
m['logs'] = LOG.messages[:]
m['logs_by_level'] = LOG.by_level.copy()
outlog, outlog_by_level = '... | [
"def",
"_set_status",
"(",
"m",
",",
"comment",
"=",
"INVALID_RESPONSE",
",",
"status",
"=",
"False",
",",
"out",
"=",
"None",
")",
":",
"m",
"[",
"'out'",
"]",
"=",
"out",
"m",
"[",
"'status'",
"]",
"=",
"status",
"m",
"[",
"'logs'",
"]",
"=",
"... | Assign status data to a dict. | [
"Assign",
"status",
"data",
"to",
"a",
"dict",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L209-L248 | train |
saltstack/salt | salt/modules/zcbuildout.py | _invalid | def _invalid(m, comment=INVALID_RESPONSE, out=None):
'''
Return invalid status.
'''
return _set_status(m, status=False, comment=comment, out=out) | python | def _invalid(m, comment=INVALID_RESPONSE, out=None):
'''
Return invalid status.
'''
return _set_status(m, status=False, comment=comment, out=out) | [
"def",
"_invalid",
"(",
"m",
",",
"comment",
"=",
"INVALID_RESPONSE",
",",
"out",
"=",
"None",
")",
":",
"return",
"_set_status",
"(",
"m",
",",
"status",
"=",
"False",
",",
"comment",
"=",
"comment",
",",
"out",
"=",
"out",
")"
] | Return invalid status. | [
"Return",
"invalid",
"status",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L251-L255 | train |
saltstack/salt | salt/modules/zcbuildout.py | _valid | def _valid(m, comment=VALID_RESPONSE, out=None):
'''
Return valid status.
'''
return _set_status(m, status=True, comment=comment, out=out) | python | def _valid(m, comment=VALID_RESPONSE, out=None):
'''
Return valid status.
'''
return _set_status(m, status=True, comment=comment, out=out) | [
"def",
"_valid",
"(",
"m",
",",
"comment",
"=",
"VALID_RESPONSE",
",",
"out",
"=",
"None",
")",
":",
"return",
"_set_status",
"(",
"m",
",",
"status",
"=",
"True",
",",
"comment",
"=",
"comment",
",",
"out",
"=",
"out",
")"
] | Return valid status. | [
"Return",
"valid",
"status",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L258-L262 | train |
saltstack/salt | salt/modules/zcbuildout.py | _Popen | def _Popen(command,
output=False,
directory='.',
runas=None,
env=(),
exitcode=0,
use_vt=False,
loglevel=None):
'''
Run a command.
output
return output if true
directory
directory to execute in
runas
... | python | def _Popen(command,
output=False,
directory='.',
runas=None,
env=(),
exitcode=0,
use_vt=False,
loglevel=None):
'''
Run a command.
output
return output if true
directory
directory to execute in
runas
... | [
"def",
"_Popen",
"(",
"command",
",",
"output",
"=",
"False",
",",
"directory",
"=",
"'.'",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"(",
")",
",",
"exitcode",
"=",
"0",
",",
"use_vt",
"=",
"False",
",",
"loglevel",
"=",
"None",
")",
":",
"ret... | Run a command.
output
return output if true
directory
directory to execute in
runas
user used to run buildout as
env
environment variables to set when running
exitcode
fails if cmd does not return this exit code
(set to None to disable check)
... | [
"Run",
"a",
"command",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L265-L312 | train |
saltstack/salt | salt/modules/zcbuildout.py | _find_cfgs | def _find_cfgs(path, cfgs=None):
'''
Find all buildout configs in a subdirectory.
only buildout.cfg and etc/buildout.cfg are valid in::
path
directory where to start to search
cfg
a optional list to append to
.
├── buildout.cfg
├── etc
... | python | def _find_cfgs(path, cfgs=None):
'''
Find all buildout configs in a subdirectory.
only buildout.cfg and etc/buildout.cfg are valid in::
path
directory where to start to search
cfg
a optional list to append to
.
├── buildout.cfg
├── etc
... | [
"def",
"_find_cfgs",
"(",
"path",
",",
"cfgs",
"=",
"None",
")",
":",
"ignored",
"=",
"[",
"'var'",
",",
"'parts'",
"]",
"dirs",
"=",
"[",
"]",
"if",
"not",
"cfgs",
":",
"cfgs",
"=",
"[",
"]",
"for",
"i",
"in",
"os",
".",
"listdir",
"(",
"path"... | Find all buildout configs in a subdirectory.
only buildout.cfg and etc/buildout.cfg are valid in::
path
directory where to start to search
cfg
a optional list to append to
.
├── buildout.cfg
├── etc
│ └── buildout.cfg
├── foo
... | [
"Find",
"all",
"buildout",
"configs",
"in",
"a",
"subdirectory",
".",
"only",
"buildout",
".",
"cfg",
"and",
"etc",
"/",
"buildout",
".",
"cfg",
"are",
"valid",
"in",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L353-L388 | train |
saltstack/salt | salt/modules/zcbuildout.py | _get_bootstrap_content | def _get_bootstrap_content(directory='.'):
'''
Get the current bootstrap.py script content
'''
try:
with salt.utils.files.fopen(os.path.join(
os.path.abspath(directory),
'bootstrap.py')) as fic:
oldcontent = salt.utils.s... | python | def _get_bootstrap_content(directory='.'):
'''
Get the current bootstrap.py script content
'''
try:
with salt.utils.files.fopen(os.path.join(
os.path.abspath(directory),
'bootstrap.py')) as fic:
oldcontent = salt.utils.s... | [
"def",
"_get_bootstrap_content",
"(",
"directory",
"=",
"'.'",
")",
":",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"directory",
")",
",",
... | Get the current bootstrap.py script content | [
"Get",
"the",
"current",
"bootstrap",
".",
"py",
"script",
"content"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L391-L404 | train |
saltstack/salt | salt/modules/zcbuildout.py | _get_buildout_ver | def _get_buildout_ver(directory='.'):
'''Check for buildout versions.
In any cases, check for a version pinning
Also check for buildout.dumppickedversions which is buildout1 specific
Also check for the version targeted by the local bootstrap file
Take as default buildout2
directory
dir... | python | def _get_buildout_ver(directory='.'):
'''Check for buildout versions.
In any cases, check for a version pinning
Also check for buildout.dumppickedversions which is buildout1 specific
Also check for the version targeted by the local bootstrap file
Take as default buildout2
directory
dir... | [
"def",
"_get_buildout_ver",
"(",
"directory",
"=",
"'.'",
")",
":",
"directory",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"directory",
")",
"buildoutver",
"=",
"2",
"try",
":",
"files",
"=",
"_find_cfgs",
"(",
"directory",
")",
"for",
"f",
"in",
"f... | Check for buildout versions.
In any cases, check for a version pinning
Also check for buildout.dumppickedversions which is buildout1 specific
Also check for the version targeted by the local bootstrap file
Take as default buildout2
directory
directory to execute in | [
"Check",
"for",
"buildout",
"versions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L407-L441 | train |
saltstack/salt | salt/modules/zcbuildout.py | _get_bootstrap_url | def _get_bootstrap_url(directory):
'''
Get the most appropriate download URL for the bootstrap script.
directory
directory to execute in
'''
v = _get_buildout_ver(directory)
return _URL_VERSIONS.get(v, _URL_VERSIONS[DEFAULT_VER]) | python | def _get_bootstrap_url(directory):
'''
Get the most appropriate download URL for the bootstrap script.
directory
directory to execute in
'''
v = _get_buildout_ver(directory)
return _URL_VERSIONS.get(v, _URL_VERSIONS[DEFAULT_VER]) | [
"def",
"_get_bootstrap_url",
"(",
"directory",
")",
":",
"v",
"=",
"_get_buildout_ver",
"(",
"directory",
")",
"return",
"_URL_VERSIONS",
".",
"get",
"(",
"v",
",",
"_URL_VERSIONS",
"[",
"DEFAULT_VER",
"]",
")"
] | Get the most appropriate download URL for the bootstrap script.
directory
directory to execute in | [
"Get",
"the",
"most",
"appropriate",
"download",
"URL",
"for",
"the",
"bootstrap",
"script",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L444-L453 | train |
saltstack/salt | salt/modules/zcbuildout.py | upgrade_bootstrap | def upgrade_bootstrap(directory='.',
onlyif=None,
unless=None,
runas=None,
env=(),
offline=False,
buildout_ver=None):
'''
Upgrade current bootstrap.py with the last released one.
... | python | def upgrade_bootstrap(directory='.',
onlyif=None,
unless=None,
runas=None,
env=(),
offline=False,
buildout_ver=None):
'''
Upgrade current bootstrap.py with the last released one.
... | [
"def",
"upgrade_bootstrap",
"(",
"directory",
"=",
"'.'",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"(",
")",
",",
"offline",
"=",
"False",
",",
"buildout_ver",
"=",
"None",
")",
":",
"if",
... | Upgrade current bootstrap.py with the last released one.
Indeed, when we first run a buildout, a common source of problem
is to have a locally stale bootstrap, we just try to grab a new copy
directory
directory to execute in
offline
are we executing buildout in offline mode
build... | [
"Upgrade",
"current",
"bootstrap",
".",
"py",
"with",
"the",
"last",
"released",
"one",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L468-L553 | train |
saltstack/salt | salt/modules/zcbuildout.py | bootstrap | def bootstrap(directory='.',
config='buildout.cfg',
python=sys.executable,
onlyif=None,
unless=None,
runas=None,
env=(),
distribute=None,
buildout_ver=None,
test_release=False,
off... | python | def bootstrap(directory='.',
config='buildout.cfg',
python=sys.executable,
onlyif=None,
unless=None,
runas=None,
env=(),
distribute=None,
buildout_ver=None,
test_release=False,
off... | [
"def",
"bootstrap",
"(",
"directory",
"=",
"'.'",
",",
"config",
"=",
"'buildout.cfg'",
",",
"python",
"=",
"sys",
".",
"executable",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"(",
")",
",",
... | Run the buildout bootstrap dance (python bootstrap.py).
directory
directory to execute in
config
alternative buildout configuration file to use
runas
User used to run buildout as
env
environment variables to set when running
buildout_ver
force a specific ... | [
"Run",
"the",
"buildout",
"bootstrap",
"dance",
"(",
"python",
"bootstrap",
".",
"py",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L557-L764 | train |
saltstack/salt | salt/modules/zcbuildout.py | run_buildout | def run_buildout(directory='.',
config='buildout.cfg',
parts=None,
onlyif=None,
unless=None,
offline=False,
newest=True,
runas=None,
env=(),
verbose=False,
... | python | def run_buildout(directory='.',
config='buildout.cfg',
parts=None,
onlyif=None,
unless=None,
offline=False,
newest=True,
runas=None,
env=(),
verbose=False,
... | [
"def",
"run_buildout",
"(",
"directory",
"=",
"'.'",
",",
"config",
"=",
"'buildout.cfg'",
",",
"parts",
"=",
"None",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"offline",
"=",
"False",
",",
"newest",
"=",
"True",
",",
"runas",
"=",
... | Run a buildout in a directory.
directory
directory to execute in
config
alternative buildout configuration file to use
offline
are we executing buildout in offline mode
runas
user used to run buildout as
env
environment variables to set when running
... | [
"Run",
"a",
"buildout",
"in",
"a",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L768-L870 | train |
saltstack/salt | salt/modules/zcbuildout.py | buildout | def buildout(directory='.',
config='buildout.cfg',
parts=None,
runas=None,
env=(),
buildout_ver=None,
test_release=False,
distribute=None,
new_st=None,
offline=False,
newest=False,
... | python | def buildout(directory='.',
config='buildout.cfg',
parts=None,
runas=None,
env=(),
buildout_ver=None,
test_release=False,
distribute=None,
new_st=None,
offline=False,
newest=False,
... | [
"def",
"buildout",
"(",
"directory",
"=",
"'.'",
",",
"config",
"=",
"'buildout.cfg'",
",",
"parts",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"(",
")",
",",
"buildout_ver",
"=",
"None",
",",
"test_release",
"=",
"False",
",",
"distribut... | Run buildout in a directory.
directory
directory to execute in
config
buildout config to use
parts
specific buildout parts to run
runas
user used to run buildout as
env
environment variables to set when running
buildout_ver
force a specific b... | [
"Run",
"buildout",
"in",
"a",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L922-L1024 | train |
saltstack/salt | salt/pillar/sqlite3.py | ext_pillar | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLite3, merge and return as a dict
'''
return SQLite3ExtPillar().fetch(minion_id, pillar, *args, **kwargs) | python | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLite3, merge and return as a dict
'''
return SQLite3ExtPillar().fetch(minion_id, pillar, *args, **kwargs) | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"SQLite3ExtPillar",
"(",
")",
".",
"fetch",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | Execute queries against SQLite3, merge and return as a dict | [
"Execute",
"queries",
"against",
"SQLite3",
"merge",
"and",
"return",
"as",
"a",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlite3.py#L110-L117 | train |
saltstack/salt | salt/pillar/http_json.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url,
with_grains=False):
'''
Read pillar data from HTTP response.
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:retu... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url,
with_grains=False):
'''
Read pillar data from HTTP response.
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:retu... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"url",
",",
"with_grains",
"=",
"False",
")",
":",
"url",
"=",
"url",
".",
"replace",
"(",
"'%s'",
",",
"_quote",
"(",
"minion_id",
")",
")",
"grain_pattern",
"=",
"r'<(?... | Read pillar data from HTTP response.
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:return: A dictionary of the pillar data to add.
:rtype: dict | [
"Read",
"pillar",
"data",
"from",
"HTTP",
"response",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/http_json.py#L66-L109 | train |
saltstack/salt | salt/modules/nxos.py | check_password | def check_password(username, password, encrypted=False, **kwargs):
'''
Verify user password.
username
Username on which to perform password check
password
Password to check
encrypted
Whether or not the password is encrypted
Default: False
.. code-block: bash
... | python | def check_password(username, password, encrypted=False, **kwargs):
'''
Verify user password.
username
Username on which to perform password check
password
Password to check
encrypted
Whether or not the password is encrypted
Default: False
.. code-block: bash
... | [
"def",
"check_password",
"(",
"username",
",",
"password",
",",
"encrypted",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"hash_algorithms",
"=",
"{",
"'1'",
":",
"'md5'",
",",
"'2a'",
":",
"'blowfish'",
",",
"'5'",
":",
"'sha256'",
",",
"'6'",
":"... | Verify user password.
username
Username on which to perform password check
password
Password to check
encrypted
Whether or not the password is encrypted
Default: False
.. code-block: bash
salt '*' nxos.cmd check_password username=admin password=admin
... | [
"Verify",
"user",
"password",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L143-L181 | train |
saltstack/salt | salt/modules/nxos.py | cmd | def cmd(command, *args, **kwargs):
'''
NOTE: This function is preserved for backwards compatibilty. This allows
commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
or
salt '*' nxos.<function>
command
function from `salt.modules.nxo... | python | def cmd(command, *args, **kwargs):
'''
NOTE: This function is preserved for backwards compatibilty. This allows
commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
or
salt '*' nxos.<function>
command
function from `salt.modules.nxo... | [
"def",
"cmd",
"(",
"command",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"k",
"in",
"list",
"(",
"kwargs",
")",
":",
"if",
"k",
".",
"startswith",
"(",
"'__pub_'",
")",
":",
"kwargs",
".",
"pop",
"(",
"k",
")",
"local_command",
... | NOTE: This function is preserved for backwards compatibilty. This allows
commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
or
salt '*' nxos.<function>
command
function from `salt.modules.nxos` to run
args
positional args to ... | [
"NOTE",
":",
"This",
"function",
"is",
"preserved",
"for",
"backwards",
"compatibilty",
".",
"This",
"allows",
"commands",
"to",
"be",
"executed",
"using",
"either",
"of",
"the",
"following",
"syntactic",
"forms",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L195-L228 | train |
saltstack/salt | salt/modules/nxos.py | get_roles | def get_roles(username, **kwargs):
'''
Get roles assigned to a username.
.. code-block: bash
salt '*' nxos.cmd get_roles username=admin
'''
user = get_user(username)
if not user:
return []
command = 'show user-account {0}'.format(username)
info = ''
info = show(comm... | python | def get_roles(username, **kwargs):
'''
Get roles assigned to a username.
.. code-block: bash
salt '*' nxos.cmd get_roles username=admin
'''
user = get_user(username)
if not user:
return []
command = 'show user-account {0}'.format(username)
info = ''
info = show(comm... | [
"def",
"get_roles",
"(",
"username",
",",
"*",
"*",
"kwargs",
")",
":",
"user",
"=",
"get_user",
"(",
"username",
")",
"if",
"not",
"user",
":",
"return",
"[",
"]",
"command",
"=",
"'show user-account {0}'",
".",
"format",
"(",
"username",
")",
"info",
... | Get roles assigned to a username.
.. code-block: bash
salt '*' nxos.cmd get_roles username=admin | [
"Get",
"roles",
"assigned",
"to",
"a",
"username",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L247-L268 | train |
saltstack/salt | salt/modules/nxos.py | get_user | def get_user(username, **kwargs):
'''
Get username line from switch.
.. code-block: bash
salt '*' nxos.cmd get_user username=admin
'''
command = 'show run | include "^username {0} password 5 "'.format(username)
info = ''
info = show(command, **kwargs)
if isinstance(info, list):... | python | def get_user(username, **kwargs):
'''
Get username line from switch.
.. code-block: bash
salt '*' nxos.cmd get_user username=admin
'''
command = 'show run | include "^username {0} password 5 "'.format(username)
info = ''
info = show(command, **kwargs)
if isinstance(info, list):... | [
"def",
"get_user",
"(",
"username",
",",
"*",
"*",
"kwargs",
")",
":",
"command",
"=",
"'show run | include \"^username {0} password 5 \"'",
".",
"format",
"(",
"username",
")",
"info",
"=",
"''",
"info",
"=",
"show",
"(",
"command",
",",
"*",
"*",
"kwargs",... | Get username line from switch.
.. code-block: bash
salt '*' nxos.cmd get_user username=admin | [
"Get",
"username",
"line",
"from",
"switch",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L271-L284 | train |
saltstack/salt | salt/modules/nxos.py | grains | def grains(**kwargs):
'''
Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains
'''
if not DEVICE_DETAILS['grains_cache']:
ret = salt.utils.nxos.system_info(show_ver(**kwargs))
log.debug(ret)
DEVICE_DETAILS['grains_cache'].update(ret['nxos'])
retur... | python | def grains(**kwargs):
'''
Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains
'''
if not DEVICE_DETAILS['grains_cache']:
ret = salt.utils.nxos.system_info(show_ver(**kwargs))
log.debug(ret)
DEVICE_DETAILS['grains_cache'].update(ret['nxos'])
retur... | [
"def",
"grains",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"DEVICE_DETAILS",
"[",
"'grains_cache'",
"]",
":",
"ret",
"=",
"salt",
".",
"utils",
".",
"nxos",
".",
"system_info",
"(",
"show_ver",
"(",
"*",
"*",
"kwargs",
")",
")",
"log",
".",
"... | Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains | [
"Get",
"grains",
"for",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L287-L299 | train |
saltstack/salt | salt/modules/nxos.py | sendline | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitray commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send confi... | python | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitray commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send confi... | [
"def",
"sendline",
"(",
"command",
",",
"method",
"=",
"'cli_show_ascii'",
",",
"*",
"*",
"kwargs",
")",
":",
"smethods",
"=",
"[",
"'cli_show_ascii'",
",",
"'cli_show'",
",",
"'cli_conf'",
"]",
"if",
"method",
"not",
"in",
"smethods",
":",
"msg",
"=",
"... | Send arbitray commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
Defaults to ``cli_show_ascii`... | [
"Send",
"arbitray",
"commands",
"to",
"the",
"NX",
"-",
"OS",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L314-L345 | train |
saltstack/salt | salt/modules/nxos.py | show | def show(commands, raw_text=True, **kwargs):
'''
Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
NOTE: raw_text option is ignored for SSH proxy minion. Data is
... | python | def show(commands, raw_text=True, **kwargs):
'''
Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
NOTE: raw_text option is ignored for SSH proxy minion. Data is
... | [
"def",
"show",
"(",
"commands",
",",
"raw_text",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"raw_text",
",",
"bool",
")",
":",
"msg",
"=",
"\"\"\"\n INPUT ERROR: Second argument 'raw_text' must be either True or False\n ... | Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
NOTE: raw_text option is ignored for SSH proxy minion. Data is
returned unstructured.
CLI Example:
.. code-b... | [
"Execute",
"one",
"or",
"more",
"show",
"(",
"non",
"-",
"configuration",
")",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L348-L388 | train |
saltstack/salt | salt/modules/nxos.py | show_ver | def show_ver(**kwargs):
'''
Shortcut to run `show version` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_ver
'''
command = 'show version'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | python | def show_ver(**kwargs):
'''
Shortcut to run `show version` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_ver
'''
command = 'show version'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | [
"def",
"show_ver",
"(",
"*",
"*",
"kwargs",
")",
":",
"command",
"=",
"'show version'",
"info",
"=",
"''",
"info",
"=",
"show",
"(",
"command",
",",
"*",
"*",
"kwargs",
")",
"if",
"isinstance",
"(",
"info",
",",
"list",
")",
":",
"info",
"=",
"info... | Shortcut to run `show version` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_ver | [
"Shortcut",
"to",
"run",
"show",
"version",
"on",
"the",
"NX",
"-",
"OS",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L391-L404 | train |
saltstack/salt | salt/modules/nxos.py | show_run | def show_run(**kwargs):
'''
Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run
'''
command = 'show running-config'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | python | def show_run(**kwargs):
'''
Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run
'''
command = 'show running-config'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | [
"def",
"show_run",
"(",
"*",
"*",
"kwargs",
")",
":",
"command",
"=",
"'show running-config'",
"info",
"=",
"''",
"info",
"=",
"show",
"(",
"command",
",",
"*",
"*",
"kwargs",
")",
"if",
"isinstance",
"(",
"info",
",",
"list",
")",
":",
"info",
"=",
... | Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run | [
"Shortcut",
"to",
"run",
"show",
"running",
"-",
"config",
"on",
"the",
"NX",
"-",
"OS",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L407-L420 | train |
saltstack/salt | salt/modules/nxos.py | config | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to t... | python | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to t... | [
"def",
"config",
"(",
"commands",
"=",
"None",
",",
"config_file",
"=",
"None",
",",
"template_engine",
"=",
"'jinja'",
",",
"context",
"=",
"None",
",",
"defaults",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"initia... | Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to the switch. It
will take either a string or a list and prepend the necessary commands
to put the session into config mode.
.. warning::
All the commands will be applied directly to ... | [
"Configures",
"the",
"Nexus",
"switch",
"with",
"the",
"specified",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L459-L556 | train |
saltstack/salt | salt/modules/nxos.py | delete_config | def delete_config(lines, **kwargs):
'''
Delete one or more config lines to the switch running config.
lines
Configuration lines to remove.
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
... | python | def delete_config(lines, **kwargs):
'''
Delete one or more config lines to the switch running config.
lines
Configuration lines to remove.
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
... | [
"def",
"delete_config",
"(",
"lines",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"lines",
",",
"list",
")",
":",
"lines",
"=",
"[",
"lines",
"]",
"for",
"i",
",",
"_",
"in",
"enumerate",
"(",
"lines",
")",
":",
"lines",
"[... | Delete one or more config lines to the switch running config.
lines
Configuration lines to remove.
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block:: bash... | [
"Delete",
"one",
"or",
"more",
"config",
"lines",
"to",
"the",
"switch",
"running",
"config",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L573-L604 | train |
saltstack/salt | salt/modules/nxos.py | set_password | def set_password(username,
password,
encrypted=False,
role=None,
crypt_salt=None,
algorithm='sha256',
**kwargs):
'''
Set users password on switch.
username
Username to configure
password
... | python | def set_password(username,
password,
encrypted=False,
role=None,
crypt_salt=None,
algorithm='sha256',
**kwargs):
'''
Set users password on switch.
username
Username to configure
password
... | [
"def",
"set_password",
"(",
"username",
",",
"password",
",",
"encrypted",
"=",
"False",
",",
"role",
"=",
"None",
",",
"crypt_salt",
"=",
"None",
",",
"algorithm",
"=",
"'sha256'",
",",
"*",
"*",
"kwargs",
")",
":",
"password_line",
"=",
"get_user",
"("... | Set users password on switch.
username
Username to configure
password
Password to configure for username
encrypted
Whether or not to encrypt the password
Default: False
role
Configure role for the username
Default: None
crypt_salt
Configur... | [
"Set",
"users",
"password",
"on",
"switch",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L667-L723 | train |
saltstack/salt | salt/modules/nxos.py | set_role | def set_role(username, role, **kwargs):
'''
Assign role to username.
username
Username for role configuration
role
Configure role for username
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startu... | python | def set_role(username, role, **kwargs):
'''
Assign role to username.
username
Username for role configuration
role
Configure role for username
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startu... | [
"def",
"set_role",
"(",
"username",
",",
"role",
",",
"*",
"*",
"kwargs",
")",
":",
"role_line",
"=",
"'username {0} role {1}'",
".",
"format",
"(",
"username",
",",
"role",
")",
"return",
"config",
"(",
"role_line",
",",
"*",
"*",
"kwargs",
")"
] | Assign role to username.
username
Username for role configuration
role
Configure role for username
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code... | [
"Assign",
"role",
"to",
"username",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L726-L746 | train |
saltstack/salt | salt/modules/nxos.py | unset_role | def unset_role(username, role, **kwargs):
'''
Remove role from username.
username
Username for role removal
role
Role to remove
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration... | python | def unset_role(username, role, **kwargs):
'''
Remove role from username.
username
Username for role removal
role
Role to remove
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration... | [
"def",
"unset_role",
"(",
"username",
",",
"role",
",",
"*",
"*",
"kwargs",
")",
":",
"role_line",
"=",
"'no username {0} role {1}'",
".",
"format",
"(",
"username",
",",
"role",
")",
"return",
"config",
"(",
"role_line",
",",
"*",
"*",
"kwargs",
")"
] | Remove role from username.
username
Username for role removal
role
Role to remove
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block:: bash
... | [
"Remove",
"role",
"from",
"username",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L749-L769 | train |
saltstack/salt | salt/modules/nxos.py | _configure_device | def _configure_device(commands, **kwargs):
'''
Helper function to send configuration commands to the device over a
proxy minion or native minion using NX-API or SSH.
'''
if salt.utils.platform.is_proxy():
return __proxy__['nxos.proxy_config'](commands, **kwargs)
else:
return _nxa... | python | def _configure_device(commands, **kwargs):
'''
Helper function to send configuration commands to the device over a
proxy minion or native minion using NX-API or SSH.
'''
if salt.utils.platform.is_proxy():
return __proxy__['nxos.proxy_config'](commands, **kwargs)
else:
return _nxa... | [
"def",
"_configure_device",
"(",
"commands",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_proxy",
"(",
")",
":",
"return",
"__proxy__",
"[",
"'nxos.proxy_config'",
"]",
"(",
"commands",
",",
"*",
"*",
"kwargs",... | Helper function to send configuration commands to the device over a
proxy minion or native minion using NX-API or SSH. | [
"Helper",
"function",
"to",
"send",
"configuration",
"commands",
"to",
"the",
"device",
"over",
"a",
"proxy",
"minion",
"or",
"native",
"minion",
"using",
"NX",
"-",
"API",
"or",
"SSH",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L775-L783 | train |
saltstack/salt | salt/modules/nxos.py | _nxapi_config | def _nxapi_config(commands, methods='cli_conf', bsb_arg=None, **kwargs):
'''
Helper function to send configuration commands using NX-API.
'''
api_kwargs = __salt__['config.get']('nxos', {})
api_kwargs.update(**kwargs)
if not isinstance(commands, list):
commands = [commands]
try:
... | python | def _nxapi_config(commands, methods='cli_conf', bsb_arg=None, **kwargs):
'''
Helper function to send configuration commands using NX-API.
'''
api_kwargs = __salt__['config.get']('nxos', {})
api_kwargs.update(**kwargs)
if not isinstance(commands, list):
commands = [commands]
try:
... | [
"def",
"_nxapi_config",
"(",
"commands",
",",
"methods",
"=",
"'cli_conf'",
",",
"bsb_arg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"api_kwargs",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'nxos'",
",",
"{",
"}",
")",
"api_kwargs",
".",
"... | Helper function to send configuration commands using NX-API. | [
"Helper",
"function",
"to",
"send",
"configuration",
"commands",
"using",
"NX",
"-",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L786-L806 | train |
saltstack/salt | salt/modules/nxos.py | _nxapi_request | def _nxapi_request(commands,
method='cli_conf',
**kwargs):
'''
Helper function to send exec and config requests over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured o... | python | def _nxapi_request(commands,
method='cli_conf',
**kwargs):
'''
Helper function to send exec and config requests over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured o... | [
"def",
"_nxapi_request",
"(",
"commands",
",",
"method",
"=",
"'cli_conf'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_proxy",
"(",
")",
":",
"return",
"__proxy__",
"[",
"'nxos._nxapi_request'",
"]",
"(",
"co... | Helper function to send exec and config requests over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to t... | [
"Helper",
"function",
"to",
"send",
"exec",
"and",
"config",
"requests",
"over",
"NX",
"-",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L809-L829 | train |
saltstack/salt | salt/utils/gzip_util.py | compress | def compress(data, compresslevel=9):
'''
Returns the data compressed at gzip level compression.
'''
buf = BytesIO()
with open_fileobj(buf, 'wb', compresslevel) as ogz:
if six.PY3 and not isinstance(data, bytes):
data = data.encode(__salt_system_encoding__)
ogz.write(data)... | python | def compress(data, compresslevel=9):
'''
Returns the data compressed at gzip level compression.
'''
buf = BytesIO()
with open_fileobj(buf, 'wb', compresslevel) as ogz:
if six.PY3 and not isinstance(data, bytes):
data = data.encode(__salt_system_encoding__)
ogz.write(data)... | [
"def",
"compress",
"(",
"data",
",",
"compresslevel",
"=",
"9",
")",
":",
"buf",
"=",
"BytesIO",
"(",
")",
"with",
"open_fileobj",
"(",
"buf",
",",
"'wb'",
",",
"compresslevel",
")",
"as",
"ogz",
":",
"if",
"six",
".",
"PY3",
"and",
"not",
"isinstanc... | Returns the data compressed at gzip level compression. | [
"Returns",
"the",
"data",
"compressed",
"at",
"gzip",
"level",
"compression",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gzip_util.py#L54-L64 | train |
saltstack/salt | salt/utils/gzip_util.py | compress_file | def compress_file(fh_, compresslevel=9, chunk_size=1048576):
'''
Generator that reads chunk_size bytes at a time from a file/filehandle and
yields the compressed result of each read.
.. note::
Each chunk is compressed separately. They cannot be stitched together
to form a compressed fil... | python | def compress_file(fh_, compresslevel=9, chunk_size=1048576):
'''
Generator that reads chunk_size bytes at a time from a file/filehandle and
yields the compressed result of each read.
.. note::
Each chunk is compressed separately. They cannot be stitched together
to form a compressed fil... | [
"def",
"compress_file",
"(",
"fh_",
",",
"compresslevel",
"=",
"9",
",",
"chunk_size",
"=",
"1048576",
")",
":",
"try",
":",
"bytes_read",
"=",
"int",
"(",
"chunk_size",
")",
"if",
"bytes_read",
"!=",
"chunk_size",
":",
"raise",
"ValueError",
"except",
"Va... | Generator that reads chunk_size bytes at a time from a file/filehandle and
yields the compressed result of each read.
.. note::
Each chunk is compressed separately. They cannot be stitched together
to form a compressed file. This function is designed to break up a file
into compressed c... | [
"Generator",
"that",
"reads",
"chunk_size",
"bytes",
"at",
"a",
"time",
"from",
"a",
"file",
"/",
"filehandle",
"and",
"yields",
"the",
"compressed",
"result",
"of",
"each",
"read",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gzip_util.py#L74-L106 | train |
saltstack/salt | salt/modules/systemd_service.py | _root | def _root(path, root):
'''
Relocate an absolute path to a new root directory.
'''
if root:
return os.path.join(root, os.path.relpath(path, os.path.sep))
else:
return path | python | def _root(path, root):
'''
Relocate an absolute path to a new root directory.
'''
if root:
return os.path.join(root, os.path.relpath(path, os.path.sep))
else:
return path | [
"def",
"_root",
"(",
"path",
",",
"root",
")",
":",
"if",
"root",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"path",
",",
"os",
".",
"path",
".",
"sep",
")",
")",
"else",
":",
"ret... | Relocate an absolute path to a new root directory. | [
"Relocate",
"an",
"absolute",
"path",
"to",
"a",
"new",
"root",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L73-L80 | train |
saltstack/salt | salt/modules/systemd_service.py | _canonical_unit_name | def _canonical_unit_name(name):
'''
Build a canonical unit name treating unit names without one
of the valid suffixes as a service.
'''
if not isinstance(name, six.string_types):
name = six.text_type(name)
if any(name.endswith(suffix) for suffix in VALID_UNIT_TYPES):
return name
... | python | def _canonical_unit_name(name):
'''
Build a canonical unit name treating unit names without one
of the valid suffixes as a service.
'''
if not isinstance(name, six.string_types):
name = six.text_type(name)
if any(name.endswith(suffix) for suffix in VALID_UNIT_TYPES):
return name
... | [
"def",
"_canonical_unit_name",
"(",
"name",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"six",
".",
"string_types",
")",
":",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"if",
"any",
"(",
"name",
".",
"endswith",
"(",
"suffix",
... | Build a canonical unit name treating unit names without one
of the valid suffixes as a service. | [
"Build",
"a",
"canonical",
"unit",
"name",
"treating",
"unit",
"names",
"without",
"one",
"of",
"the",
"valid",
"suffixes",
"as",
"a",
"service",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L83-L92 | train |
saltstack/salt | salt/modules/systemd_service.py | _check_available | def _check_available(name):
'''
Returns boolean telling whether or not the named service is available
'''
_status = _systemctl_status(name)
sd_version = salt.utils.systemd.version(__context__)
if sd_version is not None and sd_version >= 231:
# systemd 231 changed the output of "systemctl... | python | def _check_available(name):
'''
Returns boolean telling whether or not the named service is available
'''
_status = _systemctl_status(name)
sd_version = salt.utils.systemd.version(__context__)
if sd_version is not None and sd_version >= 231:
# systemd 231 changed the output of "systemctl... | [
"def",
"_check_available",
"(",
"name",
")",
":",
"_status",
"=",
"_systemctl_status",
"(",
"name",
")",
"sd_version",
"=",
"salt",
".",
"utils",
".",
"systemd",
".",
"version",
"(",
"__context__",
")",
"if",
"sd_version",
"is",
"not",
"None",
"and",
"sd_v... | Returns boolean telling whether or not the named service is available | [
"Returns",
"boolean",
"telling",
"whether",
"or",
"not",
"the",
"named",
"service",
"is",
"available"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L95-L125 | train |
saltstack/salt | salt/modules/systemd_service.py | _check_for_unit_changes | def _check_for_unit_changes(name):
'''
Check for modified/updated unit files, and run a daemon-reload if any are
found.
'''
contextkey = 'systemd._check_for_unit_changes.{0}'.format(name)
if contextkey not in __context__:
if _untracked_custom_unit_found(name) or _unit_file_changed(name):... | python | def _check_for_unit_changes(name):
'''
Check for modified/updated unit files, and run a daemon-reload if any are
found.
'''
contextkey = 'systemd._check_for_unit_changes.{0}'.format(name)
if contextkey not in __context__:
if _untracked_custom_unit_found(name) or _unit_file_changed(name):... | [
"def",
"_check_for_unit_changes",
"(",
"name",
")",
":",
"contextkey",
"=",
"'systemd._check_for_unit_changes.{0}'",
".",
"format",
"(",
"name",
")",
"if",
"contextkey",
"not",
"in",
"__context__",
":",
"if",
"_untracked_custom_unit_found",
"(",
"name",
")",
"or",
... | Check for modified/updated unit files, and run a daemon-reload if any are
found. | [
"Check",
"for",
"modified",
"/",
"updated",
"unit",
"files",
"and",
"run",
"a",
"daemon",
"-",
"reload",
"if",
"any",
"are",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L128-L138 | train |
saltstack/salt | salt/modules/systemd_service.py | _check_unmask | def _check_unmask(name, unmask, unmask_runtime, root=None):
'''
Common code for conditionally removing masks before making changes to a
service's state.
'''
if unmask:
unmask_(name, runtime=False, root=root)
if unmask_runtime:
unmask_(name, runtime=True, root=root) | python | def _check_unmask(name, unmask, unmask_runtime, root=None):
'''
Common code for conditionally removing masks before making changes to a
service's state.
'''
if unmask:
unmask_(name, runtime=False, root=root)
if unmask_runtime:
unmask_(name, runtime=True, root=root) | [
"def",
"_check_unmask",
"(",
"name",
",",
"unmask",
",",
"unmask_runtime",
",",
"root",
"=",
"None",
")",
":",
"if",
"unmask",
":",
"unmask_",
"(",
"name",
",",
"runtime",
"=",
"False",
",",
"root",
"=",
"root",
")",
"if",
"unmask_runtime",
":",
"unmas... | Common code for conditionally removing masks before making changes to a
service's state. | [
"Common",
"code",
"for",
"conditionally",
"removing",
"masks",
"before",
"making",
"changes",
"to",
"a",
"service",
"s",
"state",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L141-L149 | train |
saltstack/salt | salt/modules/systemd_service.py | _clear_context | def _clear_context():
'''
Remove context
'''
# Using list() here because modifying a dictionary during iteration will
# raise a RuntimeError.
for key in list(__context__):
try:
if key.startswith('systemd._systemctl_status.'):
__context__.pop(key)
excep... | python | def _clear_context():
'''
Remove context
'''
# Using list() here because modifying a dictionary during iteration will
# raise a RuntimeError.
for key in list(__context__):
try:
if key.startswith('systemd._systemctl_status.'):
__context__.pop(key)
excep... | [
"def",
"_clear_context",
"(",
")",
":",
"# Using list() here because modifying a dictionary during iteration will",
"# raise a RuntimeError.",
"for",
"key",
"in",
"list",
"(",
"__context__",
")",
":",
"try",
":",
"if",
"key",
".",
"startswith",
"(",
"'systemd._systemctl_s... | Remove context | [
"Remove",
"context"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L152-L163 | train |
saltstack/salt | salt/modules/systemd_service.py | _default_runlevel | def _default_runlevel():
'''
Try to figure out the default runlevel. It is kept in
/etc/init/rc-sysinit.conf, but can be overridden with entries
in /etc/inittab, or via the kernel command-line at boot
'''
# Try to get the "main" default. If this fails, throw up our
# hands and just guess "... | python | def _default_runlevel():
'''
Try to figure out the default runlevel. It is kept in
/etc/init/rc-sysinit.conf, but can be overridden with entries
in /etc/inittab, or via the kernel command-line at boot
'''
# Try to get the "main" default. If this fails, throw up our
# hands and just guess "... | [
"def",
"_default_runlevel",
"(",
")",
":",
"# Try to get the \"main\" default. If this fails, throw up our",
"# hands and just guess \"2\", because things are horribly broken",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/init/rc-sysinit.conf... | Try to figure out the default runlevel. It is kept in
/etc/init/rc-sysinit.conf, but can be overridden with entries
in /etc/inittab, or via the kernel command-line at boot | [
"Try",
"to",
"figure",
"out",
"the",
"default",
"runlevel",
".",
"It",
"is",
"kept",
"in",
"/",
"etc",
"/",
"init",
"/",
"rc",
"-",
"sysinit",
".",
"conf",
"but",
"can",
"be",
"overridden",
"with",
"entries",
"in",
"/",
"etc",
"/",
"inittab",
"or",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L166-L208 | train |
saltstack/salt | salt/modules/systemd_service.py | _get_systemd_services | def _get_systemd_services(root):
'''
Use os.listdir() to get all the unit files
'''
ret = set()
for path in SYSTEM_CONFIG_PATHS + (LOCAL_CONFIG_PATH,):
# Make sure user has access to the path, and if the path is a
# link it's likely that another entry in SYSTEM_CONFIG_PATHS
#... | python | def _get_systemd_services(root):
'''
Use os.listdir() to get all the unit files
'''
ret = set()
for path in SYSTEM_CONFIG_PATHS + (LOCAL_CONFIG_PATH,):
# Make sure user has access to the path, and if the path is a
# link it's likely that another entry in SYSTEM_CONFIG_PATHS
#... | [
"def",
"_get_systemd_services",
"(",
"root",
")",
":",
"ret",
"=",
"set",
"(",
")",
"for",
"path",
"in",
"SYSTEM_CONFIG_PATHS",
"+",
"(",
"LOCAL_CONFIG_PATH",
",",
")",
":",
"# Make sure user has access to the path, and if the path is a",
"# link it's likely that another ... | Use os.listdir() to get all the unit files | [
"Use",
"os",
".",
"listdir",
"()",
"to",
"get",
"all",
"the",
"unit",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L211-L229 | train |
saltstack/salt | salt/modules/systemd_service.py | _get_sysv_services | def _get_sysv_services(root, systemd_services=None):
'''
Use os.listdir() and os.access() to get all the initscripts
'''
initscript_path = _root(INITSCRIPT_PATH, root)
try:
sysv_services = os.listdir(initscript_path)
except OSError as exc:
if exc.errno == errno.ENOENT:
... | python | def _get_sysv_services(root, systemd_services=None):
'''
Use os.listdir() and os.access() to get all the initscripts
'''
initscript_path = _root(INITSCRIPT_PATH, root)
try:
sysv_services = os.listdir(initscript_path)
except OSError as exc:
if exc.errno == errno.ENOENT:
... | [
"def",
"_get_sysv_services",
"(",
"root",
",",
"systemd_services",
"=",
"None",
")",
":",
"initscript_path",
"=",
"_root",
"(",
"INITSCRIPT_PATH",
",",
"root",
")",
"try",
":",
"sysv_services",
"=",
"os",
".",
"listdir",
"(",
"initscript_path",
")",
"except",
... | Use os.listdir() and os.access() to get all the initscripts | [
"Use",
"os",
".",
"listdir",
"()",
"and",
"os",
".",
"access",
"()",
"to",
"get",
"all",
"the",
"initscripts"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L232-L269 | train |
saltstack/salt | salt/modules/systemd_service.py | _get_service_exec | def _get_service_exec():
'''
Returns the path to the sysv service manager (either update-rc.d or
chkconfig)
'''
contextkey = 'systemd._get_service_exec'
if contextkey not in __context__:
executables = ('update-rc.d', 'chkconfig')
for executable in executables:
service... | python | def _get_service_exec():
'''
Returns the path to the sysv service manager (either update-rc.d or
chkconfig)
'''
contextkey = 'systemd._get_service_exec'
if contextkey not in __context__:
executables = ('update-rc.d', 'chkconfig')
for executable in executables:
service... | [
"def",
"_get_service_exec",
"(",
")",
":",
"contextkey",
"=",
"'systemd._get_service_exec'",
"if",
"contextkey",
"not",
"in",
"__context__",
":",
"executables",
"=",
"(",
"'update-rc.d'",
",",
"'chkconfig'",
")",
"for",
"executable",
"in",
"executables",
":",
"ser... | Returns the path to the sysv service manager (either update-rc.d or
chkconfig) | [
"Returns",
"the",
"path",
"to",
"the",
"sysv",
"service",
"manager",
"(",
"either",
"update",
"-",
"rc",
".",
"d",
"or",
"chkconfig",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L272-L291 | train |
saltstack/salt | salt/modules/systemd_service.py | _runlevel | def _runlevel():
'''
Return the current runlevel
'''
contextkey = 'systemd._runlevel'
if contextkey in __context__:
return __context__[contextkey]
out = __salt__['cmd.run']('runlevel', python_shell=False, ignore_retcode=True)
try:
ret = out.split()[1]
except IndexError:
... | python | def _runlevel():
'''
Return the current runlevel
'''
contextkey = 'systemd._runlevel'
if contextkey in __context__:
return __context__[contextkey]
out = __salt__['cmd.run']('runlevel', python_shell=False, ignore_retcode=True)
try:
ret = out.split()[1]
except IndexError:
... | [
"def",
"_runlevel",
"(",
")",
":",
"contextkey",
"=",
"'systemd._runlevel'",
"if",
"contextkey",
"in",
"__context__",
":",
"return",
"__context__",
"[",
"contextkey",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'runlevel'",
",",
"python_shell",
"... | Return the current runlevel | [
"Return",
"the",
"current",
"runlevel"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L294-L308 | train |
saltstack/salt | salt/modules/systemd_service.py | _strip_scope | def _strip_scope(msg):
'''
Strip unnecessary message about running the command with --scope from
stderr so that we can raise an exception with the remaining stderr text.
'''
ret = []
for line in msg.splitlines():
if not line.endswith('.scope'):
ret.append(line)
return '\n... | python | def _strip_scope(msg):
'''
Strip unnecessary message about running the command with --scope from
stderr so that we can raise an exception with the remaining stderr text.
'''
ret = []
for line in msg.splitlines():
if not line.endswith('.scope'):
ret.append(line)
return '\n... | [
"def",
"_strip_scope",
"(",
"msg",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"line",
"in",
"msg",
".",
"splitlines",
"(",
")",
":",
"if",
"not",
"line",
".",
"endswith",
"(",
"'.scope'",
")",
":",
"ret",
".",
"append",
"(",
"line",
")",
"return",
"'... | Strip unnecessary message about running the command with --scope from
stderr so that we can raise an exception with the remaining stderr text. | [
"Strip",
"unnecessary",
"message",
"about",
"running",
"the",
"command",
"with",
"--",
"scope",
"from",
"stderr",
"so",
"that",
"we",
"can",
"raise",
"an",
"exception",
"with",
"the",
"remaining",
"stderr",
"text",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L311-L320 | train |
saltstack/salt | salt/modules/systemd_service.py | _systemctl_cmd | def _systemctl_cmd(action, name=None, systemd_scope=False, no_block=False,
root=None):
'''
Build a systemctl command line. Treat unit names without one
of the valid suffixes as a service.
'''
ret = []
if systemd_scope \
and salt.utils.systemd.has_scope(__context__)... | python | def _systemctl_cmd(action, name=None, systemd_scope=False, no_block=False,
root=None):
'''
Build a systemctl command line. Treat unit names without one
of the valid suffixes as a service.
'''
ret = []
if systemd_scope \
and salt.utils.systemd.has_scope(__context__)... | [
"def",
"_systemctl_cmd",
"(",
"action",
",",
"name",
"=",
"None",
",",
"systemd_scope",
"=",
"False",
",",
"no_block",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"if",
"systemd_scope",
"and",
"salt",
".",
"utils",
".",
"s... | Build a systemctl command line. Treat unit names without one
of the valid suffixes as a service. | [
"Build",
"a",
"systemctl",
"command",
"line",
".",
"Treat",
"unit",
"names",
"without",
"one",
"of",
"the",
"valid",
"suffixes",
"as",
"a",
"service",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L323-L346 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.