partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
add_repo_key
.. versionadded:: 2017.7.0 Add a repo key using ``apt-key add``. :param str path: The path of the key file to import. :param str text: The key data to import, in string form. :param str keyserver: The server to download the repo key specified by the keyid. :param str keyid: The key id of the repo ...
salt/modules/aptpkg.py
def add_repo_key(path=None, text=None, keyserver=None, keyid=None, saltenv='base'): ''' .. versionadded:: 2017.7.0 Add a repo key using ``apt-key add``. :param str path: The path of the key file to import. :param str text: The key data to import, in string form. :param str keyserver: The serve...
def add_repo_key(path=None, text=None, keyserver=None, keyid=None, saltenv='base'): ''' .. versionadded:: 2017.7.0 Add a repo key using ``apt-key add``. :param str path: The path of the key file to import. :param str text: The key data to import, in string form. :param str keyserver: The serve...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L1907-L1975
[ "def", "add_repo_key", "(", "path", "=", "None", ",", "text", "=", "None", ",", "keyserver", "=", "None", ",", "keyid", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "cmd", "=", "[", "'apt-key'", "]", "kwargs", "=", "{", "}", "current_repo_ke...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_repo_key
.. versionadded:: 2015.8.0 Remove a repo key using ``apt-key del`` name Repo from which to remove the key. Unnecessary if ``keyid`` is passed. keyid The KeyID of the GPG key to remove keyid_ppa : False If set to ``True``, the repo's GPG key ID will be looked up from p...
salt/modules/aptpkg.py
def del_repo_key(name=None, **kwargs): ''' .. versionadded:: 2015.8.0 Remove a repo key using ``apt-key del`` name Repo from which to remove the key. Unnecessary if ``keyid`` is passed. keyid The KeyID of the GPG key to remove keyid_ppa : False If set to ``True``, the...
def del_repo_key(name=None, **kwargs): ''' .. versionadded:: 2015.8.0 Remove a repo key using ``apt-key del`` name Repo from which to remove the key. Unnecessary if ``keyid`` is passed. keyid The KeyID of the GPG key to remove keyid_ppa : False If set to ``True``, the...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L1978-L2030
[ "def", "del_repo_key", "(", "name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "get", "(", "'keyid_ppa'", ",", "False", ")", ":", "if", "isinstance", "(", "name", ",", "six", ".", "string_types", ")", "and", "name", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mod_repo
Modify one or more values for a repo. If the repo does not exist, it will be created, so long as the definition is well formed. For Ubuntu the ``ppa:<project>/repo`` format is acceptable. ``ppa:`` format can only be used to create a new repository. The following options are available to modify a repo...
salt/modules/aptpkg.py
def mod_repo(repo, saltenv='base', **kwargs): ''' Modify one or more values for a repo. If the repo does not exist, it will be created, so long as the definition is well formed. For Ubuntu the ``ppa:<project>/repo`` format is acceptable. ``ppa:`` format can only be used to create a new repository....
def mod_repo(repo, saltenv='base', **kwargs): ''' Modify one or more values for a repo. If the repo does not exist, it will be created, so long as the definition is well formed. For Ubuntu the ``ppa:<project>/repo`` format is acceptable. ``ppa:`` format can only be used to create a new repository....
[ "Modify", "one", "or", "more", "values", "for", "a", "repo", ".", "If", "the", "repo", "does", "not", "exist", "it", "will", "be", "created", "so", "long", "as", "the", "definition", "is", "well", "formed", ".", "For", "Ubuntu", "the", "ppa", ":", "<...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2033-L2362
[ "def", "mod_repo", "(", "repo", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "if", "'refresh_db'", "in", "kwargs", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Neon'", ",", "'The \\'refresh_db\\' argument to \\'p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
expand_repo_def
Take a repository definition and expand it to the full pkg repository dict that can be used for comparison. This is a helper function to make the Debian/Ubuntu apt sources sane for comparison in the pkgrepo states. This is designed to be called from pkgrepo states and will have little use being called...
salt/modules/aptpkg.py
def expand_repo_def(**kwargs): ''' Take a repository definition and expand it to the full pkg repository dict that can be used for comparison. This is a helper function to make the Debian/Ubuntu apt sources sane for comparison in the pkgrepo states. This is designed to be called from pkgrepo state...
def expand_repo_def(**kwargs): ''' Take a repository definition and expand it to the full pkg repository dict that can be used for comparison. This is a helper function to make the Debian/Ubuntu apt sources sane for comparison in the pkgrepo states. This is designed to be called from pkgrepo state...
[ "Take", "a", "repository", "definition", "and", "expand", "it", "to", "the", "full", "pkg", "repository", "dict", "that", "can", "be", "used", "for", "comparison", ".", "This", "is", "a", "helper", "function", "to", "make", "the", "Debian", "/", "Ubuntu", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2399-L2452
[ "def", "expand_repo_def", "(", "*", "*", "kwargs", ")", ":", "if", "'repo'", "not", "in", "kwargs", ":", "raise", "SaltInvocationError", "(", "'missing \\'repo\\' argument'", ")", "_check_apt", "(", ")", "sanitized", "=", "{", "}", "repo", "=", "salt", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_selections
Parses the format from ``dpkg --get-selections`` and return a format that pkg.get_selections and pkg.set_selections work with.
salt/modules/aptpkg.py
def _parse_selections(dpkgselection): ''' Parses the format from ``dpkg --get-selections`` and return a format that pkg.get_selections and pkg.set_selections work with. ''' ret = {} if isinstance(dpkgselection, six.string_types): dpkgselection = dpkgselection.split('\n') for line in ...
def _parse_selections(dpkgselection): ''' Parses the format from ``dpkg --get-selections`` and return a format that pkg.get_selections and pkg.set_selections work with. ''' ret = {} if isinstance(dpkgselection, six.string_types): dpkgselection = dpkgselection.split('\n') for line in ...
[ "Parses", "the", "format", "from", "dpkg", "--", "get", "-", "selections", "and", "return", "a", "format", "that", "pkg", ".", "get_selections", "and", "pkg", ".", "set_selections", "work", "with", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2455-L2470
[ "def", "_parse_selections", "(", "dpkgselection", ")", ":", "ret", "=", "{", "}", "if", "isinstance", "(", "dpkgselection", ",", "six", ".", "string_types", ")", ":", "dpkgselection", "=", "dpkgselection", ".", "split", "(", "'\\n'", ")", "for", "line", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_selections
View package state from the dpkg database. Returns a dict of dicts containing the state, and package names: .. code-block:: python {'<host>': {'<state>': ['pkg1', ... ] }, ... } CLI Example: .. code...
salt/modules/aptpkg.py
def get_selections(pattern=None, state=None): ''' View package state from the dpkg database. Returns a dict of dicts containing the state, and package names: .. code-block:: python {'<host>': {'<state>': ['pkg1', ... ] }...
def get_selections(pattern=None, state=None): ''' View package state from the dpkg database. Returns a dict of dicts containing the state, and package names: .. code-block:: python {'<host>': {'<state>': ['pkg1', ... ] }...
[ "View", "package", "state", "from", "the", "dpkg", "database", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2473-L2507
[ "def", "get_selections", "(", "pattern", "=", "None", ",", "state", "=", "None", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'dpkg'", ",", "'--get-selections'", "]", "cmd", ".", "append", "(", "pattern", "if", "pattern", "else", "'*'", ")", "st...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_selections
Change package state in the dpkg database. The state can be any one of, documented in ``dpkg(1)``: - install - hold - deinstall - purge This command is commonly used to mark specific packages to be held from being upgraded, that is, to be kept at a certain version. When a state is cha...
salt/modules/aptpkg.py
def set_selections(path=None, selection=None, clear=False, saltenv='base'): ''' Change package state in the dpkg database. The state can be any one of, documented in ``dpkg(1)``: - install - hold - deinstall - purge This command is commonly used to mark specific packages to be held fr...
def set_selections(path=None, selection=None, clear=False, saltenv='base'): ''' Change package state in the dpkg database. The state can be any one of, documented in ``dpkg(1)``: - install - hold - deinstall - purge This command is commonly used to mark specific packages to be held fr...
[ "Change", "package", "state", "in", "the", "dpkg", "database", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2516-L2618
[ "def", "set_selections", "(", "path", "=", "None", ",", "selection", "=", "None", ",", "clear", "=", "False", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "}", "if", "not", "path", "and", "not", "selection", ":", "return", "ret", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_resolve_deps
Installs missing dependencies and marks them as auto installed so they are removed when no more manually installed packages depend on them. .. versionadded:: 2014.7.0 :depends: - python-apt module
salt/modules/aptpkg.py
def _resolve_deps(name, pkgs, **kwargs): ''' Installs missing dependencies and marks them as auto installed so they are removed when no more manually installed packages depend on them. .. versionadded:: 2014.7.0 :depends: - python-apt module ''' missing_deps = [] for pkg_file in pkgs...
def _resolve_deps(name, pkgs, **kwargs): ''' Installs missing dependencies and marks them as auto installed so they are removed when no more manually installed packages depend on them. .. versionadded:: 2014.7.0 :depends: - python-apt module ''' missing_deps = [] for pkg_file in pkgs...
[ "Installs", "missing", "dependencies", "and", "marks", "them", "as", "auto", "installed", "so", "they", "are", "removed", "when", "no", "more", "manually", "installed", "packages", "depend", "on", "them", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2621-L2663
[ "def", "_resolve_deps", "(", "name", ",", "pkgs", ",", "*", "*", "kwargs", ")", ":", "missing_deps", "=", "[", "]", "for", "pkg_file", "in", "pkgs", ":", "deb", "=", "apt", ".", "debfile", ".", "DebPackage", "(", "filename", "=", "pkg_file", ",", "ca...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show
.. versionadded:: 2019.2.0 Runs an ``apt-cache show`` on the passed package names, and returns the results in a nested dictionary. The top level of the return data will be the package name, with each package name mapping to a dictionary of version numbers to any additional information returned by ``apt...
salt/modules/aptpkg.py
def show(*names, **kwargs): ''' .. versionadded:: 2019.2.0 Runs an ``apt-cache show`` on the passed package names, and returns the results in a nested dictionary. The top level of the return data will be the package name, with each package name mapping to a dictionary of version numbers to any ...
def show(*names, **kwargs): ''' .. versionadded:: 2019.2.0 Runs an ``apt-cache show`` on the passed package names, and returns the results in a nested dictionary. The top level of the return data will be the package name, with each package name mapping to a dictionary of version numbers to any ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2701-L2782
[ "def", "show", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "refresh", "=", "kwargs", ".", "pop", "(", "'refresh'", ",", "False", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info_installed
Return the information of the named package(s) installed on the system. .. versionadded:: 2015.8.1 names The names of the packages for which to return information. failhard Whether to throw an exception if none of the packages are installed. Defaults to True. .. versionad...
salt/modules/aptpkg.py
def info_installed(*names, **kwargs): ''' Return the information of the named package(s) installed on the system. .. versionadded:: 2015.8.1 names The names of the packages for which to return information. failhard Whether to throw an exception if none of the packages are installe...
def info_installed(*names, **kwargs): ''' Return the information of the named package(s) installed on the system. .. versionadded:: 2015.8.1 names The names of the packages for which to return information. failhard Whether to throw an exception if none of the packages are installe...
[ "Return", "the", "information", "of", "the", "named", "package", "(", "s", ")", "installed", "on", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2785-L2853
[ "def", "info_installed", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "failhard", "=", "kwargs", ".", "pop", "(", "'failhard'", ",", "True",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_http_proxy_url
Returns the http_proxy_url if proxy_username, proxy_password, proxy_host, and proxy_port config values are set. Returns a string.
salt/modules/aptpkg.py
def _get_http_proxy_url(): ''' Returns the http_proxy_url if proxy_username, proxy_password, proxy_host, and proxy_port config values are set. Returns a string. ''' http_proxy_url = '' host = __salt__['config.option']('proxy_host') port = __salt__['config.option']('proxy_port') user...
def _get_http_proxy_url(): ''' Returns the http_proxy_url if proxy_username, proxy_password, proxy_host, and proxy_port config values are set. Returns a string. ''' http_proxy_url = '' host = __salt__['config.option']('proxy_host') port = __salt__['config.option']('proxy_port') user...
[ "Returns", "the", "http_proxy_url", "if", "proxy_username", "proxy_password", "proxy_host", "and", "proxy_port", "config", "values", "are", "set", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptpkg.py#L2856-L2884
[ "def", "_get_http_proxy_url", "(", ")", ":", "http_proxy_url", "=", "''", "host", "=", "__salt__", "[", "'config.option'", "]", "(", "'proxy_host'", ")", "port", "=", "__salt__", "[", "'config.option'", "]", "(", "'proxy_port'", ")", "username", "=", "__salt__...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_diff_and_merge_host_list
If Zabbix template is to be updated then list of assigned hosts must be provided in all or nothing manner to prevent some externally assigned hosts to be detached. :param defined: list of hosts defined in sls :param existing: list of hosts taken from live Zabbix :return: list to be updated (combinated ...
salt/states/zabbix_template.py
def _diff_and_merge_host_list(defined, existing): ''' If Zabbix template is to be updated then list of assigned hosts must be provided in all or nothing manner to prevent some externally assigned hosts to be detached. :param defined: list of hosts defined in sls :param existing: list of hosts taken...
def _diff_and_merge_host_list(defined, existing): ''' If Zabbix template is to be updated then list of assigned hosts must be provided in all or nothing manner to prevent some externally assigned hosts to be detached. :param defined: list of hosts defined in sls :param existing: list of hosts taken...
[ "If", "Zabbix", "template", "is", "to", "be", "updated", "then", "list", "of", "assigned", "hosts", "must", "be", "provided", "in", "all", "or", "nothing", "manner", "to", "prevent", "some", "externally", "assigned", "hosts", "to", "be", "detached", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L217-L233
[ "def", "_diff_and_merge_host_list", "(", "defined", ",", "existing", ")", ":", "try", ":", "defined_host_ids", "=", "set", "(", "[", "host", "[", "'hostid'", "]", "for", "host", "in", "defined", "]", ")", "existing_host_ids", "=", "set", "(", "[", "host", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_existing_template_c_list
Make a list of given component type not inherited from other templates because Zabbix API returns only list of all and list of inherited component items so we have to do a difference list. :param component: Template component (application, item, etc...) :param parent_id: ID of existing template the compone...
salt/states/zabbix_template.py
def _get_existing_template_c_list(component, parent_id, **kwargs): ''' Make a list of given component type not inherited from other templates because Zabbix API returns only list of all and list of inherited component items so we have to do a difference list. :param component: Template component (appli...
def _get_existing_template_c_list(component, parent_id, **kwargs): ''' Make a list of given component type not inherited from other templates because Zabbix API returns only list of all and list of inherited component items so we have to do a difference list. :param component: Template component (appli...
[ "Make", "a", "list", "of", "given", "component", "type", "not", "inherited", "from", "other", "templates", "because", "Zabbix", "API", "returns", "only", "list", "of", "all", "and", "list", "of", "inherited", "component", "items", "so", "we", "have", "to", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L236-L261
[ "def", "_get_existing_template_c_list", "(", "component", ",", "parent_id", ",", "*", "*", "kwargs", ")", ":", "c_def", "=", "TEMPLATE_COMPONENT_DEF", "[", "component", "]", "q_params", "=", "dict", "(", "c_def", "[", "'output'", "]", ")", "q_params", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_adjust_object_lists
For creation or update of object that have attribute which contains a list Zabbix awaits plain list of IDs while querying Zabbix for same object returns list of dicts :param obj: Zabbix object parameters
salt/states/zabbix_template.py
def _adjust_object_lists(obj): ''' For creation or update of object that have attribute which contains a list Zabbix awaits plain list of IDs while querying Zabbix for same object returns list of dicts :param obj: Zabbix object parameters ''' for subcomp in TEMPLATE_COMPONENT_DEF: if su...
def _adjust_object_lists(obj): ''' For creation or update of object that have attribute which contains a list Zabbix awaits plain list of IDs while querying Zabbix for same object returns list of dicts :param obj: Zabbix object parameters ''' for subcomp in TEMPLATE_COMPONENT_DEF: if su...
[ "For", "creation", "or", "update", "of", "object", "that", "have", "attribute", "which", "contains", "a", "list", "Zabbix", "awaits", "plain", "list", "of", "IDs", "while", "querying", "Zabbix", "for", "same", "object", "returns", "list", "of", "dicts" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L264-L273
[ "def", "_adjust_object_lists", "(", "obj", ")", ":", "for", "subcomp", "in", "TEMPLATE_COMPONENT_DEF", ":", "if", "subcomp", "in", "obj", "and", "TEMPLATE_COMPONENT_DEF", "[", "subcomp", "]", "[", "'adjust'", "]", ":", "obj", "[", "subcomp", "]", "=", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_manage_component
Takes particular component list, compares it with existing, call appropriate API methods - create, update, delete. :param component: component name :param parent_id: ID of parent entity under which component should be created :param defined: list of defined items of named component :param existing: lis...
salt/states/zabbix_template.py
def _manage_component(component, parent_id, defined, existing, template_id=None, **kwargs): ''' Takes particular component list, compares it with existing, call appropriate API methods - create, update, delete. :param component: component name :param parent_id: ID of parent entity under which component...
def _manage_component(component, parent_id, defined, existing, template_id=None, **kwargs): ''' Takes particular component list, compares it with existing, call appropriate API methods - create, update, delete. :param component: component name :param parent_id: ID of parent entity under which component...
[ "Takes", "particular", "component", "list", "compares", "it", "with", "existing", "call", "appropriate", "API", "methods", "-", "create", "update", "delete", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L276-L339
[ "def", "_manage_component", "(", "component", ",", "parent_id", ",", "defined", ",", "existing", ",", "template_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "zabbix_id_mapper", "=", "__salt__", "[", "'zabbix.get_zabbix_id_mapper'", "]", "(", ")", "dry_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_present
Check if Zabbix Template already exists. :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring) :par...
salt/states/zabbix_template.py
def is_present(name, **kwargs): ''' Check if Zabbix Template already exists. :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts...
def is_present(name, **kwargs): ''' Check if Zabbix Template already exists. :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts...
[ "Check", "if", "Zabbix", "Template", "already", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L342-L371
[ "def", "is_present", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "try", ":", "object_id", "=", "__salt__",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters according to Zabbix API documentation :param static_host_list: If hosts assigned to the tem...
salt/states/zabbix_template.py
def present(name, params, static_host_list=True, **kwargs): ''' Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters according to Zabbix API...
def present(name, params, static_host_list=True, **kwargs): ''' Creates Zabbix Template object or if differs update it according defined parameters. See Zabbix API documentation. Zabbix API version: >3.0 :param name: Zabbix Template name :param params: Additional parameters according to Zabbix API...
[ "Creates", "Zabbix", "Template", "object", "or", "if", "differs", "update", "it", "according", "defined", "parameters", ".", "See", "Zabbix", "API", "documentation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L375-L699
[ "def", "present", "(", "name", ",", "params", ",", "static_host_list", "=", "True", ",", "*", "*", "kwargs", ")", ":", "zabbix_id_mapper", "=", "__salt__", "[", "'zabbix.get_zabbix_id_mapper'", "]", "(", ")", "dry_run", "=", "__opts__", "[", "'test'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Makes the Zabbix Template to be absent (either does not exist or delete it). :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts or pill...
salt/states/zabbix_template.py
def absent(name, **kwargs): ''' Makes the Zabbix Template to be absent (either does not exist or delete it). :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix p...
def absent(name, **kwargs): ''' Makes the Zabbix Template to be absent (either does not exist or delete it). :param name: Zabbix Template name :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix p...
[ "Makes", "the", "Zabbix", "Template", "to", "be", "absent", "(", "either", "does", "not", "exist", "or", "delete", "it", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_template.py#L702-L742
[ "def", "absent", "(", "name", ",", "*", "*", "kwargs", ")", ":", "dry_run", "=", "__opts__", "[", "'test'", "]", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
chgid
Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376
salt/modules/solaris_group.py
def chgid(name, gid): ''' Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376 ''' pre_gid = __salt__['file.group_to_gid'](name) if gid == pre_gid: return True cmd = 'groupmod -g {0} {1}'.format(gid, name) __salt__['cmd.r...
def chgid(name, gid): ''' Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376 ''' pre_gid = __salt__['file.group_to_gid'](name) if gid == pre_gid: return True cmd = 'groupmod -g {0} {1}'.format(gid, name) __salt__['cmd.r...
[ "Change", "the", "gid", "for", "a", "named", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_group.py#L125-L143
[ "def", "chgid", "(", "name", ",", "gid", ")", ":", "pre_gid", "=", "__salt__", "[", "'file.group_to_gid'", "]", "(", "name", ")", "if", "gid", "==", "pre_gid", ":", "return", "True", "cmd", "=", "'groupmod -g {0} {1}'", ".", "format", "(", "gid", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
gen_key
Generate and return an private_key. If a ``dns_name`` is passed in, the private_key will be cached under that name. The type of key and the parameters used to generate the key are based on the default certificate use policy associated with the specified zone. CLI Example: .. code-block:: bash ...
salt/runners/venafiapi.py
def gen_key(minion_id, dns_name=None, zone='default', password=None): ''' Generate and return an private_key. If a ``dns_name`` is passed in, the private_key will be cached under that name. The type of key and the parameters used to generate the key are based on the default certificate use policy as...
def gen_key(minion_id, dns_name=None, zone='default', password=None): ''' Generate and return an private_key. If a ``dns_name`` is passed in, the private_key will be cached under that name. The type of key and the parameters used to generate the key are based on the default certificate use policy as...
[ "Generate", "and", "return", "an", "private_key", ".", "If", "a", "dns_name", "is", "passed", "in", "the", "private_key", "will", "be", "cached", "under", "that", "name", ".", "The", "type", "of", "key", "and", "the", "parameters", "used", "to", "generate"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L87-L167
[ "def", "gen_key", "(", "minion_id", ",", "dns_name", "=", "None", ",", "zone", "=", "'default'", ",", "password", "=", "None", ")", ":", "# Get the default certificate use policy associated with the zone", "# so we can generate keys that conform with policy", "# The /v1/zones...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
gen_csr
Generate a csr using the host's private_key. Analogous to: .. code-block:: bash VCert gencsr -cn [CN Value] -o "Beta Organization" -ou "Beta Group" \ -l "Palo Alto" -st "California" -c US CLI Example: .. code-block:: bash salt-run venafi.gen_csr <minion_id> <dns_name>
salt/runners/venafiapi.py
def gen_csr( minion_id, dns_name, zone='default', country=None, state=None, loc=None, org=None, org_unit=None, password=None, ): ''' Generate a csr using the host's private_key. Analogous to: .. code-block:: bash VCert...
def gen_csr( minion_id, dns_name, zone='default', country=None, state=None, loc=None, org=None, org_unit=None, password=None, ): ''' Generate a csr using the host's private_key. Analogous to: .. code-block:: bash VCert...
[ "Generate", "a", "csr", "using", "the", "host", "s", "private_key", ".", "Analogous", "to", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L170-L259
[ "def", "gen_csr", "(", "minion_id", ",", "dns_name", ",", "zone", "=", "'default'", ",", "country", "=", "None", ",", "state", "=", "None", ",", "loc", "=", "None", ",", "org", "=", "None", ",", "org_unit", "=", "None", ",", "password", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request
Request a new certificate Uses the following command: .. code-block:: bash VCert enroll -z <zone> -k <api key> -cn <domain name> CLI Example: .. code-block:: bash salt-run venafi.request <minion_id> <dns_name>
salt/runners/venafiapi.py
def request( minion_id, dns_name=None, zone='default', request_id=None, country='US', state='California', loc='Palo Alto', org='Beta Organization', org_unit='Beta Group', password=None, zone_id=None, ): ''' Request a new...
def request( minion_id, dns_name=None, zone='default', request_id=None, country='US', state='California', loc='Palo Alto', org='Beta Organization', org_unit='Beta Group', password=None, zone_id=None, ): ''' Request a new...
[ "Request", "a", "new", "certificate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L262-L361
[ "def", "request", "(", "minion_id", ",", "dns_name", "=", "None", ",", "zone", "=", "'default'", ",", "request_id", "=", "None", ",", "country", "=", "'US'", ",", "state", "=", "'California'", ",", "loc", "=", "'Palo Alto'", ",", "org", "=", "'Beta Organ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
register
Register a new user account CLI Example: .. code-block:: bash salt-run venafi.register email@example.com
salt/runners/venafiapi.py
def register(email): ''' Register a new user account CLI Example: .. code-block:: bash salt-run venafi.register email@example.com ''' data = __utils__['http.query']( '{0}/useraccounts'.format(_base_url()), method='POST', data=salt.utils.json.dumps({ ...
def register(email): ''' Register a new user account CLI Example: .. code-block:: bash salt-run venafi.register email@example.com ''' data = __utils__['http.query']( '{0}/useraccounts'.format(_base_url()), method='POST', data=salt.utils.json.dumps({ ...
[ "Register", "a", "new", "user", "account" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L382-L411
[ "def", "register", "(", "email", ")", ":", "data", "=", "__utils__", "[", "'http.query'", "]", "(", "'{0}/useraccounts'", ".", "format", "(", "_base_url", "(", ")", ")", ",", "method", "=", "'POST'", ",", "data", "=", "salt", ".", "utils", ".", "json",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_company
Show company information, especially the company id CLI Example: .. code-block:: bash salt-run venafi.show_company example.com
salt/runners/venafiapi.py
def show_company(domain): ''' Show company information, especially the company id CLI Example: .. code-block:: bash salt-run venafi.show_company example.com ''' data = __utils__['http.query']( '{0}/companies/domain/{1}'.format(_base_url(), domain), status=True, ...
def show_company(domain): ''' Show company information, especially the company id CLI Example: .. code-block:: bash salt-run venafi.show_company example.com ''' data = __utils__['http.query']( '{0}/companies/domain/{1}'.format(_base_url(), domain), status=True, ...
[ "Show", "company", "information", "especially", "the", "company", "id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L414-L438
[ "def", "show_company", "(", "domain", ")", ":", "data", "=", "__utils__", "[", "'http.query'", "]", "(", "'{0}/companies/domain/{1}'", ".", "format", "(", "_base_url", "(", ")", ",", "domain", ")", ",", "status", "=", "True", ",", "decode", "=", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_cert
Show certificate requests for this API key CLI Example: .. code-block:: bash salt-run venafi.show_cert 01234567-89ab-cdef-0123-456789abcdef
salt/runners/venafiapi.py
def show_cert(id_): ''' Show certificate requests for this API key CLI Example: .. code-block:: bash salt-run venafi.show_cert 01234567-89ab-cdef-0123-456789abcdef ''' data = __utils__['http.query']( '{0}/certificaterequests/{1}/certificate'.format(_base_url(), id_), p...
def show_cert(id_): ''' Show certificate requests for this API key CLI Example: .. code-block:: bash salt-run venafi.show_cert 01234567-89ab-cdef-0123-456789abcdef ''' data = __utils__['http.query']( '{0}/certificaterequests/{1}/certificate'.format(_base_url(), id_), p...
[ "Show", "certificate", "requests", "for", "this", "API", "key" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L550-L605
[ "def", "show_cert", "(", "id_", ")", ":", "data", "=", "__utils__", "[", "'http.query'", "]", "(", "'{0}/certificaterequests/{1}/certificate'", ".", "format", "(", "_base_url", "(", ")", ",", "id_", ")", ",", "params", "=", "{", "'format'", ":", "'PEM'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_domain_cache
List domains that have been cached CLI Example: .. code-block:: bash salt-run venafi.list_domain_cache
salt/runners/venafiapi.py
def list_domain_cache(): ''' List domains that have been cached CLI Example: .. code-block:: bash salt-run venafi.list_domain_cache ''' cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR) return cache.list('venafi/domains')
def list_domain_cache(): ''' List domains that have been cached CLI Example: .. code-block:: bash salt-run venafi.list_domain_cache ''' cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR) return cache.list('venafi/domains')
[ "List", "domains", "that", "have", "been", "cached" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L629-L640
[ "def", "list_domain_cache", "(", ")", ":", "cache", "=", "salt", ".", "cache", ".", "Cache", "(", "__opts__", ",", "syspaths", ".", "CACHE_DIR", ")", "return", "cache", ".", "list", "(", "'venafi/domains'", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_cached_domain
Delete cached domains from the master CLI Example: .. code-block:: bash salt-run venafi.del_cached_domain domain1.example.com,domain2.example.com
salt/runners/venafiapi.py
def del_cached_domain(domains): ''' Delete cached domains from the master CLI Example: .. code-block:: bash salt-run venafi.del_cached_domain domain1.example.com,domain2.example.com ''' cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR) if isinstance(domains, six.string_types)...
def del_cached_domain(domains): ''' Delete cached domains from the master CLI Example: .. code-block:: bash salt-run venafi.del_cached_domain domain1.example.com,domain2.example.com ''' cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR) if isinstance(domains, six.string_types)...
[ "Delete", "cached", "domains", "from", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/venafiapi.py#L643-L669
[ "def", "del_cached_domain", "(", "domains", ")", ":", "cache", "=", "salt", ".", "cache", ".", "Cache", "(", "__opts__", ",", "syspaths", ".", "CACHE_DIR", ")", "if", "isinstance", "(", "domains", ",", "six", ".", "string_types", ")", ":", "domains", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_present
Ensure a user is present with the specified groups name Name of user password Encrypted or Plain Text password for user roles List of roles the user should be assigned. Any roles not in this list will be removed encrypted Whether the password is encrypted already or ...
salt/states/onyx.py
def user_present(name, password=None, roles=None, encrypted=False, crypt_salt=None, algorithm='sha256'): ''' Ensure a user is present with the specified groups name Name of user password Encrypted or Plain Text password for user roles List of roles the user should be assig...
def user_present(name, password=None, roles=None, encrypted=False, crypt_salt=None, algorithm='sha256'): ''' Ensure a user is present with the specified groups name Name of user password Encrypted or Plain Text password for user roles List of roles the user should be assig...
[ "Ensure", "a", "user", "is", "present", "with", "the", "specified", "groups" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/onyx.py#L18-L150
[ "def", "user_present", "(", "name", ",", "password", "=", "None", ",", "roles", "=", "None", ",", "encrypted", "=", "False", ",", "crypt_salt", "=", "None", ",", "algorithm", "=", "'sha256'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_absent
Ensure a user is not present name username to remove if it exists Examples: .. code-block:: yaml delete: onyx.user_absent: - name: daniel
salt/states/onyx.py
def user_absent(name): ''' Ensure a user is not present name username to remove if it exists Examples: .. code-block:: yaml delete: onyx.user_absent: - name: daniel ''' ret = {'name': name, 'result': False, 'changes': {}, ...
def user_absent(name): ''' Ensure a user is not present name username to remove if it exists Examples: .. code-block:: yaml delete: onyx.user_absent: - name: daniel ''' ret = {'name': name, 'result': False, 'changes': {}, ...
[ "Ensure", "a", "user", "is", "not", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/onyx.py#L153-L197
[ "def", "user_absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "old_user", "=", "__salt__", "[", "'onyx.cmd'", "]", "(", "'get_use...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_present
Ensure a specific configuration line exists in the running config name config line to set Examples: .. code-block:: yaml add snmp group: onyx.config_present: - names: - snmp-server community randoSNMPstringHERE group network-operator - sn...
salt/states/onyx.py
def config_present(name): ''' Ensure a specific configuration line exists in the running config name config line to set Examples: .. code-block:: yaml add snmp group: onyx.config_present: - names: - snmp-server community randoSNMPstringHERE gro...
def config_present(name): ''' Ensure a specific configuration line exists in the running config name config line to set Examples: .. code-block:: yaml add snmp group: onyx.config_present: - names: - snmp-server community randoSNMPstringHERE gro...
[ "Ensure", "a", "specific", "configuration", "line", "exists", "in", "the", "running", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/onyx.py#L200-L250
[ "def", "config_present", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "matches", "=", "__salt__", "[", "'onyx.cmd'", "]", "(", "'find'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_absent
Ensure a specific configuration line does not exist in the running config name config line to remove Examples: .. code-block:: yaml add snmp group: onyx.config_absent: - names: - snmp-server community randoSNMPstringHERE group network-operator ...
salt/states/onyx.py
def config_absent(name): ''' Ensure a specific configuration line does not exist in the running config name config line to remove Examples: .. code-block:: yaml add snmp group: onyx.config_absent: - names: - snmp-server community randoSNMPstrin...
def config_absent(name): ''' Ensure a specific configuration line does not exist in the running config name config line to remove Examples: .. code-block:: yaml add snmp group: onyx.config_absent: - names: - snmp-server community randoSNMPstrin...
[ "Ensure", "a", "specific", "configuration", "line", "does", "not", "exist", "in", "the", "running", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/onyx.py#L253-L304
[ "def", "config_absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "matches", "=", "__salt__", "[", "'onyx.cmd'", "]", "(", "'find'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
replace
Replace all instances of a string or full line in the running config name String to replace repl The replacement text full_match Whether `name` will match the full line or only a subset of the line. Defaults to False. When False, .* is added around `name` for matching ...
salt/states/onyx.py
def replace(name, repl, full_match=False): ''' Replace all instances of a string or full line in the running config name String to replace repl The replacement text full_match Whether `name` will match the full line or only a subset of the line. Defaults to False. ...
def replace(name, repl, full_match=False): ''' Replace all instances of a string or full line in the running config name String to replace repl The replacement text full_match Whether `name` will match the full line or only a subset of the line. Defaults to False. ...
[ "Replace", "all", "instances", "of", "a", "string", "or", "full", "line", "in", "the", "running", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/onyx.py#L307-L379
[ "def", "replace", "(", "name", ",", "repl", ",", "full_match", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "if", "full_match", "is...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Checks existance of the named login. If not present, creates the login with the specified roles and options. name The name of the login to manage password Creates a SQL Server authentication login Since hashed passwords are varbinary values, if the new_login_password is 'lon...
salt/states/mssql_login.py
def present(name, password=None, domain=None, server_roles=None, options=None, **kwargs): ''' Checks existance of the named login. If not present, creates the login with the specified roles and options. name The name of the login to manage password Creates a SQL Server authenticatio...
def present(name, password=None, domain=None, server_roles=None, options=None, **kwargs): ''' Checks existance of the named login. If not present, creates the login with the specified roles and options. name The name of the login to manage password Creates a SQL Server authenticatio...
[ "Checks", "existance", "of", "the", "named", "login", ".", "If", "not", "present", "creates", "the", "login", "with", "the", "specified", "roles", "and", "options", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mssql_login.py#L37-L87
[ "def", "present", "(", "name", ",", "password", "=", "None", ",", "domain", "=", "None", ",", "server_roles", "=", "None", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_reinterpreted_state
Re-interpret the state returned by salt.state.run using our protocol.
salt/states/cmd.py
def _reinterpreted_state(state): ''' Re-interpret the state returned by salt.state.run using our protocol. ''' ret = state['changes'] state['changes'] = {} state['comment'] = '' out = ret.get('stdout') if not out: if ret.get('stderr'): state['comment'] = ret['stderr'...
def _reinterpreted_state(state): ''' Re-interpret the state returned by salt.state.run using our protocol. ''' ret = state['changes'] state['changes'] = {} state['comment'] = '' out = ret.get('stdout') if not out: if ret.get('stderr'): state['comment'] = ret['stderr'...
[ "Re", "-", "interpret", "the", "state", "returned", "by", "salt", ".", "state", ".", "run", "using", "our", "protocol", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L251-L310
[ "def", "_reinterpreted_state", "(", "state", ")", ":", "ret", "=", "state", "[", "'changes'", "]", "state", "[", "'changes'", "]", "=", "{", "}", "state", "[", "'comment'", "]", "=", "''", "out", "=", "ret", ".", "get", "(", "'stdout'", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mod_run_check
Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True
salt/states/cmd.py
def mod_run_check(cmd_kwargs, onlyif, unless, creates): ''' Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True ''' # never use VT for onlyif/unless executions because this will lead # to quote ...
def mod_run_check(cmd_kwargs, onlyif, unless, creates): ''' Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True ''' # never use VT for onlyif/unless executions because this will lead # to quote ...
[ "Execute", "the", "onlyif", "and", "unless", "logic", ".", "Return", "a", "result", "dict", "if", ":", "*", "onlyif", "failed", "(", "onlyif", "!", "=", "0", ")", "*", "unless", "succeeded", "(", "unless", "==", "0", ")", "else", "return", "True" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L327-L398
[ "def", "mod_run_check", "(", "cmd_kwargs", ",", "onlyif", ",", "unless", ",", "creates", ")", ":", "# never use VT for onlyif/unless executions because this will lead", "# to quote problems", "cmd_kwargs", "=", "copy", ".", "deepcopy", "(", "cmd_kwargs", ")", "cmd_kwargs"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait
Run the given command only if the watch statement calls it. .. note:: Use :mod:`cmd.run <salt.states.cmd.run>` together with :mod:`onchanges </ref/states/requisites#onchanges>` instead of :mod:`cmd.wait <salt.states.cmd.wait>`. name The command to execute, remember that the command wi...
salt/states/cmd.py
def wait(name, onlyif=None, unless=None, creates=None, cwd=None, root=None, runas=None, shell=None, env=(), stateful=False, umask=None, output_loglevel='debug', hide_output=False, use_vt=False, ...
def wait(name, onlyif=None, unless=None, creates=None, cwd=None, root=None, runas=None, shell=None, env=(), stateful=False, umask=None, output_loglevel='debug', hide_output=False, use_vt=False, ...
[ "Run", "the", "given", "command", "only", "if", "the", "watch", "statement", "calls", "it", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L401-L554
[ "def", "wait", "(", "name", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "creates", "=", "None", ",", "cwd", "=", "None", ",", "root", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "None", ",", "env", "=", "(", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait_script
Download a script from a remote source and execute it only if a watch statement calls it. source The source script being downloaded to the minion, this source script is hosted on the salt master server. If the file is located on the master in the directory named spam, and is called egg...
salt/states/cmd.py
def wait_script(name, source=None, template=None, onlyif=None, unless=None, cwd=None, runas=None, shell=None, env=None, stateful=False, umask=None, ...
def wait_script(name, source=None, template=None, onlyif=None, unless=None, cwd=None, runas=None, shell=None, env=None, stateful=False, umask=None, ...
[ "Download", "a", "script", "from", "a", "remote", "source", "and", "execute", "it", "only", "if", "a", "watch", "statement", "calls", "it", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L561-L710
[ "def", "wait_script", "(", "name", ",", "source", "=", "None", ",", "template", "=", "None", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "cwd", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "None", ",", "env", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run
Run a command if certain circumstances are met. Use ``cmd.wait`` if you want to use the ``watch`` requisite. name The command to execute, remember that the command will execute with the path and permissions of the salt-minion. onlyif A command to run as a check, run the named comm...
salt/states/cmd.py
def run(name, onlyif=None, unless=None, creates=None, cwd=None, root=None, runas=None, shell=None, env=None, prepend_path=None, stateful=False, umask=None, output_loglevel='debug', hide_output=False, timeout=...
def run(name, onlyif=None, unless=None, creates=None, cwd=None, root=None, runas=None, shell=None, env=None, prepend_path=None, stateful=False, umask=None, output_loglevel='debug', hide_output=False, timeout=...
[ "Run", "a", "command", "if", "certain", "circumstances", "are", "met", ".", "Use", "cmd", ".", "wait", "if", "you", "want", "to", "use", "the", "watch", "requisite", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L713-L1005
[ "def", "run", "(", "name", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "creates", "=", "None", ",", "cwd", "=", "None", ",", "root", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "None", ",", "env", "=", "None", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
script
Download a script and execute it with specified arguments. source The location of the script to download. If the file is located on the master in the directory named spam, and is called eggs, the source string is salt://spam/eggs template If this setting is applied then the nam...
salt/states/cmd.py
def script(name, source=None, template=None, onlyif=None, unless=None, creates=None, cwd=None, runas=None, shell=None, env=None, stateful=False, umask=None, timeout=None, use_vt...
def script(name, source=None, template=None, onlyif=None, unless=None, creates=None, cwd=None, runas=None, shell=None, env=None, stateful=False, umask=None, timeout=None, use_vt...
[ "Download", "a", "script", "and", "execute", "it", "with", "specified", "arguments", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L1008-L1292
[ "def", "script", "(", "name", ",", "source", "=", "None", ",", "template", "=", "None", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "creates", "=", "None", ",", "cwd", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Invoke a pre-defined Python function with arguments specified in the state declaration. This function is mainly used by the :mod:`salt.renderers.pydsl` renderer. The interpretation of ``onlyif`` and ``unless`` arguments are identical to those of :mod:`cmd.run <salt.states.cmd.run>`, and all other a...
salt/states/cmd.py
def call(name, func, args=(), kws=None, onlyif=None, unless=None, creates=None, output_loglevel='debug', hide_output=False, use_vt=False, **kwargs): ''' Invoke a pre-defined Python function with arguments specified in the ...
def call(name, func, args=(), kws=None, onlyif=None, unless=None, creates=None, output_loglevel='debug', hide_output=False, use_vt=False, **kwargs): ''' Invoke a pre-defined Python function with arguments specified in the ...
[ "Invoke", "a", "pre", "-", "defined", "Python", "function", "with", "arguments", "specified", "in", "the", "state", "declaration", ".", "This", "function", "is", "mainly", "used", "by", "the", ":", "mod", ":", "salt", ".", "renderers", ".", "pydsl", "rende...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L1295-L1369
[ "def", "call", "(", "name", ",", "func", ",", "args", "=", "(", ")", ",", "kws", "=", "None", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "creates", "=", "None", ",", "output_loglevel", "=", "'debug'", ",", "hide_output", "=", "Fal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mod_watch
Execute a cmd function based on a watch call .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being triggered.
salt/states/cmd.py
def mod_watch(name, **kwargs): ''' Execute a cmd function based on a watch call .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being tr...
def mod_watch(name, **kwargs): ''' Execute a cmd function based on a watch call .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being tr...
[ "Execute", "a", "cmd", "function", "based", "on", "a", "watch", "call" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cmd.py#L1391-L1429
[ "def", "mod_watch", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", "[", "'sfun'", "]", "in", "(", "'wait'", ",", "'run'", ",", "'watch'", ")", ":", "if", "kwargs", ".", "get", "(", "'stateful'", ")", ":", "kwargs", ".", "pop", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_nova
Check version of novaclient
salt/utils/openstack/nova.py
def check_nova(): ''' Check version of novaclient ''' if HAS_NOVA: novaclient_ver = _LooseVersion(novaclient.__version__) min_ver = _LooseVersion(NOVACLIENT_MINVER) if min_ver <= novaclient_ver: return HAS_NOVA log.debug('Newer novaclient version required. Mi...
def check_nova(): ''' Check version of novaclient ''' if HAS_NOVA: novaclient_ver = _LooseVersion(novaclient.__version__) min_ver = _LooseVersion(NOVACLIENT_MINVER) if min_ver <= novaclient_ver: return HAS_NOVA log.debug('Newer novaclient version required. Mi...
[ "Check", "version", "of", "novaclient" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L67-L77
[ "def", "check_nova", "(", ")", ":", "if", "HAS_NOVA", ":", "novaclient_ver", "=", "_LooseVersion", "(", "novaclient", ".", "__version__", ")", "min_ver", "=", "_LooseVersion", "(", "NOVACLIENT_MINVER", ")", "if", "min_ver", "<=", "novaclient_ver", ":", "return",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._get_version_from_url
Exctract API version from provided URL
salt/utils/openstack/nova.py
def _get_version_from_url(self, url): ''' Exctract API version from provided URL ''' regex = re.compile(r"^https?:\/\/.*\/(v[0-9])(\.[0-9])?(\/)?$") try: ver = regex.match(url) if ver.group(1): retver = ver.group(1) if ver.g...
def _get_version_from_url(self, url): ''' Exctract API version from provided URL ''' regex = re.compile(r"^https?:\/\/.*\/(v[0-9])(\.[0-9])?(\/)?$") try: ver = regex.match(url) if ver.group(1): retver = ver.group(1) if ver.g...
[ "Exctract", "API", "version", "from", "provided", "URL" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L268-L281
[ "def", "_get_version_from_url", "(", "self", ",", "url", ")", ":", "regex", "=", "re", ".", "compile", "(", "r\"^https?:\\/\\/.*\\/(v[0-9])(\\.[0-9])?(\\/)?$\"", ")", "try", ":", "ver", "=", "regex", ".", "match", "(", "url", ")", "if", "ver", ".", "group", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._discover_ks_version
Keystone API version discovery
salt/utils/openstack/nova.py
def _discover_ks_version(self, url): ''' Keystone API version discovery ''' result = salt.utils.http.query(url, backend='requests', status=True, decode=True, decode_type='json') versions = json.loads(result['body']) try: links = [ver['links'] for ver in versio...
def _discover_ks_version(self, url): ''' Keystone API version discovery ''' result = salt.utils.http.query(url, backend='requests', status=True, decode=True, decode_type='json') versions = json.loads(result['body']) try: links = [ver['links'] for ver in versio...
[ "Keystone", "API", "version", "discovery" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L283-L295
[ "def", "_discover_ks_version", "(", "self", ",", "url", ")", ":", "result", "=", "salt", ".", "utils", ".", "http", ".", "query", "(", "url", ",", "backend", "=", "'requests'", ",", "status", "=", "True", ",", "decode", "=", "True", ",", "decode_type",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_show_libcloud
Make output look like libcloud output for consistency
salt/utils/openstack/nova.py
def server_show_libcloud(self, uuid): ''' Make output look like libcloud output for consistency ''' server_info = self.server_show(uuid) server = next(six.itervalues(server_info)) server_name = next(six.iterkeys(server_info)) if not hasattr(self, 'password'): ...
def server_show_libcloud(self, uuid): ''' Make output look like libcloud output for consistency ''' server_info = self.server_show(uuid) server = next(six.itervalues(server_info)) server_name = next(six.iterkeys(server_info)) if not hasattr(self, 'password'): ...
[ "Make", "output", "look", "like", "libcloud", "output", "for", "consistency" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L483-L494
[ "def", "server_show_libcloud", "(", "self", ",", "uuid", ")", ":", "server_info", "=", "self", ".", "server_show", "(", "uuid", ")", "server", "=", "next", "(", "six", ".", "itervalues", "(", "server_info", ")", ")", "server_name", "=", "next", "(", "six...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.boot
Boot a cloud server.
salt/utils/openstack/nova.py
def boot(self, name, flavor_id=0, image_id=0, timeout=300, **kwargs): ''' Boot a cloud server. ''' nt_ks = self.compute_conn kwargs['name'] = name kwargs['flavor'] = flavor_id kwargs['image'] = image_id or None ephemeral = kwargs.pop('ephemeral', []) ...
def boot(self, name, flavor_id=0, image_id=0, timeout=300, **kwargs): ''' Boot a cloud server. ''' nt_ks = self.compute_conn kwargs['name'] = name kwargs['flavor'] = flavor_id kwargs['image'] = image_id or None ephemeral = kwargs.pop('ephemeral', []) ...
[ "Boot", "a", "cloud", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L496-L535
[ "def", "boot", "(", "self", ",", "name", ",", "flavor_id", "=", "0", ",", "image_id", "=", "0", ",", "timeout", "=", "300", ",", "*", "*", "kwargs", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "kwargs", "[", "'name'", "]", "=", "name", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.root_password
Change server(uuid's) root password
salt/utils/openstack/nova.py
def root_password(self, server_id, password): ''' Change server(uuid's) root password ''' nt_ks = self.compute_conn nt_ks.servers.change_password(server_id, password)
def root_password(self, server_id, password): ''' Change server(uuid's) root password ''' nt_ks = self.compute_conn nt_ks.servers.change_password(server_id, password)
[ "Change", "server", "(", "uuid", "s", ")", "root", "password" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L543-L548
[ "def", "root_password", "(", "self", ",", "server_id", ",", "password", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "nt_ks", ".", "servers", ".", "change_password", "(", "server_id", ",", "password", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_by_name
Find a server by its name
salt/utils/openstack/nova.py
def server_by_name(self, name): ''' Find a server by its name ''' return self.server_show_libcloud( self.server_list().get(name, {}).get('id', '') )
def server_by_name(self, name): ''' Find a server by its name ''' return self.server_show_libcloud( self.server_list().get(name, {}).get('id', '') )
[ "Find", "a", "server", "by", "its", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L550-L556
[ "def", "server_by_name", "(", "self", ",", "name", ")", ":", "return", "self", ".", "server_show_libcloud", "(", "self", ".", "server_list", "(", ")", ".", "get", "(", "name", ",", "{", "}", ")", ".", "get", "(", "'id'", ",", "''", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._volume_get
Organize information about a volume from the volume_id
salt/utils/openstack/nova.py
def _volume_get(self, volume_id): ''' Organize information about a volume from the volume_id ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volume = nt_ks.volumes.get(volume_id) respo...
def _volume_get(self, volume_id): ''' Organize information about a volume from the volume_id ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volume = nt_ks.volumes.get(volume_id) respo...
[ "Organize", "information", "about", "a", "volume", "from", "the", "volume_id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L558-L573
[ "def", "_volume_get", "(", "self", ",", "volume_id", ")", ":", "if", "self", ".", "volume_conn", "is", "None", ":", "raise", "SaltCloudSystemExit", "(", "'No cinder endpoint available'", ")", "nt_ks", "=", "self", ".", "volume_conn", "volume", "=", "nt_ks", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_list
List all block volumes
salt/utils/openstack/nova.py
def volume_list(self, search_opts=None): ''' List all block volumes ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volumes = nt_ks.volumes.list(search_opts=search_opts) response = {} ...
def volume_list(self, search_opts=None): ''' List all block volumes ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volumes = nt_ks.volumes.list(search_opts=search_opts) response = {} ...
[ "List", "all", "block", "volumes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L575-L593
[ "def", "volume_list", "(", "self", ",", "search_opts", "=", "None", ")", ":", "if", "self", ".", "volume_conn", "is", "None", ":", "raise", "SaltCloudSystemExit", "(", "'No cinder endpoint available'", ")", "nt_ks", "=", "self", ".", "volume_conn", "volumes", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_show
Show one volume
salt/utils/openstack/nova.py
def volume_show(self, name): ''' Show one volume ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volumes = self.volume_list( search_opts={'display_name': name}, ) v...
def volume_show(self, name): ''' Show one volume ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn volumes = self.volume_list( search_opts={'display_name': name}, ) v...
[ "Show", "one", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L595-L611
[ "def", "volume_show", "(", "self", ",", "name", ")", ":", "if", "self", ".", "volume_conn", "is", "None", ":", "raise", "SaltCloudSystemExit", "(", "'No cinder endpoint available'", ")", "nt_ks", "=", "self", ".", "volume_conn", "volumes", "=", "self", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_create
Create a block device
salt/utils/openstack/nova.py
def volume_create(self, name, size=100, snapshot=None, voltype=None, availability_zone=None): ''' Create a block device ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn re...
def volume_create(self, name, size=100, snapshot=None, voltype=None, availability_zone=None): ''' Create a block device ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn re...
[ "Create", "a", "block", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L613-L629
[ "def", "volume_create", "(", "self", ",", "name", ",", "size", "=", "100", ",", "snapshot", "=", "None", ",", "voltype", "=", "None", ",", "availability_zone", "=", "None", ")", ":", "if", "self", ".", "volume_conn", "is", "None", ":", "raise", "SaltCl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_delete
Delete a block device
salt/utils/openstack/nova.py
def volume_delete(self, name): ''' Delete a block device ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn try: volume = self.volume_show(name) except KeyError as exc: ...
def volume_delete(self, name): ''' Delete a block device ''' if self.volume_conn is None: raise SaltCloudSystemExit('No cinder endpoint available') nt_ks = self.volume_conn try: volume = self.volume_show(name) except KeyError as exc: ...
[ "Delete", "a", "block", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L631-L645
[ "def", "volume_delete", "(", "self", ",", "name", ")", ":", "if", "self", ".", "volume_conn", "is", "None", ":", "raise", "SaltCloudSystemExit", "(", "'No cinder endpoint available'", ")", "nt_ks", "=", "self", ".", "volume_conn", "try", ":", "volume", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_detach
Detach a block device
salt/utils/openstack/nova.py
def volume_detach(self, name, timeout=300): ''' Detach a block device ''' try: volume = self.volume_show(name) except KeyError as exc: raise SaltCloudSystemExit('Unable to find {0} volume: {1}'.format(name, exc))...
def volume_detach(self, name, timeout=300): ''' Detach a block device ''' try: volume = self.volume_show(name) except KeyError as exc: raise SaltCloudSystemExit('Unable to find {0} volume: {1}'.format(name, exc))...
[ "Detach", "a", "block", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L647-L681
[ "def", "volume_detach", "(", "self", ",", "name", ",", "timeout", "=", "300", ")", ":", "try", ":", "volume", "=", "self", ".", "volume_show", "(", "name", ")", "except", "KeyError", "as", "exc", ":", "raise", "SaltCloudSystemExit", "(", "'Unable to find {...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.volume_attach
Attach a block device
salt/utils/openstack/nova.py
def volume_attach(self, name, server_name, device='/dev/xvdb', timeout=300): ''' Attach a block device ''' try: volume = self.volume_show(name) except KeyError as exc: ...
def volume_attach(self, name, server_name, device='/dev/xvdb', timeout=300): ''' Attach a block device ''' try: volume = self.volume_show(name) except KeyError as exc: ...
[ "Attach", "a", "block", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L683-L719
[ "def", "volume_attach", "(", "self", ",", "name", ",", "server_name", ",", "device", "=", "'/dev/xvdb'", ",", "timeout", "=", "300", ")", ":", "try", ":", "volume", "=", "self", ".", "volume_show", "(", "name", ")", "except", "KeyError", "as", "exc", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.suspend
Suspend a server
salt/utils/openstack/nova.py
def suspend(self, instance_id): ''' Suspend a server ''' nt_ks = self.compute_conn response = nt_ks.servers.suspend(instance_id) return True
def suspend(self, instance_id): ''' Suspend a server ''' nt_ks = self.compute_conn response = nt_ks.servers.suspend(instance_id) return True
[ "Suspend", "a", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L721-L727
[ "def", "suspend", "(", "self", ",", "instance_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "response", "=", "nt_ks", ".", "servers", ".", "suspend", "(", "instance_id", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.resume
Resume a server
salt/utils/openstack/nova.py
def resume(self, instance_id): ''' Resume a server ''' nt_ks = self.compute_conn response = nt_ks.servers.resume(instance_id) return True
def resume(self, instance_id): ''' Resume a server ''' nt_ks = self.compute_conn response = nt_ks.servers.resume(instance_id) return True
[ "Resume", "a", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L729-L735
[ "def", "resume", "(", "self", ",", "instance_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "response", "=", "nt_ks", ".", "servers", ".", "resume", "(", "instance_id", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.lock
Lock an instance
salt/utils/openstack/nova.py
def lock(self, instance_id): ''' Lock an instance ''' nt_ks = self.compute_conn response = nt_ks.servers.lock(instance_id) return True
def lock(self, instance_id): ''' Lock an instance ''' nt_ks = self.compute_conn response = nt_ks.servers.lock(instance_id) return True
[ "Lock", "an", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L737-L743
[ "def", "lock", "(", "self", ",", "instance_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "response", "=", "nt_ks", ".", "servers", ".", "lock", "(", "instance_id", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.delete
Delete a server
salt/utils/openstack/nova.py
def delete(self, instance_id): ''' Delete a server ''' nt_ks = self.compute_conn response = nt_ks.servers.delete(instance_id) return True
def delete(self, instance_id): ''' Delete a server ''' nt_ks = self.compute_conn response = nt_ks.servers.delete(instance_id) return True
[ "Delete", "a", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L745-L751
[ "def", "delete", "(", "self", ",", "instance_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "response", "=", "nt_ks", ".", "servers", ".", "delete", "(", "instance_id", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_list
Return a list of available flavors (nova flavor-list)
salt/utils/openstack/nova.py
def flavor_list(self, **kwargs): ''' Return a list of available flavors (nova flavor-list) ''' nt_ks = self.compute_conn ret = {} for flavor in nt_ks.flavors.list(**kwargs): links = {} for link in flavor.links: links[link['rel']] = ...
def flavor_list(self, **kwargs): ''' Return a list of available flavors (nova flavor-list) ''' nt_ks = self.compute_conn ret = {} for flavor in nt_ks.flavors.list(**kwargs): links = {} for link in flavor.links: links[link['rel']] = ...
[ "Return", "a", "list", "of", "available", "flavors", "(", "nova", "flavor", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L753-L774
[ "def", "flavor_list", "(", "self", ",", "*", "*", "kwargs", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "flavor", "in", "nt_ks", ".", "flavors", ".", "list", "(", "*", "*", "kwargs", ")", ":", "links", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_create
Create a flavor
salt/utils/openstack/nova.py
def flavor_create(self, name, # pylint: disable=C0103 flavor_id=0, # pylint: disable=C0103 ram=0, disk=0, vcpus=1, is_public=True): ''' Create a flavor ...
def flavor_create(self, name, # pylint: disable=C0103 flavor_id=0, # pylint: disable=C0103 ram=0, disk=0, vcpus=1, is_public=True): ''' Create a flavor ...
[ "Create", "a", "flavor" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L778-L797
[ "def", "flavor_create", "(", "self", ",", "name", ",", "# pylint: disable=C0103", "flavor_id", "=", "0", ",", "# pylint: disable=C0103", "ram", "=", "0", ",", "disk", "=", "0", ",", "vcpus", "=", "1", ",", "is_public", "=", "True", ")", ":", "nt_ks", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_delete
Delete a flavor
salt/utils/openstack/nova.py
def flavor_delete(self, flavor_id): # pylint: disable=C0103 ''' Delete a flavor ''' nt_ks = self.compute_conn nt_ks.flavors.delete(flavor_id) return 'Flavor deleted: {0}'.format(flavor_id)
def flavor_delete(self, flavor_id): # pylint: disable=C0103 ''' Delete a flavor ''' nt_ks = self.compute_conn nt_ks.flavors.delete(flavor_id) return 'Flavor deleted: {0}'.format(flavor_id)
[ "Delete", "a", "flavor" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L799-L805
[ "def", "flavor_delete", "(", "self", ",", "flavor_id", ")", ":", "# pylint: disable=C0103", "nt_ks", "=", "self", ".", "compute_conn", "nt_ks", ".", "flavors", ".", "delete", "(", "flavor_id", ")", "return", "'Flavor deleted: {0}'", ".", "format", "(", "flavor_i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_access_list
Return a list of project IDs assigned to flavor ID
salt/utils/openstack/nova.py
def flavor_access_list(self, **kwargs): ''' Return a list of project IDs assigned to flavor ID ''' flavor_id = kwargs.get('flavor_id') nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.list(flavor=flavor_id, **kwargs) fo...
def flavor_access_list(self, **kwargs): ''' Return a list of project IDs assigned to flavor ID ''' flavor_id = kwargs.get('flavor_id') nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.list(flavor=flavor_id, **kwargs) fo...
[ "Return", "a", "list", "of", "project", "IDs", "assigned", "to", "flavor", "ID" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L807-L817
[ "def", "flavor_access_list", "(", "self", ",", "*", "*", "kwargs", ")", ":", "flavor_id", "=", "kwargs", ".", "get", "(", "'flavor_id'", ")", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "flavor_id", ":", "[", "]", "}", "flavor_accesses", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_access_add
Add a project to the flavor access list
salt/utils/openstack/nova.py
def flavor_access_add(self, flavor_id, project_id): ''' Add a project to the flavor access list ''' nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.add_tenant_access(flavor_id, project_id) for project in flavor_accesses: ...
def flavor_access_add(self, flavor_id, project_id): ''' Add a project to the flavor access list ''' nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.add_tenant_access(flavor_id, project_id) for project in flavor_accesses: ...
[ "Add", "a", "project", "to", "the", "flavor", "access", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L819-L828
[ "def", "flavor_access_add", "(", "self", ",", "flavor_id", ",", "project_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "flavor_id", ":", "[", "]", "}", "flavor_accesses", "=", "nt_ks", ".", "flavor_access", ".", "add_tenant_acces...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.flavor_access_remove
Remove a project from the flavor access list
salt/utils/openstack/nova.py
def flavor_access_remove(self, flavor_id, project_id): ''' Remove a project from the flavor access list ''' nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.remove_tenant_access(flavor_id, project_id) for project in flavor_acce...
def flavor_access_remove(self, flavor_id, project_id): ''' Remove a project from the flavor access list ''' nt_ks = self.compute_conn ret = {flavor_id: []} flavor_accesses = nt_ks.flavor_access.remove_tenant_access(flavor_id, project_id) for project in flavor_acce...
[ "Remove", "a", "project", "from", "the", "flavor", "access", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L830-L839
[ "def", "flavor_access_remove", "(", "self", ",", "flavor_id", ",", "project_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "flavor_id", ":", "[", "]", "}", "flavor_accesses", "=", "nt_ks", ".", "flavor_access", ".", "remove_tenant...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.keypair_list
List keypairs
salt/utils/openstack/nova.py
def keypair_list(self): ''' List keypairs ''' nt_ks = self.compute_conn ret = {} for keypair in nt_ks.keypairs.list(): ret[keypair.name] = { 'name': keypair.name, 'fingerprint': keypair.fingerprint, 'public_key':...
def keypair_list(self): ''' List keypairs ''' nt_ks = self.compute_conn ret = {} for keypair in nt_ks.keypairs.list(): ret[keypair.name] = { 'name': keypair.name, 'fingerprint': keypair.fingerprint, 'public_key':...
[ "List", "keypairs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L841-L853
[ "def", "keypair_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "keypair", "in", "nt_ks", ".", "keypairs", ".", "list", "(", ")", ":", "ret", "[", "keypair", ".", "name", "]", "=", "{", "'name'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.keypair_add
Add a keypair
salt/utils/openstack/nova.py
def keypair_add(self, name, pubfile=None, pubkey=None): ''' Add a keypair ''' nt_ks = self.compute_conn if pubfile: with salt.utils.files.fopen(pubfile, 'r') as fp_: pubkey = salt.utils.stringutils.to_unicode(fp_.read()) if not pubkey: ...
def keypair_add(self, name, pubfile=None, pubkey=None): ''' Add a keypair ''' nt_ks = self.compute_conn if pubfile: with salt.utils.files.fopen(pubfile, 'r') as fp_: pubkey = salt.utils.stringutils.to_unicode(fp_.read()) if not pubkey: ...
[ "Add", "a", "keypair" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L855-L867
[ "def", "keypair_add", "(", "self", ",", "name", ",", "pubfile", "=", "None", ",", "pubkey", "=", "None", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "if", "pubfile", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "pubfil...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.keypair_delete
Delete a keypair
salt/utils/openstack/nova.py
def keypair_delete(self, name): ''' Delete a keypair ''' nt_ks = self.compute_conn nt_ks.keypairs.delete(name) return 'Keypair deleted: {0}'.format(name)
def keypair_delete(self, name): ''' Delete a keypair ''' nt_ks = self.compute_conn nt_ks.keypairs.delete(name) return 'Keypair deleted: {0}'.format(name)
[ "Delete", "a", "keypair" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L869-L875
[ "def", "keypair_delete", "(", "self", ",", "name", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "nt_ks", ".", "keypairs", ".", "delete", "(", "name", ")", "return", "'Keypair deleted: {0}'", ".", "format", "(", "name", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.image_show
Show image details and metadata
salt/utils/openstack/nova.py
def image_show(self, image_id): ''' Show image details and metadata ''' nt_ks = self.compute_conn image = nt_ks.images.get(image_id) links = {} for link in image.links: links[link['rel']] = link['href'] ret = { 'name': image.name, ...
def image_show(self, image_id): ''' Show image details and metadata ''' nt_ks = self.compute_conn image = nt_ks.images.get(image_id) links = {} for link in image.links: links[link['rel']] = link['href'] ret = { 'name': image.name, ...
[ "Show", "image", "details", "and", "metadata" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L877-L901
[ "def", "image_show", "(", "self", ",", "image_id", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "image", "=", "nt_ks", ".", "images", ".", "get", "(", "image_id", ")", "links", "=", "{", "}", "for", "link", "in", "image", ".", "links", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.image_list
List server images
salt/utils/openstack/nova.py
def image_list(self, name=None): ''' List server images ''' nt_ks = self.compute_conn ret = {} for image in nt_ks.images.list(): links = {} for link in image.links: links[link['rel']] = link['href'] ret[image.name] = { ...
def image_list(self, name=None): ''' List server images ''' nt_ks = self.compute_conn ret = {} for image in nt_ks.images.list(): links = {} for link in image.links: links[link['rel']] = link['href'] ret[image.name] = { ...
[ "List", "server", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L903-L929
[ "def", "image_list", "(", "self", ",", "name", "=", "None", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "image", "in", "nt_ks", ".", "images", ".", "list", "(", ")", ":", "links", "=", "{", "}", "for", "link"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.image_meta_set
Set image metadata
salt/utils/openstack/nova.py
def image_meta_set(self, image_id=None, name=None, **kwargs): # pylint: disable=C0103 ''' Set image metadata ''' nt_ks = self.compute_conn if name: for image in nt_ks.images.list(): ...
def image_meta_set(self, image_id=None, name=None, **kwargs): # pylint: disable=C0103 ''' Set image metadata ''' nt_ks = self.compute_conn if name: for image in nt_ks.images.list(): ...
[ "Set", "image", "metadata" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L933-L948
[ "def", "image_meta_set", "(", "self", ",", "image_id", "=", "None", ",", "name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0103", "nt_ks", "=", "self", ".", "compute_conn", "if", "name", ":", "for", "image", "in", "nt_ks", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.image_meta_delete
Delete image metadata
salt/utils/openstack/nova.py
def image_meta_delete(self, image_id=None, # pylint: disable=C0103 name=None, keys=None): ''' Delete image metadata ''' nt_ks = self.compute_conn if name: for image in nt_ks.images.list(...
def image_meta_delete(self, image_id=None, # pylint: disable=C0103 name=None, keys=None): ''' Delete image metadata ''' nt_ks = self.compute_conn if name: for image in nt_ks.images.list(...
[ "Delete", "image", "metadata" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L950-L966
[ "def", "image_meta_delete", "(", "self", ",", "image_id", "=", "None", ",", "# pylint: disable=C0103", "name", "=", "None", ",", "keys", "=", "None", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "if", "name", ":", "for", "image", "in", "nt_ks", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_list
List servers
salt/utils/openstack/nova.py
def server_list(self): ''' List servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(): try: ret[item.name] = { 'id': item.id, 'name': item.name, 'state': item...
def server_list(self): ''' List servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(): try: ret[item.name] = { 'id': item.id, 'name': item.name, 'state': item...
[ "List", "servers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L968-L989
[ "def", "server_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "item", "in", "nt_ks", ".", "servers", ".", "list", "(", ")", ":", "try", ":", "ret", "[", "item", ".", "name", "]", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_list_min
List minimal information about servers
salt/utils/openstack/nova.py
def server_list_min(self): ''' List minimal information about servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(detailed=False): try: ret[item.name] = { 'id': item.id, 'state':...
def server_list_min(self): ''' List minimal information about servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(detailed=False): try: ret[item.name] = { 'id': item.id, 'state':...
[ "List", "minimal", "information", "about", "servers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L991-L1005
[ "def", "server_list_min", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "item", "in", "nt_ks", ".", "servers", ".", "list", "(", "detailed", "=", "False", ")", ":", "try", ":", "ret", "[", "item", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_list_detailed
Detailed list of servers
salt/utils/openstack/nova.py
def server_list_detailed(self): ''' Detailed list of servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(): try: ret[item.name] = { 'OS-EXT-SRV-ATTR': {}, 'OS-EXT-STS': {}, ...
def server_list_detailed(self): ''' Detailed list of servers ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.servers.list(): try: ret[item.name] = { 'OS-EXT-SRV-ATTR': {}, 'OS-EXT-STS': {}, ...
[ "Detailed", "list", "of", "servers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1007-L1067
[ "def", "server_list_detailed", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "item", "in", "nt_ks", ".", "servers", ".", "list", "(", ")", ":", "try", ":", "ret", "[", "item", ".", "name", "]", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.server_show
Show details of one server
salt/utils/openstack/nova.py
def server_show(self, server_id): ''' Show details of one server ''' ret = {} try: servers = self.server_list_detailed() except AttributeError: raise SaltCloudSystemExit('Corrupt server in server_list_detailed. Remove corrupt servers.') for...
def server_show(self, server_id): ''' Show details of one server ''' ret = {} try: servers = self.server_list_detailed() except AttributeError: raise SaltCloudSystemExit('Corrupt server in server_list_detailed. Remove corrupt servers.') for...
[ "Show", "details", "of", "one", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1069-L1081
[ "def", "server_show", "(", "self", ",", "server_id", ")", ":", "ret", "=", "{", "}", "try", ":", "servers", "=", "self", ".", "server_list_detailed", "(", ")", "except", "AttributeError", ":", "raise", "SaltCloudSystemExit", "(", "'Corrupt server in server_list_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.secgroup_create
Create a security group
salt/utils/openstack/nova.py
def secgroup_create(self, name, description): ''' Create a security group ''' nt_ks = self.compute_conn nt_ks.security_groups.create(name, description) ret = {'name': name, 'description': description} return ret
def secgroup_create(self, name, description): ''' Create a security group ''' nt_ks = self.compute_conn nt_ks.security_groups.create(name, description) ret = {'name': name, 'description': description} return ret
[ "Create", "a", "security", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1083-L1090
[ "def", "secgroup_create", "(", "self", ",", "name", ",", "description", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "nt_ks", ".", "security_groups", ".", "create", "(", "name", ",", "description", ")", "ret", "=", "{", "'name'", ":", "name", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.secgroup_delete
Delete a security group
salt/utils/openstack/nova.py
def secgroup_delete(self, name): ''' Delete a security group ''' nt_ks = self.compute_conn for item in nt_ks.security_groups.list(): if item.name == name: nt_ks.security_groups.delete(item.id) return {name: 'Deleted security group: {0}'...
def secgroup_delete(self, name): ''' Delete a security group ''' nt_ks = self.compute_conn for item in nt_ks.security_groups.list(): if item.name == name: nt_ks.security_groups.delete(item.id) return {name: 'Deleted security group: {0}'...
[ "Delete", "a", "security", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1092-L1101
[ "def", "secgroup_delete", "(", "self", ",", "name", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "for", "item", "in", "nt_ks", ".", "security_groups", ".", "list", "(", ")", ":", "if", "item", ".", "name", "==", "name", ":", "nt_ks", ".", "se...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.secgroup_list
List security groups
salt/utils/openstack/nova.py
def secgroup_list(self): ''' List security groups ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.security_groups.list(): ret[item.name] = { 'name': item.name, 'description': item.description, 'id': item...
def secgroup_list(self): ''' List security groups ''' nt_ks = self.compute_conn ret = {} for item in nt_ks.security_groups.list(): ret[item.name] = { 'name': item.name, 'description': item.description, 'id': item...
[ "List", "security", "groups" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1103-L1117
[ "def", "secgroup_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "{", "}", "for", "item", "in", "nt_ks", ".", "security_groups", ".", "list", "(", ")", ":", "ret", "[", "item", ".", "name", "]", "=", "{", "'name...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._item_list
List items
salt/utils/openstack/nova.py
def _item_list(self): ''' List items ''' nt_ks = self.compute_conn ret = [] for item in nt_ks.items.list(): ret.append(item.__dict__) return ret
def _item_list(self): ''' List items ''' nt_ks = self.compute_conn ret = [] for item in nt_ks.items.list(): ret.append(item.__dict__) return ret
[ "List", "items" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1119-L1127
[ "def", "_item_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "ret", "=", "[", "]", "for", "item", "in", "nt_ks", ".", "items", ".", "list", "(", ")", ":", "ret", ".", "append", "(", "item", ".", "__dict__", ")", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._network_show
Parse the returned network list
salt/utils/openstack/nova.py
def _network_show(self, name, network_lst): ''' Parse the returned network list ''' for net in network_lst: if net.label == name: return net.__dict__ return {}
def _network_show(self, name, network_lst): ''' Parse the returned network list ''' for net in network_lst: if net.label == name: return net.__dict__ return {}
[ "Parse", "the", "returned", "network", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1129-L1136
[ "def", "_network_show", "(", "self", ",", "name", ",", "network_lst", ")", ":", "for", "net", "in", "network_lst", ":", "if", "net", ".", "label", "==", "name", ":", "return", "net", ".", "__dict__", "return", "{", "}" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.network_show
Show network information
salt/utils/openstack/nova.py
def network_show(self, name): ''' Show network information ''' nt_ks = self.compute_conn net_list = nt_ks.networks.list() return self._network_show(name, net_list)
def network_show(self, name): ''' Show network information ''' nt_ks = self.compute_conn net_list = nt_ks.networks.list() return self._network_show(name, net_list)
[ "Show", "network", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1138-L1144
[ "def", "network_show", "(", "self", ",", "name", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "net_list", "=", "nt_ks", ".", "networks", ".", "list", "(", ")", "return", "self", ".", "_network_show", "(", "name", ",", "net_list", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.network_list
List extra private networks
salt/utils/openstack/nova.py
def network_list(self): ''' List extra private networks ''' nt_ks = self.compute_conn return [network.__dict__ for network in nt_ks.networks.list()]
def network_list(self): ''' List extra private networks ''' nt_ks = self.compute_conn return [network.__dict__ for network in nt_ks.networks.list()]
[ "List", "extra", "private", "networks" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1146-L1151
[ "def", "network_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "return", "[", "network", ".", "__dict__", "for", "network", "in", "nt_ks", ".", "networks", ".", "list", "(", ")", "]" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova._sanatize_network_params
Sanatize novaclient network parameters
salt/utils/openstack/nova.py
def _sanatize_network_params(self, kwargs): ''' Sanatize novaclient network parameters ''' params = [ 'label', 'bridge', 'bridge_interface', 'cidr', 'cidr_v6', 'dns1', 'dns2', 'fixed_cidr', 'gateway', 'gateway_v6', 'multi_host', 'priority', 'project_id...
def _sanatize_network_params(self, kwargs): ''' Sanatize novaclient network parameters ''' params = [ 'label', 'bridge', 'bridge_interface', 'cidr', 'cidr_v6', 'dns1', 'dns2', 'fixed_cidr', 'gateway', 'gateway_v6', 'multi_host', 'priority', 'project_id...
[ "Sanatize", "novaclient", "network", "parameters" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1153-L1166
[ "def", "_sanatize_network_params", "(", "self", ",", "kwargs", ")", ":", "params", "=", "[", "'label'", ",", "'bridge'", ",", "'bridge_interface'", ",", "'cidr'", ",", "'cidr_v6'", ",", "'dns1'", ",", "'dns2'", ",", "'fixed_cidr'", ",", "'gateway'", ",", "'g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.network_create
Create extra private network
salt/utils/openstack/nova.py
def network_create(self, name, **kwargs): ''' Create extra private network ''' nt_ks = self.compute_conn kwargs['label'] = name kwargs = self._sanatize_network_params(kwargs) net = nt_ks.networks.create(**kwargs) return net.__dict__
def network_create(self, name, **kwargs): ''' Create extra private network ''' nt_ks = self.compute_conn kwargs['label'] = name kwargs = self._sanatize_network_params(kwargs) net = nt_ks.networks.create(**kwargs) return net.__dict__
[ "Create", "extra", "private", "network" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1168-L1176
[ "def", "network_create", "(", "self", ",", "name", ",", "*", "*", "kwargs", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "kwargs", "[", "'label'", "]", "=", "name", "kwargs", "=", "self", ".", "_sanatize_network_params", "(", "kwargs", ")", "net"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.virtual_interface_list
Get virtual interfaces on slice
salt/utils/openstack/nova.py
def virtual_interface_list(self, name): ''' Get virtual interfaces on slice ''' nt_ks = self.compute_conn nets = nt_ks.virtual_interfaces.list(self._server_uuid_from_name(name)) return [network.__dict__ for network in nets]
def virtual_interface_list(self, name): ''' Get virtual interfaces on slice ''' nt_ks = self.compute_conn nets = nt_ks.virtual_interfaces.list(self._server_uuid_from_name(name)) return [network.__dict__ for network in nets]
[ "Get", "virtual", "interfaces", "on", "slice" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1184-L1190
[ "def", "virtual_interface_list", "(", "self", ",", "name", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "nets", "=", "nt_ks", ".", "virtual_interfaces", ".", "list", "(", "self", ".", "_server_uuid_from_name", "(", "name", ")", ")", "return", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.virtual_interface_create
Add an interfaces to a slice
salt/utils/openstack/nova.py
def virtual_interface_create(self, name, net_name): ''' Add an interfaces to a slice ''' nt_ks = self.compute_conn serverid = self._server_uuid_from_name(name) networkid = self.network_show(net_name).get('id', None) if networkid is None: return {net_na...
def virtual_interface_create(self, name, net_name): ''' Add an interfaces to a slice ''' nt_ks = self.compute_conn serverid = self._server_uuid_from_name(name) networkid = self.network_show(net_name).get('id', None) if networkid is None: return {net_na...
[ "Add", "an", "interfaces", "to", "a", "slice" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1192-L1202
[ "def", "virtual_interface_create", "(", "self", ",", "name", ",", "net_name", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "serverid", "=", "self", ".", "_server_uuid_from_name", "(", "name", ")", "networkid", "=", "self", ".", "network_show", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_pool_list
List all floating IP pools .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_pool_list(self): ''' List all floating IP pools .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn pools = nt_ks.floating_ip_pools.list() response = {} for pool in pools: response[pool.name] = { 'name': po...
def floating_ip_pool_list(self): ''' List all floating IP pools .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn pools = nt_ks.floating_ip_pools.list() response = {} for pool in pools: response[pool.name] = { 'name': po...
[ "List", "all", "floating", "IP", "pools" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1204-L1217
[ "def", "floating_ip_pool_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "pools", "=", "nt_ks", ".", "floating_ip_pools", ".", "list", "(", ")", "response", "=", "{", "}", "for", "pool", "in", "pools", ":", "response", "[", "pool...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_list
List floating IPs .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_list(self): ''' List floating IPs .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn floating_ips = nt_ks.floating_ips.list() response = {} for floating_ip in floating_ips: response[floating_ip.ip] = { 'ip...
def floating_ip_list(self): ''' List floating IPs .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn floating_ips = nt_ks.floating_ips.list() response = {} for floating_ip in floating_ips: response[floating_ip.ip] = { 'ip...
[ "List", "floating", "IPs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1219-L1236
[ "def", "floating_ip_list", "(", "self", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "floating_ips", "=", "nt_ks", ".", "floating_ips", ".", "list", "(", ")", "response", "=", "{", "}", "for", "floating_ip", "in", "floating_ips", ":", "response", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_create
Allocate a floating IP .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_create(self, pool=None): ''' Allocate a floating IP .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn floating_ip = nt_ks.floating_ips.create(pool) response = { 'ip': floating_ip.ip, 'fixed_ip': floating_ip.fixed_ip,...
def floating_ip_create(self, pool=None): ''' Allocate a floating IP .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn floating_ip = nt_ks.floating_ips.create(pool) response = { 'ip': floating_ip.ip, 'fixed_ip': floating_ip.fixed_ip,...
[ "Allocate", "a", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1258-L1273
[ "def", "floating_ip_create", "(", "self", ",", "pool", "=", "None", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "floating_ip", "=", "nt_ks", ".", "floating_ips", ".", "create", "(", "pool", ")", "response", "=", "{", "'ip'", ":", "floating_ip", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_delete
De-allocate a floating IP .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_delete(self, floating_ip): ''' De-allocate a floating IP .. versionadded:: 2016.3.0 ''' ip = self.floating_ip_show(floating_ip) nt_ks = self.compute_conn return nt_ks.floating_ips.delete(ip)
def floating_ip_delete(self, floating_ip): ''' De-allocate a floating IP .. versionadded:: 2016.3.0 ''' ip = self.floating_ip_show(floating_ip) nt_ks = self.compute_conn return nt_ks.floating_ips.delete(ip)
[ "De", "-", "allocate", "a", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1275-L1283
[ "def", "floating_ip_delete", "(", "self", ",", "floating_ip", ")", ":", "ip", "=", "self", ".", "floating_ip_show", "(", "floating_ip", ")", "nt_ks", "=", "self", ".", "compute_conn", "return", "nt_ks", ".", "floating_ips", ".", "delete", "(", "ip", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_associate
Associate floating IP address to server .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_associate(self, server_name, floating_ip): ''' Associate floating IP address to server .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn server_ = self.server_by_name(server_name) server = nt_ks.servers.get(server_.__dict__['id']) s...
def floating_ip_associate(self, server_name, floating_ip): ''' Associate floating IP address to server .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn server_ = self.server_by_name(server_name) server = nt_ks.servers.get(server_.__dict__['id']) s...
[ "Associate", "floating", "IP", "address", "to", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1285-L1295
[ "def", "floating_ip_associate", "(", "self", ",", "server_name", ",", "floating_ip", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "server_", "=", "self", ".", "server_by_name", "(", "server_name", ")", "server", "=", "nt_ks", ".", "servers", ".", "ge...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltNova.floating_ip_disassociate
Disassociate a floating IP from server .. versionadded:: 2016.3.0
salt/utils/openstack/nova.py
def floating_ip_disassociate(self, server_name, floating_ip): ''' Disassociate a floating IP from server .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn server_ = self.server_by_name(server_name) server = nt_ks.servers.get(server_.__dict__['id']) ...
def floating_ip_disassociate(self, server_name, floating_ip): ''' Disassociate a floating IP from server .. versionadded:: 2016.3.0 ''' nt_ks = self.compute_conn server_ = self.server_by_name(server_name) server = nt_ks.servers.get(server_.__dict__['id']) ...
[ "Disassociate", "a", "floating", "IP", "from", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/nova.py#L1297-L1307
[ "def", "floating_ip_disassociate", "(", "self", ",", "server_name", ",", "floating_ip", ")", ":", "nt_ks", "=", "self", ".", "compute_conn", "server_", "=", "self", ".", "server_by_name", "(", "server_name", ")", "server", "=", "nt_ks", ".", "servers", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dependency_information
Report versions of library dependencies.
salt/version.py
def dependency_information(include_salt_cloud=False): ''' Report versions of library dependencies. ''' libs = [ ('Python', None, sys.version.rsplit('\n')[0].strip()), ('Jinja2', 'jinja2', '__version__'), ('M2Crypto', 'M2Crypto', 'version'), ('msgpack-python', 'msgpack', '...
def dependency_information(include_salt_cloud=False): ''' Report versions of library dependencies. ''' libs = [ ('Python', None, sys.version.rsplit('\n')[0].strip()), ('Jinja2', 'jinja2', '__version__'), ('M2Crypto', 'M2Crypto', 'version'), ('msgpack-python', 'msgpack', '...
[ "Report", "versions", "of", "library", "dependencies", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/version.py#L574-L624
[ "def", "dependency_information", "(", "include_salt_cloud", "=", "False", ")", ":", "libs", "=", "[", "(", "'Python'", ",", "None", ",", "sys", ".", "version", ".", "rsplit", "(", "'\\n'", ")", "[", "0", "]", ".", "strip", "(", ")", ")", ",", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
system_information
Report system versions.
salt/version.py
def system_information(): ''' Report system versions. ''' def system_version(): ''' Return host system version. ''' lin_ver = linux_distribution() mac_ver = platform.mac_ver() win_ver = platform.win32_ver() if lin_ver[0]: return ' '.jo...
def system_information(): ''' Report system versions. ''' def system_version(): ''' Return host system version. ''' lin_ver = linux_distribution() mac_ver = platform.mac_ver() win_ver = platform.win32_ver() if lin_ver[0]: return ' '.jo...
[ "Report", "system", "versions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/version.py#L627-L704
[ "def", "system_information", "(", ")", ":", "def", "system_version", "(", ")", ":", "'''\n Return host system version.\n '''", "lin_ver", "=", "linux_distribution", "(", ")", "mac_ver", "=", "platform", ".", "mac_ver", "(", ")", "win_ver", "=", "platfo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
versions_information
Report the versions of dependent software.
salt/version.py
def versions_information(include_salt_cloud=False): ''' Report the versions of dependent software. ''' salt_info = list(salt_information()) lib_info = list(dependency_information(include_salt_cloud)) sys_info = list(system_information()) return {'Salt Version': dict(salt_info), ...
def versions_information(include_salt_cloud=False): ''' Report the versions of dependent software. ''' salt_info = list(salt_information()) lib_info = list(dependency_information(include_salt_cloud)) sys_info = list(system_information()) return {'Salt Version': dict(salt_info), ...
[ "Report", "the", "versions", "of", "dependent", "software", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/version.py#L707-L717
[ "def", "versions_information", "(", "include_salt_cloud", "=", "False", ")", ":", "salt_info", "=", "list", "(", "salt_information", "(", ")", ")", "lib_info", "=", "list", "(", "dependency_information", "(", "include_salt_cloud", ")", ")", "sys_info", "=", "lis...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
versions_report
Yield each version properly formatted for console output.
salt/version.py
def versions_report(include_salt_cloud=False): ''' Yield each version properly formatted for console output. ''' ver_info = versions_information(include_salt_cloud) lib_pad = max(len(name) for name in ver_info['Dependency Versions']) sys_pad = max(len(name) for name in ver_info['System Versions...
def versions_report(include_salt_cloud=False): ''' Yield each version properly formatted for console output. ''' ver_info = versions_information(include_salt_cloud) lib_pad = max(len(name) for name in ver_info['Dependency Versions']) sys_pad = max(len(name) for name in ver_info['System Versions...
[ "Yield", "each", "version", "properly", "formatted", "for", "console", "output", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/version.py#L720-L743
[ "def", "versions_report", "(", "include_salt_cloud", "=", "False", ")", ":", "ver_info", "=", "versions_information", "(", "include_salt_cloud", ")", "lib_pad", "=", "max", "(", "len", "(", "name", ")", "for", "name", "in", "ver_info", "[", "'Dependency Versions...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
msi_conformant_version
An msi installer uninstalls/replaces a lower "internal version" of itself. "internal version" is ivMAJOR.ivMINOR.ivBUILD with max values 255.255.65535. Using the build nr allows continuous integration of the installer. "Display version" is indipendent and free format: Year.Month.Bugfix as in Salt 2016.11.3....
salt/version.py
def msi_conformant_version(): ''' An msi installer uninstalls/replaces a lower "internal version" of itself. "internal version" is ivMAJOR.ivMINOR.ivBUILD with max values 255.255.65535. Using the build nr allows continuous integration of the installer. "Display version" is indipendent and free forma...
def msi_conformant_version(): ''' An msi installer uninstalls/replaces a lower "internal version" of itself. "internal version" is ivMAJOR.ivMINOR.ivBUILD with max values 255.255.65535. Using the build nr allows continuous integration of the installer. "Display version" is indipendent and free forma...
[ "An", "msi", "installer", "uninstalls", "/", "replaces", "a", "lower", "internal", "version", "of", "itself", ".", "internal", "version", "is", "ivMAJOR", ".", "ivMINOR", ".", "ivBUILD", "with", "max", "values", "255", ".", "255", ".", "65535", ".", "Using...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/version.py#L746-L779
[ "def", "msi_conformant_version", "(", ")", ":", "short_year", "=", "int", "(", "six", ".", "text_type", "(", "__saltstack_version__", ".", "major", ")", "[", "2", ":", "]", ")", "month", "=", "__saltstack_version__", ".", "minor", "bugfix", "=", "__saltstack...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
genrepo
Refresh the winrepo.p file of the repository (salt-run winrepo.genrepo) If ``force`` is ``True`` no checks will be made and the repository will be generated if ``allow_empty`` is ``True`` then the state will not return an error if there are 0 packages, .. note:: This state only loads on minio...
salt/states/winrepo.py
def genrepo(name, force=False, allow_empty=False): ''' Refresh the winrepo.p file of the repository (salt-run winrepo.genrepo) If ``force`` is ``True`` no checks will be made and the repository will be generated if ``allow_empty`` is ``True`` then the state will not return an error if there are 0 p...
def genrepo(name, force=False, allow_empty=False): ''' Refresh the winrepo.p file of the repository (salt-run winrepo.genrepo) If ``force`` is ``True`` no checks will be made and the repository will be generated if ``allow_empty`` is ``True`` then the state will not return an error if there are 0 p...
[ "Refresh", "the", "winrepo", ".", "p", "file", "of", "the", "repository", "(", "salt", "-", "run", "winrepo", ".", "genrepo", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/winrepo.py#L23-L95
[ "def", "genrepo", "(", "name", ",", "force", "=", "False", ",", "allow_empty", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "master_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Beacon.process
Process the configured beacons The config must be a list and looks like this in yaml .. code_block:: yaml beacons: inotify: - files: - /etc/fstab: {} - /var/cache/foo: {}
salt/beacons/__init__.py
def process(self, config, grains): ''' Process the configured beacons The config must be a list and looks like this in yaml .. code_block:: yaml beacons: inotify: - files: - /etc/fstab: {} - /var/cache/fo...
def process(self, config, grains): ''' Process the configured beacons The config must be a list and looks like this in yaml .. code_block:: yaml beacons: inotify: - files: - /etc/fstab: {} - /var/cache/fo...
[ "Process", "the", "configured", "beacons" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L31-L131
[ "def", "process", "(", "self", ",", "config", ",", "grains", ")", ":", "ret", "=", "[", "]", "b_config", "=", "copy", ".", "deepcopy", "(", "config", ")", "if", "'enabled'", "in", "b_config", "and", "not", "b_config", "[", "'enabled'", "]", ":", "ret...
e8541fd6e744ab0df786c0f76102e41631f45d46