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 | get_group_id | Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup | salt/modules/boto_secgroup.py | def get_group_id(name, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup
'''
conn = _get_conn(region=region, key=key... | def get_group_id(name, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup
'''
conn = _get_conn(region=region, key=key... | [
"Get",
"a",
"Group",
"ID",
"given",
"a",
"Group",
"Name",
"or",
"Group",
"Name",
"and",
"VPC",
"ID"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L301-L316 | [
"def",
"get_group_id",
"(",
"name",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"reg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | convert_to_group_ids | Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt myminion boto_secgroup.convert_to_group_ids mysecgroup vpc-89yhh7h | salt/modules/boto_secgroup.py | def convert_to_group_ids(groups, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt... | def convert_to_group_ids(groups, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt... | [
"Given",
"a",
"list",
"of",
"security",
"groups",
"and",
"a",
"vpc_id",
"convert_to_group_ids",
"will",
"convert",
"all",
"list",
"items",
"in",
"the",
"given",
"list",
"to",
"security",
"group",
"ids",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L319-L342 | [
"def",
"convert_to_group_ids",
"(",
"groups",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_config | Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup | salt/modules/boto_secgroup.py | def get_config(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup
'''
conn = _get_conn(region=region, key=key,... | def get_config(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup
'''
conn = _get_conn(region=region, key=key,... | [
"Get",
"the",
"configuration",
"for",
"a",
"security",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L345-L374 | [
"def",
"get_config",
"(",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group' | salt/modules/boto_secgroup.py | def create(name, description, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group'
'''
conn = _get_conn(region=region, key=key, keyid=keyid, prof... | def create(name, description, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group'
'''
conn = _get_conn(region=region, key=key, keyid=keyid, prof... | [
"Create",
"a",
"security",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L377-L403 | [
"def",
"create",
"(",
"name",
",",
"description",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup | salt/modules/boto_secgroup.py | def delete(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | def delete(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | [
"Delete",
"a",
"security",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L406-L431 | [
"def",
"delete",
"(",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | authorize | Add a new rule to an existing security group.
CLI example::
salt myminion boto_secgroup.authorize mysecgroup ip_protocol=tcp from_port=80 to_port=80 cidr_ip='['10.0.0.0/8', '192.168.0.0/24']' | salt/modules/boto_secgroup.py | def authorize(name=None, source_group_name=None,
source_group_owner_id=None, ip_protocol=None,
from_port=None, to_port=None, cidr_ip=None, group_id=None,
source_group_group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None, egres... | def authorize(name=None, source_group_name=None,
source_group_owner_id=None, ip_protocol=None,
from_port=None, to_port=None, cidr_ip=None, group_id=None,
source_group_group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None, egres... | [
"Add",
"a",
"new",
"rule",
"to",
"an",
"existing",
"security",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L434-L486 | [
"def",
"authorize",
"(",
"name",
"=",
"None",
",",
"source_group_name",
"=",
"None",
",",
"source_group_owner_id",
"=",
"None",
",",
"ip_protocol",
"=",
"None",
",",
"from_port",
"=",
"None",
",",
"to_port",
"=",
"None",
",",
"cidr_ip",
"=",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_vpcs | Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library | salt/modules/boto_secgroup.py | def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library
'''
if all((vpc_id, vpc_name)):
... | def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library
'''
if all((vpc_id, vpc_name)):
... | [
"Given",
"VPC",
"properties",
"find",
"and",
"return",
"matching",
"VPC",
"ids",
".",
"Borrowed",
"from",
"boto_vpc",
";",
"these",
"could",
"be",
"refactored",
"into",
"a",
"common",
"library"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L542-L580 | [
"def",
"_find_vpcs",
"(",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"cidr",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_tags | sets tags on a security group
.. versionadded:: 2016.3.0
tags
a dict of key:value pair of tags to set on the security group
name
the name of the security group
group_id
the group id of the security group (in lie of a name/vpc combo)
vpc_name
the name of the vpc t... | salt/modules/boto_secgroup.py | def set_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
sets tags on a security group
.. versionadded:: 2016.3.0
tags
a... | def set_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
sets tags on a security group
.. versionadded:: 2016.3.0
tags
a... | [
"sets",
"tags",
"on",
"a",
"security",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L583-L644 | [
"def",
"set_tags",
"(",
"tags",
",",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_tags | deletes tags from a security group
.. versionadded:: 2016.3.0
tags
a list of tags to remove
name
the name of the security group
group_id
the group id of the security group (in lie of a name/vpc combo)
vpc_name
the name of the vpc to search the named group for
... | salt/modules/boto_secgroup.py | def delete_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
deletes tags from a security group
.. versionadde... | def delete_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
deletes tags from a security group
.. versionadde... | [
"deletes",
"tags",
"from",
"a",
"security",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L647-L710 | [
"def",
"delete_tags",
"(",
"tags",
",",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_upgrades | List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list... | salt/modules/zypperpkg.py | def list_upgrades(refresh=True, root=None, **kwargs):
'''
List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
... | def list_upgrades(refresh=True, root=None, **kwargs):
'''
List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
... | [
"List",
"all",
"available",
"package",
"upgrades",
"on",
"this",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L455-L487 | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"dict",
"(",
")",
"cmd",
"=",
"[",
"'list-updates'",
"]",
"if",
"'fr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info_available | Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root directory.
CLI example:
.. code-block:: bash
... | salt/modules/zypperpkg.py | def info_available(*names, **kwargs):
'''
Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root direc... | def info_available(*names, **kwargs):
'''
Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root direc... | [
"Return",
"the",
"information",
"of",
"the",
"named",
"package",
"available",
"for",
"the",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L554-L613 | [
"def",
"info_available",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"names",
":",
"return",
"ret",
"else",
":",
"names",
"=",
"sorted",
"(",
"list",
"(",
"set",
"(",
"names",
")",
")",
")",
"root",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version_cmp | .. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ``True`` to ignore the epoch when comparing versions
.. versio... | salt/modules/zypperpkg.py | def version_cmp(ver1, ver2, ignore_epoch=False, **kwargs):
'''
.. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ... | def version_cmp(ver1, ver2, ignore_epoch=False, **kwargs):
'''
.. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"4"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L707-L726 | [
"def",
"version_cmp",
"(",
"ver1",
",",
"ver2",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"__salt__",
"[",
"'lowpkg.version_cmp'",
"]",
"(",
"ver1",
",",
"ver2",
",",
"ignore_epoch",
"=",
"ignore_epoch",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the versions are provided as a list
{'<package_name>': ['<version>', '<version>']}
... | salt/modules/zypperpkg.py | def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs):
'''
List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the vers... | def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs):
'''
List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the vers... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
".",
"By",
"default",
"the",
"dict",
"contains",
"versions",
"as",
"a",
"comma",
"separated",
"string",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L729-L858 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"root",
"=",
"None",
",",
"includes",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_repo_pkgs | .. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
This function can be helpful in discovering the... | salt/modules/zypperpkg.py | def list_repo_pkgs(*args, **kwargs):
'''
.. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
... | def list_repo_pkgs(*args, **kwargs):
'''
.. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"5",
"2018",
".",
"3",
".",
"1"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L861-L979 | [
"def",
"list_repo_pkgs",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"byrepo",
"=",
"kwargs",
".",
"pop",
"(",
"'byrepo'",
",",
"False",
")",
"fromrepo",
"=",
"kwargs",
".",
"pop",
"(",
"'fromrepo'",
",",
"''",
")",
"or",
"''",
"ret",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_configured_repos | Get all the info about repositories from the configurations. | salt/modules/zypperpkg.py | def _get_configured_repos(root=None):
'''
Get all the info about repositories from the configurations.
'''
repos = os.path.join(root, os.path.relpath(REPOS, os.path.sep)) if root else REPOS
repos_cfg = configparser.ConfigParser()
if os.path.exists(repos):
repos_cfg.read([repos + '/' + f... | def _get_configured_repos(root=None):
'''
Get all the info about repositories from the configurations.
'''
repos = os.path.join(root, os.path.relpath(REPOS, os.path.sep)) if root else REPOS
repos_cfg = configparser.ConfigParser()
if os.path.exists(repos):
repos_cfg.read([repos + '/' + f... | [
"Get",
"all",
"the",
"info",
"about",
"repositories",
"from",
"the",
"configurations",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L982-L994 | [
"def",
"_get_configured_repos",
"(",
"root",
"=",
"None",
")",
":",
"repos",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"REPOS",
",",
"os",
".",
"path",
".",
"sep",
")",
")",
"if",
"root",
"else... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_repo_info | Get one repo meta-data. | salt/modules/zypperpkg.py | def _get_repo_info(alias, repos_cfg=None, root=None):
'''
Get one repo meta-data.
'''
try:
meta = dict((repos_cfg or _get_configured_repos(root=root)).items(alias))
meta['alias'] = alias
for key, val in six.iteritems(meta):
if val in ['0', '1']:
meta[k... | def _get_repo_info(alias, repos_cfg=None, root=None):
'''
Get one repo meta-data.
'''
try:
meta = dict((repos_cfg or _get_configured_repos(root=root)).items(alias))
meta['alias'] = alias
for key, val in six.iteritems(meta):
if val in ['0', '1']:
meta[k... | [
"Get",
"one",
"repo",
"meta",
"-",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L997-L1011 | [
"def",
"_get_repo_info",
"(",
"alias",
",",
"repos_cfg",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"try",
":",
"meta",
"=",
"dict",
"(",
"(",
"repos_cfg",
"or",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
")",
".",
"items",
"(",
"a... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_repos | Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos | salt/modules/zypperpkg.py | def list_repos(root=None, **kwargs):
'''
Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos_cfg = _get_configured_repos(root=root)
all_repos = {}
for alias in repos_cfg.sections():
... | def list_repos(root=None, **kwargs):
'''
Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos_cfg = _get_configured_repos(root=root)
all_repos = {}
for alias in repos_cfg.sections():
... | [
"Lists",
"all",
"repos",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1030-L1048 | [
"def",
"list_repos",
"(",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"all_repos",
"=",
"{",
"}",
"for",
"alias",
"in",
"repos_cfg",
".",
"sections",
"(",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | del_repo | Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias | salt/modules/zypperpkg.py | def del_repo(repo, root=None):
'''
Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias
'''
repos_cfg = _get_configured_repos(root=root)
for alias in repos_cfg.sections():
if alias == repo:
... | def del_repo(repo, root=None):
'''
Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias
'''
repos_cfg = _get_configured_repos(root=root)
for alias in repos_cfg.sections():
if alias == repo:
... | [
"Delete",
"a",
"repo",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1051-L1075 | [
"def",
"del_repo",
"(",
"repo",
",",
"root",
"=",
"None",
")",
":",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"for",
"alias",
"in",
"repos_cfg",
".",
"sections",
"(",
")",
":",
"if",
"alias",
"==",
"repo",
":",
"doc",
... | 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 following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
enabled
Enable or disable (Tru... | salt/modules/zypperpkg.py | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as the following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
... | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as the following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
... | [
"Modify",
"one",
"or",
"more",
"values",
"for",
"a",
"repo",
".",
"If",
"the",
"repo",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"so",
"long",
"as",
"the",
"following",
"values",
"are",
"specified",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1078-L1233 | [
"def",
"mod_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"or",
"None",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"added",
"=",
"False",
"# An attempt to add ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | refresh_db | Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | salt/modules/zypperpkg.py | def refresh_db(root=None):
'''
Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file... | def refresh_db(root=None):
'''
Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file... | [
"Force",
"a",
"repository",
"refresh",
"by",
"calling",
"zypper",
"refresh",
"--",
"force",
"return",
"a",
"dict",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1236-L1270 | [
"def",
"refresh_db",
"(",
"root",
"=",
"None",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"ret",
"=",
"{",
"}",
"out",
"=",
"__zypper__",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_types | Form a package names list, find prefixes of packages types. | salt/modules/zypperpkg.py | def _find_types(pkgs):
'''Form a package names list, find prefixes of packages types.'''
return sorted({pkg.split(':', 1)[0] for pkg in pkgs
if len(pkg.split(':', 1)) == 2}) | def _find_types(pkgs):
'''Form a package names list, find prefixes of packages types.'''
return sorted({pkg.split(':', 1)[0] for pkg in pkgs
if len(pkg.split(':', 1)) == 2}) | [
"Form",
"a",
"package",
"names",
"list",
"find",
"prefixes",
"of",
"packages",
"types",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1273-L1276 | [
"def",
"_find_types",
"(",
"pkgs",
")",
":",
"return",
"sorted",
"(",
"{",
"pkg",
".",
"split",
"(",
"':'",
",",
"1",
")",
"[",
"0",
"]",
"for",
"pkg",
"in",
"pkgs",
"if",
"len",
"(",
"pkg",
".",
"split",
"(",
"':'",
",",
"1",
")",
")",
"==",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | salt/modules/zypperpkg.py | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
downloadonly=None,
skip_verify=False,
version=None,
ignore_repo_failure=False,
no_recommends=False,
root=None,
... | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
downloadonly=None,
skip_verify=False,
version=None,
ignore_repo_failure=False,
no_recommends=False,
root=None,
... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1279-L1528 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"downloadonly",
"=",
"None",
",",
"skip_verify",
"=",
"False",
",",
"version",
"=",
"N... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | upgrade | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | salt/modules/zypperpkg.py | def upgrade(refresh=True,
dryrun=False,
dist_upgrade=False,
fromrepo=None,
novendorchange=False,
skip_verify=False,
no_recommends=False,
root=None,
**kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:... | def upgrade(refresh=True,
dryrun=False,
dist_upgrade=False,
fromrepo=None,
novendorchange=False,
skip_verify=False,
no_recommends=False,
root=None,
**kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1531-L1656 | [
"def",
"upgrade",
"(",
"refresh",
"=",
"True",
",",
"dryrun",
"=",
"False",
",",
"dist_upgrade",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"novendorchange",
"=",
"False",
",",
"skip_verify",
"=",
"False",
",",
"no_recommends",
"=",
"False",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _uninstall | Remove and purge do identical things but with different Zypper commands,
this function performs the common logic. | salt/modules/zypperpkg.py | def _uninstall(name=None, pkgs=None, root=None):
'''
Remove and purge do identical things but with different Zypper commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
raise Comm... | def _uninstall(name=None, pkgs=None, root=None):
'''
Remove and purge do identical things but with different Zypper commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
raise Comm... | [
"Remove",
"and",
"purge",
"do",
"identical",
"things",
"but",
"with",
"different",
"Zypper",
"commands",
"this",
"function",
"performs",
"the",
"common",
"logic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1659-L1699 | [
"def",
"_uninstall",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
")",
"[",
"0",
"]",
"except",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | salt/modules/zypperpkg.py | def remove(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemo... | def remove(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemo... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1728-L1772 | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"return",
"_uninstall",
"(",
"name",
"=",
"name",
",",
"pkgs",
"=",
"pkgs",
",",
"roo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | purge | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | salt/modules/zypperpkg.py | def purge(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon... | def purge(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1775-L1820 | [
"def",
"purge",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"return",
"_uninstall",
"(",
"name",
"=",
"name",
",",
"pkgs",
"=",
"pkgs",
",",
"root... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_locks | List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
'type': '<type>'}}
CLI Exa... | salt/modules/zypperpkg.py | def list_locks(root=None):
'''
List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
... | def list_locks(root=None):
'''
List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
... | [
"List",
"current",
"package",
"locks",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1823-L1859 | [
"def",
"list_locks",
"(",
"root",
"=",
"None",
")",
":",
"locks",
"=",
"{",
"}",
"_locks",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"LOCKS",
",",
"os",
".",
"path",
".",
"sep",
")",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | clean_locks | Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks | salt/modules/zypperpkg.py | def clean_locks(root=None):
'''
Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks
'''
LCK = "removed"
out = {LCK: 0}... | def clean_locks(root=None):
'''
Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks
'''
LCK = "removed"
out = {LCK: 0}... | [
"Remove",
"unused",
"locks",
"that",
"do",
"not",
"currently",
"(",
"with",
"regard",
"to",
"repositories",
"used",
")",
"lock",
"any",
"package",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1862-L1888 | [
"def",
"clean_locks",
"(",
"root",
"=",
"None",
")",
":",
"LCK",
"=",
"\"removed\"",
"out",
"=",
"{",
"LCK",
":",
"0",
"}",
"locks",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"LOCKS",
",",
"o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unhold | Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' pkg.remove_lock pkgs='["foo", "bar"]' | salt/modules/zypperpkg.py | def unhold(name=None, pkgs=None, **kwargs):
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' ... | def unhold(name=None, pkgs=None, **kwargs):
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' ... | [
"Remove",
"specified",
"package",
"lock",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1891-L1932 | [
"def",
"unhold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"if",
"(",
"not",
"name",
"and",
"not",
"pkgs",
")",
"or",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_lock | Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' pkg.remove_lock pkgs='["foo", "bar"]' | salt/modules/zypperpkg.py | def remove_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,... | def remove_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,... | [
"Remove",
"specified",
"package",
"lock",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1935-L1968 | [
"def",
"remove_lock",
"(",
"packages",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'This function is deprecated. Please use unhold(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hold | Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<package3>
salt '*' pkg.add_lock pkgs='["foo", "bar"]... | salt/modules/zypperpkg.py | def hold(name=None, pkgs=None, **kwargs):
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<packag... | def hold(name=None, pkgs=None, **kwargs):
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<packag... | [
"Add",
"a",
"package",
"lock",
".",
"Specify",
"packages",
"to",
"lock",
"by",
"exact",
"name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1971-L2016 | [
"def",
"hold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"if",
"(",
"not",
"name",
"and",
"not",
"pkgs",
")",
"or",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_lock | Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<package3>
salt '*' pkg.add_lock pkgs='["foo", "bar"]... | salt/modules/zypperpkg.py | def add_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.... | def add_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.... | [
"Add",
"a",
"package",
"lock",
".",
"Specify",
"packages",
"to",
"lock",
"by",
"exact",
"name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2019-L2049 | [
"def",
"add_lock",
"(",
"packages",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'This function is deprecated. Please use hold() ins... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_patterns | List all known patterns in repos. | salt/modules/zypperpkg.py | def _get_patterns(installed_only=None, root=None):
'''
List all known patterns in repos.
'''
patterns = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (insta... | def _get_patterns(installed_only=None, root=None):
'''
List all known patterns in repos.
'''
patterns = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (insta... | [
"List",
"all",
"known",
"patterns",
"in",
"repos",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2185-L2198 | [
"def",
"_get_patterns",
"(",
"installed_only",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"patterns",
"=",
"{",
"}",
"for",
"element",
"in",
"__zypper__",
"(",
"root",
"=",
"root",
")",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_patterns | List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.list_pat... | salt/modules/zypperpkg.py | def list_patterns(refresh=False, root=None):
'''
List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:... | def list_patterns(refresh=False, root=None):
'''
List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:... | [
"List",
"all",
"known",
"patterns",
"from",
"available",
"repos",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2201-L2222 | [
"def",
"list_patterns",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"return",
"_get_patterns",
"(",
"root",
"=",
"root",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | search | List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search for an `exact` match
or for the whole `words` only. D... | salt/modules/zypperpkg.py | def search(criteria, refresh=False, **kwargs):
'''
List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search fo... | def search(criteria, refresh=False, **kwargs):
'''
List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search fo... | [
"List",
"known",
"packages",
"available",
"to",
"the",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2241-L2345 | [
"def",
"search",
"(",
"criteria",
",",
"refresh",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ALLOWED_SEARCH_OPTIONS",
"=",
"{",
"'provides'",
":",
"'--provides'",
",",
"'recommends'",
":",
"'--recommends'",
",",
"'requires'",
":",
"'--requires'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_first_aggregate_text | Extract text from the first occurred DOM aggregate. | salt/modules/zypperpkg.py | def _get_first_aggregate_text(node_list):
'''
Extract text from the first occurred DOM aggregate.
'''
if not node_list:
return ''
out = []
for node in node_list[0].childNodes:
if node.nodeType == dom.Document.TEXT_NODE:
out.append(node.nodeValue)
return '\n'.join... | def _get_first_aggregate_text(node_list):
'''
Extract text from the first occurred DOM aggregate.
'''
if not node_list:
return ''
out = []
for node in node_list[0].childNodes:
if node.nodeType == dom.Document.TEXT_NODE:
out.append(node.nodeValue)
return '\n'.join... | [
"Extract",
"text",
"from",
"the",
"first",
"occurred",
"DOM",
"aggregate",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2348-L2359 | [
"def",
"_get_first_aggregate_text",
"(",
"node_list",
")",
":",
"if",
"not",
"node_list",
":",
"return",
"''",
"out",
"=",
"[",
"]",
"for",
"node",
"in",
"node_list",
"[",
"0",
"]",
".",
"childNodes",
":",
"if",
"node",
".",
"nodeType",
"==",
"dom",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_products | List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root dir... | salt/modules/zypperpkg.py | def list_products(all=False, refresh=False, root=None):
'''
List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is... | def list_products(all=False, refresh=False, root=None):
'''
List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is... | [
"List",
"all",
"available",
"or",
"installed",
"SUSE",
"products",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2362-L2431 | [
"def",
"list_products",
"(",
"all",
"=",
"False",
",",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"list",
"(",
")",
"OEM_PATH",
"=",
"'/var/lib/suseRegister/OEM'",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | download | Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:: bash
salt '*' pkg.download httpd
... | salt/modules/zypperpkg.py | def download(*packages, **kwargs):
'''
Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:... | def download(*packages, **kwargs):
'''
Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:... | [
"Download",
"packages",
"to",
"the",
"local",
"disk",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2434-L2485 | [
"def",
"download",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"packages",
":",
"raise",
"SaltInvocationError",
"(",
"'No packages specified'",
")",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
",",
"None",
")",
"refresh",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_patches | List all known patches in repos. | salt/modules/zypperpkg.py | def _get_patches(installed_only=False, root=None):
'''
List all known patches in repos.
'''
patches = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'patch').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (installed... | def _get_patches(installed_only=False, root=None):
'''
List all known patches in repos.
'''
patches = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'patch').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (installed... | [
"List",
"all",
"known",
"patches",
"in",
"repos",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2563-L2576 | [
"def",
"_get_patches",
"(",
"installed_only",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"patches",
"=",
"{",
"}",
"for",
"element",
"in",
"__zypper__",
"(",
"root",
"=",
"root",
")",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_patches | .. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:
.. code-blo... | salt/modules/zypperpkg.py | def list_patches(refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate ... | def list_patches(refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate ... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2579-L2602 | [
"def",
"list_patches",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"return",
"_get_patches",
"(",
"root",
"=",
"root",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_provides | .. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.list_provides | salt/modules/zypperpkg.py | def list_provides(root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
sal... | def list_provides(root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
sal... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2623-L2657 | [
"def",
"list_provides",
"(",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"__context__",
".",
"get",
"(",
"'pkg.list_provides'",
")",
"if",
"not",
"ret",
":",
"cmd",
"=",
"[",
"'rpm'",
"]",
"if",
"root",
":",
"cmd",
".",
"ext... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resolve_capabilities | .. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unchanged.
refresh
force a refresh if set to True.
If set to F... | salt/modules/zypperpkg.py | def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unc... | def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unc... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2660-L2723 | [
"def",
"resolve_capabilities",
"(",
"pkgs",
",",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"list",
"(",
")",
"for",
"pkg",
"in",
"pkgs",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _Zypper._reset | Resets values of the call setup.
:return: | salt/modules/zypperpkg.py | def _reset(self):
'''
Resets values of the call setup.
:return:
'''
self.__cmd = ['zypper', '--non-interactive']
self.__exit_code = 0
self.__call_result = dict()
self.__error_msg = ''
self.__env = salt.utils.environment.get_module_environment(glob... | def _reset(self):
'''
Resets values of the call setup.
:return:
'''
self.__cmd = ['zypper', '--non-interactive']
self.__exit_code = 0
self.__call_result = dict()
self.__error_msg = ''
self.__env = salt.utils.environment.get_module_environment(glob... | [
"Resets",
"values",
"of",
"the",
"call",
"setup",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L112-L134 | [
"def",
"_reset",
"(",
"self",
")",
":",
"self",
".",
"__cmd",
"=",
"[",
"'zypper'",
",",
"'--non-interactive'",
"]",
"self",
".",
"__exit_code",
"=",
"0",
"self",
".",
"__call_result",
"=",
"dict",
"(",
")",
"self",
".",
"__error_msg",
"=",
"''",
"self... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _Zypper._is_error | Is this is an error code?
:return: | salt/modules/zypperpkg.py | def _is_error(self):
'''
Is this is an error code?
:return:
'''
if self.exit_code:
msg = self.SUCCESS_EXIT_CODES.get(self.exit_code)
if msg:
log.info(msg)
msg = self.WARNING_EXIT_CODES.get(self.exit_code)
if msg:
... | def _is_error(self):
'''
Is this is an error code?
:return:
'''
if self.exit_code:
msg = self.SUCCESS_EXIT_CODES.get(self.exit_code)
if msg:
log.info(msg)
msg = self.WARNING_EXIT_CODES.get(self.exit_code)
if msg:
... | [
"Is",
"this",
"is",
"an",
"error",
"code?"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L214-L228 | [
"def",
"_is_error",
"(",
"self",
")",
":",
"if",
"self",
".",
"exit_code",
":",
"msg",
"=",
"self",
".",
"SUCCESS_EXIT_CODES",
".",
"get",
"(",
"self",
".",
"exit_code",
")",
"if",
"msg",
":",
"log",
".",
"info",
"(",
"msg",
")",
"msg",
"=",
"self"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _Zypper._is_xml_mode | Is Zypper's output is in XML format?
:return: | salt/modules/zypperpkg.py | def _is_xml_mode(self):
'''
Is Zypper's output is in XML format?
:return:
'''
return [itm for itm in self.XML_DIRECTIVES if itm in self.__cmd] and True or False | def _is_xml_mode(self):
'''
Is Zypper's output is in XML format?
:return:
'''
return [itm for itm in self.XML_DIRECTIVES if itm in self.__cmd] and True or False | [
"Is",
"Zypper",
"s",
"output",
"is",
"in",
"XML",
"format?"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L238-L244 | [
"def",
"_is_xml_mode",
"(",
"self",
")",
":",
"return",
"[",
"itm",
"for",
"itm",
"in",
"self",
".",
"XML_DIRECTIVES",
"if",
"itm",
"in",
"self",
".",
"__cmd",
"]",
"and",
"True",
"or",
"False"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _Zypper._check_result | Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all | salt/modules/zypperpkg.py | def _check_result(self):
'''
Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all
'''
if not self.__call_result:
... | def _check_result(self):
'''
Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all
'''
if not self.__call_result:
... | [
"Check",
"and",
"set",
"the",
"result",
"of",
"a",
"zypper",
"command",
".",
"In",
"case",
"of",
"an",
"error",
"either",
"raise",
"a",
"CommandExecutionError",
"or",
"extract",
"the",
"error",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L246-L281 | [
"def",
"_check_result",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"__call_result",
":",
"raise",
"CommandExecutionError",
"(",
"'No output result from Zypper?'",
")",
"self",
".",
"exit_code",
"=",
"self",
".",
"__call_result",
"[",
"'retcode'",
"]",
"if"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _Zypper.__call | Call Zypper.
:param state:
:return: | salt/modules/zypperpkg.py | def __call(self, *args, **kwargs):
'''
Call Zypper.
:param state:
:return:
'''
self.__called = True
if self.__xml:
self.__cmd.append('--xmlout')
if not self.__refresh and '--no-refresh' not in args:
self.__cmd.append('--no-refresh'... | def __call(self, *args, **kwargs):
'''
Call Zypper.
:param state:
:return:
'''
self.__called = True
if self.__xml:
self.__cmd.append('--xmlout')
if not self.__refresh and '--no-refresh' not in args:
self.__cmd.append('--no-refresh'... | [
"Call",
"Zypper",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L283-L356 | [
"def",
"__call",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"__called",
"=",
"True",
"if",
"self",
".",
"__xml",
":",
"self",
".",
"__cmd",
".",
"append",
"(",
"'--xmlout'",
")",
"if",
"not",
"self",
".",
"__re... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Wildcard._get_available_versions | Get available versions of the package.
:return: | salt/modules/zypperpkg.py | def _get_available_versions(self):
'''
Get available versions of the package.
:return:
'''
solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
if not solvables:
raise CommandExecutionError('No packages found matchin... | def _get_available_versions(self):
'''
Get available versions of the package.
:return:
'''
solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
if not solvables:
raise CommandExecutionError('No packages found matchin... | [
"Get",
"available",
"versions",
"of",
"the",
"package",
".",
":",
"return",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L402-L412 | [
"def",
"_get_available_versions",
"(",
"self",
")",
":",
"solvables",
"=",
"self",
".",
"zypper",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
"'-xv'",
",",
"self",
".",
"name",
")",
".",
"getElementsByTagName",
"(",
"'solvable'",
")",
"if",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Wildcard._get_scope_versions | Get available difference between next possible matches.
:return: | salt/modules/zypperpkg.py | def _get_scope_versions(self, pkg_versions):
'''
Get available difference between next possible matches.
:return:
'''
get_in_versions = []
for p_version in pkg_versions:
if fnmatch.fnmatch(p_version, self.version):
get_in_versions.append(p_ver... | def _get_scope_versions(self, pkg_versions):
'''
Get available difference between next possible matches.
:return:
'''
get_in_versions = []
for p_version in pkg_versions:
if fnmatch.fnmatch(p_version, self.version):
get_in_versions.append(p_ver... | [
"Get",
"available",
"difference",
"between",
"next",
"possible",
"matches",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L414-L424 | [
"def",
"_get_scope_versions",
"(",
"self",
",",
"pkg_versions",
")",
":",
"get_in_versions",
"=",
"[",
"]",
"for",
"p_version",
"in",
"pkg_versions",
":",
"if",
"fnmatch",
".",
"fnmatch",
"(",
"p_version",
",",
"self",
".",
"version",
")",
":",
"get_in_versi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Wildcard._set_version | Stash operator from the version, if any.
:return: | salt/modules/zypperpkg.py | def _set_version(self, version):
'''
Stash operator from the version, if any.
:return:
'''
if not version:
return
exact_version = re.sub(r'[<>=+]*', '', version)
self._op = version.replace(exact_version, '') or None
if self._op and self._op n... | def _set_version(self, version):
'''
Stash operator from the version, if any.
:return:
'''
if not version:
return
exact_version = re.sub(r'[<>=+]*', '', version)
self._op = version.replace(exact_version, '') or None
if self._op and self._op n... | [
"Stash",
"operator",
"from",
"the",
"version",
"if",
"any",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L426-L439 | [
"def",
"_set_version",
"(",
"self",
",",
"version",
")",
":",
"if",
"not",
"version",
":",
"return",
"exact_version",
"=",
"re",
".",
"sub",
"(",
"r'[<>=+]*'",
",",
"''",
",",
"version",
")",
"self",
".",
"_op",
"=",
"version",
".",
"replace",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _cleanup | Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up. | salt/utils/vt.py | def _cleanup():
'''
Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up.
'''
for inst in _ACTIVE[:]:
res = inst.isalive()
if res is not True:
try:
_ACTIVE.remove(inst)
except ValueError:
... | def _cleanup():
'''
Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up.
'''
for inst in _ACTIVE[:]:
res = inst.isalive()
if res is not True:
try:
_ACTIVE.remove(inst)
except ValueError:
... | [
"Make",
"sure",
"that",
"any",
"terminal",
"processes",
"still",
"running",
"when",
"__del__",
"was",
"called",
"to",
"the",
"waited",
"and",
"cleaned",
"up",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L78-L91 | [
"def",
"_cleanup",
"(",
")",
":",
"for",
"inst",
"in",
"_ACTIVE",
"[",
":",
"]",
":",
"res",
"=",
"inst",
".",
"isalive",
"(",
")",
"if",
"res",
"is",
"not",
"True",
":",
"try",
":",
"_ACTIVE",
".",
"remove",
"(",
"inst",
")",
"except",
"ValueErr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Terminal.sendline | Send the provided data to the terminal appending a line feed. | salt/utils/vt.py | def sendline(self, data, linesep=os.linesep):
'''
Send the provided data to the terminal appending a line feed.
'''
return self.send('{0}{1}'.format(data, linesep)) | def sendline(self, data, linesep=os.linesep):
'''
Send the provided data to the terminal appending a line feed.
'''
return self.send('{0}{1}'.format(data, linesep)) | [
"Send",
"the",
"provided",
"data",
"to",
"the",
"terminal",
"appending",
"a",
"line",
"feed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L295-L299 | [
"def",
"sendline",
"(",
"self",
",",
"data",
",",
"linesep",
"=",
"os",
".",
"linesep",
")",
":",
"return",
"self",
".",
"send",
"(",
"'{0}{1}'",
".",
"format",
"(",
"data",
",",
"linesep",
")",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Terminal.recv | Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process. | salt/utils/vt.py | def recv(self, maxsize=None):
'''
Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process.
'''
if maxsize is None:
maxsize = 1024
elif maxsize < 1:
... | def recv(self, maxsize=None):
'''
Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process.
'''
if maxsize is None:
maxsize = 1024
elif maxsize < 1:
... | [
"Receive",
"data",
"from",
"the",
"terminal",
"as",
"a",
"(",
"stdout",
"stderr",
")",
"tuple",
".",
"If",
"any",
"of",
"those",
"is",
"None",
"we",
"can",
"no",
"longer",
"communicate",
"with",
"the",
"terminal",
"s",
"child",
"process",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L301-L311 | [
"def",
"recv",
"(",
"self",
",",
"maxsize",
"=",
"None",
")",
":",
"if",
"maxsize",
"is",
"None",
":",
"maxsize",
"=",
"1024",
"elif",
"maxsize",
"<",
"1",
":",
"maxsize",
"=",
"1",
"return",
"self",
".",
"_recv",
"(",
"maxsize",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Terminal.close | Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough. | salt/utils/vt.py | def close(self, terminate=True, kill=False):
'''
Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough.
'''
... | def close(self, terminate=True, kill=False):
'''
Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough.
'''
... | [
"Close",
"the",
"communication",
"with",
"the",
"terminal",
"s",
"child",
".",
"If",
"terminate",
"is",
"True",
"then",
"additionally",
"try",
"to",
"terminate",
"the",
"terminal",
"and",
"if",
"kill",
"is",
"also",
"True",
"kill",
"the",
"terminal",
"if",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L313-L331 | [
"def",
"close",
"(",
"self",
",",
"terminate",
"=",
"True",
",",
"kill",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"closed",
":",
"if",
"self",
".",
"child_fd",
"is",
"not",
"None",
":",
"os",
".",
"close",
"(",
"self",
".",
"child_fd",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider | salt/states/pyrax_queues.py | def present(name, provider):
'''
Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', provider=pr... | def present(name, provider):
'''
Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', provider=pr... | [
"Ensure",
"the",
"RackSpace",
"queue",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyrax_queues.py#L36-L68 | [
"def",
"present",
"(",
"name",
",",
"provider",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_present",
"=",
"list",
"(",
"__salt__",
"[",
"'cl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider | salt/states/pyrax_queues.py | def absent(name, provider):
'''
Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', pr... | def absent(name, provider):
'''
Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', pr... | [
"Ensure",
"the",
"named",
"Rackspace",
"queue",
"is",
"deleted",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyrax_queues.py#L71-L102 | [
"def",
"absent",
"(",
"name",
",",
"provider",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_present",
"=",
"list",
"(",
"__salt__",
"[",
"'clo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | __connect | Connect to the DRAC | salt/runners/drac.py | def __connect(hostname, timeout=20, username=None, password=None):
'''
Connect to the DRAC
'''
drac_cred = __opts__.get('drac')
err_msg = 'No drac login credentials found. Please add the \'username\' and \'password\' ' \
'fields beneath a \'drac\' key in the master configuration file. ... | def __connect(hostname, timeout=20, username=None, password=None):
'''
Connect to the DRAC
'''
drac_cred = __opts__.get('drac')
err_msg = 'No drac login credentials found. Please add the \'username\' and \'password\' ' \
'fields beneath a \'drac\' key in the master configuration file. ... | [
"Connect",
"to",
"the",
"DRAC"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L37-L66 | [
"def",
"__connect",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"drac_cred",
"=",
"__opts__",
".",
"get",
"(",
"'drac'",
")",
"err_msg",
"=",
"'No drac login credentials found. Please add th... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | __version | Grab DRAC version | salt/runners/drac.py | def __version(client):
'''
Grab DRAC version
'''
versions = {9: 'CMC',
8: 'iDRAC6',
10: 'iDRAC6',
11: 'iDRAC6',
16: 'iDRAC7',
17: 'iDRAC7'}
if isinstance(client, paramiko.SSHClient):
(stdin, stdout, stderr) = cl... | def __version(client):
'''
Grab DRAC version
'''
versions = {9: 'CMC',
8: 'iDRAC6',
10: 'iDRAC6',
11: 'iDRAC6',
16: 'iDRAC7',
17: 'iDRAC7'}
if isinstance(client, paramiko.SSHClient):
(stdin, stdout, stderr) = cl... | [
"Grab",
"DRAC",
"version"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L69-L87 | [
"def",
"__version",
"(",
"client",
")",
":",
"versions",
"=",
"{",
"9",
":",
"'CMC'",
",",
"8",
":",
"'iDRAC6'",
",",
"10",
":",
"'iDRAC6'",
",",
"11",
":",
"'iDRAC6'",
",",
"16",
":",
"'iDRAC7'",
",",
"17",
":",
"'iDRAC7'",
"}",
"if",
"isinstance"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pxe | Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com | salt/runners/drac.py | def pxe(hostname, timeout=20, username=None, password=None):
'''
Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com
'''
_cmds = [
'racadm config -g cfgServerInfo... | def pxe(hostname, timeout=20, username=None, password=None):
'''
Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com
'''
_cmds = [
'racadm config -g cfgServerInfo... | [
"Connect",
"to",
"the",
"Dell",
"DRAC",
"and",
"have",
"the",
"boot",
"order",
"set",
"to",
"PXE",
"and",
"power",
"cycle",
"the",
"system",
"to",
"PXE",
"boot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L90-L121 | [
"def",
"pxe",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"_cmds",
"=",
"[",
"'racadm config -g cfgServerInfo -o cfgServerFirstBootDevice pxe'",
",",
"'racadm config -g cfgServerInfo -o cfgServerBootO... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com | salt/runners/drac.py | def reboot(hostname, timeout=20, username=None, password=None):
'''
Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com
'''
client = __connect(hostname, timeout, username, password)
if isinstance(client, paramiko.SSHClient):
... | def reboot(hostname, timeout=20, username=None, password=None):
'''
Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com
'''
client = __connect(hostname, timeout, username, password)
if isinstance(client, paramiko.SSHClient):
... | [
"Reboot",
"a",
"server",
"using",
"the",
"Dell",
"DRAC"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L124-L148 | [
"def",
"reboot",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"client",
"=",
"__connect",
"(",
"hostname",
",",
"timeout",
",",
"username",
",",
"password",
")",
"if",
"isinstance",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com | salt/runners/drac.py | def version(hostname, timeout=20, username=None, password=None):
'''
Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com
'''
return __version(__connect(hostname, timeout, username, password)) | def version(hostname, timeout=20, username=None, password=None):
'''
Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com
'''
return __version(__connect(hostname, timeout, username, password)) | [
"Display",
"the",
"version",
"of",
"DRAC"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L205-L215 | [
"def",
"version",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"return",
"__version",
"(",
"__connect",
"(",
"hostname",
",",
"timeout",
",",
"username",
",",
"password",
")",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | beacon | Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True | salt/beacons/glxinfo.py | def beacon(config):
'''
Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True
'''
log.t... | def beacon(config):
'''
Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True
'''
log.t... | [
"Emit",
"the",
"status",
"of",
"a",
"connected",
"display",
"to",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/glxinfo.py#L49-L82 | [
"def",
"beacon",
"(",
"config",
")",
":",
"log",
".",
"trace",
"(",
"'glxinfo beacon starting'",
")",
"ret",
"=",
"[",
"]",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"retcode",
"=",
"__salt_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get | Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels of a data
structure.
CLI Example:
.... | salt/runners/config.py | def get(key, default='', delimiter=':'):
'''
Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels ... | def get(key, default='', delimiter=':'):
'''
Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels ... | [
"Retrieve",
"master",
"config",
"options",
"with",
"optional",
"nesting",
"via",
"the",
"delimiter",
"argument",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/config.py#L12-L40 | [
"def",
"get",
"(",
"key",
",",
"default",
"=",
"''",
",",
"delimiter",
"=",
"':'",
")",
":",
"ret",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"traverse_dict_and_list",
"(",
"__opts__",
",",
"key",
",",
"default",
"=",
"'_|-'",
",",
"delimiter",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reissue | Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Request file
certificate_id
Unique ID of the SSL certificate you wish to activate
web_server_type
The type of certificate format to return. Possible values include... | salt/modules/namecheap_ssl.py | def reissue(csr_file,
certificate_id,
web_server_type,
approver_email=None,
http_dc_validation=False,
**kwargs):
'''
Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Requ... | def reissue(csr_file,
certificate_id,
web_server_type,
approver_email=None,
http_dc_validation=False,
**kwargs):
'''
Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Requ... | [
"Reissues",
"a",
"purchased",
"SSL",
"certificate",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"values",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L58-L128 | [
"def",
"reissue",
"(",
"csr_file",
",",
"certificate_id",
",",
"web_server_type",
",",
"approver_email",
"=",
"None",
",",
"http_dc_validation",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"__get_certificates",
"(",
"'namecheap.ssl.reissue'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | renew | Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
Number of years to register
certificate_id
Unique ID of the SSL certif... | salt/modules/namecheap_ssl.py | def renew(years, certificate_id, certificate_type, promotion_code=None):
'''
Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
... | def renew(years, certificate_id, certificate_type, promotion_code=None):
'''
Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
... | [
"Renews",
"an",
"SSL",
"certificate",
"if",
"it",
"is",
"ACTIVE",
"and",
"Expires",
"<",
"=",
"30",
"days",
".",
"Returns",
"the",
"following",
"information",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L295-L407 | [
"def",
"renew",
"(",
"years",
",",
"certificate_id",
",",
"certificate_type",
",",
"promotion_code",
"=",
"None",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'InstantSSL'",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- The date on which the certificate was created
- The date on which the certificate wil... | salt/modules/namecheap_ssl.py | def create(years, certificate_type, promotion_code=None, sans_to_add=None):
'''
Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- T... | def create(years, certificate_type, promotion_code=None, sans_to_add=None):
'''
Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- T... | [
"Creates",
"a",
"new",
"SSL",
"certificate",
".",
"Returns",
"the",
"following",
"information",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L410-L591 | [
"def",
"create",
"(",
"years",
",",
"certificate_type",
",",
"promotion_code",
"=",
"None",
",",
"sans_to_add",
"=",
"None",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'Insta... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | parse_csr | Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- EV SSL
- EV SSL SGC
- EssentialSSL
- EssentialSSL Wildcar... | salt/modules/namecheap_ssl.py | def parse_csr(csr_file, certificate_type, http_dc_validation=False):
'''
Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- ... | def parse_csr(csr_file, certificate_type, http_dc_validation=False):
'''
Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- ... | [
"Parses",
"the",
"CSR",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"values",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L594-L696 | [
"def",
"parse_csr",
"(",
"csr_file",
",",
"certificate_type",
",",
"http_dc_validation",
"=",
"False",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'InstantSSL'",
",",
"'PositiveSS... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_list | Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled
- NewPurchase
- New... | salt/modules/namecheap_ssl.py | def get_list(**kwargs):
'''
Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled... | def get_list(**kwargs):
'''
Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled... | [
"Returns",
"a",
"list",
"of",
"SSL",
"certificates",
"for",
"a",
"particular",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L699-L755 | [
"def",
"get_list",
"(",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.ssl.getList'",
")",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"kwargs",
")",
":",
"opts",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_info | Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details for the certificate such as the
CSR, Approver, and certificate data
certi... | salt/modules/namecheap_ssl.py | def get_info(certificate_id, returncertificate=False, returntype=None):
'''
Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details ... | def get_info(certificate_id, returncertificate=False, returntype=None):
'''
Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details ... | [
"Retrieves",
"information",
"about",
"the",
"requested",
"SSL",
"certificate",
".",
"Returns",
"a",
"dictionary",
"of",
"information",
"about",
"the",
"SSL",
"certificate",
"with",
"two",
"keys",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L758-L806 | [
"def",
"get_info",
"(",
"certificate_id",
",",
"returncertificate",
"=",
"False",
",",
"returntype",
"=",
"None",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.ssl.getinfo'",
")",
"opts",
"[",
"'certificateID'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_cron | Return the changes | salt/states/cron.py | def _check_cron(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
comment=None,
commented=None,
identifier=None,
special=None):
''... | def _check_cron(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
comment=None,
commented=None,
identifier=None,
special=None):
''... | [
"Return",
"the",
"changes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L161-L214 | [
"def",
"_check_cron",
"(",
"user",
",",
"cmd",
",",
"minute",
"=",
"None",
",",
"hour",
"=",
"None",
",",
"daymonth",
"=",
"None",
",",
"month",
"=",
"None",
",",
"dayweek",
"=",
"None",
",",
"comment",
"=",
"None",
",",
"commented",
"=",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_cron_env | Return the environment changes | salt/states/cron.py | def _check_cron_env(user,
name,
value=None):
'''
Return the environment changes
'''
if value is None:
value = "" # Matching value set in salt.modules.cron._render_tab
lst = __salt__['cron.list_tab'](user)
for env in lst['env']:
if name == ... | def _check_cron_env(user,
name,
value=None):
'''
Return the environment changes
'''
if value is None:
value = "" # Matching value set in salt.modules.cron._render_tab
lst = __salt__['cron.list_tab'](user)
for env in lst['env']:
if name == ... | [
"Return",
"the",
"environment",
"changes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L217-L231 | [
"def",
"_check_cron_env",
"(",
"user",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"\"\"",
"# Matching value set in salt.modules.cron._render_tab",
"lst",
"=",
"__salt__",
"[",
"'cron.list_tab'",
"]",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_cron_info | Returns the proper group owner and path to the cron directory | salt/states/cron.py | def _get_cron_info():
'''
Returns the proper group owner and path to the cron directory
'''
owner = 'root'
if __grains__['os'] == 'FreeBSD':
group = 'wheel'
crontab_dir = '/var/cron/tabs'
elif __grains__['os'] == 'OpenBSD':
group = 'crontab'
crontab_dir = '/var/cr... | def _get_cron_info():
'''
Returns the proper group owner and path to the cron directory
'''
owner = 'root'
if __grains__['os'] == 'FreeBSD':
group = 'wheel'
crontab_dir = '/var/cron/tabs'
elif __grains__['os'] == 'OpenBSD':
group = 'crontab'
crontab_dir = '/var/cr... | [
"Returns",
"the",
"proper",
"group",
"owner",
"and",
"path",
"to",
"the",
"cron",
"directory"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L234-L254 | [
"def",
"_get_cron_info",
"(",
")",
":",
"owner",
"=",
"'root'",
"if",
"__grains__",
"[",
"'os'",
"]",
"==",
"'FreeBSD'",
":",
"group",
"=",
"'wheel'",
"crontab_dir",
"=",
"'/var/cron/tabs'",
"elif",
"__grains__",
"[",
"'os'",
"]",
"==",
"'OpenBSD'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Verifies that the specified cron job is present for the specified user.
It is recommended to use `identifier`. Otherwise the cron job is installed
twice if you change the name.
For more advanced information about what exactly can be set in the cron
timing parameters, check your cron system's documentati... | salt/states/cron.py | def present(name,
user='root',
minute='*',
hour='*',
daymonth='*',
month='*',
dayweek='*',
comment=None,
commented=False,
identifier=False,
special=None):
'''
Verifies that the specified cron ... | def present(name,
user='root',
minute='*',
hour='*',
daymonth='*',
month='*',
dayweek='*',
comment=None,
commented=False,
identifier=False,
special=None):
'''
Verifies that the specified cron ... | [
"Verifies",
"that",
"the",
"specified",
"cron",
"job",
"is",
"present",
"for",
"the",
"specified",
"user",
".",
"It",
"is",
"recommended",
"to",
"use",
"identifier",
".",
"Otherwise",
"the",
"cron",
"job",
"is",
"installed",
"twice",
"if",
"you",
"change",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L257-L383 | [
"def",
"present",
"(",
"name",
",",
"user",
"=",
"'root'",
",",
"minute",
"=",
"'*'",
",",
"hour",
"=",
"'*'",
",",
"daymonth",
"=",
"'*'",
",",
"month",
"=",
"'*'",
",",
"dayweek",
"=",
"'*'",
",",
"comment",
"=",
"None",
",",
"commented",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user crontab.
user
The name of the user whose crontab needs to be modified, defaults to
the root user
identif... | salt/states/cron.py | def absent(name,
user='root',
identifier=False,
special=None,
**kwargs):
'''
Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user c... | def absent(name,
user='root',
identifier=False,
special=None,
**kwargs):
'''
Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user c... | [
"Verifies",
"that",
"the",
"specified",
"cron",
"job",
"is",
"absent",
"for",
"the",
"specified",
"user",
";",
"only",
"the",
"name",
"is",
"matched",
"when",
"removing",
"a",
"cron",
"job",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L386-L448 | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"'root'",
",",
"identifier",
"=",
"False",
",",
"special",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# NOTE: The keyword arguments in **kwargs are ignored in this state, but",
"# cannot be removed from the fun... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file | Provides file.managed-like functionality (templating, etc.) for a pre-made
crontab file, to be assigned to a given user.
name
The source file to be used as the crontab. This source file can be
hosted on either the salt master server, or on an HTTP or FTP server.
For files hosted on the ... | salt/states/cron.py | def file(name,
source_hash='',
source_hash_name=None,
user='root',
template=None,
context=None,
replace=True,
defaults=None,
backup='',
**kwargs):
'''
Provides file.managed-like functionality (templating, etc.) for a pre-made
c... | def file(name,
source_hash='',
source_hash_name=None,
user='root',
template=None,
context=None,
replace=True,
defaults=None,
backup='',
**kwargs):
'''
Provides file.managed-like functionality (templating, etc.) for a pre-made
c... | [
"Provides",
"file",
".",
"managed",
"-",
"like",
"functionality",
"(",
"templating",
"etc",
".",
")",
"for",
"a",
"pre",
"-",
"made",
"crontab",
"file",
"to",
"be",
"assigned",
"to",
"a",
"given",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L451-L669 | [
"def",
"file",
"(",
"name",
",",
"source_hash",
"=",
"''",
",",
"source_hash_name",
"=",
"None",
",",
"user",
"=",
"'root'",
",",
"template",
"=",
"None",
",",
"context",
"=",
"None",
",",
"replace",
"=",
"True",
",",
"defaults",
"=",
"None",
",",
"b... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | env_present | Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whose crontab needs to be modified, defaults to
the root user
value
The val... | salt/states/cron.py | def env_present(name,
value=None,
user='root'):
'''
Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whos... | def env_present(name,
value=None,
user='root'):
'''
Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whos... | [
"Verifies",
"that",
"the",
"specified",
"environment",
"variable",
"is",
"present",
"in",
"the",
"crontab",
"for",
"the",
"specified",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L672-L722 | [
"def",
"env_present",
"(",
"name",
",",
"value",
"=",
"None",
",",
"user",
"=",
"'root'",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
"}",
"if",
"__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | env_absent | Verifies that the specified environment variable is absent from the crontab
for the specified user
name
The name of the environment variable to remove from the user crontab
user
The name of the user whose crontab needs to be modified, defaults to
the root user | salt/states/cron.py | def env_absent(name,
user='root'):
'''
Verifies that the specified environment variable is absent from the crontab
for the specified user
name
The name of the environment variable to remove from the user crontab
user
The name of the user whose crontab needs to be mod... | def env_absent(name,
user='root'):
'''
Verifies that the specified environment variable is absent from the crontab
for the specified user
name
The name of the environment variable to remove from the user crontab
user
The name of the user whose crontab needs to be mod... | [
"Verifies",
"that",
"the",
"specified",
"environment",
"variable",
"is",
"absent",
"from",
"the",
"crontab",
"for",
"the",
"specified",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L725-L767 | [
"def",
"env_absent",
"(",
"name",
",",
"user",
"=",
"'root'",
")",
":",
"name",
"=",
"name",
".",
"strip",
"(",
")",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | output | The HighState Outputter is only meant to be used with the state.highstate
function, or a function that returns highstate return data. | salt/output/highstate.py | def output(data, **kwargs): # pylint: disable=unused-argument
'''
The HighState Outputter is only meant to be used with the state.highstate
function, or a function that returns highstate return data.
'''
if len(data.keys()) == 1:
# account for nested orchs via saltutil.runner
if 're... | def output(data, **kwargs): # pylint: disable=unused-argument
'''
The HighState Outputter is only meant to be used with the state.highstate
function, or a function that returns highstate return data.
'''
if len(data.keys()) == 1:
# account for nested orchs via saltutil.runner
if 're... | [
"The",
"HighState",
"Outputter",
"is",
"only",
"meant",
"to",
"be",
"used",
"with",
"the",
"state",
".",
"highstate",
"function",
"or",
"a",
"function",
"that",
"returns",
"highstate",
"return",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/highstate.py#L136-L183 | [
"def",
"output",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"len",
"(",
"data",
".",
"keys",
"(",
")",
")",
"==",
"1",
":",
"# account for nested orchs via saltutil.runner",
"if",
"'return'",
"in",
"data",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_host | Main highstate formatter. can be called recursively if a nested highstate
contains other highstates (ie in an orchestration) | salt/output/highstate.py | def _format_host(host, data, indent_level=1):
'''
Main highstate formatter. can be called recursively if a nested highstate
contains other highstates (ie in an orchestration)
'''
host = salt.utils.data.decode(host)
colors = salt.utils.color.get_colors(
__opts__.get('color'),
... | def _format_host(host, data, indent_level=1):
'''
Main highstate formatter. can be called recursively if a nested highstate
contains other highstates (ie in an orchestration)
'''
host = salt.utils.data.decode(host)
colors = salt.utils.color.get_colors(
__opts__.get('color'),
... | [
"Main",
"highstate",
"formatter",
".",
"can",
"be",
"called",
"recursively",
"if",
"a",
"nested",
"highstate",
"contains",
"other",
"highstates",
"(",
"ie",
"in",
"an",
"orchestration",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/highstate.py#L186-L511 | [
"def",
"_format_host",
"(",
"host",
",",
"data",
",",
"indent_level",
"=",
"1",
")",
":",
"host",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"host",
")",
"colors",
"=",
"salt",
".",
"utils",
".",
"color",
".",
"get_colors",
"(",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _nested_changes | Print the changes data using the nested outputter | salt/output/highstate.py | def _nested_changes(changes):
'''
Print the changes data using the nested outputter
'''
ret = '\n'
ret += salt.output.out_format(
changes,
'nested',
__opts__,
nested_indent=14)
return ret | def _nested_changes(changes):
'''
Print the changes data using the nested outputter
'''
ret = '\n'
ret += salt.output.out_format(
changes,
'nested',
__opts__,
nested_indent=14)
return ret | [
"Print",
"the",
"changes",
"data",
"using",
"the",
"nested",
"outputter"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/highstate.py#L514-L524 | [
"def",
"_nested_changes",
"(",
"changes",
")",
":",
"ret",
"=",
"'\\n'",
"ret",
"+=",
"salt",
".",
"output",
".",
"out_format",
"(",
"changes",
",",
"'nested'",
",",
"__opts__",
",",
"nested_indent",
"=",
"14",
")",
"return",
"ret"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_changes | Format the changes dict based on what the data is | salt/output/highstate.py | def _format_changes(changes, orchestration=False):
'''
Format the changes dict based on what the data is
'''
if not changes:
return False, ''
if orchestration:
return True, _nested_changes(changes)
if not isinstance(changes, dict):
return True, 'Invalid Changes data: {0... | def _format_changes(changes, orchestration=False):
'''
Format the changes dict based on what the data is
'''
if not changes:
return False, ''
if orchestration:
return True, _nested_changes(changes)
if not isinstance(changes, dict):
return True, 'Invalid Changes data: {0... | [
"Format",
"the",
"changes",
"dict",
"based",
"on",
"what",
"the",
"data",
"is"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/highstate.py#L527-L551 | [
"def",
"_format_changes",
"(",
"changes",
",",
"orchestration",
"=",
"False",
")",
":",
"if",
"not",
"changes",
":",
"return",
"False",
",",
"''",
"if",
"orchestration",
":",
"return",
"True",
",",
"_nested_changes",
"(",
"changes",
")",
"if",
"not",
"isin... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_terse | Terse formatting of a message. | salt/output/highstate.py | def _format_terse(tcolor, comps, ret, colors, tabular):
'''
Terse formatting of a message.
'''
result = 'Clean'
if ret['changes']:
result = 'Changed'
if ret['result'] is False:
result = 'Failed'
elif ret['result'] is None:
result = 'Differs'
if tabular is True:
... | def _format_terse(tcolor, comps, ret, colors, tabular):
'''
Terse formatting of a message.
'''
result = 'Clean'
if ret['changes']:
result = 'Changed'
if ret['result'] is False:
result = 'Failed'
elif ret['result'] is None:
result = 'Differs'
if tabular is True:
... | [
"Terse",
"formatting",
"of",
"a",
"message",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/highstate.py#L554-L595 | [
"def",
"_format_terse",
"(",
"tcolor",
",",
"comps",
",",
"ret",
",",
"colors",
",",
"tabular",
")",
":",
"result",
"=",
"'Clean'",
"if",
"ret",
"[",
"'changes'",
"]",
":",
"result",
"=",
"'Changed'",
"if",
"ret",
"[",
"'result'",
"]",
"is",
"False",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_watch | The kernerpkg watcher, called to invoke the watch command.
When called, execute a kernelpkg state based on a watch or listen call.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for th... | salt/states/kernelpkg.py | def mod_watch(name, sfun, **kwargs):
'''
The kernerpkg watcher, called to invoke the watch command.
When called, execute a kernelpkg state based on a watch or listen call.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should n... | def mod_watch(name, sfun, **kwargs):
'''
The kernerpkg watcher, called to invoke the watch command.
When called, execute a kernelpkg state based on a watch or listen call.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should n... | [
"The",
"kernerpkg",
"watcher",
"called",
"to",
"invoke",
"the",
"watch",
"command",
".",
"When",
"called",
"execute",
"a",
"kernelpkg",
"state",
"based",
"on",
"a",
"watch",
"or",
"listen",
"call",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kernelpkg.py#L204-L221 | [
"def",
"mod_watch",
"(",
"name",
",",
"sfun",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"sfun",
"in",
"(",
"'latest_active'",
",",
"'latest_wait'",
")",
":",
"return",
"latest_active",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
"else",
":",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_none_or_value | PRIVATE METHOD
Checks to see if the value of a primitive or built-in container such as
a list, dict, set, tuple etc is empty or none. None type is returned if the
value is empty/None/False. Number data types that are 0 will return None.
value : obj
The primitive or built-in container to evaluat... | salt/modules/solr.py | def _get_none_or_value(value):
'''
PRIVATE METHOD
Checks to see if the value of a primitive or built-in container such as
a list, dict, set, tuple etc is empty or none. None type is returned if the
value is empty/None/False. Number data types that are 0 will return None.
value : obj
The... | def _get_none_or_value(value):
'''
PRIVATE METHOD
Checks to see if the value of a primitive or built-in container such as
a list, dict, set, tuple etc is empty or none. None type is returned if the
value is empty/None/False. Number data types that are 0 will return None.
value : obj
The... | [
"PRIVATE",
"METHOD",
"Checks",
"to",
"see",
"if",
"the",
"value",
"of",
"a",
"primitive",
"or",
"built",
"-",
"in",
"container",
"such",
"as",
"a",
"list",
"dict",
"set",
"tuple",
"etc",
"is",
"empty",
"or",
"none",
".",
"None",
"type",
"is",
"returned... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L99-L122 | [
"def",
"_get_none_or_value",
"(",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"None",
"elif",
"not",
"value",
":",
"return",
"value",
"# if it's a string, and it's not empty check for none",
"elif",
"isinstance",
"(",
"value",
",",
"six",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_return_dict | PRIVATE METHOD
Creates a new return dict with default values. Defaults may be overwritten.
success : boolean (True)
True indicates a successful result.
data : dict<str,obj> ({})
Data to be returned to the caller.
errors : list<str> ([()])
A list of error messages to be returned ... | salt/modules/solr.py | def _get_return_dict(success=True, data=None, errors=None, warnings=None):
'''
PRIVATE METHOD
Creates a new return dict with default values. Defaults may be overwritten.
success : boolean (True)
True indicates a successful result.
data : dict<str,obj> ({})
Data to be returned to the... | def _get_return_dict(success=True, data=None, errors=None, warnings=None):
'''
PRIVATE METHOD
Creates a new return dict with default values. Defaults may be overwritten.
success : boolean (True)
True indicates a successful result.
data : dict<str,obj> ({})
Data to be returned to the... | [
"PRIVATE",
"METHOD",
"Creates",
"a",
"new",
"return",
"dict",
"with",
"default",
"values",
".",
"Defaults",
"may",
"be",
"overwritten",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L138-L164 | [
"def",
"_get_return_dict",
"(",
"success",
"=",
"True",
",",
"data",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"warnings",
"=",
"None",
")",
":",
"data",
"=",
"{",
"}",
"if",
"data",
"is",
"None",
"else",
"data",
"errors",
"=",
"[",
"]",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _update_return_dict | PRIVATE METHOD
Updates the return dictionary and returns it.
ret : dict<str,obj>
The original return dict to update. The ret param should have
been created from _get_return_dict()
success : boolean (True)
True indicates a successful result.
data : dict<str,obj> ({})
Data... | salt/modules/solr.py | def _update_return_dict(ret, success, data, errors=None, warnings=None):
'''
PRIVATE METHOD
Updates the return dictionary and returns it.
ret : dict<str,obj>
The original return dict to update. The ret param should have
been created from _get_return_dict()
success : boolean (True)
... | def _update_return_dict(ret, success, data, errors=None, warnings=None):
'''
PRIVATE METHOD
Updates the return dictionary and returns it.
ret : dict<str,obj>
The original return dict to update. The ret param should have
been created from _get_return_dict()
success : boolean (True)
... | [
"PRIVATE",
"METHOD",
"Updates",
"the",
"return",
"dictionary",
"and",
"returns",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L167-L194 | [
"def",
"_update_return_dict",
"(",
"ret",
",",
"success",
",",
"data",
",",
"errors",
"=",
"None",
",",
"warnings",
"=",
"None",
")",
":",
"errors",
"=",
"[",
"]",
"if",
"errors",
"is",
"None",
"else",
"errors",
"warnings",
"=",
"[",
"]",
"if",
"warn... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_url | PRIVATE METHOD
Formats the URL based on parameters, and if cores are used or not
handler : str
The request handler to hit.
host : str (None)
The solr host to query. __opts__['host'] is default
core_name : str (None)
The name of the solr core if using cores. Leave this blank if y... | salt/modules/solr.py | def _format_url(handler, host=None, core_name=None, extra=None):
'''
PRIVATE METHOD
Formats the URL based on parameters, and if cores are used or not
handler : str
The request handler to hit.
host : str (None)
The solr host to query. __opts__['host'] is default
core_name : str (... | def _format_url(handler, host=None, core_name=None, extra=None):
'''
PRIVATE METHOD
Formats the URL based on parameters, and if cores are used or not
handler : str
The request handler to hit.
host : str (None)
The solr host to query. __opts__['host'] is default
core_name : str (... | [
"PRIVATE",
"METHOD",
"Formats",
"the",
"URL",
"based",
"on",
"parameters",
"and",
"if",
"cores",
"are",
"used",
"or",
"not"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L197-L233 | [
"def",
"_format_url",
"(",
"handler",
",",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
",",
"extra",
"=",
"None",
")",
":",
"extra",
"=",
"[",
"]",
"if",
"extra",
"is",
"None",
"else",
"extra",
"if",
"_get_none_or_value",
"(",
"host",
")",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _auth | Install an auth handler for urllib2 | salt/modules/solr.py | def _auth(url):
'''
Install an auth handler for urllib2
'''
user = __salt__['config.get']('solr.user', False)
password = __salt__['config.get']('solr.passwd', False)
realm = __salt__['config.get']('solr.auth_realm', 'Solr')
if user and password:
basic = _HTTPBasicAuthHandler()
... | def _auth(url):
'''
Install an auth handler for urllib2
'''
user = __salt__['config.get']('solr.user', False)
password = __salt__['config.get']('solr.passwd', False)
realm = __salt__['config.get']('solr.auth_realm', 'Solr')
if user and password:
basic = _HTTPBasicAuthHandler()
... | [
"Install",
"an",
"auth",
"handler",
"for",
"urllib2"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L236-L255 | [
"def",
"_auth",
"(",
"url",
")",
":",
"user",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'solr.user'",
",",
"False",
")",
"password",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'solr.passwd'",
",",
"False",
")",
"realm",
"=",
"__salt__",
"[",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _http_request | PRIVATE METHOD
Uses salt.utils.json.load to fetch the JSON results from the solr API.
url : str
a complete URL that can be passed to urllib.open
request_timeout : int (None)
The number of seconds before the timeout should fail. Leave blank/None
to use the default. __opts__['solr.req... | salt/modules/solr.py | def _http_request(url, request_timeout=None):
'''
PRIVATE METHOD
Uses salt.utils.json.load to fetch the JSON results from the solr API.
url : str
a complete URL that can be passed to urllib.open
request_timeout : int (None)
The number of seconds before the timeout should fail. Leave... | def _http_request(url, request_timeout=None):
'''
PRIVATE METHOD
Uses salt.utils.json.load to fetch the JSON results from the solr API.
url : str
a complete URL that can be passed to urllib.open
request_timeout : int (None)
The number of seconds before the timeout should fail. Leave... | [
"PRIVATE",
"METHOD",
"Uses",
"salt",
".",
"utils",
".",
"json",
".",
"load",
"to",
"fetch",
"the",
"JSON",
"results",
"from",
"the",
"solr",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L258-L281 | [
"def",
"_http_request",
"(",
"url",
",",
"request_timeout",
"=",
"None",
")",
":",
"_auth",
"(",
"url",
")",
"try",
":",
"request_timeout",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'solr.request_timeout'",
")",
"kwargs",
"=",
"{",
"}",
"if",
"re... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _replication_request | PRIVATE METHOD
Performs the requested replication command and returns a dictionary with
success, errors and data as keys. The data object will contain the JSON
response.
command : str
The replication command to execute.
host : str (None)
The solr host to query. __opts__['host'] is d... | salt/modules/solr.py | def _replication_request(command, host=None, core_name=None, params=None):
'''
PRIVATE METHOD
Performs the requested replication command and returns a dictionary with
success, errors and data as keys. The data object will contain the JSON
response.
command : str
The replication command ... | def _replication_request(command, host=None, core_name=None, params=None):
'''
PRIVATE METHOD
Performs the requested replication command and returns a dictionary with
success, errors and data as keys. The data object will contain the JSON
response.
command : str
The replication command ... | [
"PRIVATE",
"METHOD",
"Performs",
"the",
"requested",
"replication",
"command",
"and",
"returns",
"a",
"dictionary",
"with",
"success",
"errors",
"and",
"data",
"as",
"keys",
".",
"The",
"data",
"object",
"will",
"contain",
"the",
"JSON",
"response",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L284-L310 | [
"def",
"_replication_request",
"(",
"command",
",",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"params",
"=",
"[",
"]",
"if",
"params",
"is",
"None",
"else",
"params",
"extra",
"=",
"[",
"\"command={0}\"",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_admin_info | PRIVATE METHOD
Calls the _http_request method and passes the admin command to execute
and stores the data. This data is fairly static but should be refreshed
periodically to make sure everything this OK. The data object will contain
the JSON response.
command : str
The admin command to exec... | salt/modules/solr.py | def _get_admin_info(command, host=None, core_name=None):
'''
PRIVATE METHOD
Calls the _http_request method and passes the admin command to execute
and stores the data. This data is fairly static but should be refreshed
periodically to make sure everything this OK. The data object will contain
th... | def _get_admin_info(command, host=None, core_name=None):
'''
PRIVATE METHOD
Calls the _http_request method and passes the admin command to execute
and stores the data. This data is fairly static but should be refreshed
periodically to make sure everything this OK. The data object will contain
th... | [
"PRIVATE",
"METHOD",
"Calls",
"the",
"_http_request",
"method",
"and",
"passes",
"the",
"admin",
"command",
"to",
"execute",
"and",
"stores",
"the",
"data",
".",
"This",
"data",
"is",
"fairly",
"static",
"but",
"should",
"be",
"refreshed",
"periodically",
"to"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L313-L335 | [
"def",
"_get_admin_info",
"(",
"command",
",",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"url",
"=",
"_format_url",
"(",
"\"admin/{0}\"",
".",
"format",
"(",
"command",
")",
",",
"host",
",",
"core_name",
"=",
"core_name",
")",
"resp"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _merge_options | PRIVATE METHOD
updates the default import options from __opts__['solr.dih.import_options']
with the dictionary passed in. Also converts booleans to strings
to pass to solr.
options : dict<str,boolean>
Dictionary the over rides the default options defined in
__opts__['solr.dih.import_op... | salt/modules/solr.py | def _merge_options(options):
'''
PRIVATE METHOD
updates the default import options from __opts__['solr.dih.import_options']
with the dictionary passed in. Also converts booleans to strings
to pass to solr.
options : dict<str,boolean>
Dictionary the over rides the default options define... | def _merge_options(options):
'''
PRIVATE METHOD
updates the default import options from __opts__['solr.dih.import_options']
with the dictionary passed in. Also converts booleans to strings
to pass to solr.
options : dict<str,boolean>
Dictionary the over rides the default options define... | [
"PRIVATE",
"METHOD",
"updates",
"the",
"default",
"import",
"options",
"from",
"__opts__",
"[",
"solr",
".",
"dih",
".",
"import_options",
"]",
"with",
"the",
"dictionary",
"passed",
"in",
".",
"Also",
"converts",
"booleans",
"to",
"strings",
"to",
"pass",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L350-L371 | [
"def",
"_merge_options",
"(",
"options",
")",
":",
"defaults",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'solr.dih.import_options'",
")",
"if",
"isinstance",
"(",
"options",
",",
"dict",
")",
":",
"defaults",
".",
"update",
"(",
"options",
")",
"fo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _pre_index_check | PRIVATE METHOD - MASTER CALL
Does a pre-check to make sure that all the options are set and that
we can talk to solr before trying to send a command to solr. This
Command should only be issued to masters.
handler : str
The import handler to check the state of
host : str (None):
The ... | salt/modules/solr.py | def _pre_index_check(handler, host=None, core_name=None):
'''
PRIVATE METHOD - MASTER CALL
Does a pre-check to make sure that all the options are set and that
we can talk to solr before trying to send a command to solr. This
Command should only be issued to masters.
handler : str
The im... | def _pre_index_check(handler, host=None, core_name=None):
'''
PRIVATE METHOD - MASTER CALL
Does a pre-check to make sure that all the options are set and that
we can talk to solr before trying to send a command to solr. This
Command should only be issued to masters.
handler : str
The im... | [
"PRIVATE",
"METHOD",
"-",
"MASTER",
"CALL",
"Does",
"a",
"pre",
"-",
"check",
"to",
"make",
"sure",
"that",
"all",
"the",
"options",
"are",
"set",
"and",
"that",
"we",
"can",
"talk",
"to",
"solr",
"before",
"trying",
"to",
"send",
"a",
"command",
"to",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L374-L419 | [
"def",
"_pre_index_check",
"(",
"handler",
",",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"# make sure that it's a master minion",
"if",
"_get_none_or_value",
"(",
"host",
")",
"is",
"None",
"and",
"not",
"_is_master",
"(",
")",
":",
"err",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_value | PRIVATE METHOD
Traverses a dictionary of dictionaries/lists to find key
and return the value stored.
TODO:// this method doesn't really work very well, and it's not really
very useful in its current state. The purpose for this method is
to simplify parsing the JSON output so you can ... | salt/modules/solr.py | def _find_value(ret_dict, key, path=None):
'''
PRIVATE METHOD
Traverses a dictionary of dictionaries/lists to find key
and return the value stored.
TODO:// this method doesn't really work very well, and it's not really
very useful in its current state. The purpose for this method is
... | def _find_value(ret_dict, key, path=None):
'''
PRIVATE METHOD
Traverses a dictionary of dictionaries/lists to find key
and return the value stored.
TODO:// this method doesn't really work very well, and it's not really
very useful in its current state. The purpose for this method is
... | [
"PRIVATE",
"METHOD",
"Traverses",
"a",
"dictionary",
"of",
"dictionaries",
"/",
"lists",
"to",
"find",
"key",
"and",
"return",
"the",
"value",
"stored",
".",
"TODO",
":",
"//",
"this",
"method",
"doesn",
"t",
"really",
"work",
"very",
"well",
"and",
"it",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L422-L456 | [
"def",
"_find_value",
"(",
"ret_dict",
",",
"key",
",",
"path",
"=",
"None",
")",
":",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"key",
"else",
":",
"path",
"=",
"\"{0}:{1}\"",
".",
"format",
"(",
"path",
",",
"key",
")",
"ret",
"=",
"[",
"]"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | lucene_version | Gets the lucene version that solr is using. If you are running a multi-core
setup you should specify a core name since all the cores run under the same
servlet container, they will all have the same version.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you ar... | salt/modules/solr.py | def lucene_version(core_name=None):
'''
Gets the lucene version that solr is using. If you are running a multi-core
setup you should specify a core name since all the cores run under the same
servlet container, they will all have the same version.
core_name : str (None)
The name of the solr... | def lucene_version(core_name=None):
'''
Gets the lucene version that solr is using. If you are running a multi-core
setup you should specify a core name since all the cores run under the same
servlet container, they will all have the same version.
core_name : str (None)
The name of the solr... | [
"Gets",
"the",
"lucene",
"version",
"that",
"solr",
"is",
"using",
".",
"If",
"you",
"are",
"running",
"a",
"multi",
"-",
"core",
"setup",
"you",
"should",
"specify",
"a",
"core",
"name",
"since",
"all",
"the",
"cores",
"run",
"under",
"the",
"same",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L461-L501 | [
"def",
"lucene_version",
"(",
"core_name",
"=",
"None",
")",
":",
"ret",
"=",
"_get_return_dict",
"(",
")",
"# do we want to check for all the cores?",
"if",
"_get_none_or_value",
"(",
"core_name",
")",
"is",
"None",
"and",
"_check_for_cores",
"(",
")",
":",
"succ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | Gets the solr version for the core specified. You should specify a core
here as all the cores will run under the same servlet container and so will
all have the same version.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you are
not using cores or if ... | salt/modules/solr.py | def version(core_name=None):
'''
Gets the solr version for the core specified. You should specify a core
here as all the cores will run under the same servlet container and so will
all have the same version.
core_name : str (None)
The name of the solr core if using cores. Leave this blank ... | def version(core_name=None):
'''
Gets the solr version for the core specified. You should specify a core
here as all the cores will run under the same servlet container and so will
all have the same version.
core_name : str (None)
The name of the solr core if using cores. Leave this blank ... | [
"Gets",
"the",
"solr",
"version",
"for",
"the",
"core",
"specified",
".",
"You",
"should",
"specify",
"a",
"core",
"here",
"as",
"all",
"the",
"cores",
"will",
"run",
"under",
"the",
"same",
"servlet",
"container",
"and",
"so",
"will",
"all",
"have",
"th... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L504-L546 | [
"def",
"version",
"(",
"core_name",
"=",
"None",
")",
":",
"ret",
"=",
"_get_return_dict",
"(",
")",
"# do we want to check for all the cores?",
"if",
"_get_none_or_value",
"(",
"core_name",
")",
"is",
"None",
"and",
"_check_for_cores",
"(",
")",
":",
"success",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | optimize | Search queries fast, but it is a very expensive operation. The ideal
process is to run this with a master/slave configuration. Then you
can optimize the master, and push the optimized index to the slaves.
If you are running a single solr instance, or if you are going to run
this on a slave be aware tha... | salt/modules/solr.py | def optimize(host=None, core_name=None):
'''
Search queries fast, but it is a very expensive operation. The ideal
process is to run this with a master/slave configuration. Then you
can optimize the master, and push the optimized index to the slaves.
If you are running a single solr instance, or if ... | def optimize(host=None, core_name=None):
'''
Search queries fast, but it is a very expensive operation. The ideal
process is to run this with a master/slave configuration. Then you
can optimize the master, and push the optimized index to the slaves.
If you are running a single solr instance, or if ... | [
"Search",
"queries",
"fast",
"but",
"it",
"is",
"a",
"very",
"expensive",
"operation",
".",
"The",
"ideal",
"process",
"is",
"to",
"run",
"this",
"with",
"a",
"master",
"/",
"slave",
"configuration",
".",
"Then",
"you",
"can",
"optimize",
"the",
"master",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L549-L597 | [
"def",
"optimize",
"(",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"ret",
"=",
"_get_return_dict",
"(",
")",
"if",
"_get_none_or_value",
"(",
"core_name",
")",
"is",
"None",
"and",
"_check_for_cores",
"(",
")",
":",
"success",
"=",
"Tr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ping | Does a health check on solr, makes sure solr can talk to the indexes.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you are
not using cores or if you want to check all cores.
... | salt/modules/solr.py | def ping(host=None, core_name=None):
'''
Does a health check on solr, makes sure solr can talk to the indexes.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you are
not ... | def ping(host=None, core_name=None):
'''
Does a health check on solr, makes sure solr can talk to the indexes.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you are
not ... | [
"Does",
"a",
"health",
"check",
"on",
"solr",
"makes",
"sure",
"solr",
"can",
"talk",
"to",
"the",
"indexes",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L600-L634 | [
"def",
"ping",
"(",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"ret",
"=",
"_get_return_dict",
"(",
")",
"if",
"_get_none_or_value",
"(",
"core_name",
")",
"is",
"None",
"and",
"_check_for_cores",
"(",
")",
":",
"success",
"=",
"True",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | is_replication_enabled | SLAVE CALL
Check for errors, and determine if a slave is replicating or not.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this blank if you are
not using cores or if you want to check al... | salt/modules/solr.py | def is_replication_enabled(host=None, core_name=None):
'''
SLAVE CALL
Check for errors, and determine if a slave is replicating or not.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this ... | def is_replication_enabled(host=None, core_name=None):
'''
SLAVE CALL
Check for errors, and determine if a slave is replicating or not.
host : str (None)
The solr host to query. __opts__['host'] is default.
core_name : str (None)
The name of the solr core if using cores. Leave this ... | [
"SLAVE",
"CALL",
"Check",
"for",
"errors",
"and",
"determine",
"if",
"a",
"slave",
"is",
"replicating",
"or",
"not",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L637-L708 | [
"def",
"is_replication_enabled",
"(",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"ret",
"=",
"_get_return_dict",
"(",
")",
"success",
"=",
"True",
"# since only slaves can call this let's check the config:",
"if",
"_is_master",
"(",
")",
"and",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | match_index_versions | SLAVE CALL
Verifies that the master and the slave versions are in sync by
comparing the index version. If you are constantly pushing updates
the index the master and slave versions will seldom match. A solution
to this is pause indexing every so often to allow the slave to replicate
and then call th... | salt/modules/solr.py | def match_index_versions(host=None, core_name=None):
'''
SLAVE CALL
Verifies that the master and the slave versions are in sync by
comparing the index version. If you are constantly pushing updates
the index the master and slave versions will seldom match. A solution
to this is pause indexing ev... | def match_index_versions(host=None, core_name=None):
'''
SLAVE CALL
Verifies that the master and the slave versions are in sync by
comparing the index version. If you are constantly pushing updates
the index the master and slave versions will seldom match. A solution
to this is pause indexing ev... | [
"SLAVE",
"CALL",
"Verifies",
"that",
"the",
"master",
"and",
"the",
"slave",
"versions",
"are",
"in",
"sync",
"by",
"comparing",
"the",
"index",
"version",
".",
"If",
"you",
"are",
"constantly",
"pushing",
"updates",
"the",
"index",
"the",
"master",
"and",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solr.py#L711-L800 | [
"def",
"match_index_versions",
"(",
"host",
"=",
"None",
",",
"core_name",
"=",
"None",
")",
":",
"# since only slaves can call this let's check the config:",
"ret",
"=",
"_get_return_dict",
"(",
")",
"success",
"=",
"True",
"if",
"_is_master",
"(",
")",
"and",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.