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/cloud/__init__.py | Cloud.do_function | def do_function(self, prov, func, kwargs):
'''
Perform a function against a cloud provider
'''
matches = self.lookup_providers(prov)
if len(matches) > 1:
raise SaltCloudSystemExit(
'More than one results matched \'{0}\'. Please specify '
... | python | def do_function(self, prov, func, kwargs):
'''
Perform a function against a cloud provider
'''
matches = self.lookup_providers(prov)
if len(matches) > 1:
raise SaltCloudSystemExit(
'More than one results matched \'{0}\'. Please specify '
... | [
"def",
"do_function",
"(",
"self",
",",
"prov",
",",
"func",
",",
"kwargs",
")",
":",
"matches",
"=",
"self",
".",
"lookup_providers",
"(",
"prov",
")",
"if",
"len",
"(",
"matches",
")",
">",
"1",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'More than one... | Perform a function against a cloud provider | [
"Perform",
"a",
"function",
"against",
"a",
"cloud",
"provider"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1549-L1595 | train |
saltstack/salt | salt/cloud/__init__.py | Cloud.__filter_non_working_providers | def __filter_non_working_providers(self):
'''
Remove any mis-configured cloud providers from the available listing
'''
for alias, drivers in six.iteritems(self.opts['providers'].copy()):
for driver in drivers.copy():
fun = '{0}.get_configured_provider'.format(... | python | def __filter_non_working_providers(self):
'''
Remove any mis-configured cloud providers from the available listing
'''
for alias, drivers in six.iteritems(self.opts['providers'].copy()):
for driver in drivers.copy():
fun = '{0}.get_configured_provider'.format(... | [
"def",
"__filter_non_working_providers",
"(",
"self",
")",
":",
"for",
"alias",
",",
"drivers",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"opts",
"[",
"'providers'",
"]",
".",
"copy",
"(",
")",
")",
":",
"for",
"driver",
"in",
"drivers",
".",
"c... | Remove any mis-configured cloud providers from the available listing | [
"Remove",
"any",
"mis",
"-",
"configured",
"cloud",
"providers",
"from",
"the",
"available",
"listing"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1597-L1643 | train |
saltstack/salt | salt/cloud/__init__.py | Map.read | def read(self):
'''
Read in the specified map and return the map structure
'''
map_ = None
if self.opts.get('map', None) is None:
if self.opts.get('map_data', None) is None:
if self.opts.get('map_pillar', None) is None:
pass
... | python | def read(self):
'''
Read in the specified map and return the map structure
'''
map_ = None
if self.opts.get('map', None) is None:
if self.opts.get('map_data', None) is None:
if self.opts.get('map_pillar', None) is None:
pass
... | [
"def",
"read",
"(",
"self",
")",
":",
"map_",
"=",
"None",
"if",
"self",
".",
"opts",
".",
"get",
"(",
"'map'",
",",
"None",
")",
"is",
"None",
":",
"if",
"self",
".",
"opts",
".",
"get",
"(",
"'map_data'",
",",
"None",
")",
"is",
"None",
":",
... | Read in the specified map and return the map structure | [
"Read",
"in",
"the",
"specified",
"map",
"and",
"return",
"the",
"map",
"structure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1742-L1857 | train |
saltstack/salt | salt/cloud/__init__.py | Map.map_data | def map_data(self, cached=False):
'''
Create a data map of what to execute on
'''
ret = {'create': {}}
pmap = self.map_providers_parallel(cached=cached)
exist = set()
defined = set()
rendered_map = copy.deepcopy(self.rendered_map)
for profile_name,... | python | def map_data(self, cached=False):
'''
Create a data map of what to execute on
'''
ret = {'create': {}}
pmap = self.map_providers_parallel(cached=cached)
exist = set()
defined = set()
rendered_map = copy.deepcopy(self.rendered_map)
for profile_name,... | [
"def",
"map_data",
"(",
"self",
",",
"cached",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'create'",
":",
"{",
"}",
"}",
"pmap",
"=",
"self",
".",
"map_providers_parallel",
"(",
"cached",
"=",
"cached",
")",
"exist",
"=",
"set",
"(",
")",
"defined",
... | Create a data map of what to execute on | [
"Create",
"a",
"data",
"map",
"of",
"what",
"to",
"execute",
"on"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1905-L2029 | train |
saltstack/salt | salt/cloud/__init__.py | Map.run_map | def run_map(self, dmap):
'''
Execute the contents of the VM map
'''
if self._has_loop(dmap):
msg = 'Uh-oh, that cloud map has a dependency loop!'
log.error(msg)
raise SaltCloudException(msg)
# Go through the create list and calc dependencies
... | python | def run_map(self, dmap):
'''
Execute the contents of the VM map
'''
if self._has_loop(dmap):
msg = 'Uh-oh, that cloud map has a dependency loop!'
log.error(msg)
raise SaltCloudException(msg)
# Go through the create list and calc dependencies
... | [
"def",
"run_map",
"(",
"self",
",",
"dmap",
")",
":",
"if",
"self",
".",
"_has_loop",
"(",
"dmap",
")",
":",
"msg",
"=",
"'Uh-oh, that cloud map has a dependency loop!'",
"log",
".",
"error",
"(",
"msg",
")",
"raise",
"SaltCloudException",
"(",
"msg",
")",
... | Execute the contents of the VM map | [
"Execute",
"the",
"contents",
"of",
"the",
"VM",
"map"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L2031-L2293 | train |
saltstack/salt | salt/modules/gpg.py | _get_user_info | def _get_user_info(user=None):
'''
Wrapper for user.info Salt function
'''
if not user:
# Get user Salt runnining as
user = __salt__['config.option']('user')
userinfo = __salt__['user.info'](user)
if not userinfo:
if user == 'salt':
# Special case with `salt... | python | def _get_user_info(user=None):
'''
Wrapper for user.info Salt function
'''
if not user:
# Get user Salt runnining as
user = __salt__['config.option']('user')
userinfo = __salt__['user.info'](user)
if not userinfo:
if user == 'salt':
# Special case with `salt... | [
"def",
"_get_user_info",
"(",
"user",
"=",
"None",
")",
":",
"if",
"not",
"user",
":",
"# Get user Salt runnining as",
"user",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'user'",
")",
"userinfo",
"=",
"__salt__",
"[",
"'user.info'",
"]",
"(",
"user"... | Wrapper for user.info Salt function | [
"Wrapper",
"for",
"user",
".",
"info",
"Salt",
"function"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L104-L122 | train |
saltstack/salt | salt/modules/gpg.py | _get_user_gnupghome | def _get_user_gnupghome(user):
'''
Return default GnuPG home directory path for a user
'''
if user == 'salt':
gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
else:
gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')
return gnupghome | python | def _get_user_gnupghome(user):
'''
Return default GnuPG home directory path for a user
'''
if user == 'salt':
gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
else:
gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')
return gnupghome | [
"def",
"_get_user_gnupghome",
"(",
"user",
")",
":",
"if",
"user",
"==",
"'salt'",
":",
"gnupghome",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'config_dir'",
")",
",",
"'gpgkeys'",
")",
"else",
":",
"gnupghome"... | Return default GnuPG home directory path for a user | [
"Return",
"default",
"GnuPG",
"home",
"directory",
"path",
"for",
"a",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L125-L134 | train |
saltstack/salt | salt/modules/gpg.py | _create_gpg | def _create_gpg(user=None, gnupghome=None):
'''
Create the GPG object
'''
if not gnupghome:
gnupghome = _get_user_gnupghome(user)
if GPG_1_3_1:
gpg = gnupg.GPG(homedir=gnupghome)
else:
gpg = gnupg.GPG(gnupghome=gnupghome)
return gpg | python | def _create_gpg(user=None, gnupghome=None):
'''
Create the GPG object
'''
if not gnupghome:
gnupghome = _get_user_gnupghome(user)
if GPG_1_3_1:
gpg = gnupg.GPG(homedir=gnupghome)
else:
gpg = gnupg.GPG(gnupghome=gnupghome)
return gpg | [
"def",
"_create_gpg",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"if",
"not",
"gnupghome",
":",
"gnupghome",
"=",
"_get_user_gnupghome",
"(",
"user",
")",
"if",
"GPG_1_3_1",
":",
"gpg",
"=",
"gnupg",
".",
"GPG",
"(",
"homedir",
... | Create the GPG object | [
"Create",
"the",
"GPG",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L176-L188 | train |
saltstack/salt | salt/modules/gpg.py | _list_keys | def _list_keys(user=None, gnupghome=None, secret=False):
'''
Helper function for Listing keys
'''
gpg = _create_gpg(user, gnupghome)
_keys = gpg.list_keys(secret)
return _keys | python | def _list_keys(user=None, gnupghome=None, secret=False):
'''
Helper function for Listing keys
'''
gpg = _create_gpg(user, gnupghome)
_keys = gpg.list_keys(secret)
return _keys | [
"def",
"_list_keys",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
",",
"secret",
"=",
"False",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
",",
"gnupghome",
")",
"_keys",
"=",
"gpg",
".",
"list_keys",
"(",
"secret",
")",
"return",
"... | Helper function for Listing keys | [
"Helper",
"function",
"for",
"Listing",
"keys"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L191-L197 | train |
saltstack/salt | salt/modules/gpg.py | _search_keys | def _search_keys(text, keyserver, user=None):
'''
Helper function for searching keys from keyserver
'''
gpg = _create_gpg(user)
if keyserver:
_keys = gpg.search_keys(text, keyserver)
else:
_keys = gpg.search_keys(text)
return _keys | python | def _search_keys(text, keyserver, user=None):
'''
Helper function for searching keys from keyserver
'''
gpg = _create_gpg(user)
if keyserver:
_keys = gpg.search_keys(text, keyserver)
else:
_keys = gpg.search_keys(text)
return _keys | [
"def",
"_search_keys",
"(",
"text",
",",
"keyserver",
",",
"user",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
")",
"if",
"keyserver",
":",
"_keys",
"=",
"gpg",
".",
"search_keys",
"(",
"text",
",",
"keyserver",
")",
"else",
":",
"... | Helper function for searching keys from keyserver | [
"Helper",
"function",
"for",
"searching",
"keys",
"from",
"keyserver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L200-L209 | train |
saltstack/salt | salt/modules/gpg.py | search_keys | def search_keys(text, keyserver=None, user=None):
'''
Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to a... | python | def search_keys(text, keyserver=None, user=None):
'''
Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to a... | [
"def",
"search_keys",
"(",
"text",
",",
"keyserver",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"if",
"GPG_1_3_1",
":",
"raise",
"SaltInvocationError",
"(",
"'The search_keys function is not support with this version of python-gnupg.'",
")",
"else",
":",
"if",
... | Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing th... | [
"Search",
"keys",
"from",
"keyserver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L212-L262 | train |
saltstack/salt | salt/modules/gpg.py | list_keys | def list_keys(user=None, gnupghome=None):
'''
List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location... | python | def list_keys(user=None, gnupghome=None):
'''
List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location... | [
"def",
"list_keys",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"_keys",
"=",
"[",
"]",
"for",
"_key",
"in",
"_list_keys",
"(",
"user",
",",
"gnupghome",
")",
":",
"tmp",
"=",
"{",
"'keyid'",
":",
"_key",
"[",
"'keyid'",
"]",... | List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location where GPG keyring and related files are stored.
... | [
"List",
"keys",
"in",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L265-L309 | train |
saltstack/salt | salt/modules/gpg.py | create_key | def create_key(key_type='RSA',
key_length=1024,
name_real='Autogenerated Key',
name_comment='Generated by SaltStack',
name_email=None,
subkey_type=None,
subkey_length=None,
expire_date=None,
use_passp... | python | def create_key(key_type='RSA',
key_length=1024,
name_real='Autogenerated Key',
name_comment='Generated by SaltStack',
name_email=None,
subkey_type=None,
subkey_length=None,
expire_date=None,
use_passp... | [
"def",
"create_key",
"(",
"key_type",
"=",
"'RSA'",
",",
"key_length",
"=",
"1024",
",",
"name_real",
"=",
"'Autogenerated Key'",
",",
"name_comment",
"=",
"'Generated by SaltStack'",
",",
"name_email",
"=",
"None",
",",
"subkey_type",
"=",
"None",
",",
"subkey_... | Create a key in the GPG keychain
.. note::
GPG key generation requires *a lot* of entropy and randomness.
Difficult to do over a remote connection, consider having
another process available which is generating randomness for
the machine. Also especially difficult on virtual machin... | [
"Create",
"a",
"key",
"in",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L360-L477 | train |
saltstack/salt | salt/modules/gpg.py | delete_key | def delete_key(keyid=None,
fingerprint=None,
delete_secret=False,
user=None,
gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The keyid of the key to be deleted.
fingerprint
The fingerprint of the key to be deleted.
... | python | def delete_key(keyid=None,
fingerprint=None,
delete_secret=False,
user=None,
gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The keyid of the key to be deleted.
fingerprint
The fingerprint of the key to be deleted.
... | [
"def",
"delete_key",
"(",
"keyid",
"=",
"None",
",",
"fingerprint",
"=",
"None",
",",
"delete_secret",
"=",
"False",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'message'",
":",
"''"... | Get a key from the GPG keychain
keyid
The keyid of the key to be deleted.
fingerprint
The fingerprint of the key to be deleted.
delete_secret
Whether to delete a corresponding secret key prior to deleting the public key.
Secret keys must be deleted before deleting any corr... | [
"Get",
"a",
"key",
"from",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L480-L555 | train |
saltstack/salt | salt/modules/gpg.py | get_key | def get_key(keyid=None, fingerprint=None, user=None, gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The key ID (short or long) of the key to be retrieved.
fingerprint
The fingerprint of the key to be retrieved.
user
Which user's keychain to access, defaults to ... | python | def get_key(keyid=None, fingerprint=None, user=None, gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The key ID (short or long) of the key to be retrieved.
fingerprint
The fingerprint of the key to be retrieved.
user
Which user's keychain to access, defaults to ... | [
"def",
"get_key",
"(",
"keyid",
"=",
"None",
",",
"fingerprint",
"=",
"None",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"tmp",
"=",
"{",
"}",
"for",
"_key",
"in",
"_list_keys",
"(",
"user",
",",
"gnupghome",
")",
":",
"if",... | Get a key from the GPG keychain
keyid
The key ID (short or long) of the key to be retrieved.
fingerprint
The fingerprint of the key to be retrieved.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG h... | [
"Get",
"a",
"key",
"from",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L558-L617 | train |
saltstack/salt | salt/modules/gpg.py | import_key | def import_key(text=None,
filename=None,
user=None,
gnupghome=None):
r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to acces... | python | def import_key(text=None,
filename=None,
user=None,
gnupghome=None):
r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to acces... | [
"def",
"import_key",
"(",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'message'",
":",
"''",
"}",
"gpg",
"=",
"_create_gpg",
"(",... | r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
... | [
"r",
"Import",
"a",
"key",
"from",
"text",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L683-L755 | train |
saltstack/salt | salt/modules/gpg.py | export_key | def export_key(keyids=None, secret=False, user=None, gnupghome=None):
'''
Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example... | python | def export_key(keyids=None, secret=False, user=None, gnupghome=None):
'''
Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example... | [
"def",
"export_key",
"(",
"keyids",
"=",
"None",
",",
"secret",
"=",
"False",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
",",
"gnupghome",
")",
"if",
"isinstance",
"(",
"keyids",
",",
"s... | Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example, the key ID or the fingerprint could be
used.
secret
Export ... | [
"Export",
"a",
"key",
"from",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L758-L794 | train |
saltstack/salt | salt/modules/gpg.py | receive_keys | def receive_keys(keyserver=None, keys=None, user=None, gnupghome=None):
'''
Receive key(s) from keyserver and add them to keychain
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu
keys
The keyID(s) to retrieve from the keyserver. Can be specified as a com... | python | def receive_keys(keyserver=None, keys=None, user=None, gnupghome=None):
'''
Receive key(s) from keyserver and add them to keychain
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu
keys
The keyID(s) to retrieve from the keyserver. Can be specified as a com... | [
"def",
"receive_keys",
"(",
"keyserver",
"=",
"None",
",",
"keys",
"=",
"None",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'message'",
":",
"[",
... | Receive key(s) from keyserver and add them to keychain
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu
keys
The keyID(s) to retrieve from the keyserver. Can be specified as a comma
separated string or a list.
user
Which user's keychain to ac... | [
"Receive",
"key",
"(",
"s",
")",
"from",
"keyserver",
"and",
"add",
"them",
"to",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L798-L851 | train |
saltstack/salt | salt/modules/gpg.py | trust_key | def trust_key(keyid=None,
fingerprint=None,
trust_level=None,
user=None):
'''
Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for... | python | def trust_key(keyid=None,
fingerprint=None,
trust_level=None,
user=None):
'''
Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for... | [
"def",
"trust_key",
"(",
"keyid",
"=",
"None",
",",
"fingerprint",
"=",
"None",
",",
"trust_level",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'message'",
":",
"''",
"}",
"_VALID_TRUST_LEVELS",
"=",
... | Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for.
trust_level
The trust level to set for the specified key, must be one
of the following:
expired, ... | [
"Set",
"the",
"trust",
"level",
"for",
"a",
"key",
"in",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L854-L951 | train |
saltstack/salt | salt/modules/gpg.py | sign | def sign(user=None,
keyid=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None):
'''
Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`... | python | def sign(user=None,
keyid=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None):
'''
Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`... | [
"def",
"sign",
"(",
"user",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"None",
")",
":",
"gpg",
"=",
"_crea... | Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
keyid
The keyid of the key to set the trust level for, defaults to
first key in t... | [
"Sign",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L954-L1027 | train |
saltstack/salt | salt/modules/gpg.py | verify | def verify(text=None,
user=None,
filename=None,
gnupghome=None,
signature=None,
trustmodel=None):
'''
Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to acc... | python | def verify(text=None,
user=None,
filename=None,
gnupghome=None,
signature=None,
trustmodel=None):
'''
Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to acc... | [
"def",
"verify",
"(",
"text",
"=",
"None",
",",
"user",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"gnupghome",
"=",
"None",
",",
"signature",
"=",
"None",
",",
"trustmodel",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
")",
... | Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome... | [
"Verify",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1030-L1117 | train |
saltstack/salt | salt/modules/gpg.py | encrypt | def encrypt(user=None,
recipients=None,
text=None,
filename=None,
output=None,
sign=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Encrypt a message or file
user
Which user's keychain to ac... | python | def encrypt(user=None,
recipients=None,
text=None,
filename=None,
output=None,
sign=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Encrypt a message or file
user
Which user's keychain to ac... | [
"def",
"encrypt",
"(",
"user",
"=",
"None",
",",
"recipients",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"sign",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"Non... | Encrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
recipients
The fingerprints for those recipient whom the data is being encrypted for... | [
"Encrypt",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1120-L1223 | train |
saltstack/salt | salt/modules/gpg.py | decrypt | def decrypt(user=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
P... | python | def decrypt(user=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
P... | [
"def",
"decrypt",
"(",
"user",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"None",
",",
"bare",
"=",
"False",
")",
":",
"ret",
"=",
"{"... | Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
text
The encrypted text to decrypt.
filename
The encrypted filename to ... | [
"Decrypt",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1226-L1311 | train |
saltstack/salt | salt/utils/msgpack.py | pack | def pack(o, stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
a proxy.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
ms... | python | def pack(o, stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
a proxy.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
ms... | [
"def",
"pack",
"(",
"o",
",",
"stream",
",",
"*",
"*",
"kwargs",
")",
":",
"msgpack_module",
"=",
"kwargs",
".",
"pop",
"(",
"'_msgpack_module'",
",",
"msgpack",
")",
"orig_enc_func",
"=",
"kwargs",
".",
"pop",
"(",
"'default'",
",",
"lambda",
"x",
":"... | .. versionadded:: 2018.3.4
Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
a proxy.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argu... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"4"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L20-L38 | train |
saltstack/salt | salt/utils/msgpack.py | unpack | def unpack(stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpack... | python | def unpack(stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpack... | [
"def",
"unpack",
"(",
"stream",
",",
"*",
"*",
"kwargs",
")",
":",
"msgpack_module",
"=",
"kwargs",
".",
"pop",
"(",
"'_msgpack_module'",
",",
"msgpack",
")",
"return",
"msgpack_module",
".",
"unpack",
"(",
"stream",
",",
"*",
"*",
"kwargs",
")"
] | .. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument. | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"4"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L62-L73 | train |
saltstack/salt | salt/utils/msgpack.py | unpackb | def unpackb(packed, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpac... | python | def unpackb(packed, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpac... | [
"def",
"unpackb",
"(",
"packed",
",",
"*",
"*",
"kwargs",
")",
":",
"msgpack_module",
"=",
"kwargs",
".",
"pop",
"(",
"'_msgpack_module'",
",",
"msgpack",
")",
"return",
"msgpack_module",
".",
"unpackb",
"(",
"packed",
",",
"*",
"*",
"kwargs",
")"
] | .. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument. | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"4"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L76-L87 | train |
saltstack/salt | salt/thorium/key.py | timeout | def timeout(name, delete=0, reject=0):
'''
If any minion's status is older than the timeout value then apply the
given action to the timed out key. This example will remove keys to
minions that have not checked in for 300 seconds (5 minutes)
USAGE:
.. code-block:: yaml
statreg:
... | python | def timeout(name, delete=0, reject=0):
'''
If any minion's status is older than the timeout value then apply the
given action to the timed out key. This example will remove keys to
minions that have not checked in for 300 seconds (5 minutes)
USAGE:
.. code-block:: yaml
statreg:
... | [
"def",
"timeout",
"(",
"name",
",",
"delete",
"=",
"0",
",",
"reject",
"=",
"0",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"True",
"}",
"now",
"=",
"tim... | If any minion's status is older than the timeout value then apply the
given action to the timed out key. This example will remove keys to
minions that have not checked in for 300 seconds (5 minutes)
USAGE:
.. code-block:: yaml
statreg:
status.reg
clean_keys:
key.t... | [
"If",
"any",
"minion",
"s",
"status",
"is",
"older",
"than",
"the",
"timeout",
"value",
"then",
"apply",
"the",
"given",
"action",
"to",
"the",
"timed",
"out",
"key",
".",
"This",
"example",
"will",
"remove",
"keys",
"to",
"minions",
"that",
"have",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/key.py#L24-L80 | train |
saltstack/salt | salt/beacons/inotify.py | _get_notifier | def _get_notifier(config):
'''
Check the context for the notifier and construct it if not present
'''
if 'inotify.notifier' not in __context__:
__context__['inotify.queue'] = collections.deque()
wm = pyinotify.WatchManager()
__context__['inotify.notifier'] = pyinotify.Notifier(wm... | python | def _get_notifier(config):
'''
Check the context for the notifier and construct it if not present
'''
if 'inotify.notifier' not in __context__:
__context__['inotify.queue'] = collections.deque()
wm = pyinotify.WatchManager()
__context__['inotify.notifier'] = pyinotify.Notifier(wm... | [
"def",
"_get_notifier",
"(",
"config",
")",
":",
"if",
"'inotify.notifier'",
"not",
"in",
"__context__",
":",
"__context__",
"[",
"'inotify.queue'",
"]",
"=",
"collections",
".",
"deque",
"(",
")",
"wm",
"=",
"pyinotify",
".",
"WatchManager",
"(",
")",
"__co... | Check the context for the notifier and construct it if not present | [
"Check",
"the",
"context",
"for",
"the",
"notifier",
"and",
"construct",
"it",
"if",
"not",
"present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L70-L82 | train |
saltstack/salt | salt/beacons/inotify.py | validate | def validate(config):
'''
Validate the beacon configuration
'''
VALID_MASK = [
'access',
'attrib',
'close_nowrite',
'close_write',
'create',
'delete',
'delete_self',
'excl_unlink',
'ignored',
'modify',
'moved_from',... | python | def validate(config):
'''
Validate the beacon configuration
'''
VALID_MASK = [
'access',
'attrib',
'close_nowrite',
'close_write',
'create',
'delete',
'delete_self',
'excl_unlink',
'ignored',
'modify',
'moved_from',... | [
"def",
"validate",
"(",
"config",
")",
":",
"VALID_MASK",
"=",
"[",
"'access'",
",",
"'attrib'",
",",
"'close_nowrite'",
",",
"'close_write'",
",",
"'create'",
",",
"'delete'",
",",
"'delete_self'",
",",
"'excl_unlink'",
",",
"'ignored'",
",",
"'modify'",
",",... | Validate the beacon configuration | [
"Validate",
"the",
"beacon",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L85-L150 | train |
saltstack/salt | salt/beacons/inotify.py | beacon | def beacon(config):
'''
Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
... | python | def beacon(config):
'''
Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
... | [
"def",
"beacon",
"(",
"config",
")",
":",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"ret",
"=",
"[",
"]",
"notifier",
"=",
"_get_notifier",
"(",
"_config",
")",
"wm",
"=",
"notifier",
".",... | Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
recurse: True
... | [
"Watch",
"the",
"configured",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L153-L323 | train |
saltstack/salt | salt/modules/gem.py | _gem | def _gem(command, ruby=None, runas=None, gem_bin=None):
'''
Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM ... | python | def _gem(command, ruby=None, runas=None, gem_bin=None):
'''
Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM ... | [
"def",
"_gem",
"(",
"command",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmdline",
"=",
"[",
"gem_bin",
"or",
"'gem'",
"]",
"+",
"command",
"# If a custom gem is given, use that and don't check for rvm/rbenv. Us... | Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Igno... | [
"Run",
"the",
"actual",
"gem",
"command",
".",
"If",
"rvm",
"or",
"rbenv",
"is",
"installed",
"run",
"the",
"command",
"using",
"the",
"corresponding",
"module",
".",
"rbenv",
"is",
"not",
"available",
"on",
"windows",
"so",
"don",
"t",
"try",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L23-L64 | train |
saltstack/salt | salt/modules/gem.py | install | def install(gems, # pylint: disable=C0103
ruby=None,
gem_bin=None,
runas=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C0103
'''
... | python | def install(gems, # pylint: disable=C0103
ruby=None,
gem_bin=None,
runas=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C0103
'''
... | [
"def",
"install",
"(",
"gems",
",",
"# pylint: disable=C0103",
"ruby",
"=",
"None",
",",
"gem_bin",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"version",
"=",
"None",
",",
"rdoc",
"=",
"False",
",",
"ri",
"=",
"False",
",",
"pre_releases",
"=",
"Fals... | Installs one or several gems.
:param gems: string
The gems to install
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:par... | [
"Installs",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L67-L146 | train |
saltstack/salt | salt/modules/gem.py | uninstall | def uninstall(gems, ruby=None, runas=None, gem_bin=None):
'''
Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versio... | python | def uninstall(gems, ruby=None, runas=None, gem_bin=None):
'''
Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versio... | [
"def",
"uninstall",
"(",
"gems",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"try",
":",
"gems",
"=",
"gems",
".",
"split",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"return",
"_gem",
"(",
"[... | Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
... | [
"Uninstall",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L149-L177 | train |
saltstack/salt | salt/modules/gem.py | update | def update(gems, ruby=None, runas=None, gem_bin=None):
'''
Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gem... | python | def update(gems, ruby=None, runas=None, gem_bin=None):
'''
Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gem... | [
"def",
"update",
"(",
"gems",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"try",
":",
"gems",
"=",
"gems",
".",
"split",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"return",
"_gem",
"(",
"[",
... | Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param... | [
"Update",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L180-L208 | train |
saltstack/salt | salt/modules/gem.py | update_system | def update_system(version='', ruby=None, runas=None, gem_bin=None):
'''
Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are ins... | python | def update_system(version='', ruby=None, runas=None, gem_bin=None):
'''
Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are ins... | [
"def",
"update_system",
"(",
"version",
"=",
"''",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'update'",
",",
"'--system'",
",",
"version",
"]",
",",
"ruby",
",",
"gem_bin"... | Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is sp... | [
"Update",
"rubygems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L211-L234 | train |
saltstack/salt | salt/modules/gem.py | version | def version(ruby=None, runas=None, gem_bin=None):
'''
Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.... | python | def version(ruby=None, runas=None, gem_bin=None):
'''
Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.... | [
"def",
"version",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'--version'",
"]",
"stdout",
"=",
"_gem",
"(",
"cmd",
",",
"ruby",
",",
"gem_bin",
"=",
"gem_bin",
",",
"runas",
"=",
... | Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param runas: string : None
The user to run gem a... | [
"Print",
"out",
"the",
"version",
"of",
"gem"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L237-L266 | train |
saltstack/salt | salt/modules/gem.py | list_ | def list_(prefix='', ruby=None, runas=None, gem_bin=None):
'''
List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv ... | python | def list_(prefix='', ruby=None, runas=None, gem_bin=None):
'''
List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv ... | [
"def",
"list_",
"(",
"prefix",
"=",
"''",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'list'",
"]",
"if",
"prefix",
":",
"cmd",
".",
"append",
"(",
"prefix",
")",
"stdout",
"=",
... | List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if `... | [
"List",
"locally",
"installed",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L276-L310 | train |
saltstack/salt | salt/modules/gem.py | list_upgrades | def list_upgrades(ruby=None,
runas=None,
gem_bin=None):
'''
.. versionadded:: 2015.8.0
Check if an upgrade is available for installed gems
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby vers... | python | def list_upgrades(ruby=None,
runas=None,
gem_bin=None):
'''
.. versionadded:: 2015.8.0
Check if an upgrade is available for installed gems
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby vers... | [
"def",
"list_upgrades",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"result",
"=",
"_gem",
"(",
"[",
"'outdated'",
"]",
",",
"ruby",
",",
"gem_bin",
"=",
"gem_bin",
",",
"runas",
"=",
"runas",
")",
"r... | .. versionadded:: 2015.8.0
Check if an upgrade is available for installed gems
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
runas : None
The user to... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L313-L348 | train |
saltstack/salt | salt/modules/gem.py | sources_add | def sources_add(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versi... | python | def sources_add(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versi... | [
"def",
"sources_add",
"(",
"source_uri",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'sources'",
",",
"'--add'",
",",
"source_uri",
"]",
",",
"ruby",
",",
"gem_bin",
"=",
"g... | Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param ... | [
"Add",
"a",
"gem",
"source",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L351-L374 | train |
saltstack/salt | salt/modules/gem.py | sources_remove | def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the r... | python | def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the r... | [
"def",
"sources_remove",
"(",
"source_uri",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'sources'",
",",
"'--remove'",
",",
"source_uri",
"]",
",",
"ruby",
",",
"gem_bin",
"="... | Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:... | [
"Remove",
"a",
"gem",
"source",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L377-L400 | train |
saltstack/salt | salt/modules/gem.py | sources_list | def sources_list(ruby=None, runas=None, gem_bin=None):
'''
List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is s... | python | def sources_list(ruby=None, runas=None, gem_bin=None):
'''
List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is s... | [
"def",
"sources_list",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"ret",
"=",
"_gem",
"(",
"[",
"'sources'",
"]",
",",
"ruby",
",",
"gem_bin",
"=",
"gem_bin",
",",
"runas",
"=",
"runas",
")",
"return... | List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param runas: string : None
The user to run g... | [
"List",
"the",
"configured",
"gem",
"sources",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L403-L422 | train |
saltstack/salt | salt/states/icinga2.py | generate_ticket | def generate_ticket(name, output=None, grain=None, key=None, overwrite=True):
'''
Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the... | python | def generate_ticket(name, output=None, grain=None, key=None, overwrite=True):
'''
Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the... | [
"def",
"generate_ticket",
"(",
"name",
",",
"output",
"=",
"None",
",",
"grain",
"=",
"None",
",",
"key",
"=",
"None",
",",
"overwrite",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'"... | Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the result comment (default)
grain:
grain to store the output (need output=grain... | [
"Generate",
"an",
"icinga2",
"ticket",
"on",
"the",
"master",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L40-L131 | train |
saltstack/salt | salt/states/icinga2.py | generate_cert | def generate_cert(name):
'''
Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
cert = "{0}{1}.crt".forma... | python | def generate_cert(name):
'''
Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
cert = "{0}{1}.crt".forma... | [
"def",
"generate_cert",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert",
"=",
"\"{0}{1}.crt\"",
".",
"format",
"(",
"get_certs_path",... | Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated | [
"Generate",
"an",
"icinga2",
"certificate",
"and",
"key",
"on",
"the",
"client",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L134-L163 | train |
saltstack/salt | salt/states/icinga2.py | save_cert | def save_cert(name, master):
'''
Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
'''
ret = {'name': name,
'changes': {},
'result'... | python | def save_cert(name, master):
'''
Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
'''
ret = {'name': name,
'changes': {},
'result'... | [
"def",
"save_cert",
"(",
"name",
",",
"master",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert",
"=",
"\"{0}trusted-master.crt\"",
".",
"format",
... | Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved | [
"Save",
"the",
"certificate",
"on",
"master",
"icinga2",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L166-L196 | train |
saltstack/salt | salt/states/icinga2.py | request_cert | def request_cert(name, master, ticket, port="5665"):
'''
Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generate... | python | def request_cert(name, master, ticket, port="5665"):
'''
Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generate... | [
"def",
"request_cert",
"(",
"name",
",",
"master",
",",
"ticket",
",",
"port",
"=",
"\"5665\"",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert... | Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generated on icinga2 master
port
Icinga2 port, defaults to 5... | [
"Request",
"CA",
"certificate",
"from",
"master",
"icinga2",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L199-L239 | train |
saltstack/salt | salt/states/icinga2.py | node_setup | def node_setup(name, master, ticket):
'''
Setup the icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generated on icinga2 master
'''
ret = {'... | python | def node_setup(name, master, ticket):
'''
Setup the icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generated on icinga2 master
'''
ret = {'... | [
"def",
"node_setup",
"(",
"name",
",",
"master",
",",
"ticket",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert",
"=",
"\"{0}{1}.crt.orig\"",
"."... | Setup the icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generated on icinga2 master | [
"Setup",
"the",
"icinga2",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L242-L280 | train |
saltstack/salt | salt/cloud/clouds/linode.py | avail_images | def avail_images(call=None):
'''
Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fun... | python | def avail_images(call=None):
'''
Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fun... | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_images function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'distribution... | Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config | [
"Return",
"available",
"Linode",
"images",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L110-L133 | train |
saltstack/salt | salt/cloud/clouds/linode.py | avail_locations | def avail_locations(call=None):
'''
Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config
'''
if call == 'action':
raise SaltCloudException(
... | python | def avail_locations(call=None):
'''
Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config
'''
if call == 'action':
raise SaltCloudException(
... | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'datace... | Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config | [
"Return",
"available",
"Linode",
"datacenter",
"locations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L136-L159 | train |
saltstack/salt | salt/cloud/clouds/linode.py | avail_sizes | def avail_sizes(call=None):
'''
Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations func... | python | def avail_sizes(call=None):
'''
Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations func... | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'LinodePlan... | Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config | [
"Return",
"available",
"Linode",
"sizes",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L162-L185 | train |
saltstack/salt | salt/cloud/clouds/linode.py | boot | def boot(name=None, kwargs=None, call=None):
'''
Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
... | python | def boot(name=None, kwargs=None, call=None):
'''
Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
... | [
"def",
"boot",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
"and",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The boot action requires a \\'name\\'.'",
")",
... | Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
Linode by one. Will be preferred over ``name``.
... | [
"Boot",
"a",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L188-L272 | train |
saltstack/salt | salt/cloud/clouds/linode.py | clone | def clone(kwargs=None, call=None):
'''
Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. ... | python | def clone(kwargs=None, call=None):
'''
Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. ... | [
"def",
"clone",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The clone function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":",
"kwarg... | Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. code-block:: bash
salt-cloud -f clone ... | [
"Clone",
"a",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L275-L320 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create | def create(vm_):
'''
Create a single Linode VM.
'''
name = vm_['name']
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_... | python | def create(vm_):
'''
Create a single Linode VM.
'''
name = vm_['name']
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_... | [
"def",
"create",
"(",
"vm_",
")",
":",
"name",
"=",
"vm_",
"[",
"'name'",
"]",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
... | Create a single Linode VM. | [
"Create",
"a",
"single",
"Linode",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L323-L537 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create_config | def create_config(kwargs=None, call=None):
'''
Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk... | python | def create_config(kwargs=None, call=None):
'''
Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk... | [
"def",
"create_config",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_config function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",... | Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk_id
The Swap Disk ID to be used for this config... | [
"Creates",
"a",
"Linode",
"Configuration",
"Profile",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L540-L603 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create_disk_from_distro | def create_disk_from_distro(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk... | python | def create_disk_from_distro(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk... | [
"def",
"create_disk_from_distro",
"(",
"vm_",
",",
"linode_id",
",",
"swap_size",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"swap_size",
"is",
"None",
":",
"swap_size",
"=",
"get_swap_size",
"(",
"vm_",
")",
"pub_key",
"=",
"get_pub_key",
"(",
... | r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk, in MB. | [
"r",
"Creates",
"the",
"disk",
"for",
"the",
"Linode",
"from",
"the",
"distribution",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L606-L644 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create_swap_disk | def create_swap_disk(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB.
'''
kwargs = {}... | python | def create_swap_disk(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB.
'''
kwargs = {}... | [
"def",
"create_swap_disk",
"(",
"vm_",
",",
"linode_id",
",",
"swap_size",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"not",
"swap_size",
":",
"swap_size",
"=",
"get_swap_size",
"(",
"vm_",
")",
"kwargs",
".",
"update",
"(",
"{",
"'LinodeID'",... | r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB. | [
"r",
"Creates",
"the",
"disk",
"for",
"the",
"specified",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L647-L673 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create_data_disk | def create_data_disk(vm_=None, linode_id=None, data_size=None):
r'''
Create a data disk for the linode (type is hardcoded to ext4 at the moment)
.. versionadded:: 2016.3.0
vm\_
The VM profile to create the data disk for.
linode_id
The ID of the Linode to create the data disk for.
... | python | def create_data_disk(vm_=None, linode_id=None, data_size=None):
r'''
Create a data disk for the linode (type is hardcoded to ext4 at the moment)
.. versionadded:: 2016.3.0
vm\_
The VM profile to create the data disk for.
linode_id
The ID of the Linode to create the data disk for.
... | [
"def",
"create_data_disk",
"(",
"vm_",
"=",
"None",
",",
"linode_id",
"=",
"None",
",",
"data_size",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"kwargs",
".",
"update",
"(",
"{",
"'LinodeID'",
":",
"linode_id",
",",
"'Label'",
":",
"vm_",
"[",
"... | r'''
Create a data disk for the linode (type is hardcoded to ext4 at the moment)
.. versionadded:: 2016.3.0
vm\_
The VM profile to create the data disk for.
linode_id
The ID of the Linode to create the data disk for.
data_size
The size of the disk, in MB. | [
"r",
"Create",
"a",
"data",
"disk",
"for",
"the",
"linode",
"(",
"type",
"is",
"hardcoded",
"to",
"ext4",
"at",
"the",
"moment",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L676-L701 | train |
saltstack/salt | salt/cloud/clouds/linode.py | create_private_ip | def create_private_ip(linode_id):
r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for.
'''
kwargs = {'LinodeID': linode_id}
result = _query('linode', 'ip.addprivate', args=kwargs)
return _clean_data(result) | python | def create_private_ip(linode_id):
r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for.
'''
kwargs = {'LinodeID': linode_id}
result = _query('linode', 'ip.addprivate', args=kwargs)
return _clean_data(result) | [
"def",
"create_private_ip",
"(",
"linode_id",
")",
":",
"kwargs",
"=",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
"result",
"=",
"_query",
"(",
"'linode'",
",",
"'ip.addprivate'",
",",
"args",
"=",
"kwargs",
")",
"return",
"_clean_data",
"(",
"result",
")"
] | r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for. | [
"r",
"Creates",
"a",
"private",
"IP",
"for",
"the",
"specified",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L704-L714 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_config_id | def get_config_id(kwargs=None, call=None):
'''
Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_i... | python | def get_config_id(kwargs=None, call=None):
'''
Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_i... | [
"def",
"get_config_id",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The get_config_id function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
... | Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_id. Can be used instead
of ``name``.
CLI Ex... | [
"Returns",
"a",
"config_id",
"for",
"a",
"given",
"linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L764-L806 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_disk_size | def get_disk_size(vm_, swap, linode_id):
r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for.
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
return config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_s... | python | def get_disk_size(vm_, swap, linode_id):
r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for.
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
return config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_s... | [
"def",
"get_disk_size",
"(",
"vm_",
",",
"swap",
",",
"linode_id",
")",
":",
"disk_size",
"=",
"get_linode",
"(",
"kwargs",
"=",
"{",
"'linode_id'",
":",
"linode_id",
"}",
")",
"[",
"'TOTALHD'",
"]",
"return",
"config",
".",
"get_cloud_config_value",
"(",
... | r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for. | [
"r",
"Returns",
"the",
"size",
"of",
"of",
"the",
"root",
"disk",
"in",
"MB",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L820-L830 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_data_disk_size | def get_data_disk_size(vm_, swap, linode_id):
'''
Return the size of of the data disk in MB
.. versionadded:: 2016.3.0
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
root_disk_size = config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_size - s... | python | def get_data_disk_size(vm_, swap, linode_id):
'''
Return the size of of the data disk in MB
.. versionadded:: 2016.3.0
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
root_disk_size = config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_size - s... | [
"def",
"get_data_disk_size",
"(",
"vm_",
",",
"swap",
",",
"linode_id",
")",
":",
"disk_size",
"=",
"get_linode",
"(",
"kwargs",
"=",
"{",
"'linode_id'",
":",
"linode_id",
"}",
")",
"[",
"'TOTALHD'",
"]",
"root_disk_size",
"=",
"config",
".",
"get_cloud_conf... | Return the size of of the data disk in MB
.. versionadded:: 2016.3.0 | [
"Return",
"the",
"size",
"of",
"of",
"the",
"data",
"disk",
"in",
"MB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L833-L843 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_distribution_id | def get_distribution_id(vm_):
r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for
'''
distributions = _query('avail', 'distributions')['DATA']
vm_image_name = config.get_cloud_config_value('image', vm_, __opts__)
distro_id = ''
for distro in di... | python | def get_distribution_id(vm_):
r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for
'''
distributions = _query('avail', 'distributions')['DATA']
vm_image_name = config.get_cloud_config_value('image', vm_, __opts__)
distro_id = ''
for distro in di... | [
"def",
"get_distribution_id",
"(",
"vm_",
")",
":",
"distributions",
"=",
"_query",
"(",
"'avail'",
",",
"'distributions'",
")",
"[",
"'DATA'",
"]",
"vm_image_name",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"vm_",
",",
"__opts__",
")"... | r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for | [
"r",
"Returns",
"the",
"distribution",
"ID",
"for",
"a",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L846-L872 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_ips | def get_ips(linode_id=None):
'''
Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID.
'''
if linode_id:
ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
else:
ips = _query('linode', 'ip.list')
... | python | def get_ips(linode_id=None):
'''
Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID.
'''
if linode_id:
ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
else:
ips = _query('linode', 'ip.list')
... | [
"def",
"get_ips",
"(",
"linode_id",
"=",
"None",
")",
":",
"if",
"linode_id",
":",
"ips",
"=",
"_query",
"(",
"'linode'",
",",
"'ip.list'",
",",
"args",
"=",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
")",
"else",
":",
"ips",
"=",
"_query",
"(",
"'lin... | Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID. | [
"Returns",
"public",
"and",
"private",
"IP",
"addresses",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L875-L912 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_linode | def get_linode(kwargs=None, call=None):
'''
Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of th... | python | def get_linode(kwargs=None, call=None):
'''
Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of th... | [
"def",
"get_linode",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_linode function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":"... | Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of the Linode for which to get data. Can be used instead ... | [
"Returns",
"data",
"for",
"a",
"single",
"named",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L915-L955 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_linode_id_from_name | def get_linode_id_from_name(name):
'''
Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required.
'''
nodes = _query('linode', 'list')['DATA']
linode_id = ''
for node in nodes:
if name == node['LABEL']:
... | python | def get_linode_id_from_name(name):
'''
Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required.
'''
nodes = _query('linode', 'list')['DATA']
linode_id = ''
for node in nodes:
if name == node['LABEL']:
... | [
"def",
"get_linode_id_from_name",
"(",
"name",
")",
":",
"nodes",
"=",
"_query",
"(",
"'linode'",
",",
"'list'",
")",
"[",
"'DATA'",
"]",
"linode_id",
"=",
"''",
"for",
"node",
"in",
"nodes",
":",
"if",
"name",
"==",
"node",
"[",
"'LABEL'",
"]",
":",
... | Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required. | [
"Returns",
"the",
"Linode",
"ID",
"for",
"a",
"VM",
"from",
"the",
"provided",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L958-L976 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_password | def get_password(vm_):
r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from.
'''
return config.get_cloud_config_value(
'password', vm_, __opts__,
default=config.get_cloud_config_value(
'passwd', vm_, __opts__,
s... | python | def get_password(vm_):
r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from.
'''
return config.get_cloud_config_value(
'password', vm_, __opts__,
default=config.get_cloud_config_value(
'passwd', vm_, __opts__,
s... | [
"def",
"get_password",
"(",
"vm_",
")",
":",
"return",
"config",
".",
"get_cloud_config_value",
"(",
"'password'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'passwd'",
",",
"vm_",
",",
"__opts__",
",",
"... | r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from. | [
"r",
"Return",
"the",
"password",
"to",
"use",
"for",
"a",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L979-L993 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _decode_linode_plan_label | def _decode_linode_plan_label(label):
'''
Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB`
'''
sizes = avail_sizes()
if label no... | python | def _decode_linode_plan_label(label):
'''
Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB`
'''
sizes = avail_sizes()
if label no... | [
"def",
"_decode_linode_plan_label",
"(",
"label",
")",
":",
"sizes",
"=",
"avail_sizes",
"(",
")",
"if",
"label",
"not",
"in",
"sizes",
":",
"if",
"'GB'",
"in",
"label",
":",
"raise",
"SaltCloudException",
"(",
"'Invalid Linode plan ({}) specified - call avail_sizes... | Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB` | [
"Attempts",
"to",
"decode",
"a",
"user",
"-",
"supplied",
"Linode",
"plan",
"label",
"into",
"the",
"format",
"in",
"Linode",
"API",
"output"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L996-L1049 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_plan_id | def get_plan_id(kwargs=None, call=None):
'''
Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024"
'''
if call == 'action':
raise SaltCloudExcept... | python | def get_plan_id(kwargs=None, call=None):
'''
Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024"
'''
if call == 'action':
raise SaltCloudExcept... | [
"def",
"get_plan_id",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":... | Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024" | [
"Returns",
"the",
"Linode",
"Plan",
"ID",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1052-L1081 | train |
saltstack/salt | salt/cloud/clouds/linode.py | get_vm_size | def get_vm_size(vm_):
r'''
Returns the VM's size.
vm\_
The VM to get the size for.
'''
vm_size = config.get_cloud_config_value('size', vm_, __opts__)
ram = avail_sizes()[vm_size]['RAM']
if vm_size.startswith('Linode'):
vm_size = vm_size.replace('Linode ', '')
if ram ==... | python | def get_vm_size(vm_):
r'''
Returns the VM's size.
vm\_
The VM to get the size for.
'''
vm_size = config.get_cloud_config_value('size', vm_, __opts__)
ram = avail_sizes()[vm_size]['RAM']
if vm_size.startswith('Linode'):
vm_size = vm_size.replace('Linode ', '')
if ram ==... | [
"def",
"get_vm_size",
"(",
"vm_",
")",
":",
"vm_size",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'size'",
",",
"vm_",
",",
"__opts__",
")",
"ram",
"=",
"avail_sizes",
"(",
")",
"[",
"vm_size",
"]",
"[",
"'RAM'",
"]",
"if",
"vm_size",
".",
"st... | r'''
Returns the VM's size.
vm\_
The VM to get the size for. | [
"r",
"Returns",
"the",
"VM",
"s",
"size",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1128-L1146 | train |
saltstack/salt | salt/cloud/clouds/linode.py | list_nodes_min | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt... | python | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt... | [
"def",
"list_nodes_min",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_min function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"nodes",
"=",
"_query",
"(",
"'... | Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes_min my-linode-config
... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
".",
"Only",
"a",
"list",
"of",
"VM",
"names",
"and",
"their",
"state",
"is",
"returned",
".",
"This",
"is",
"the",
"minimum",
"amount",
"of",
"information",
"needed",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1199-L1231 | train |
saltstack/salt | salt/cloud/clouds/linode.py | reboot | def reboot(name, call=None):
'''
Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
if call != 'action':
raise SaltCloudException(
'The show_instance ac... | python | def reboot(name, call=None):
'''
Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
if call != 'action':
raise SaltCloudException(
'The show_instance ac... | [
"def",
"reboot",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"name",
... | Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name | [
"Reboot",
"a",
"linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1243-L1272 | train |
saltstack/salt | salt/cloud/clouds/linode.py | show_instance | def show_instance(name, call=None):
'''
Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_ins... | python | def show_instance(name, call=None):
'''
Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_ins... | [
"def",
"show_instance",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"na... | Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
.. note::
The ``imag... | [
"Displays",
"details",
"about",
"a",
"particular",
"Linode",
"VM",
".",
"Either",
"a",
"name",
"or",
"a",
"linode_id",
"must",
"be",
"provided",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1275-L1315 | train |
saltstack/salt | salt/cloud/clouds/linode.py | show_pricing | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
'... | python | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
'... | [
"def",
"show_pricing",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -f or --function.'",
")",
"profile",
"=",
"__opts__",
"["... | Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile | [
"Show",
"pricing",
"for",
"a",
"particular",
"profile",
".",
"This",
"is",
"only",
"an",
"estimate",
"based",
"on",
"unofficial",
"pricing",
"sources",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1318-L1360 | train |
saltstack/salt | salt/cloud/clouds/linode.py | start | def start(name, call=None):
'''
Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name
'''
if call != 'action':
raise SaltCloudException(
'The start action must be called with -a or --action... | python | def start(name, call=None):
'''
Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name
'''
if call != 'action':
raise SaltCloudException(
'The start action must be called with -a or --action... | [
"def",
"start",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The start action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"name",
")",
"n... | Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name | [
"Start",
"a",
"VM",
"in",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1363-L1398 | train |
saltstack/salt | salt/cloud/clouds/linode.py | update_linode | def update_linode(linode_id, update_args=None):
'''
Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form.
'''
update_args.update({'LinodeID': linode_id})
result = _qu... | python | def update_linode(linode_id, update_args=None):
'''
Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form.
'''
update_args.update({'LinodeID': linode_id})
result = _qu... | [
"def",
"update_linode",
"(",
"linode_id",
",",
"update_args",
"=",
"None",
")",
":",
"update_args",
".",
"update",
"(",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
")",
"result",
"=",
"_query",
"(",
"'linode'",
",",
"'update'",
",",
"args",
"=",
"update_args... | Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form. | [
"Updates",
"a",
"Linode",
"s",
"properties",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1438-L1452 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _clean_data | def _clean_data(api_response):
'''
Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned.
'''
data = {}
data.update(api_response['DATA'])
if not data:
response_data = api_response['DATA']
data.upd... | python | def _clean_data(api_response):
'''
Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned.
'''
data = {}
data.update(api_response['DATA'])
if not data:
response_data = api_response['DATA']
data.upd... | [
"def",
"_clean_data",
"(",
"api_response",
")",
":",
"data",
"=",
"{",
"}",
"data",
".",
"update",
"(",
"api_response",
"[",
"'DATA'",
"]",
")",
"if",
"not",
"data",
":",
"response_data",
"=",
"api_response",
"[",
"'DATA'",
"]",
"data",
".",
"update",
... | Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned. | [
"Returns",
"the",
"DATA",
"response",
"from",
"a",
"Linode",
"API",
"query",
"as",
"a",
"single",
"pre",
"-",
"formatted",
"dictionary"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1455-L1469 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _list_linodes | def _list_linodes(full=False):
'''
Helper function to format and parse linode data
'''
nodes = _query('linode', 'list')['DATA']
ips = get_ips()
ret = {}
for node in nodes:
this_node = {}
linode_id = six.text_type(node['LINODEID'])
this_node['id'] = linode_id
... | python | def _list_linodes(full=False):
'''
Helper function to format and parse linode data
'''
nodes = _query('linode', 'list')['DATA']
ips = get_ips()
ret = {}
for node in nodes:
this_node = {}
linode_id = six.text_type(node['LINODEID'])
this_node['id'] = linode_id
... | [
"def",
"_list_linodes",
"(",
"full",
"=",
"False",
")",
":",
"nodes",
"=",
"_query",
"(",
"'linode'",
",",
"'list'",
")",
"[",
"'DATA'",
"]",
"ips",
"=",
"get_ips",
"(",
")",
"ret",
"=",
"{",
"}",
"for",
"node",
"in",
"nodes",
":",
"this_node",
"="... | Helper function to format and parse linode data | [
"Helper",
"function",
"to",
"format",
"and",
"parse",
"linode",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1472-L1502 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _query | def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None,
url='https://api.linode.com/'):
'''
Make a web call to the Linode API.
'''
global LASTCALL
vm_ = get_configured_provider()
ratelimit_slee... | python | def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None,
url='https://api.linode.com/'):
'''
Make a web call to the Linode API.
'''
global LASTCALL
vm_ = get_configured_provider()
ratelimit_slee... | [
"def",
"_query",
"(",
"action",
"=",
"None",
",",
"command",
"=",
"None",
",",
"args",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"header_dict",
"=",
"None",
",",
"data",
"=",
"None",
",",
"url",
"=",
"'https://api.linode.com/'",
")",
":",
"global"... | Make a web call to the Linode API. | [
"Make",
"a",
"web",
"call",
"to",
"the",
"Linode",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1505-L1582 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_job | def _wait_for_job(linode_id, job_id, timeout=300, quiet=True):
'''
Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status ... | python | def _wait_for_job(linode_id, job_id, timeout=300, quiet=True):
'''
Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status ... | [
"def",
"_wait_for_job",
"(",
"linode_id",
",",
"job_id",
",",
"timeout",
"=",
"300",
",",
"quiet",
"=",
"True",
")",
":",
"interval",
"=",
"5",
"iterations",
"=",
"int",
"(",
"timeout",
"/",
"interval",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
... | Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debug logs when True. Otherwise, logs to info. | [
"Wait",
"for",
"a",
"Job",
"to",
"return",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1585-L1616 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_status | def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
'''
Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
q... | python | def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
'''
Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
q... | [
"def",
"_wait_for_status",
"(",
"linode_id",
",",
"status",
"=",
"None",
",",
"timeout",
"=",
"300",
",",
"quiet",
"=",
"True",
")",
":",
"if",
"status",
"is",
"None",
":",
"status",
"=",
"_get_status_id_by_name",
"(",
"'brand_new'",
")",
"status_desc_waitin... | Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debug logs when False. Otherwise, logs to info. | [
"Wait",
"for",
"a",
"certain",
"status",
"from",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1619-L1658 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _get_status_descr_by_id | def _get_status_descr_by_id(status_id):
'''
Return linode status by ID
status_id
linode VM status ID
'''
for status_name, status_data in six.iteritems(LINODE_STATUS):
if status_data['code'] == int(status_id):
return status_data['descr']
return LINODE_STATUS.get(statu... | python | def _get_status_descr_by_id(status_id):
'''
Return linode status by ID
status_id
linode VM status ID
'''
for status_name, status_data in six.iteritems(LINODE_STATUS):
if status_data['code'] == int(status_id):
return status_data['descr']
return LINODE_STATUS.get(statu... | [
"def",
"_get_status_descr_by_id",
"(",
"status_id",
")",
":",
"for",
"status_name",
",",
"status_data",
"in",
"six",
".",
"iteritems",
"(",
"LINODE_STATUS",
")",
":",
"if",
"status_data",
"[",
"'code'",
"]",
"==",
"int",
"(",
"status_id",
")",
":",
"return",... | Return linode status by ID
status_id
linode VM status ID | [
"Return",
"linode",
"status",
"by",
"ID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1661-L1671 | train |
saltstack/salt | salt/cloud/clouds/linode.py | _validate_name | def _validate_name(name):
'''
Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate
'''
name = six.text_type(name)
name_length = len(name)
regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$')
if name... | python | def _validate_name(name):
'''
Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate
'''
name = six.text_type(name)
name_length = len(name)
regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$')
if name... | [
"def",
"_validate_name",
"(",
"name",
")",
":",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"name_length",
"=",
"len",
"(",
"name",
")",
"regex",
"=",
"re",
".",
"compile",
"(",
"r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$'",
")",
"if",
"name_length... | Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate | [
"Checks",
"if",
"the",
"provided",
"name",
"fits",
"Linode",
"s",
"labeling",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1684-L1711 | train |
saltstack/salt | salt/modules/napalm_netacl.py | _get_capirca_platform | def _get_capirca_platform(): # pylint: disable=too-many-return-statements
'''
Given the following NAPALM grains, we can determine the Capirca platform name:
- vendor
- device model
- operating system
Not the most optimal.
'''
vendor = __grains__['vendor'].lower()
os_ = __grains__[... | python | def _get_capirca_platform(): # pylint: disable=too-many-return-statements
'''
Given the following NAPALM grains, we can determine the Capirca platform name:
- vendor
- device model
- operating system
Not the most optimal.
'''
vendor = __grains__['vendor'].lower()
os_ = __grains__[... | [
"def",
"_get_capirca_platform",
"(",
")",
":",
"# pylint: disable=too-many-return-statements",
"vendor",
"=",
"__grains__",
"[",
"'vendor'",
"]",
".",
"lower",
"(",
")",
"os_",
"=",
"__grains__",
"[",
"'os'",
"]",
".",
"lower",
"(",
")",
"model",
"=",
"__grain... | Given the following NAPALM grains, we can determine the Capirca platform name:
- vendor
- device model
- operating system
Not the most optimal. | [
"Given",
"the",
"following",
"NAPALM",
"grains",
"we",
"can",
"determine",
"the",
"Capirca",
"platform",
"name",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L80-L108 | train |
saltstack/salt | salt/modules/napalm_netacl.py | load_term_config | def load_term_config(filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
revision_id=None,
r... | python | def load_term_config(filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
revision_id=None,
r... | [
"def",
"load_term_config",
"(",
"filter_name",
",",
"term_name",
",",
"filter_options",
"=",
"None",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"=",
"True",
",",
"revision_id",
"=",
"None... | Generate and load the configuration of a policy term.
filter_name
The name of the policy filter.
term_name
The name of the term.
filter_options
Additional filter options. These options are platform-specific.
See the complete list of options_.
.. _options: https://... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"a",
"policy",
"term",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L116-L451 | train |
saltstack/salt | salt/modules/napalm_netacl.py | load_filter_config | def load_filter_config(filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
... | python | def load_filter_config(filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
... | [
"def",
"load_filter_config",
"(",
"filter_name",
",",
"filter_options",
"=",
"None",
",",
"terms",
"=",
"None",
",",
"prepend",
"=",
"True",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"... | Generate and load the configuration of a policy filter.
.. note::
The order of the terms is very important. The configuration loaded
on the device respects the order defined in the ``terms`` and/or
inside the pillar.
When merging the ``terms`` with the pillar data, consider the
... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"a",
"policy",
"filter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L455-L665 | train |
saltstack/salt | salt/modules/napalm_netacl.py | load_policy_config | def load_policy_config(filters=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
only_lower_merge=False,
revision_id=None,... | python | def load_policy_config(filters=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
only_lower_merge=False,
revision_id=None,... | [
"def",
"load_policy_config",
"(",
"filters",
"=",
"None",
",",
"prepend",
"=",
"True",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"=",
"True",
",",
"only_lower_merge",
"=",
"False",
","... | Generate and load the configuration of the whole policy.
.. note::
The order of the filters and their terms is very important.
The configuration loaded on the device respects the order
defined in the ``filters`` and/or inside the pillar.
When merging the ``filters`` with the pilla... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"the",
"whole",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L669-L855 | train |
saltstack/salt | salt/modules/napalm_netacl.py | get_filter_pillar | def get_filter_pillar(filter_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the filter configuration given its name.
filter_name
The name of the filter.
... | python | def get_filter_pillar(filter_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the filter configuration given its name.
filter_name
The name of the filter.
... | [
"def",
"get_filter_pillar",
"(",
"filter_name",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'capirca.get_filter_pillar'",
"]",
"(",
"filter_name",
",",
"pillar_key",
"=",
"p... | Helper that can be used inside a state SLS,
in order to get the filter configuration given its name.
filter_name
The name of the filter.
pillar_key
The root key of the whole policy config.
pillarenv
Query the master to generate fresh pillar data on the fly,
specificall... | [
"Helper",
"that",
"can",
"be",
"used",
"inside",
"a",
"state",
"SLS",
"in",
"order",
"to",
"get",
"the",
"filter",
"configuration",
"given",
"its",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L858-L883 | train |
saltstack/salt | salt/modules/napalm_netacl.py | get_term_pillar | def get_term_pillar(filter_name,
term_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the term configuration given its name,
under a certain filter uniqu... | python | def get_term_pillar(filter_name,
term_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the term configuration given its name,
under a certain filter uniqu... | [
"def",
"get_term_pillar",
"(",
"filter_name",
",",
"term_name",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
")",
":",
"return",
"__salt__",
"[",
"'capirca.get_term_pillar'",
"]",
"(",
"filter_name",
",",
"term_n... | Helper that can be used inside a state SLS,
in order to get the term configuration given its name,
under a certain filter uniquely identified by its name.
filter_name
The name of the filter.
term_name
The name of the term.
pillar_key: ``acl``
The root key of the whole poli... | [
"Helper",
"that",
"can",
"be",
"used",
"inside",
"a",
"state",
"SLS",
"in",
"order",
"to",
"get",
"the",
"term",
"configuration",
"given",
"its",
"name",
"under",
"a",
"certain",
"filter",
"uniquely",
"identified",
"by",
"its",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L886-L917 | train |
saltstack/salt | salt/modules/purefb.py | _get_blade | def _get_blade():
'''
Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB... | python | def _get_blade():
'''
Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB... | [
"def",
"_get_blade",
"(",
")",
":",
"try",
":",
"blade_name",
"=",
"__opts__",
"[",
"'pure_tags'",
"]",
"[",
"'fb'",
"]",
".",
"get",
"(",
"'san_ip'",
")",
"api_token",
"=",
"__opts__",
"[",
"'pure_tags'",
"]",
"[",
"'fb'",
"]",
".",
"get",
"(",
"'ap... | Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB_API)
3) From the pillar (... | [
"Get",
"Pure",
"Storage",
"FlasBlade",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L85-L123 | train |
saltstack/salt | salt/modules/purefb.py | _get_fs | def _get_fs(name, blade):
'''
Private function to
check for existance of a filesystem
'''
_fs = []
_fs.append(name)
try:
res = blade.file_systems.list_file_systems(names=_fs)
return res.items[0]
except rest.ApiException:
return None | python | def _get_fs(name, blade):
'''
Private function to
check for existance of a filesystem
'''
_fs = []
_fs.append(name)
try:
res = blade.file_systems.list_file_systems(names=_fs)
return res.items[0]
except rest.ApiException:
return None | [
"def",
"_get_fs",
"(",
"name",
",",
"blade",
")",
":",
"_fs",
"=",
"[",
"]",
"_fs",
".",
"append",
"(",
"name",
")",
"try",
":",
"res",
"=",
"blade",
".",
"file_systems",
".",
"list_file_systems",
"(",
"names",
"=",
"_fs",
")",
"return",
"res",
"."... | Private function to
check for existance of a filesystem | [
"Private",
"function",
"to",
"check",
"for",
"existance",
"of",
"a",
"filesystem"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L126-L137 | train |
saltstack/salt | salt/modules/purefb.py | _get_snapshot | def _get_snapshot(name, suffix, blade):
'''
Return name of Snapshot
or None
'''
try:
filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix)
res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt)
return res.items[0]
except rest.ApiException:
... | python | def _get_snapshot(name, suffix, blade):
'''
Return name of Snapshot
or None
'''
try:
filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix)
res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt)
return res.items[0]
except rest.ApiException:
... | [
"def",
"_get_snapshot",
"(",
"name",
",",
"suffix",
",",
"blade",
")",
":",
"try",
":",
"filt",
"=",
"'source=\\'{}\\' and suffix=\\'{}\\''",
".",
"format",
"(",
"name",
",",
"suffix",
")",
"res",
"=",
"blade",
".",
"file_system_snapshots",
".",
"list_file_sys... | Return name of Snapshot
or None | [
"Return",
"name",
"of",
"Snapshot",
"or",
"None"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L140-L150 | train |
saltstack/salt | salt/modules/purefb.py | _get_deleted_fs | def _get_deleted_fs(name, blade):
'''
Private function to check
if a file systeem has already been deleted
'''
try:
_fs = _get_fs(name, blade)
if _fs and _fs.destroyed:
return _fs
except rest.ApiException:
return None | python | def _get_deleted_fs(name, blade):
'''
Private function to check
if a file systeem has already been deleted
'''
try:
_fs = _get_fs(name, blade)
if _fs and _fs.destroyed:
return _fs
except rest.ApiException:
return None | [
"def",
"_get_deleted_fs",
"(",
"name",
",",
"blade",
")",
":",
"try",
":",
"_fs",
"=",
"_get_fs",
"(",
"name",
",",
"blade",
")",
"if",
"_fs",
"and",
"_fs",
".",
"destroyed",
":",
"return",
"_fs",
"except",
"rest",
".",
"ApiException",
":",
"return",
... | Private function to check
if a file systeem has already been deleted | [
"Private",
"function",
"to",
"check",
"if",
"a",
"file",
"systeem",
"has",
"already",
"been",
"deleted"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L153-L163 | train |
saltstack/salt | salt/states/syslog_ng.py | started | def started(name=None,
user=None,
group=None,
chroot=None,
caps=None,
no_caps=False,
pidfile=None,
enable_core=False,
fd_limit=None,
verbose=False,
debug=False,
trace=False,
yy... | python | def started(name=None,
user=None,
group=None,
chroot=None,
caps=None,
no_caps=False,
pidfile=None,
enable_core=False,
fd_limit=None,
verbose=False,
debug=False,
trace=False,
yy... | [
"def",
"started",
"(",
"name",
"=",
"None",
",",
"user",
"=",
"None",
",",
"group",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"caps",
"=",
"None",
",",
"no_caps",
"=",
"False",
",",
"pidfile",
"=",
"None",
",",
"enable_core",
"=",
"False",
",",... | Ensures, that syslog-ng is started via the given parameters.
Users shouldn't use this function, if the service module is available on
their system. | [
"Ensures",
"that",
"syslog",
"-",
"ng",
"is",
"started",
"via",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/syslog_ng.py#L76-L115 | train |
saltstack/salt | salt/client/ssh/client.py | SSHClient._prep_ssh | def _prep_ssh(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Prepare the arguments
'''
opts = copy.deepcopy(self.opts)
opts.update(kwargs)
i... | python | def _prep_ssh(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Prepare the arguments
'''
opts = copy.deepcopy(self.opts)
opts.update(kwargs)
i... | [
"def",
"_prep_ssh",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"copy",
".",
"deepcopy",
... | Prepare the arguments | [
"Prepare",
"the",
"arguments"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L43-L64 | train |
saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd_iter | def cmd_iter(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return a
generator
... | python | def cmd_iter(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return a
generator
... | [
"def",
"cmd_iter",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"ret",
"=",
"''",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ssh",
"=",
"... | Execute a single command via the salt-ssh subsystem and return a
generator
.. versionadded:: 2015.5.0 | [
"Execute",
"a",
"single",
"command",
"via",
"the",
"salt",
"-",
"ssh",
"subsystem",
"and",
"return",
"a",
"generator"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L66-L91 | train |
saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd | def cmd(self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0
... | python | def cmd(self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0
... | [
"def",
"cmd",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ssh",
"=",
"self",
".",
"_prep_ssh",
"(",
... | Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0 | [
"Execute",
"a",
"single",
"command",
"via",
"the",
"salt",
"-",
"ssh",
"subsystem",
"and",
"return",
"all",
"routines",
"at",
"once"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L93-L118 | train |
saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd_sync | def cmd_sync(self, low):
'''
Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': ... | python | def cmd_sync(self, low):
'''
Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': ... | [
"def",
"cmd_sync",
"(",
"self",
",",
"low",
")",
":",
"kwargs",
"=",
"copy",
".",
"deepcopy",
"(",
"low",
")",
"for",
"ignore",
"in",
"[",
"'tgt'",
",",
"'fun'",
",",
"'arg'",
",",
"'timeout'",
",",
"'tgt_type'",
",",
"'kwarg'",
"]",
":",
"if",
"ig... | Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': (),
'tgt_type'='glob',
... | [
"Execute",
"a",
"salt",
"-",
"ssh",
"call",
"synchronously",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L120-L152 | train |
saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd_subset | def cmd_subset(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
sub=3,
**kwargs):
'''
Execute a command on a random subset of the targeted systems
T... | python | def cmd_subset(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
sub=3,
**kwargs):
'''
Execute a command on a random subset of the targeted systems
T... | [
"def",
"cmd_subset",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"ret",
"=",
"''",
",",
"kwarg",
"=",
"None",
",",
"sub",
"=",
"3",
",",
"*",
"*",
"kwargs",
... | Execute a command on a random subset of the targeted systems
The function signature is the same as :py:meth:`cmd` with the
following exceptions.
:param sub: The number of systems to execute on
.. code-block:: python
>>> import salt.client.ssh.client
>>> sshcli... | [
"Execute",
"a",
"command",
"on",
"a",
"random",
"subset",
"of",
"the",
"targeted",
"systems"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L174-L214 | train |
saltstack/salt | salt/states/eselect.py | set_ | def set_(name, target, module_parameter=None, action_parameter=None):
'''
Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
ac... | python | def set_(name, target, module_parameter=None, action_parameter=None):
'''
Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
ac... | [
"def",
"set_",
"(",
"name",
",",
"target",
",",
"module_parameter",
"=",
"None",
",",
"action_parameter",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":... | Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
action_parameter
additional params passed to the defined action
.. code... | [
"Verify",
"that",
"the",
"given",
"module",
"is",
"set",
"to",
"the",
"given",
"target"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/eselect.py#L26-L85 | train |
saltstack/salt | salt/modules/napalm_network.py | _filter_list | def _filter_list(input_list, search_key, search_value):
'''
Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_ke... | python | def _filter_list(input_list, search_key, search_value):
'''
Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_ke... | [
"def",
"_filter_list",
"(",
"input_list",
",",
"search_key",
",",
"search_value",
")",
":",
"output_list",
"=",
"list",
"(",
")",
"for",
"dictionary",
"in",
"input_list",
":",
"if",
"dictionary",
".",
"get",
"(",
"search_key",
")",
"==",
"search_value",
":",... | Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_key
:return: filered list of dictionaries | [
"Filters",
"a",
"list",
"of",
"dictionary",
"by",
"a",
"set",
"of",
"key",
"-",
"value",
"pair",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L70-L87 | train |
saltstack/salt | salt/modules/napalm_network.py | _filter_dict | def _filter_dict(input_dict, search_key, search_value):
'''
Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the lea... | python | def _filter_dict(input_dict, search_key, search_value):
'''
Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the lea... | [
"def",
"_filter_dict",
"(",
"input_dict",
",",
"search_key",
",",
"search_value",
")",
":",
"output_dict",
"=",
"dict",
"(",
")",
"for",
"key",
",",
"key_list",
"in",
"six",
".",
"iteritems",
"(",
"input_dict",
")",
":",
"key_list_filtered",
"=",
"_filter_li... | Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the leaf dictionaries
:return: filtered dictionary | [
"Filters",
"a",
"dictionary",
"of",
"dictionaries",
"by",
"a",
"key",
"-",
"value",
"pair",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L90-L108 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.