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 | list_present | Ensure a Linux ACL list is present
Takes a list of acl names and add them to the given path
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_names
The list of users or groups
perms
Set the permissions eg.: rwx
recurs... | salt/states/linux_acl.py | def list_present(name, acl_type, acl_names=None, perms='', recurse=False, force=False):
'''
Ensure a Linux ACL list is present
Takes a list of acl names and add them to the given path
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_n... | def list_present(name, acl_type, acl_names=None, perms='', recurse=False, force=False):
'''
Ensure a Linux ACL list is present
Takes a list of acl names and add them to the given path
name
The acl path
acl_type
The type of the acl is used for it can be 'user' or 'group'
acl_n... | [
"Ensure",
"a",
"Linux",
"ACL",
"list",
"is",
"present"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/linux_acl.py#L310-L499 | [
"def",
"list_present",
"(",
"name",
",",
"acl_type",
",",
"acl_names",
"=",
"None",
",",
"perms",
"=",
"''",
",",
"recurse",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"if",
"acl_names",
"is",
"None",
":",
"acl_names",
"=",
"[",
"]",
"ret",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_absent | Ensure a Linux ACL list does not exist
Takes a list of acl names and remove them from the given path
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
The list of users or groups
perms
Remove the permissions eg.: rw... | salt/states/linux_acl.py | def list_absent(name, acl_type, acl_names=None, recurse=False):
'''
Ensure a Linux ACL list does not exist
Takes a list of acl names and remove them from the given path
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
T... | def list_absent(name, acl_type, acl_names=None, recurse=False):
'''
Ensure a Linux ACL list does not exist
Takes a list of acl names and remove them from the given path
name
The acl path
acl_type
The type of the acl is used for, it can be 'user' or 'group'
acl_names
T... | [
"Ensure",
"a",
"Linux",
"ACL",
"list",
"does",
"not",
"exist"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/linux_acl.py#L502-L584 | [
"def",
"list_absent",
"(",
"name",
",",
"acl_type",
",",
"acl_names",
"=",
"None",
",",
"recurse",
"=",
"False",
")",
":",
"if",
"acl_names",
"is",
"None",
":",
"acl_names",
"=",
"[",
"]",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_object | Helper function to retrieve objtype from pillars if objname
is string_types, used for SupportedLoginProviders and
OpenIdConnectProviderARNs. | salt/states/boto_cognitoidentity.py | def _get_object(objname, objtype):
'''
Helper function to retrieve objtype from pillars if objname
is string_types, used for SupportedLoginProviders and
OpenIdConnectProviderARNs.
'''
ret = None
if objname is None:
return ret
if isinstance(objname, string_types):
if objn... | def _get_object(objname, objtype):
'''
Helper function to retrieve objtype from pillars if objname
is string_types, used for SupportedLoginProviders and
OpenIdConnectProviderARNs.
'''
ret = None
if objname is None:
return ret
if isinstance(objname, string_types):
if objn... | [
"Helper",
"function",
"to",
"retrieve",
"objtype",
"from",
"pillars",
"if",
"objname",
"is",
"string_types",
"used",
"for",
"SupportedLoginProviders",
"and",
"OpenIdConnectProviderARNs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cognitoidentity.py#L66-L90 | [
"def",
"_get_object",
"(",
"objname",
",",
"objtype",
")",
":",
"ret",
"=",
"None",
"if",
"objname",
"is",
"None",
":",
"return",
"ret",
"if",
"isinstance",
"(",
"objname",
",",
"string_types",
")",
":",
"if",
"objname",
"in",
"__opts__",
":",
"ret",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _role_present | Helper function to set the Roles to the identity pool | salt/states/boto_cognitoidentity.py | def _role_present(ret, IdentityPoolId, AuthenticatedRole, UnauthenticatedRole, conn_params):
'''
Helper function to set the Roles to the identity pool
'''
r = __salt__['boto_cognitoidentity.get_identity_pool_roles'](IdentityPoolName='',
Id... | def _role_present(ret, IdentityPoolId, AuthenticatedRole, UnauthenticatedRole, conn_params):
'''
Helper function to set the Roles to the identity pool
'''
r = __salt__['boto_cognitoidentity.get_identity_pool_roles'](IdentityPoolName='',
Id... | [
"Helper",
"function",
"to",
"set",
"the",
"Roles",
"to",
"the",
"identity",
"pool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cognitoidentity.py#L93-L131 | [
"def",
"_role_present",
"(",
"ret",
",",
"IdentityPoolId",
",",
"AuthenticatedRole",
",",
"UnauthenticatedRole",
",",
"conn_params",
")",
":",
"r",
"=",
"__salt__",
"[",
"'boto_cognitoidentity.get_identity_pool_roles'",
"]",
"(",
"IdentityPoolName",
"=",
"''",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pool_present | Ensure Cognito Identity Pool exists.
name
The name of the state definition
IdentityPoolName
Name of the Cognito Identity Pool
AuthenticatedRole
An IAM role name or ARN that will be associated with temporary AWS
credentials for an authenticated cognito identity.
AllowU... | salt/states/boto_cognitoidentity.py | def pool_present(name,
IdentityPoolName,
AuthenticatedRole,
AllowUnauthenticatedIdentities=False,
UnauthenticatedRole=None,
SupportedLoginProviders=None,
DeveloperProviderName=None,
OpenIdConnectProvid... | def pool_present(name,
IdentityPoolName,
AuthenticatedRole,
AllowUnauthenticatedIdentities=False,
UnauthenticatedRole=None,
SupportedLoginProviders=None,
DeveloperProviderName=None,
OpenIdConnectProvid... | [
"Ensure",
"Cognito",
"Identity",
"Pool",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cognitoidentity.py#L134-L279 | [
"def",
"pool_present",
"(",
"name",
",",
"IdentityPoolName",
",",
"AuthenticatedRole",
",",
"AllowUnauthenticatedIdentities",
"=",
"False",
",",
"UnauthenticatedRole",
"=",
"None",
",",
"SupportedLoginProviders",
"=",
"None",
",",
"DeveloperProviderName",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pool_absent | Ensure cognito identity pool with passed properties is absent.
name
The name of the state definition.
IdentityPoolName
Name of the Cognito Identity Pool. Please note that this may
match multiple pools with the same given name, in which case,
all will be removed.
RemoveAll... | salt/states/boto_cognitoidentity.py | def pool_absent(name, IdentityPoolName, RemoveAllMatched=False,
region=None, key=None, keyid=None, profile=None):
'''
Ensure cognito identity pool with passed properties is absent.
name
The name of the state definition.
IdentityPoolName
Name of the Cognito Identity Pool. Plea... | def pool_absent(name, IdentityPoolName, RemoveAllMatched=False,
region=None, key=None, keyid=None, profile=None):
'''
Ensure cognito identity pool with passed properties is absent.
name
The name of the state definition.
IdentityPoolName
Name of the Cognito Identity Pool. Plea... | [
"Ensure",
"cognito",
"identity",
"pool",
"with",
"passed",
"properties",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cognitoidentity.py#L282-L378 | [
"def",
"pool_absent",
"(",
"name",
",",
"IdentityPoolName",
",",
"RemoveAllMatched",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | match | Returns true if the passed pcre regex matches | salt/matchers/pcre_match.py | def match(tgt, opts=None):
'''
Returns true if the passed pcre regex matches
'''
if not opts:
return bool(re.match(tgt, __opts__['id']))
else:
return bool(re.match(tgt, opts['id'])) | def match(tgt, opts=None):
'''
Returns true if the passed pcre regex matches
'''
if not opts:
return bool(re.match(tgt, __opts__['id']))
else:
return bool(re.match(tgt, opts['id'])) | [
"Returns",
"true",
"if",
"the",
"passed",
"pcre",
"regex",
"matches"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/pcre_match.py#L10-L17 | [
"def",
"match",
"(",
"tgt",
",",
"opts",
"=",
"None",
")",
":",
"if",
"not",
"opts",
":",
"return",
"bool",
"(",
"re",
".",
"match",
"(",
"tgt",
",",
"__opts__",
"[",
"'id'",
"]",
")",
")",
"else",
":",
"return",
"bool",
"(",
"re",
".",
"match"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | running | Return the running jobs on this minion | salt/utils/minion.py | def running(opts):
'''
Return the running jobs on this minion
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
try:
data = _read_p... | def running(opts):
'''
Return the running jobs on this minion
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
try:
data = _read_p... | [
"Return",
"the",
"running",
"jobs",
"on",
"this",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minion.py#L21-L41 | [
"def",
"running",
"(",
"opts",
")",
":",
"ret",
"=",
"[",
"]",
"proc_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'cachedir'",
"]",
",",
"'proc'",
")",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"proc_dir",
")",
":",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cache_jobs | Write job information to cache | salt/utils/minion.py | def cache_jobs(opts, jid, ret):
'''
Write job information to cache
'''
serial = salt.payload.Serial(opts=opts)
fn_ = os.path.join(
opts['cachedir'],
'minion_jobs',
jid,
'return.p')
jdir = os.path.dirname(fn_)
if not os.path.isdir(jdir):
os.makedirs(jd... | def cache_jobs(opts, jid, ret):
'''
Write job information to cache
'''
serial = salt.payload.Serial(opts=opts)
fn_ = os.path.join(
opts['cachedir'],
'minion_jobs',
jid,
'return.p')
jdir = os.path.dirname(fn_)
if not os.path.isdir(jdir):
os.makedirs(jd... | [
"Write",
"job",
"information",
"to",
"cache"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minion.py#L44-L59 | [
"def",
"cache_jobs",
"(",
"opts",
",",
"jid",
",",
"ret",
")",
":",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"opts",
"=",
"opts",
")",
"fn_",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'cachedir'",
"]",
",",
"'minio... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _read_proc_file | Return a dict of JID metadata, or None | salt/utils/minion.py | def _read_proc_file(path, opts):
'''
Return a dict of JID metadata, or None
'''
serial = salt.payload.Serial(opts)
current_thread = threading.currentThread().name
pid = os.getpid()
with salt.utils.files.fopen(path, 'rb') as fp_:
buf = fp_.read()
fp_.close()
if buf:
... | def _read_proc_file(path, opts):
'''
Return a dict of JID metadata, or None
'''
serial = salt.payload.Serial(opts)
current_thread = threading.currentThread().name
pid = os.getpid()
with salt.utils.files.fopen(path, 'rb') as fp_:
buf = fp_.read()
fp_.close()
if buf:
... | [
"Return",
"a",
"dict",
"of",
"JID",
"metadata",
"or",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minion.py#L62-L122 | [
"def",
"_read_proc_file",
"(",
"path",
",",
"opts",
")",
":",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"opts",
")",
"current_thread",
"=",
"threading",
".",
"currentThread",
"(",
")",
".",
"name",
"pid",
"=",
"os",
".",
"getpid",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_cmdline | In some cases where there are an insane number of processes being created
on a system a PID can get recycled or assigned to a non-Salt process.
On Linux this fn checks to make sure the PID we are checking on is actually
a Salt process.
For non-Linux systems we punt and just return True | salt/utils/minion.py | def _check_cmdline(data):
'''
In some cases where there are an insane number of processes being created
on a system a PID can get recycled or assigned to a non-Salt process.
On Linux this fn checks to make sure the PID we are checking on is actually
a Salt process.
For non-Linux systems we punt... | def _check_cmdline(data):
'''
In some cases where there are an insane number of processes being created
on a system a PID can get recycled or assigned to a non-Salt process.
On Linux this fn checks to make sure the PID we are checking on is actually
a Salt process.
For non-Linux systems we punt... | [
"In",
"some",
"cases",
"where",
"there",
"are",
"an",
"insane",
"number",
"of",
"processes",
"being",
"created",
"on",
"a",
"system",
"a",
"PID",
"can",
"get",
"recycled",
"or",
"assigned",
"to",
"a",
"non",
"-",
"Salt",
"process",
".",
"On",
"Linux",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minion.py#L125-L149 | [
"def",
"_check_cmdline",
"(",
"data",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"platform",
".",
"is_linux",
"(",
")",
":",
"return",
"True",
"pid",
"=",
"data",
".",
"get",
"(",
"'pid'",
")",
"if",
"not",
"pid",
":",
"return",
"False",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_newline | Return a boolean stating whether or not a file's trailing newline should be
removed. To figure this out, first check if keep_newline is a boolean and
if so, return its opposite. Otherwise, iterate over keep_newline and check
if any of the patterns match the file path. If a match is found, return
False, ... | salt/pillar/file_tree.py | def _check_newline(prefix, file_name, keep_newline):
'''
Return a boolean stating whether or not a file's trailing newline should be
removed. To figure this out, first check if keep_newline is a boolean and
if so, return its opposite. Otherwise, iterate over keep_newline and check
if any of the patt... | def _check_newline(prefix, file_name, keep_newline):
'''
Return a boolean stating whether or not a file's trailing newline should be
removed. To figure this out, first check if keep_newline is a boolean and
if so, return its opposite. Otherwise, iterate over keep_newline and check
if any of the patt... | [
"Return",
"a",
"boolean",
"stating",
"whether",
"or",
"not",
"a",
"file",
"s",
"trailing",
"newline",
"should",
"be",
"removed",
".",
"To",
"figure",
"this",
"out",
"first",
"check",
"if",
"keep_newline",
"is",
"a",
"boolean",
"and",
"if",
"so",
"return",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/file_tree.py#L174-L192 | [
"def",
"_check_newline",
"(",
"prefix",
",",
"file_name",
",",
"keep_newline",
")",
":",
"if",
"isinstance",
"(",
"keep_newline",
",",
"bool",
")",
":",
"return",
"not",
"keep_newline",
"full_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"prefix",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _construct_pillar | Construct pillar from file tree. | salt/pillar/file_tree.py | def _construct_pillar(top_dir,
follow_dir_links,
keep_newline=False,
render_default=None,
renderer_blacklist=None,
renderer_whitelist=None,
template=False):
'''
Construct pillar fr... | def _construct_pillar(top_dir,
follow_dir_links,
keep_newline=False,
render_default=None,
renderer_blacklist=None,
renderer_whitelist=None,
template=False):
'''
Construct pillar fr... | [
"Construct",
"pillar",
"from",
"file",
"tree",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/file_tree.py#L195-L265 | [
"def",
"_construct_pillar",
"(",
"top_dir",
",",
"follow_dir_links",
",",
"keep_newline",
"=",
"False",
",",
"render_default",
"=",
"None",
",",
"renderer_blacklist",
"=",
"None",
",",
"renderer_whitelist",
"=",
"None",
",",
"template",
"=",
"False",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ext_pillar | Compile pillar data from the given ``root_dir`` specific to Nodegroup names
and Minion IDs.
If a Minion's ID is not found at ``<root_dir>/host/<minion_id>`` or if it
is not included in any Nodegroups named at
``<root_dir>/nodegroups/<node_group>``, no pillar data provided by this
pillar module will... | salt/pillar/file_tree.py | def ext_pillar(minion_id,
pillar,
root_dir=None,
follow_dir_links=False,
debug=False,
keep_newline=False,
render_default=None,
renderer_blacklist=None,
renderer_whitelist=None,
template... | def ext_pillar(minion_id,
pillar,
root_dir=None,
follow_dir_links=False,
debug=False,
keep_newline=False,
render_default=None,
renderer_blacklist=None,
renderer_whitelist=None,
template... | [
"Compile",
"pillar",
"data",
"from",
"the",
"given",
"root_dir",
"specific",
"to",
"Nodegroup",
"names",
"and",
"Minion",
"IDs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/file_tree.py#L268-L448 | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"root_dir",
"=",
"None",
",",
"follow_dir_links",
"=",
"False",
",",
"debug",
"=",
"False",
",",
"keep_newline",
"=",
"False",
",",
"render_default",
"=",
"None",
",",
"renderer_blacklist",
"=",
"Non... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _ext_pillar | Compile pillar data for a single root_dir for the specified minion ID | salt/pillar/file_tree.py | def _ext_pillar(minion_id,
root_dir,
follow_dir_links,
debug,
keep_newline,
render_default,
renderer_blacklist,
renderer_whitelist,
template):
'''
Compile pillar data for a single root... | def _ext_pillar(minion_id,
root_dir,
follow_dir_links,
debug,
keep_newline,
render_default,
renderer_blacklist,
renderer_whitelist,
template):
'''
Compile pillar data for a single root... | [
"Compile",
"pillar",
"data",
"for",
"a",
"single",
"root_dir",
"for",
"the",
"specified",
"minion",
"ID"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/file_tree.py#L451-L540 | [
"def",
"_ext_pillar",
"(",
"minion_id",
",",
"root_dir",
",",
"follow_dir_links",
",",
"debug",
",",
"keep_newline",
",",
"render_default",
",",
"renderer_blacklist",
",",
"renderer_whitelist",
",",
"template",
")",
":",
"log",
".",
"debug",
"(",
"'file_tree: read... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | .. versionchanged:: 2017.7.0
Add a job to queue.
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
Make a tag for the job.
user : string
The user to run the at job
.. versionadde... | salt/states/at.py | def present(name, timespec, tag=None, user=None, job=None, unique_tag=False):
'''
.. versionchanged:: 2017.7.0
Add a job to queue.
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
Make a tag... | def present(name, timespec, tag=None, user=None, job=None, unique_tag=False):
'''
.. versionchanged:: 2017.7.0
Add a job to queue.
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
Make a tag... | [
"..",
"versionchanged",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/at.py#L26-L125 | [
"def",
"present",
"(",
"name",
",",
"timespec",
",",
"tag",
"=",
"None",
",",
"user",
"=",
"None",
",",
"job",
"=",
"None",
",",
"unique_tag",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | .. versionchanged:: 2017.7.0
Remove a job from queue
jobid: string|int
Specific jobid to remove
tag : string
Job's tag
runas : string
Runs user-specified jobs
kwargs
Addition kwargs can be provided to filter jobs.
See output of `at.jobcheck` for more.
... | salt/states/at.py | def absent(name, jobid=None, **kwargs):
'''
.. versionchanged:: 2017.7.0
Remove a job from queue
jobid: string|int
Specific jobid to remove
tag : string
Job's tag
runas : string
Runs user-specified jobs
kwargs
Addition kwargs can be provided to filter job... | def absent(name, jobid=None, **kwargs):
'''
.. versionchanged:: 2017.7.0
Remove a job from queue
jobid: string|int
Specific jobid to remove
tag : string
Job's tag
runas : string
Runs user-specified jobs
kwargs
Addition kwargs can be provided to filter job... | [
"..",
"versionchanged",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/at.py#L128-L245 | [
"def",
"absent",
"(",
"name",
",",
"jobid",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"# limit was never ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | watch | .. versionadded:: 2017.7.0
Add an at job if trigger by watch
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
Make a tag for the job.
user : string
The user to run the at job
..... | salt/states/at.py | def watch(name, timespec, tag=None, user=None, job=None, unique_tag=False):
'''
.. versionadded:: 2017.7.0
Add an at job if trigger by watch
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
... | def watch(name, timespec, tag=None, user=None, job=None, unique_tag=False):
'''
.. versionadded:: 2017.7.0
Add an at job if trigger by watch
job : string
Command to run.
timespec : string
The 'timespec' follows the format documented in the at(1) manpage.
tag : string
... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/at.py#L248-L288 | [
"def",
"watch",
"(",
"name",
",",
"timespec",
",",
"tag",
"=",
"None",
",",
"user",
"=",
"None",
",",
"job",
"=",
"None",
",",
"unique_tag",
"=",
"False",
")",
":",
"return",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'res... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_watch | The at watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
name
The name ... | salt/states/at.py | def mod_watch(name, **kwargs):
'''
The at watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state b... | def mod_watch(name, **kwargs):
'''
The at watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state b... | [
"The",
"at",
"watcher",
"called",
"to",
"invoke",
"the",
"watch",
"command",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/at.py#L291-L316 | [
"def",
"mod_watch",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"if",
"kwargs",
"[",
"'sfun'",
"]",
"=="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _normalize_args | Return args as a list of strings | salt/modules/parallels.py | def _normalize_args(args):
'''
Return args as a list of strings
'''
if isinstance(args, six.string_types):
return shlex.split(args)
if isinstance(args, (tuple, list)):
return [six.text_type(arg) for arg in args]
else:
return [six.text_type(args)] | def _normalize_args(args):
'''
Return args as a list of strings
'''
if isinstance(args, six.string_types):
return shlex.split(args)
if isinstance(args, (tuple, list)):
return [six.text_type(arg) for arg in args]
else:
return [six.text_type(args)] | [
"Return",
"args",
"as",
"a",
"list",
"of",
"strings"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L49-L59 | [
"def",
"_normalize_args",
"(",
"args",
")",
":",
"if",
"isinstance",
"(",
"args",
",",
"six",
".",
"string_types",
")",
":",
"return",
"shlex",
".",
"split",
"(",
"args",
")",
"if",
"isinstance",
"(",
"args",
",",
"(",
"tuple",
",",
"list",
")",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_guids | Return the set of GUIDs found in guid_string
:param str guid_string:
String containing zero or more GUIDs. Each GUID may or may not be
enclosed in {}
Example data (this string contains two distinct GUIDs):
PARENT_SNAPSHOT_ID SNAPSHOT_ID
... | salt/modules/parallels.py | def _find_guids(guid_string):
'''
Return the set of GUIDs found in guid_string
:param str guid_string:
String containing zero or more GUIDs. Each GUID may or may not be
enclosed in {}
Example data (this string contains two distinct GUIDs):
PARENT_SNAPSHOT_ID ... | def _find_guids(guid_string):
'''
Return the set of GUIDs found in guid_string
:param str guid_string:
String containing zero or more GUIDs. Each GUID may or may not be
enclosed in {}
Example data (this string contains two distinct GUIDs):
PARENT_SNAPSHOT_ID ... | [
"Return",
"the",
"set",
"of",
"GUIDs",
"found",
"in",
"guid_string"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L62-L80 | [
"def",
"_find_guids",
"(",
"guid_string",
")",
":",
"guids",
"=",
"[",
"]",
"for",
"found_guid",
"in",
"re",
".",
"finditer",
"(",
"GUID_REGEX",
",",
"guid_string",
")",
":",
"if",
"found_guid",
".",
"groups",
"(",
")",
":",
"guids",
".",
"append",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | prlsrvctl | Execute a prlsrvctl command
.. versionadded:: 2016.11.0
:param str sub_cmd:
prlsrvctl subcommand to execute
:param str args:
The arguments supplied to ``prlsrvctl <sub_cmd>``
:param str runas:
The user that the prlsrvctl command will be run as
Example:
.. code-block... | salt/modules/parallels.py | def prlsrvctl(sub_cmd, args=None, runas=None):
'''
Execute a prlsrvctl command
.. versionadded:: 2016.11.0
:param str sub_cmd:
prlsrvctl subcommand to execute
:param str args:
The arguments supplied to ``prlsrvctl <sub_cmd>``
:param str runas:
The user that the prlsrv... | def prlsrvctl(sub_cmd, args=None, runas=None):
'''
Execute a prlsrvctl command
.. versionadded:: 2016.11.0
:param str sub_cmd:
prlsrvctl subcommand to execute
:param str args:
The arguments supplied to ``prlsrvctl <sub_cmd>``
:param str runas:
The user that the prlsrv... | [
"Execute",
"a",
"prlsrvctl",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L83-L115 | [
"def",
"prlsrvctl",
"(",
"sub_cmd",
",",
"args",
"=",
"None",
",",
"runas",
"=",
"None",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'prlsrvctl'",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'prlsrvctl utility not av... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_vms | List information about the VMs
:param str name:
Name/ID of VM to list
.. versionchanged:: 2016.11.0
No longer implies ``info=True``
:param str info:
List extra information
:param bool all:
List all non-template VMs
:param tuple args:
Additional a... | salt/modules/parallels.py | def list_vms(name=None, info=False, all=False, args=None, runas=None, template=False):
'''
List information about the VMs
:param str name:
Name/ID of VM to list
.. versionchanged:: 2016.11.0
No longer implies ``info=True``
:param str info:
List extra information
... | def list_vms(name=None, info=False, all=False, args=None, runas=None, template=False):
'''
List information about the VMs
:param str name:
Name/ID of VM to list
.. versionchanged:: 2016.11.0
No longer implies ``info=True``
:param str info:
List extra information
... | [
"List",
"information",
"about",
"the",
"VMs"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L151-L205 | [
"def",
"list_vms",
"(",
"name",
"=",
"None",
",",
"info",
"=",
"False",
",",
"all",
"=",
"False",
",",
"args",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"template",
"=",
"False",
")",
":",
"# Construct argument list",
"if",
"args",
"is",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | clone | Clone a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str new_name:
Name of the new VM
:param bool linked:
Create a linked virtual machine.
:param bool template:
Create a virtual machine template instead of a real virtual machine.
... | salt/modules/parallels.py | def clone(name, new_name, linked=False, template=False, runas=None):
'''
Clone a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str new_name:
Name of the new VM
:param bool linked:
Create a linked virtual machine.
:param bool templa... | def clone(name, new_name, linked=False, template=False, runas=None):
'''
Clone a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str new_name:
Name of the new VM
:param bool linked:
Create a linked virtual machine.
:param bool templa... | [
"Clone",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L208-L241 | [
"def",
"clone",
"(",
"name",
",",
"new_name",
",",
"linked",
"=",
"False",
",",
"template",
"=",
"False",
",",
"runas",
"=",
"None",
")",
":",
"args",
"=",
"[",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"'--name'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exec macvm 'find /etc/paths.d' runas=macdev | salt/modules/parallels.py | def delete(name, runas=None):
'''
Delete a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exec macvm 'find /etc/paths.d' ru... | def delete(name, runas=None):
'''
Delete a VM
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM to clone
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exec macvm 'find /etc/paths.d' ru... | [
"Delete",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L244-L262 | [
"def",
"delete",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"return",
"prlctl",
"(",
"'delete'",
",",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"runas",
"=",
"runas",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exists | Query whether a VM exists
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exists macvm runas=macdev | salt/modules/parallels.py | def exists(name, runas=None):
'''
Query whether a VM exists
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exists macvm runas=macdev
... | def exists(name, runas=None):
'''
Query whether a VM exists
.. versionadded:: 2016.11.0
:param str name:
Name/ID of VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exists macvm runas=macdev
... | [
"Query",
"whether",
"a",
"VM",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L265-L287 | [
"def",
"exists",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"vm_info",
"=",
"list_vms",
"(",
"name",
",",
"info",
"=",
"True",
",",
"runas",
"=",
"runas",
")",
".",
"splitlines",
"(",
")",
"for",
"info_line",
"in",
"vm_info",
":",
"if",
"'Na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Start a VM
:param str name:
Name/ID of VM to start
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.start macvm runas=macdev | salt/modules/parallels.py | def start(name, runas=None):
'''
Start a VM
:param str name:
Name/ID of VM to start
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.start macvm runas=macdev
'''
return prlctl('start', salt.uti... | def start(name, runas=None):
'''
Start a VM
:param str name:
Name/ID of VM to start
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.start macvm runas=macdev
'''
return prlctl('start', salt.uti... | [
"Start",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L290-L306 | [
"def",
"start",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"return",
"prlctl",
"(",
"'start'",
",",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"runas",
"=",
"runas",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stop | Stop a VM
:param str name:
Name/ID of VM to stop
:param bool kill:
Perform a hard shutdown
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.stop macvm runas=macdev
salt '*' parallels.stop ... | salt/modules/parallels.py | def stop(name, kill=False, runas=None):
'''
Stop a VM
:param str name:
Name/ID of VM to stop
:param bool kill:
Perform a hard shutdown
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.stop... | def stop(name, kill=False, runas=None):
'''
Stop a VM
:param str name:
Name/ID of VM to stop
:param bool kill:
Perform a hard shutdown
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.stop... | [
"Stop",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L309-L335 | [
"def",
"stop",
"(",
"name",
",",
"kill",
"=",
"False",
",",
"runas",
"=",
"None",
")",
":",
"# Construct argument list",
"args",
"=",
"[",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"]",
"if",
"kill",
":",
"args",
".",
"app... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | restart | Restart a VM by gracefully shutting it down and then restarting
it
:param str name:
Name/ID of VM to restart
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.restart macvm runas=macdev | salt/modules/parallels.py | def restart(name, runas=None):
'''
Restart a VM by gracefully shutting it down and then restarting
it
:param str name:
Name/ID of VM to restart
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.rest... | def restart(name, runas=None):
'''
Restart a VM by gracefully shutting it down and then restarting
it
:param str name:
Name/ID of VM to restart
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.rest... | [
"Restart",
"a",
"VM",
"by",
"gracefully",
"shutting",
"it",
"down",
"and",
"then",
"restarting",
"it"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L338-L355 | [
"def",
"restart",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"return",
"prlctl",
"(",
"'restart'",
",",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"runas",
"=",
"runas",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reset | Reset a VM by performing a hard shutdown and then a restart
:param str name:
Name/ID of VM to reset
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.reset macvm runas=macdev | salt/modules/parallels.py | def reset(name, runas=None):
'''
Reset a VM by performing a hard shutdown and then a restart
:param str name:
Name/ID of VM to reset
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.reset macvm runas=m... | def reset(name, runas=None):
'''
Reset a VM by performing a hard shutdown and then a restart
:param str name:
Name/ID of VM to reset
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.reset macvm runas=m... | [
"Reset",
"a",
"VM",
"by",
"performing",
"a",
"hard",
"shutdown",
"and",
"then",
"a",
"restart"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L358-L374 | [
"def",
"reset",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"return",
"prlctl",
"(",
"'reset'",
",",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"runas",
"=",
"runas",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | status | Status of a VM
:param str name:
Name/ID of VM whose status will be returned
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.status macvm runas=macdev | salt/modules/parallels.py | def status(name, runas=None):
'''
Status of a VM
:param str name:
Name/ID of VM whose status will be returned
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.status macvm runas=macdev
'''
retu... | def status(name, runas=None):
'''
Status of a VM
:param str name:
Name/ID of VM whose status will be returned
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.status macvm runas=macdev
'''
retu... | [
"Status",
"of",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L377-L393 | [
"def",
"status",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"return",
"prlctl",
"(",
"'status'",
",",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
",",
"runas",
"=",
"runas",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exec_ | Run a command on a VM
:param str name:
Name/ID of VM whose exec will be returned
:param str command:
Command to run on the VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.exec macvm 'find /etc... | salt/modules/parallels.py | def exec_(name, command, runas=None):
'''
Run a command on a VM
:param str name:
Name/ID of VM whose exec will be returned
:param str command:
Command to run on the VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash... | def exec_(name, command, runas=None):
'''
Run a command on a VM
:param str name:
Name/ID of VM whose exec will be returned
:param str command:
Command to run on the VM
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash... | [
"Run",
"a",
"command",
"on",
"a",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L396-L420 | [
"def",
"exec_",
"(",
"name",
",",
"command",
",",
"runas",
"=",
"None",
")",
":",
"# Construct argument list",
"args",
"=",
"[",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"]",
"args",
".",
"extend",
"(",
"_normalize_args",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | snapshot_id_to_name | Attempt to convert a snapshot ID to a snapshot name. If the snapshot has
no name or if the ID is not found or invalid, an empty string will be returned
:param str name:
Name/ID of VM whose snapshots are inspected
:param str snap_id:
ID of the snapshot
:param bool strict:
Rais... | salt/modules/parallels.py | def snapshot_id_to_name(name, snap_id, strict=False, runas=None):
'''
Attempt to convert a snapshot ID to a snapshot name. If the snapshot has
no name or if the ID is not found or invalid, an empty string will be returned
:param str name:
Name/ID of VM whose snapshots are inspected
:param... | def snapshot_id_to_name(name, snap_id, strict=False, runas=None):
'''
Attempt to convert a snapshot ID to a snapshot name. If the snapshot has
no name or if the ID is not found or invalid, an empty string will be returned
:param str name:
Name/ID of VM whose snapshots are inspected
:param... | [
"Attempt",
"to",
"convert",
"a",
"snapshot",
"ID",
"to",
"a",
"snapshot",
"name",
".",
"If",
"the",
"snapshot",
"has",
"no",
"name",
"or",
"if",
"the",
"ID",
"is",
"not",
"found",
"or",
"invalid",
"an",
"empty",
"string",
"will",
"be",
"returned"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L423-L501 | [
"def",
"snapshot_id_to_name",
"(",
"name",
",",
"snap_id",
",",
"strict",
"=",
"False",
",",
"runas",
"=",
"None",
")",
":",
"# Validate VM name and snapshot ID",
"name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"if",
"not",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | snapshot_name_to_id | Attempt to convert a snapshot name to a snapshot ID. If the name is not
found an empty string is returned. If multiple snapshots share the same
name, a list will be returned
:param str name:
Name/ID of VM whose snapshots are inspected
:param str snap_name:
Name of the snapshot
:... | salt/modules/parallels.py | def snapshot_name_to_id(name, snap_name, strict=False, runas=None):
'''
Attempt to convert a snapshot name to a snapshot ID. If the name is not
found an empty string is returned. If multiple snapshots share the same
name, a list will be returned
:param str name:
Name/ID of VM whose snapsh... | def snapshot_name_to_id(name, snap_name, strict=False, runas=None):
'''
Attempt to convert a snapshot name to a snapshot ID. If the name is not
found an empty string is returned. If multiple snapshots share the same
name, a list will be returned
:param str name:
Name/ID of VM whose snapsh... | [
"Attempt",
"to",
"convert",
"a",
"snapshot",
"name",
"to",
"a",
"snapshot",
"ID",
".",
"If",
"the",
"name",
"is",
"not",
"found",
"an",
"empty",
"string",
"is",
"returned",
".",
"If",
"multiple",
"snapshots",
"share",
"the",
"same",
"name",
"a",
"list",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L504-L559 | [
"def",
"snapshot_name_to_id",
"(",
"name",
",",
"snap_name",
",",
"strict",
"=",
"False",
",",
"runas",
"=",
"None",
")",
":",
"# Validate VM and snapshot names",
"name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"snap_name",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _validate_snap_name | Validate snapshot name and convert to snapshot ID
:param str name:
Name/ID of VM whose snapshot name is being validated
:param str snap_name:
Name/ID of snapshot
:param bool strict:
Raise an exception if multiple snapshot IDs are found
:param str runas:
The user that ... | salt/modules/parallels.py | def _validate_snap_name(name, snap_name, strict=True, runas=None):
'''
Validate snapshot name and convert to snapshot ID
:param str name:
Name/ID of VM whose snapshot name is being validated
:param str snap_name:
Name/ID of snapshot
:param bool strict:
Raise an exception i... | def _validate_snap_name(name, snap_name, strict=True, runas=None):
'''
Validate snapshot name and convert to snapshot ID
:param str name:
Name/ID of VM whose snapshot name is being validated
:param str snap_name:
Name/ID of snapshot
:param bool strict:
Raise an exception i... | [
"Validate",
"snapshot",
"name",
"and",
"convert",
"to",
"snapshot",
"ID"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L562-L584 | [
"def",
"_validate_snap_name",
"(",
"name",
",",
"snap_name",
",",
"strict",
"=",
"True",
",",
"runas",
"=",
"None",
")",
":",
"snap_name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"snap_name",
")",
"# Try to convert snapshot name to an ID wi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_snapshots | List the snapshots
:param str name:
Name/ID of VM whose snapshots will be listed
:param str snap_id:
Name/ID of snapshot to display information about. If ``tree=True`` is
also specified, display the snapshot subtree having this snapshot as
the root snapshot
:param bool tr... | salt/modules/parallels.py | def list_snapshots(name, snap_name=None, tree=False, names=False, runas=None):
'''
List the snapshots
:param str name:
Name/ID of VM whose snapshots will be listed
:param str snap_id:
Name/ID of snapshot to display information about. If ``tree=True`` is
also specified, display... | def list_snapshots(name, snap_name=None, tree=False, names=False, runas=None):
'''
List the snapshots
:param str name:
Name/ID of VM whose snapshots will be listed
:param str snap_id:
Name/ID of snapshot to display information about. If ``tree=True`` is
also specified, display... | [
"List",
"the",
"snapshots"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L587-L646 | [
"def",
"list_snapshots",
"(",
"name",
",",
"snap_name",
"=",
"None",
",",
"tree",
"=",
"False",
",",
"names",
"=",
"False",
",",
"runas",
"=",
"None",
")",
":",
"# Validate VM and snapshot names",
"name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"dec... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | snapshot | Create a snapshot
:param str name:
Name/ID of VM to take a snapshot of
:param str snap_name:
Name of snapshot
:param str desc:
Description of snapshot
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
sa... | salt/modules/parallels.py | def snapshot(name, snap_name=None, desc=None, runas=None):
'''
Create a snapshot
:param str name:
Name/ID of VM to take a snapshot of
:param str snap_name:
Name of snapshot
:param str desc:
Description of snapshot
:param str runas:
The user that the prlctl com... | def snapshot(name, snap_name=None, desc=None, runas=None):
'''
Create a snapshot
:param str name:
Name/ID of VM to take a snapshot of
:param str snap_name:
Name of snapshot
:param str desc:
Description of snapshot
:param str runas:
The user that the prlctl com... | [
"Create",
"a",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L649-L685 | [
"def",
"snapshot",
"(",
"name",
",",
"snap_name",
"=",
"None",
",",
"desc",
"=",
"None",
",",
"runas",
"=",
"None",
")",
":",
"# Validate VM and snapshot names",
"name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"if",
"sn... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_snapshot | Delete a snapshot
.. note::
Deleting a snapshot from which other snapshots are dervied will not
delete the derived snapshots
:param str name:
Name/ID of VM whose snapshot will be deleted
:param str snap_name:
Name/ID of snapshot to delete
:param str runas:
Th... | salt/modules/parallels.py | def delete_snapshot(name, snap_name, runas=None, all=False):
'''
Delete a snapshot
.. note::
Deleting a snapshot from which other snapshots are dervied will not
delete the derived snapshots
:param str name:
Name/ID of VM whose snapshot will be deleted
:param str snap_name... | def delete_snapshot(name, snap_name, runas=None, all=False):
'''
Delete a snapshot
.. note::
Deleting a snapshot from which other snapshots are dervied will not
delete the derived snapshots
:param str name:
Name/ID of VM whose snapshot will be deleted
:param str snap_name... | [
"Delete",
"a",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L688-L742 | [
"def",
"delete_snapshot",
"(",
"name",
",",
"snap_name",
",",
"runas",
"=",
"None",
",",
"all",
"=",
"False",
")",
":",
"# strict means raise an error if multiple snapshot IDs found for the name given",
"strict",
"=",
"not",
"all",
"# Validate VM and snapshot names",
"nam... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | revert_snapshot | Revert a VM to a snapshot
:param str name:
Name/ID of VM to revert to a snapshot
:param str snap_name:
Name/ID of snapshot to revert to
:param str runas:
The user that the prlctl command will be run as
Example:
.. code-block:: bash
salt '*' parallels.revert_snap... | salt/modules/parallels.py | def revert_snapshot(name, snap_name, runas=None):
'''
Revert a VM to a snapshot
:param str name:
Name/ID of VM to revert to a snapshot
:param str snap_name:
Name/ID of snapshot to revert to
:param str runas:
The user that the prlctl command will be run as
Example:
... | def revert_snapshot(name, snap_name, runas=None):
'''
Revert a VM to a snapshot
:param str name:
Name/ID of VM to revert to a snapshot
:param str snap_name:
Name/ID of snapshot to revert to
:param str runas:
The user that the prlctl command will be run as
Example:
... | [
"Revert",
"a",
"VM",
"to",
"a",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parallels.py#L745-L772 | [
"def",
"revert_snapshot",
"(",
"name",
",",
"snap_name",
",",
"runas",
"=",
"None",
")",
":",
"# Validate VM and snapshot names",
"name",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"name",
")",
"snap_name",
"=",
"_validate_snap_name",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rpc | Executes the given rpc. The returned data can be stored in a file
by specifying the destination path with dest as an argument
.. code-block:: yaml
get-interface-information:
junos:
- rpc
- dest: /home/user/rpc.log
- interface_name: lo0
Parame... | salt/states/junos.py | def rpc(name, dest=None, **kwargs):
'''
Executes the given rpc. The returned data can be stored in a file
by specifying the destination path with dest as an argument
.. code-block:: yaml
get-interface-information:
junos:
- rpc
- dest: /home/user/rpc.log
... | def rpc(name, dest=None, **kwargs):
'''
Executes the given rpc. The returned data can be stored in a file
by specifying the destination path with dest as an argument
.. code-block:: yaml
get-interface-information:
junos:
- rpc
- dest: /home/user/rpc.log
... | [
"Executes",
"the",
"given",
"rpc",
".",
"The",
"returned",
"data",
"can",
"be",
"stored",
"in",
"a",
"file",
"by",
"specifying",
"the",
"destination",
"path",
"with",
"dest",
"as",
"an",
"argument"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L35-L75 | [
"def",
"rpc",
"(",
"name",
",",
"dest",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'chang... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_hostname | Changes the hostname of the device.
.. code-block:: yaml
device_name:
junos:
- set_hostname
- comment: "Host-name set via saltstack."
Parameters:
Required
* hostname: The name to be set. (default = None)
Optional
* kwargs: K... | salt/states/junos.py | def set_hostname(name, **kwargs):
'''
Changes the hostname of the device.
.. code-block:: yaml
device_name:
junos:
- set_hostname
- comment: "Host-name set via saltstack."
Parameters:
Required
* hostname: The name to be set. (def... | def set_hostname(name, **kwargs):
'''
Changes the hostname of the device.
.. code-block:: yaml
device_name:
junos:
- set_hostname
- comment: "Host-name set via saltstack."
Parameters:
Required
* hostname: The name to be set. (def... | [
"Changes",
"the",
"hostname",
"of",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L79-L109 | [
"def",
"set_hostname",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | commit | Commits the changes loaded into the candidate configuration.
.. code-block:: yaml
commit the changes:
junos:
- commit
- confirm: 10
Parameters:
Optional
* kwargs: Keyworded arguments which can be provided like-
* timeout:
... | salt/states/junos.py | def commit(name, **kwargs):
'''
Commits the changes loaded into the candidate configuration.
.. code-block:: yaml
commit the changes:
junos:
- commit
- confirm: 10
Parameters:
Optional
* kwargs: Keyworded arguments which can be ... | def commit(name, **kwargs):
'''
Commits the changes loaded into the candidate configuration.
.. code-block:: yaml
commit the changes:
junos:
- commit
- confirm: 10
Parameters:
Optional
* kwargs: Keyworded arguments which can be ... | [
"Commits",
"the",
"changes",
"loaded",
"into",
"the",
"candidate",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L113-L153 | [
"def",
"commit",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__salt__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rollback | Rollbacks the committed changes.
.. code-block:: yaml
rollback the changes:
junos:
- rollback
- id: 5
Parameters:
Optional
* id:
The rollback id value [0-49]. (default = 0)
* kwargs: Keyworded arguments which can be pro... | salt/states/junos.py | def rollback(name, **kwargs):
'''
Rollbacks the committed changes.
.. code-block:: yaml
rollback the changes:
junos:
- rollback
- id: 5
Parameters:
Optional
* id:
The rollback id value [0-49]. (default = 0)
* kw... | def rollback(name, **kwargs):
'''
Rollbacks the committed changes.
.. code-block:: yaml
rollback the changes:
junos:
- rollback
- id: 5
Parameters:
Optional
* id:
The rollback id value [0-49]. (default = 0)
* kw... | [
"Rollbacks",
"the",
"committed",
"changes",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L157-L188 | [
"def",
"rollback",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__salt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | diff | Gets the difference between the candidate and the current configuration.
.. code-block:: yaml
get the diff:
junos:
- diff
- id: 10
Parameters:
Optional
* id:
The rollback id value [0-49]. (default = 0) | salt/states/junos.py | def diff(name, **kwargs):
'''
Gets the difference between the candidate and the current configuration.
.. code-block:: yaml
get the diff:
junos:
- diff
- id: 10
Parameters:
Optional
* id:
The rollback id value [0-49]. (... | def diff(name, **kwargs):
'''
Gets the difference between the candidate and the current configuration.
.. code-block:: yaml
get the diff:
junos:
- diff
- id: 10
Parameters:
Optional
* id:
The rollback id value [0-49]. (... | [
"Gets",
"the",
"difference",
"between",
"the",
"candidate",
"and",
"the",
"current",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L192-L210 | [
"def",
"diff",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__salt__",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cli | Executes the CLI commands and reuturns the text output.
.. code-block:: yaml
show version:
junos:
- cli
- format: xml
Parameters:
Required
* command:
The command that need to be executed on Junos CLI. (default = None)
Opt... | salt/states/junos.py | def cli(name, format='text', **kwargs):
'''
Executes the CLI commands and reuturns the text output.
.. code-block:: yaml
show version:
junos:
- cli
- format: xml
Parameters:
Required
* command:
The command that need to ... | def cli(name, format='text', **kwargs):
'''
Executes the CLI commands and reuturns the text output.
.. code-block:: yaml
show version:
junos:
- cli
- format: xml
Parameters:
Required
* command:
The command that need to ... | [
"Executes",
"the",
"CLI",
"commands",
"and",
"reuturns",
"the",
"text",
"output",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L214-L243 | [
"def",
"cli",
"(",
"name",
",",
"format",
"=",
"'text'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | shutdown | Shuts down the device.
.. code-block:: yaml
shut the device:
junos:
- shutdown
- in_min: 10
Parameters:
Optional
* kwargs:
* reboot:
Whether to reboot instead of shutdown. (default=False)
* at:
... | salt/states/junos.py | def shutdown(name, **kwargs):
'''
Shuts down the device.
.. code-block:: yaml
shut the device:
junos:
- shutdown
- in_min: 10
Parameters:
Optional
* kwargs:
* reboot:
Whether to reboot instead of shutdow... | def shutdown(name, **kwargs):
'''
Shuts down the device.
.. code-block:: yaml
shut the device:
junos:
- shutdown
- in_min: 10
Parameters:
Optional
* kwargs:
* reboot:
Whether to reboot instead of shutdow... | [
"Shuts",
"down",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L247-L270 | [
"def",
"shutdown",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__salt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install_config | Loads and commits the configuration provided.
.. code-block:: yaml
Install the mentioned config:
junos:
- install_config
- path: salt//configs/interface.set
- timeout: 100
- diffs_file: 'var/log/diff'
.. code-block:: y... | salt/states/junos.py | def install_config(name, **kwargs):
'''
Loads and commits the configuration provided.
.. code-block:: yaml
Install the mentioned config:
junos:
- install_config
- path: salt//configs/interface.set
- timeout: 100
- di... | def install_config(name, **kwargs):
'''
Loads and commits the configuration provided.
.. code-block:: yaml
Install the mentioned config:
junos:
- install_config
- path: salt//configs/interface.set
- timeout: 100
- di... | [
"Loads",
"and",
"commits",
"the",
"configuration",
"provided",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L274-L342 | [
"def",
"install_config",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install_os | Installs the given image on the device. After the installation is complete
the device is rebooted, if reboot=True is given as a keyworded argument.
.. code-block:: yaml
salt://images/junos_image.tgz:
junos:
- install_os
- timeout: 100
-... | salt/states/junos.py | def install_os(name, **kwargs):
'''
Installs the given image on the device. After the installation is complete
the device is rebooted, if reboot=True is given as a keyworded argument.
.. code-block:: yaml
salt://images/junos_image.tgz:
junos:
- install_os
... | def install_os(name, **kwargs):
'''
Installs the given image on the device. After the installation is complete
the device is rebooted, if reboot=True is given as a keyworded argument.
.. code-block:: yaml
salt://images/junos_image.tgz:
junos:
- install_os
... | [
"Installs",
"the",
"given",
"image",
"on",
"the",
"device",
".",
"After",
"the",
"installation",
"is",
"complete",
"the",
"device",
"is",
"rebooted",
"if",
"reboot",
"=",
"True",
"is",
"given",
"as",
"a",
"keyworded",
"argument",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L363-L395 | [
"def",
"install_os",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__sa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_copy | Copies the file from the local device to the junos device.
.. code-block:: yaml
/home/m2/info.txt:
junos:
- file_copy
- dest: info_copy.txt
Parameters:
Required
* src:
The sorce path where the file is kept.
* dest:
... | salt/states/junos.py | def file_copy(name, dest=None, **kwargs):
'''
Copies the file from the local device to the junos device.
.. code-block:: yaml
/home/m2/info.txt:
junos:
- file_copy
- dest: info_copy.txt
Parameters:
Required
* src:
The s... | def file_copy(name, dest=None, **kwargs):
'''
Copies the file from the local device to the junos device.
.. code-block:: yaml
/home/m2/info.txt:
junos:
- file_copy
- dest: info_copy.txt
Parameters:
Required
* src:
The s... | [
"Copies",
"the",
"file",
"from",
"the",
"local",
"device",
"to",
"the",
"junos",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L399-L419 | [
"def",
"file_copy",
"(",
"name",
",",
"dest",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | load | Loads the configuration provided onto the junos device.
.. code-block:: yaml
Install the mentioned config:
junos:
- load
- path: salt//configs/interface.set
.. code-block:: yaml
Install the mentioned config:
junos:
... | salt/states/junos.py | def load(name, **kwargs):
'''
Loads the configuration provided onto the junos device.
.. code-block:: yaml
Install the mentioned config:
junos:
- load
- path: salt//configs/interface.set
.. code-block:: yaml
Install the mentioned ... | def load(name, **kwargs):
'''
Loads the configuration provided onto the junos device.
.. code-block:: yaml
Install the mentioned config:
junos:
- load
- path: salt//configs/interface.set
.. code-block:: yaml
Install the mentioned ... | [
"Loads",
"the",
"configuration",
"provided",
"onto",
"the",
"junos",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L461-L519 | [
"def",
"load",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"[",
"'changes'",
"]",
"=",
"__salt__",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_table | Retrieve data from a Junos device using Tables/Views
name (required)
task definition
table (required)
Name of PyEZ Table
file
YAML file that has the table specified in table parameter
path:
Path of location of the YAML file.
defaults to op directory in jnpr.ju... | salt/states/junos.py | def get_table(name, table, table_file, **kwargs):
'''
Retrieve data from a Junos device using Tables/Views
name (required)
task definition
table (required)
Name of PyEZ Table
file
YAML file that has the table specified in table parameter
path:
Path of location... | def get_table(name, table, table_file, **kwargs):
'''
Retrieve data from a Junos device using Tables/Views
name (required)
task definition
table (required)
Name of PyEZ Table
file
YAML file that has the table specified in table parameter
path:
Path of location... | [
"Retrieve",
"data",
"from",
"a",
"Junos",
"device",
"using",
"Tables",
"/",
"Views"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/junos.py#L540-L581 | [
"def",
"get_table",
"(",
"name",
",",
"table",
",",
"table_file",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"ret",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mkfs | Create a file system on the specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.mkfs /dev/sda1 fs_type=ext4 opts='acl,noexec'
Valid options are:
* **block_size**: 1024, 2048 or 4096
* **check**: check for bad blocks
* **direct**: use direct IO
* **ext_opts**: exten... | salt/modules/extfs.py | def mkfs(device, fs_type, **kwargs):
'''
Create a file system on the specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.mkfs /dev/sda1 fs_type=ext4 opts='acl,noexec'
Valid options are:
* **block_size**: 1024, 2048 or 4096
* **check**: check for bad blocks
* **... | def mkfs(device, fs_type, **kwargs):
'''
Create a file system on the specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.mkfs /dev/sda1 fs_type=ext4 opts='acl,noexec'
Valid options are:
* **block_size**: 1024, 2048 or 4096
* **check**: check for bad blocks
* **... | [
"Create",
"a",
"file",
"system",
"on",
"the",
"specified",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/extfs.py#L29-L123 | [
"def",
"mkfs",
"(",
"device",
",",
"fs_type",
",",
"*",
"*",
"kwargs",
")",
":",
"kwarg_map",
"=",
"{",
"'block_size'",
":",
"'b'",
",",
"'check'",
":",
"'c'",
",",
"'direct'",
":",
"'D'",
",",
"'ext_opts'",
":",
"'E'",
",",
"'fragment_size'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | tune | Set attributes for the specified device (using tune2fs)
CLI Example:
.. code-block:: bash
salt '*' extfs.tune /dev/sda1 force=True label=wildstallyns opts='acl,noexec'
Valid options are:
* **max**: max mount count
* **count**: mount count
* **error**: error behavior
* **extended... | salt/modules/extfs.py | def tune(device, **kwargs):
'''
Set attributes for the specified device (using tune2fs)
CLI Example:
.. code-block:: bash
salt '*' extfs.tune /dev/sda1 force=True label=wildstallyns opts='acl,noexec'
Valid options are:
* **max**: max mount count
* **count**: mount count
* **... | def tune(device, **kwargs):
'''
Set attributes for the specified device (using tune2fs)
CLI Example:
.. code-block:: bash
salt '*' extfs.tune /dev/sda1 force=True label=wildstallyns opts='acl,noexec'
Valid options are:
* **max**: max mount count
* **count**: mount count
* **... | [
"Set",
"attributes",
"for",
"the",
"specified",
"device",
"(",
"using",
"tune2fs",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/extfs.py#L126-L191 | [
"def",
"tune",
"(",
"device",
",",
"*",
"*",
"kwargs",
")",
":",
"kwarg_map",
"=",
"{",
"'max'",
":",
"'c'",
",",
"'count'",
":",
"'C'",
",",
"'error'",
":",
"'e'",
",",
"'extended_opts'",
":",
"'E'",
",",
"'force'",
":",
"'f'",
",",
"'group'",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dump | Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.dump /dev/sda1 | salt/modules/extfs.py | def dump(device, args=None):
'''
Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.dump /dev/sda1
'''
cmd = 'dumpe2fs {0}'.format(device)
if args:
cmd = cmd + ' -' + args
ret = {'attributes': {}, 'blocks': {}}
o... | def dump(device, args=None):
'''
Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' extfs.dump /dev/sda1
'''
cmd = 'dumpe2fs {0}'.format(device)
if args:
cmd = cmd + ' -' + args
ret = {'attributes': {}, 'blocks': {}}
o... | [
"Return",
"all",
"contents",
"of",
"dumpe2fs",
"for",
"a",
"specified",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/extfs.py#L222-L285 | [
"def",
"dump",
"(",
"device",
",",
"args",
"=",
"None",
")",
":",
"cmd",
"=",
"'dumpe2fs {0}'",
".",
"format",
"(",
"device",
")",
"if",
"args",
":",
"cmd",
"=",
"cmd",
"+",
"' -'",
"+",
"args",
"ret",
"=",
"{",
"'attributes'",
":",
"{",
"}",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zmq_version | ZeroMQ python bindings >= 2.1.9 are required | salt/utils/verify.py | def zmq_version():
'''
ZeroMQ python bindings >= 2.1.9 are required
'''
try:
import zmq
except Exception:
# Return True for local mode
return True
ver = zmq.__version__
# The last matched group can be None if the version
# is something like 3.1 and that will work ... | def zmq_version():
'''
ZeroMQ python bindings >= 2.1.9 are required
'''
try:
import zmq
except Exception:
# Return True for local mode
return True
ver = zmq.__version__
# The last matched group can be None if the version
# is something like 3.1 and that will work ... | [
"ZeroMQ",
"python",
"bindings",
">",
"=",
"2",
".",
"1",
".",
"9",
"are",
"required"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L40-L98 | [
"def",
"zmq_version",
"(",
")",
":",
"try",
":",
"import",
"zmq",
"except",
"Exception",
":",
"# Return True for local mode",
"return",
"True",
"ver",
"=",
"zmq",
".",
"__version__",
"# The last matched group can be None if the version",
"# is something like 3.1 and that wi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | lookup_family | Lookup a hostname and determine its address family. The first address returned
will be AF_INET6 if the system is IPv6-enabled, and AF_INET otherwise. | salt/utils/verify.py | def lookup_family(hostname):
'''
Lookup a hostname and determine its address family. The first address returned
will be AF_INET6 if the system is IPv6-enabled, and AF_INET otherwise.
'''
# If lookups fail, fall back to AF_INET sockets (and v4 addresses).
fallback = socket.AF_INET
try:
... | def lookup_family(hostname):
'''
Lookup a hostname and determine its address family. The first address returned
will be AF_INET6 if the system is IPv6-enabled, and AF_INET otherwise.
'''
# If lookups fail, fall back to AF_INET sockets (and v4 addresses).
fallback = socket.AF_INET
try:
... | [
"Lookup",
"a",
"hostname",
"and",
"determine",
"its",
"address",
"family",
".",
"The",
"first",
"address",
"returned",
"will",
"be",
"AF_INET6",
"if",
"the",
"system",
"is",
"IPv6",
"-",
"enabled",
"and",
"AF_INET",
"otherwise",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L101-L117 | [
"def",
"lookup_family",
"(",
"hostname",
")",
":",
"# If lookups fail, fall back to AF_INET sockets (and v4 addresses).",
"fallback",
"=",
"socket",
".",
"AF_INET",
"try",
":",
"hostnames",
"=",
"socket",
".",
"getaddrinfo",
"(",
"hostname",
"or",
"None",
",",
"None",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | verify_socket | Attempt to bind to the sockets to verify that they are available | salt/utils/verify.py | def verify_socket(interface, pub_port, ret_port):
'''
Attempt to bind to the sockets to verify that they are available
'''
addr_family = lookup_family(interface)
for port in pub_port, ret_port:
sock = socket.socket(addr_family, socket.SOCK_STREAM)
try:
sock.setsockopt(so... | def verify_socket(interface, pub_port, ret_port):
'''
Attempt to bind to the sockets to verify that they are available
'''
addr_family = lookup_family(interface)
for port in pub_port, ret_port:
sock = socket.socket(addr_family, socket.SOCK_STREAM)
try:
sock.setsockopt(so... | [
"Attempt",
"to",
"bind",
"to",
"the",
"sockets",
"to",
"verify",
"that",
"they",
"are",
"available"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L120-L146 | [
"def",
"verify_socket",
"(",
"interface",
",",
"pub_port",
",",
"ret_port",
")",
":",
"addr_family",
"=",
"lookup_family",
"(",
"interface",
")",
"for",
"port",
"in",
"pub_port",
",",
"ret_port",
":",
"sock",
"=",
"socket",
".",
"socket",
"(",
"addr_family",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | verify_files | Verify that the named files exist and are owned by the named user | salt/utils/verify.py | def verify_files(files, user):
'''
Verify that the named files exist and are owned by the named user
'''
if salt.utils.platform.is_windows():
return True
import pwd # after confirming not running Windows
try:
pwnam = pwd.getpwnam(user)
uid = pwnam[2]
except KeyError:... | def verify_files(files, user):
'''
Verify that the named files exist and are owned by the named user
'''
if salt.utils.platform.is_windows():
return True
import pwd # after confirming not running Windows
try:
pwnam = pwd.getpwnam(user)
uid = pwnam[2]
except KeyError:... | [
"Verify",
"that",
"the",
"named",
"files",
"exist",
"and",
"are",
"owned",
"by",
"the",
"named",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L149-L197 | [
"def",
"verify_files",
"(",
"files",
",",
"user",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"return",
"True",
"import",
"pwd",
"# after confirming not running Windows",
"try",
":",
"pwnam",
"=",
"pwd",
".",
"g... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | verify_env | Verify that the named directories are in place and that the environment
can shake the salt | salt/utils/verify.py | def verify_env(
dirs,
user,
permissive=False,
pki_dir='',
skip_extra=False,
root_dir=ROOT_DIR):
'''
Verify that the named directories are in place and that the environment
can shake the salt
'''
if salt.utils.platform.is_windows():
return win_v... | def verify_env(
dirs,
user,
permissive=False,
pki_dir='',
skip_extra=False,
root_dir=ROOT_DIR):
'''
Verify that the named directories are in place and that the environment
can shake the salt
'''
if salt.utils.platform.is_windows():
return win_v... | [
"Verify",
"that",
"the",
"named",
"directories",
"are",
"in",
"place",
"and",
"that",
"the",
"environment",
"can",
"shake",
"the",
"salt"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L200-L307 | [
"def",
"verify_env",
"(",
"dirs",
",",
"user",
",",
"permissive",
"=",
"False",
",",
"pki_dir",
"=",
"''",
",",
"skip_extra",
"=",
"False",
",",
"root_dir",
"=",
"ROOT_DIR",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_user | Check user and assign process uid/gid. | salt/utils/verify.py | def check_user(user):
'''
Check user and assign process uid/gid.
'''
if salt.utils.platform.is_windows():
return True
if user == salt.utils.user.get_user():
return True
import pwd # after confirming not running Windows
try:
pwuser = pwd.getpwnam(user)
try:
... | def check_user(user):
'''
Check user and assign process uid/gid.
'''
if salt.utils.platform.is_windows():
return True
if user == salt.utils.user.get_user():
return True
import pwd # after confirming not running Windows
try:
pwuser = pwd.getpwnam(user)
try:
... | [
"Check",
"user",
"and",
"assign",
"process",
"uid",
"/",
"gid",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L310-L356 | [
"def",
"check_user",
"(",
"user",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"return",
"True",
"if",
"user",
"==",
"salt",
".",
"utils",
".",
"user",
".",
"get_user",
"(",
")",
":",
"return",
"True",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_path_traversal | Returns a full list of directories leading up to, and including, a path.
So list_path_traversal('/path/to/salt') would return:
['/', '/path', '/path/to', '/path/to/salt']
in that order.
This routine has been tested on Windows systems as well.
list_path_traversal('c:\\path\\to\\salt') on Window... | salt/utils/verify.py | def list_path_traversal(path):
'''
Returns a full list of directories leading up to, and including, a path.
So list_path_traversal('/path/to/salt') would return:
['/', '/path', '/path/to', '/path/to/salt']
in that order.
This routine has been tested on Windows systems as well.
list_pat... | def list_path_traversal(path):
'''
Returns a full list of directories leading up to, and including, a path.
So list_path_traversal('/path/to/salt') would return:
['/', '/path', '/path/to', '/path/to/salt']
in that order.
This routine has been tested on Windows systems as well.
list_pat... | [
"Returns",
"a",
"full",
"list",
"of",
"directories",
"leading",
"up",
"to",
"and",
"including",
"a",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L359-L381 | [
"def",
"list_path_traversal",
"(",
"path",
")",
":",
"out",
"=",
"[",
"path",
"]",
"(",
"head",
",",
"tail",
")",
"=",
"os",
".",
"path",
".",
"split",
"(",
"path",
")",
"if",
"tail",
"==",
"''",
":",
"# paths with trailing separators will return an empty ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_path_traversal | Walk from the root up to a directory and verify that the current
user has access to read each directory. This is used for making
sure a user can read all parent directories of the minion's key
before trying to go and generate a new key and raising an IOError | salt/utils/verify.py | def check_path_traversal(path, user='root', skip_perm_errors=False):
'''
Walk from the root up to a directory and verify that the current
user has access to read each directory. This is used for making
sure a user can read all parent directories of the minion's key
before trying to go and generate... | def check_path_traversal(path, user='root', skip_perm_errors=False):
'''
Walk from the root up to a directory and verify that the current
user has access to read each directory. This is used for making
sure a user can read all parent directories of the minion's key
before trying to go and generate... | [
"Walk",
"from",
"the",
"root",
"up",
"to",
"a",
"directory",
"and",
"verify",
"that",
"the",
"current",
"user",
"has",
"access",
"to",
"read",
"each",
"directory",
".",
"This",
"is",
"used",
"for",
"making",
"sure",
"a",
"user",
"can",
"read",
"all",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L384-L412 | [
"def",
"check_path_traversal",
"(",
"path",
",",
"user",
"=",
"'root'",
",",
"skip_perm_errors",
"=",
"False",
")",
":",
"for",
"tpath",
"in",
"list_path_traversal",
"(",
"path",
")",
":",
"if",
"not",
"os",
".",
"access",
"(",
"tpath",
",",
"os",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_max_open_files | Check the number of max allowed open files and adjust if needed | salt/utils/verify.py | def check_max_open_files(opts):
'''
Check the number of max allowed open files and adjust if needed
'''
mof_c = opts.get('max_open_files', 100000)
if sys.platform.startswith('win'):
# Check the Windows API for more detail on this
# http://msdn.microsoft.com/en-us/library/xt874334(v=v... | def check_max_open_files(opts):
'''
Check the number of max allowed open files and adjust if needed
'''
mof_c = opts.get('max_open_files', 100000)
if sys.platform.startswith('win'):
# Check the Windows API for more detail on this
# http://msdn.microsoft.com/en-us/library/xt874334(v=v... | [
"Check",
"the",
"number",
"of",
"max",
"allowed",
"open",
"files",
"and",
"adjust",
"if",
"needed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L415-L472 | [
"def",
"check_max_open_files",
"(",
"opts",
")",
":",
"mof_c",
"=",
"opts",
".",
"get",
"(",
"'max_open_files'",
",",
"100000",
")",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'win'",
")",
":",
"# Check the Windows API for more detail on this",
"# ht... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | clean_path | Accepts the root the path needs to be under and verifies that the path is
under said root. Pass in subdir=True if the path can result in a
subdirectory of the root instead of having to reside directly in the root | salt/utils/verify.py | def clean_path(root, path, subdir=False):
'''
Accepts the root the path needs to be under and verifies that the path is
under said root. Pass in subdir=True if the path can result in a
subdirectory of the root instead of having to reside directly in the root
'''
if not os.path.isabs(root):
... | def clean_path(root, path, subdir=False):
'''
Accepts the root the path needs to be under and verifies that the path is
under said root. Pass in subdir=True if the path can result in a
subdirectory of the root instead of having to reside directly in the root
'''
if not os.path.isabs(root):
... | [
"Accepts",
"the",
"root",
"the",
"path",
"needs",
"to",
"be",
"under",
"and",
"verifies",
"that",
"the",
"path",
"is",
"under",
"said",
"root",
".",
"Pass",
"in",
"subdir",
"=",
"True",
"if",
"the",
"path",
"can",
"result",
"in",
"a",
"subdirectory",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L475-L492 | [
"def",
"clean_path",
"(",
"root",
",",
"path",
",",
"subdir",
"=",
"False",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isabs",
"(",
"root",
")",
":",
"return",
"''",
"if",
"not",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
":",
"pat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | valid_id | Returns if the passed id is valid | salt/utils/verify.py | def valid_id(opts, id_):
'''
Returns if the passed id is valid
'''
try:
if any(x in id_ for x in ('/', '\\', str('\0'))):
return False
return bool(clean_path(opts['pki_dir'], id_))
except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
return False | def valid_id(opts, id_):
'''
Returns if the passed id is valid
'''
try:
if any(x in id_ for x in ('/', '\\', str('\0'))):
return False
return bool(clean_path(opts['pki_dir'], id_))
except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
return False | [
"Returns",
"if",
"the",
"passed",
"id",
"is",
"valid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L495-L504 | [
"def",
"valid_id",
"(",
"opts",
",",
"id_",
")",
":",
"try",
":",
"if",
"any",
"(",
"x",
"in",
"id_",
"for",
"x",
"in",
"(",
"'/'",
",",
"'\\\\'",
",",
"str",
"(",
"'\\0'",
")",
")",
")",
":",
"return",
"False",
"return",
"bool",
"(",
"clean_pa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | safe_py_code | Check a string to see if it has any potentially unsafe routines which
could be executed via python, this routine is used to improve the
safety of modules suct as virtualenv | salt/utils/verify.py | def safe_py_code(code):
'''
Check a string to see if it has any potentially unsafe routines which
could be executed via python, this routine is used to improve the
safety of modules suct as virtualenv
'''
bads = (
'import',
';',
'subprocess',
'eval... | def safe_py_code(code):
'''
Check a string to see if it has any potentially unsafe routines which
could be executed via python, this routine is used to improve the
safety of modules suct as virtualenv
'''
bads = (
'import',
';',
'subprocess',
'eval... | [
"Check",
"a",
"string",
"to",
"see",
"if",
"it",
"has",
"any",
"potentially",
"unsafe",
"routines",
"which",
"could",
"be",
"executed",
"via",
"python",
"this",
"routine",
"is",
"used",
"to",
"improve",
"the",
"safety",
"of",
"modules",
"suct",
"as",
"virt... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L507-L525 | [
"def",
"safe_py_code",
"(",
"code",
")",
":",
"bads",
"=",
"(",
"'import'",
",",
"';'",
",",
"'subprocess'",
",",
"'eval'",
",",
"'open'",
",",
"'file'",
",",
"'exec'",
",",
"'input'",
")",
"for",
"bad",
"in",
"bads",
":",
"if",
"code",
".",
"count",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | verify_log | If an insecre logging configuration is found, show a warning | salt/utils/verify.py | def verify_log(opts):
'''
If an insecre logging configuration is found, show a warning
'''
level = LOG_LEVELS.get(str(opts.get('log_level')).lower(), logging.NOTSET)
if level < logging.INFO:
log.warning('Insecure logging configuration detected! Sensitive data may be logged.') | def verify_log(opts):
'''
If an insecre logging configuration is found, show a warning
'''
level = LOG_LEVELS.get(str(opts.get('log_level')).lower(), logging.NOTSET)
if level < logging.INFO:
log.warning('Insecure logging configuration detected! Sensitive data may be logged.') | [
"If",
"an",
"insecre",
"logging",
"configuration",
"is",
"found",
"show",
"a",
"warning"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L528-L535 | [
"def",
"verify_log",
"(",
"opts",
")",
":",
"level",
"=",
"LOG_LEVELS",
".",
"get",
"(",
"str",
"(",
"opts",
".",
"get",
"(",
"'log_level'",
")",
")",
".",
"lower",
"(",
")",
",",
"logging",
".",
"NOTSET",
")",
"if",
"level",
"<",
"logging",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | win_verify_env | Verify that the named directories are in place and that the environment
can shake the salt | salt/utils/verify.py | def win_verify_env(
path,
dirs,
permissive=False,
pki_dir='',
skip_extra=False):
'''
Verify that the named directories are in place and that the environment
can shake the salt
'''
import salt.utils.win_functions
import salt.utils.win_dacl
import salt.u... | def win_verify_env(
path,
dirs,
permissive=False,
pki_dir='',
skip_extra=False):
'''
Verify that the named directories are in place and that the environment
can shake the salt
'''
import salt.utils.win_functions
import salt.utils.win_dacl
import salt.u... | [
"Verify",
"that",
"the",
"named",
"directories",
"are",
"in",
"place",
"and",
"that",
"the",
"environment",
"can",
"shake",
"the",
"salt"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/verify.py#L538-L658 | [
"def",
"win_verify_env",
"(",
"path",
",",
"dirs",
",",
"permissive",
"=",
"False",
",",
"pki_dir",
"=",
"''",
",",
"skip_extra",
"=",
"False",
")",
":",
"import",
"salt",
".",
"utils",
".",
"win_functions",
"import",
"salt",
".",
"utils",
".",
"win_dacl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_upgrades | List all available package upgrades on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades | salt/modules/pacmanpkg.py | def list_upgrades(refresh=False, root=None, **kwargs): # pylint: disable=W0613
'''
List all available package upgrades on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
upgrades = {}
cmd = ['pacman', '-S', '-p', '-u', '--print-format', '%n %v']
... | def list_upgrades(refresh=False, root=None, **kwargs): # pylint: disable=W0613
'''
List all available package upgrades on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
upgrades = {}
cmd = ['pacman', '-S', '-p', '-u', '--print-format', '%n %v']
... | [
"List",
"all",
"available",
"package",
"upgrades",
"on",
"this",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L127-L174 | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"upgrades",
"=",
"{",
"}",
"cmd",
"=",
"[",
"'pacman'",
",",
"'-S'",
",",
"'-p'",
",",
"'-u'",
",",
"'--print-... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | salt/modules/pacmanpkg.py | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L193-L241 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# not yet implemented or not applicable",
"if",
"any",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | group_list | .. versionadded:: 2016.11.0
Lists all groups known by pacman on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.group_list | salt/modules/pacmanpkg.py | def group_list():
'''
.. versionadded:: 2016.11.0
Lists all groups known by pacman on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.group_list
'''
ret = {'installed': [],
'partially_installed': [],
'available': []}
# find out what's available
... | def group_list():
'''
.. versionadded:: 2016.11.0
Lists all groups known by pacman on this system
CLI Example:
.. code-block:: bash
salt '*' pkg.group_list
'''
ret = {'installed': [],
'partially_installed': [],
'available': []}
# find out what's available
... | [
"..",
"versionadded",
"::",
"2016",
".",
"11",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L244-L318 | [
"def",
"group_list",
"(",
")",
":",
"ret",
"=",
"{",
"'installed'",
":",
"[",
"]",
",",
"'partially_installed'",
":",
"[",
"]",
",",
"'available'",
":",
"[",
"]",
"}",
"# find out what's available",
"cmd",
"=",
"[",
"'pacman'",
",",
"'-Sgg'",
"]",
"out",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | group_info | .. versionadded:: 2016.11.0
Lists all packages in the specified group
CLI Example:
.. code-block:: bash
salt '*' pkg.group_info 'xorg' | salt/modules/pacmanpkg.py | def group_info(name):
'''
.. versionadded:: 2016.11.0
Lists all packages in the specified group
CLI Example:
.. code-block:: bash
salt '*' pkg.group_info 'xorg'
'''
pkgtypes = ('mandatory', 'optional', 'default', 'conditional')
ret = {}
for pkgtype in pkgtypes:
r... | def group_info(name):
'''
.. versionadded:: 2016.11.0
Lists all packages in the specified group
CLI Example:
.. code-block:: bash
salt '*' pkg.group_info 'xorg'
'''
pkgtypes = ('mandatory', 'optional', 'default', 'conditional')
ret = {}
for pkgtype in pkgtypes:
r... | [
"..",
"versionadded",
"::",
"2016",
".",
"11",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L321-L356 | [
"def",
"group_info",
"(",
"name",
")",
":",
"pkgtypes",
"=",
"(",
"'mandatory'",
",",
"'optional'",
",",
"'default'",
",",
"'conditional'",
")",
"ret",
"=",
"{",
"}",
"for",
"pkgtype",
"in",
"pkgtypes",
":",
"ret",
"[",
"pkgtype",
"]",
"=",
"set",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | group_diff | .. versionadded:: 2016.11.0
Lists which of a group's packages are installed and which are not
installed
Compatible with yumpkg.group_diff for easy support of state.pkg.group_installed
CLI Example:
.. code-block:: bash
salt '*' pkg.group_diff 'xorg' | salt/modules/pacmanpkg.py | def group_diff(name):
'''
.. versionadded:: 2016.11.0
Lists which of a group's packages are installed and which are not
installed
Compatible with yumpkg.group_diff for easy support of state.pkg.group_installed
CLI Example:
.. code-block:: bash
salt '*' pkg.group_diff 'xorg'
... | def group_diff(name):
'''
.. versionadded:: 2016.11.0
Lists which of a group's packages are installed and which are not
installed
Compatible with yumpkg.group_diff for easy support of state.pkg.group_installed
CLI Example:
.. code-block:: bash
salt '*' pkg.group_diff 'xorg'
... | [
"..",
"versionadded",
"::",
"2016",
".",
"11",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L359-L393 | [
"def",
"group_diff",
"(",
"name",
")",
":",
"# Use a compatible structure with yum, so we can leverage the existing state.group_installed",
"# In pacmanworld, everything is the default, but nothing is mandatory",
"pkgtypes",
"=",
"(",
"'mandatory'",
",",
"'optional'",
",",
"'default'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | refresh_db | Just run a ``pacman -Sy``, return a dict::
{'<database name>': Bool}
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | salt/modules/pacmanpkg.py | def refresh_db(root=None, **kwargs):
'''
Just run a ``pacman -Sy``, return a dict::
{'<database name>': Bool}
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag... | def refresh_db(root=None, **kwargs):
'''
Just run a ``pacman -Sy``, return a dict::
{'<database name>': Bool}
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag... | [
"Just",
"run",
"a",
"pacman",
"-",
"Sy",
"return",
"a",
"dict",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L396-L441 | [
"def",
"refresh_db",
"(",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"cmd",
"=",
"[",
"'pacman'",
... | 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 pacman commands spawned by Sa... | salt/modules/pacmanpkg.py | def install(name=None,
refresh=False,
sysupgrade=None,
pkgs=None,
sources=None,
**kwargs):
'''
.. 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 mod... | def install(name=None,
refresh=False,
sysupgrade=None,
pkgs=None,
sources=None,
**kwargs):
'''
.. 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 mod... | [
"..",
"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/pacmanpkg.py#L444-L635 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"sysupgrade",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
",",
"pkg_type",
"=",
"__s... | 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 pacman commands spawned by Sa... | salt/modules/pacmanpkg.py | def upgrade(refresh=False, root=None, **kwargs):
'''
.. 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 s... | def upgrade(refresh=False, root=None, **kwargs):
'''
.. 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 s... | [
"..",
"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/pacmanpkg.py#L638-L703 | [
"def",
"upgrade",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"old",
"=",
"list_pkgs",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _uninstall | remove and purge do identical things but with different pacman commands,
this function performs the common logic. | salt/modules/pacmanpkg.py | def _uninstall(action='remove', name=None, pkgs=None, **kwargs):
'''
remove and purge do identical things but with different pacman commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
... | def _uninstall(action='remove', name=None, pkgs=None, **kwargs):
'''
remove and purge do identical things but with different pacman commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
... | [
"remove",
"and",
"purge",
"do",
"identical",
"things",
"but",
"with",
"different",
"pacman",
"commands",
"this",
"function",
"performs",
"the",
"common",
"logic",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L706-L754 | [
"def",
"_uninstall",
"(",
"action",
"=",
"'remove'",
",",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_list | List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfix
salt '*' p... | salt/modules/pacmanpkg.py | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*... | def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*... | [
"List",
"the",
"files",
"that",
"belong",
"to",
"a",
"package",
".",
"Not",
"specifying",
"any",
"packages",
"will",
"return",
"a",
"list",
"of",
"_every_",
"file",
"on",
"the",
"system",
"s",
"package",
"database",
"(",
"not",
"generally",
"recommended",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L846-L877 | [
"def",
"file_list",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"errors",
"=",
"[",
"]",
"ret",
"=",
"[",
"]",
"cmd",
"=",
"[",
"'pacman'",
",",
"'-Ql'",
"]",
"if",
"packages",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"packages"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_repo_pkgs | 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 function can be helpful in discovering the version or repo to specify
in a :mod:`pkg.installed <salt.states.pkg.installed>` state.
The re... | salt/modules/pacmanpkg.py | def list_repo_pkgs(*args, **kwargs):
'''
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 function can be helpful in discovering the version or repo to specify
in a :mod:`pkg.installe... | def list_repo_pkgs(*args, **kwargs):
'''
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 function can be helpful in discovering the version or repo to specify
in a :mod:`pkg.installe... | [
"Returns",
"all",
"available",
"packages",
".",
"Optionally",
"package",
"names",
"(",
"and",
"name",
"globs",
")",
"can",
"be",
"passed",
"and",
"the",
"results",
"will",
"be",
"filtered",
"to",
"packages",
"matching",
"those",
"names",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L946-L1066 | [
"def",
"list_repo_pkgs",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"fromrepo",
"=",
"kwargs",
".",
"pop",
"(",
"'fromrepo'",
",",
"''",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SPM.run | Run the api | salt/cli/spm.py | def run(self):
'''
Run the api
'''
ui = salt.spm.SPMCmdlineInterface()
self.parse_args()
self.setup_logfile_logger()
v_dirs = [
self.config['spm_cache_dir'],
]
verify_env(v_dirs,
self.config['user'],
... | def run(self):
'''
Run the api
'''
ui = salt.spm.SPMCmdlineInterface()
self.parse_args()
self.setup_logfile_logger()
v_dirs = [
self.config['spm_cache_dir'],
]
verify_env(v_dirs,
self.config['user'],
... | [
"Run",
"the",
"api"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/spm.py#L25-L41 | [
"def",
"run",
"(",
"self",
")",
":",
"ui",
"=",
"salt",
".",
"spm",
".",
"SPMCmdlineInterface",
"(",
")",
"self",
".",
"parse_args",
"(",
")",
"self",
".",
"setup_logfile_logger",
"(",
")",
"v_dirs",
"=",
"[",
"self",
".",
"config",
"[",
"'spm_cache_di... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SqlBaseExtPillar.extract_queries | This function normalizes the config block into a set of queries we
can use. The return is a list of consistently laid out dicts. | salt/pillar/sql_base.py | def extract_queries(self, args, kwargs):
'''
This function normalizes the config block into a set of queries we
can use. The return is a list of consistently laid out dicts.
'''
# Please note the function signature is NOT an error. Neither args, nor
# kwargs should have... | def extract_queries(self, args, kwargs):
'''
This function normalizes the config block into a set of queries we
can use. The return is a list of consistently laid out dicts.
'''
# Please note the function signature is NOT an error. Neither args, nor
# kwargs should have... | [
"This",
"function",
"normalizes",
"the",
"config",
"block",
"into",
"a",
"set",
"of",
"queries",
"we",
"can",
"use",
".",
"The",
"return",
"is",
"a",
"list",
"of",
"consistently",
"laid",
"out",
"dicts",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L230-L284 | [
"def",
"extract_queries",
"(",
"self",
",",
"args",
",",
"kwargs",
")",
":",
"# Please note the function signature is NOT an error. Neither args, nor",
"# kwargs should have asterisks. We are passing in a list and dict,",
"# rather than receiving variable args. Adding asterisks WILL BREAK... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SqlBaseExtPillar.enter_root | Set self.focus for kwarg queries | salt/pillar/sql_base.py | def enter_root(self, root):
'''
Set self.focus for kwarg queries
'''
# There is no collision protection on root name isolation
if root:
self.result[root] = self.focus = {}
else:
self.focus = self.result | def enter_root(self, root):
'''
Set self.focus for kwarg queries
'''
# There is no collision protection on root name isolation
if root:
self.result[root] = self.focus = {}
else:
self.focus = self.result | [
"Set",
"self",
".",
"focus",
"for",
"kwarg",
"queries"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L286-L294 | [
"def",
"enter_root",
"(",
"self",
",",
"root",
")",
":",
"# There is no collision protection on root name isolation",
"if",
"root",
":",
"self",
".",
"result",
"[",
"root",
"]",
"=",
"self",
".",
"focus",
"=",
"{",
"}",
"else",
":",
"self",
".",
"focus",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SqlBaseExtPillar.process_fields | The primary purpose of this function is to store the sql field list
and the depth to which we process. | salt/pillar/sql_base.py | def process_fields(self, field_names, depth):
'''
The primary purpose of this function is to store the sql field list
and the depth to which we process.
'''
# List of field names in correct order.
self.field_names = field_names
# number of fields.
self.num... | def process_fields(self, field_names, depth):
'''
The primary purpose of this function is to store the sql field list
and the depth to which we process.
'''
# List of field names in correct order.
self.field_names = field_names
# number of fields.
self.num... | [
"The",
"primary",
"purpose",
"of",
"this",
"function",
"is",
"to",
"store",
"the",
"sql",
"field",
"list",
"and",
"the",
"depth",
"to",
"which",
"we",
"process",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L296-L309 | [
"def",
"process_fields",
"(",
"self",
",",
"field_names",
",",
"depth",
")",
":",
"# List of field names in correct order.",
"self",
".",
"field_names",
"=",
"field_names",
"# number of fields.",
"self",
".",
"num_fields",
"=",
"len",
"(",
"field_names",
")",
"# Con... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SqlBaseExtPillar.process_results | This function takes a list of database results and iterates over,
merging them into a dict form. | salt/pillar/sql_base.py | def process_results(self, rows):
'''
This function takes a list of database results and iterates over,
merging them into a dict form.
'''
listify = OrderedDict()
listify_dicts = OrderedDict()
for ret in rows:
# crd is the Current Return Data level, to ... | def process_results(self, rows):
'''
This function takes a list of database results and iterates over,
merging them into a dict form.
'''
listify = OrderedDict()
listify_dicts = OrderedDict()
for ret in rows:
# crd is the Current Return Data level, to ... | [
"This",
"function",
"takes",
"a",
"list",
"of",
"database",
"results",
"and",
"iterates",
"over",
"merging",
"them",
"into",
"a",
"dict",
"form",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L311-L416 | [
"def",
"process_results",
"(",
"self",
",",
"rows",
")",
":",
"listify",
"=",
"OrderedDict",
"(",
")",
"listify_dicts",
"=",
"OrderedDict",
"(",
")",
"for",
"ret",
"in",
"rows",
":",
"# crd is the Current Return Data level, to make this non-recursive.",
"crd",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SqlBaseExtPillar.fetch | Execute queries, merge and return as a dict. | salt/pillar/sql_base.py | def fetch(self,
minion_id,
pillar, # pylint: disable=W0613
*args,
**kwargs):
'''
Execute queries, merge and return as a dict.
'''
db_name = self._db_name()
log.info('Querying %s for information for %s', db_name, minion_id)
... | def fetch(self,
minion_id,
pillar, # pylint: disable=W0613
*args,
**kwargs):
'''
Execute queries, merge and return as a dict.
'''
db_name = self._db_name()
log.info('Querying %s for information for %s', db_name, minion_id)
... | [
"Execute",
"queries",
"merge",
"and",
"return",
"as",
"a",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L418-L451 | [
"def",
"fetch",
"(",
"self",
",",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"db_name",
"=",
"self",
".",
"_db_name",
"(",
")",
"log",
".",
"info",
"(",
"'Querying %s for information for %s'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _linux_brshow | Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl) | salt/modules/bridge.py | def _linux_brshow(br=None):
'''
Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl)
'''
brctl = _tool_path('brctl')
if br:
cmd = '{0} show {1}'.format(brctl, br)
else:
cmd = '{0} show'.format(brctl)
brs = {}
for line in __salt__['cmd.run'](cmd, python... | def _linux_brshow(br=None):
'''
Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl)
'''
brctl = _tool_path('brctl')
if br:
cmd = '{0} show {1}'.format(brctl, br)
else:
cmd = '{0} show'.format(brctl)
brs = {}
for line in __salt__['cmd.run'](cmd, python... | [
"Internal",
"returns",
"bridges",
"and",
"enslaved",
"interfaces",
"(",
"GNU",
"/",
"Linux",
"-",
"brctl",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L47-L91 | [
"def",
"_linux_brshow",
"(",
"br",
"=",
"None",
")",
":",
"brctl",
"=",
"_tool_path",
"(",
"'brctl'",
")",
"if",
"br",
":",
"cmd",
"=",
"'{0} show {1}'",
".",
"format",
"(",
"brctl",
",",
"br",
")",
"else",
":",
"cmd",
"=",
"'{0} show'",
".",
"format... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _linux_bradd | Internal, creates the bridge | salt/modules/bridge.py | def _linux_bradd(br):
'''
Internal, creates the bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} addbr {1}'.format(brctl, br),
python_shell=False) | def _linux_bradd(br):
'''
Internal, creates the bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} addbr {1}'.format(brctl, br),
python_shell=False) | [
"Internal",
"creates",
"the",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L94-L100 | [
"def",
"_linux_bradd",
"(",
"br",
")",
":",
"brctl",
"=",
"_tool_path",
"(",
"'brctl'",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} addbr {1}'",
".",
"format",
"(",
"brctl",
",",
"br",
")",
",",
"python_shell",
"=",
"False",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _linux_brdel | Internal, deletes the bridge | salt/modules/bridge.py | def _linux_brdel(br):
'''
Internal, deletes the bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} delbr {1}'.format(brctl, br),
python_shell=False) | def _linux_brdel(br):
'''
Internal, deletes the bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} delbr {1}'.format(brctl, br),
python_shell=False) | [
"Internal",
"deletes",
"the",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L103-L109 | [
"def",
"_linux_brdel",
"(",
"br",
")",
":",
"brctl",
"=",
"_tool_path",
"(",
"'brctl'",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} delbr {1}'",
".",
"format",
"(",
"brctl",
",",
"br",
")",
",",
"python_shell",
"=",
"False",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _linux_delif | Internal, removes an interface from a bridge | salt/modules/bridge.py | def _linux_delif(br, iface):
'''
Internal, removes an interface from a bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} delif {1} {2}'.format(brctl, br, iface),
python_shell=False) | def _linux_delif(br, iface):
'''
Internal, removes an interface from a bridge
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} delif {1} {2}'.format(brctl, br, iface),
python_shell=False) | [
"Internal",
"removes",
"an",
"interface",
"from",
"a",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L121-L127 | [
"def",
"_linux_delif",
"(",
"br",
",",
"iface",
")",
":",
"brctl",
"=",
"_tool_path",
"(",
"'brctl'",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} delif {1} {2}'",
".",
"format",
"(",
"brctl",
",",
"br",
",",
"iface",
")",
",",
"python_sh... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _linux_stp | Internal, sets STP state | salt/modules/bridge.py | def _linux_stp(br, state):
'''
Internal, sets STP state
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state),
python_shell=False) | def _linux_stp(br, state):
'''
Internal, sets STP state
'''
brctl = _tool_path('brctl')
return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state),
python_shell=False) | [
"Internal",
"sets",
"STP",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L130-L136 | [
"def",
"_linux_stp",
"(",
"br",
",",
"state",
")",
":",
"brctl",
"=",
"_tool_path",
"(",
"'brctl'",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} stp {1} {2}'",
".",
"format",
"(",
"brctl",
",",
"br",
",",
"state",
")",
",",
"python_shell"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bsd_brshow | Internal, returns bridges and member interfaces (BSD-like: ifconfig) | salt/modules/bridge.py | def _bsd_brshow(br=None):
'''
Internal, returns bridges and member interfaces (BSD-like: ifconfig)
'''
if __grains__['kernel'] == 'NetBSD':
return _netbsd_brshow(br)
ifconfig = _tool_path('ifconfig')
ifaces = {}
if br:
ifaces[br] = br
else:
cmd = '{0} -g bridge... | def _bsd_brshow(br=None):
'''
Internal, returns bridges and member interfaces (BSD-like: ifconfig)
'''
if __grains__['kernel'] == 'NetBSD':
return _netbsd_brshow(br)
ifconfig = _tool_path('ifconfig')
ifaces = {}
if br:
ifaces[br] = br
else:
cmd = '{0} -g bridge... | [
"Internal",
"returns",
"bridges",
"and",
"member",
"interfaces",
"(",
"BSD",
"-",
"like",
":",
"ifconfig",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L139-L174 | [
"def",
"_bsd_brshow",
"(",
"br",
"=",
"None",
")",
":",
"if",
"__grains__",
"[",
"'kernel'",
"]",
"==",
"'NetBSD'",
":",
"return",
"_netbsd_brshow",
"(",
"br",
")",
"ifconfig",
"=",
"_tool_path",
"(",
"'ifconfig'",
")",
"ifaces",
"=",
"{",
"}",
"if",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _netbsd_brshow | Internal, returns bridges and enslaved interfaces (NetBSD - brconfig) | salt/modules/bridge.py | def _netbsd_brshow(br=None):
'''
Internal, returns bridges and enslaved interfaces (NetBSD - brconfig)
'''
brconfig = _tool_path('brconfig')
if br:
cmd = '{0} {1}'.format(brconfig, br)
else:
cmd = '{0} -a'.format(brconfig)
brs = {}
start_int = False
for line in __s... | def _netbsd_brshow(br=None):
'''
Internal, returns bridges and enslaved interfaces (NetBSD - brconfig)
'''
brconfig = _tool_path('brconfig')
if br:
cmd = '{0} {1}'.format(brconfig, br)
else:
cmd = '{0} -a'.format(brconfig)
brs = {}
start_int = False
for line in __s... | [
"Internal",
"returns",
"bridges",
"and",
"enslaved",
"interfaces",
"(",
"NetBSD",
"-",
"brconfig",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L177-L214 | [
"def",
"_netbsd_brshow",
"(",
"br",
"=",
"None",
")",
":",
"brconfig",
"=",
"_tool_path",
"(",
"'brconfig'",
")",
"if",
"br",
":",
"cmd",
"=",
"'{0} {1}'",
".",
"format",
"(",
"brconfig",
",",
"br",
")",
"else",
":",
"cmd",
"=",
"'{0} -a'",
".",
"for... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bsd_bradd | Internal, creates the bridge | salt/modules/bridge.py | def _bsd_bradd(br):
'''
Internal, creates the bridge
'''
kernel = __grains__['kernel']
ifconfig = _tool_path('ifconfig')
if not br:
return False
if __salt__['cmd.retcode']('{0} {1} create up'.format(ifconfig, br),
python_shell=False) != 0:
ret... | def _bsd_bradd(br):
'''
Internal, creates the bridge
'''
kernel = __grains__['kernel']
ifconfig = _tool_path('ifconfig')
if not br:
return False
if __salt__['cmd.retcode']('{0} {1} create up'.format(ifconfig, br),
python_shell=False) != 0:
ret... | [
"Internal",
"creates",
"the",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L217-L238 | [
"def",
"_bsd_bradd",
"(",
"br",
")",
":",
"kernel",
"=",
"__grains__",
"[",
"'kernel'",
"]",
"ifconfig",
"=",
"_tool_path",
"(",
"'ifconfig'",
")",
"if",
"not",
"br",
":",
"return",
"False",
"if",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"(",
"'{0} {1} creat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bsd_brdel | Internal, deletes the bridge | salt/modules/bridge.py | def _bsd_brdel(br):
'''
Internal, deletes the bridge
'''
ifconfig = _tool_path('ifconfig')
if not br:
return False
return __salt__['cmd.run']('{0} {1} destroy'.format(ifconfig, br),
python_shell=False) | def _bsd_brdel(br):
'''
Internal, deletes the bridge
'''
ifconfig = _tool_path('ifconfig')
if not br:
return False
return __salt__['cmd.run']('{0} {1} destroy'.format(ifconfig, br),
python_shell=False) | [
"Internal",
"deletes",
"the",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L241-L249 | [
"def",
"_bsd_brdel",
"(",
"br",
")",
":",
"ifconfig",
"=",
"_tool_path",
"(",
"'ifconfig'",
")",
"if",
"not",
"br",
":",
"return",
"False",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} {1} destroy'",
".",
"format",
"(",
"ifconfig",
",",
"br",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bsd_addif | Internal, adds an interface to a bridge | salt/modules/bridge.py | def _bsd_addif(br, iface):
'''
Internal, adds an interface to a bridge
'''
kernel = __grains__['kernel']
if kernel == 'NetBSD':
cmd = _tool_path('brconfig')
brcmd = 'add'
else:
cmd = _tool_path('ifconfig')
brcmd = 'addem'
if not br or not iface:
retur... | def _bsd_addif(br, iface):
'''
Internal, adds an interface to a bridge
'''
kernel = __grains__['kernel']
if kernel == 'NetBSD':
cmd = _tool_path('brconfig')
brcmd = 'add'
else:
cmd = _tool_path('ifconfig')
brcmd = 'addem'
if not br or not iface:
retur... | [
"Internal",
"adds",
"an",
"interface",
"to",
"a",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L252-L268 | [
"def",
"_bsd_addif",
"(",
"br",
",",
"iface",
")",
":",
"kernel",
"=",
"__grains__",
"[",
"'kernel'",
"]",
"if",
"kernel",
"==",
"'NetBSD'",
":",
"cmd",
"=",
"_tool_path",
"(",
"'brconfig'",
")",
"brcmd",
"=",
"'add'",
"else",
":",
"cmd",
"=",
"_tool_p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bsd_stp | Internal, sets STP state. On BSD-like, it is required to specify the
STP physical interface | salt/modules/bridge.py | def _bsd_stp(br, state, iface):
'''
Internal, sets STP state. On BSD-like, it is required to specify the
STP physical interface
'''
kernel = __grains__['kernel']
if kernel == 'NetBSD':
cmd = _tool_path('brconfig')
else:
cmd = _tool_path('ifconfig')
if not br or not iface... | def _bsd_stp(br, state, iface):
'''
Internal, sets STP state. On BSD-like, it is required to specify the
STP physical interface
'''
kernel = __grains__['kernel']
if kernel == 'NetBSD':
cmd = _tool_path('brconfig')
else:
cmd = _tool_path('ifconfig')
if not br or not iface... | [
"Internal",
"sets",
"STP",
"state",
".",
"On",
"BSD",
"-",
"like",
"it",
"is",
"required",
"to",
"specify",
"the",
"STP",
"physical",
"interface"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L290-L305 | [
"def",
"_bsd_stp",
"(",
"br",
",",
"state",
",",
"iface",
")",
":",
"kernel",
"=",
"__grains__",
"[",
"'kernel'",
"]",
"if",
"kernel",
"==",
"'NetBSD'",
":",
"cmd",
"=",
"_tool_path",
"(",
"'brconfig'",
")",
"else",
":",
"cmd",
"=",
"_tool_path",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _os_dispatch | Internal, dispatches functions by operating system | salt/modules/bridge.py | def _os_dispatch(func, *args, **kwargs):
'''
Internal, dispatches functions by operating system
'''
if __grains__['kernel'] in SUPPORTED_BSD_LIKE:
kernel = 'bsd'
else:
kernel = __grains__['kernel'].lower()
_os_func = getattr(sys.modules[__name__], '_{0}_{1}'.format(kernel, func)... | def _os_dispatch(func, *args, **kwargs):
'''
Internal, dispatches functions by operating system
'''
if __grains__['kernel'] in SUPPORTED_BSD_LIKE:
kernel = 'bsd'
else:
kernel = __grains__['kernel'].lower()
_os_func = getattr(sys.modules[__name__], '_{0}_{1}'.format(kernel, func)... | [
"Internal",
"dispatches",
"functions",
"by",
"operating",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L308-L320 | [
"def",
"_os_dispatch",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"__grains__",
"[",
"'kernel'",
"]",
"in",
"SUPPORTED_BSD_LIKE",
":",
"kernel",
"=",
"'bsd'",
"else",
":",
"kernel",
"=",
"__grains__",
"[",
"'kernel'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | Returns the machine's bridges list
CLI Example:
.. code-block:: bash
salt '*' bridge.list | salt/modules/bridge.py | def list_():
'''
Returns the machine's bridges list
CLI Example:
.. code-block:: bash
salt '*' bridge.list
'''
brs = _os_dispatch('brshow')
if not brs:
return None
brlist = []
for br in brs:
brlist.append(br)
return brlist | def list_():
'''
Returns the machine's bridges list
CLI Example:
.. code-block:: bash
salt '*' bridge.list
'''
brs = _os_dispatch('brshow')
if not brs:
return None
brlist = []
for br in brs:
brlist.append(br)
return brlist | [
"Returns",
"the",
"machine",
"s",
"bridges",
"list"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L342-L359 | [
"def",
"list_",
"(",
")",
":",
"brs",
"=",
"_os_dispatch",
"(",
"'brshow'",
")",
"if",
"not",
"brs",
":",
"return",
"None",
"brlist",
"=",
"[",
"]",
"for",
"br",
"in",
"brs",
":",
"brlist",
".",
"append",
"(",
"br",
")",
"return",
"brlist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_interfaces | Returns the bridge to which the interfaces are bond to
CLI Example:
.. code-block:: bash
salt '*' bridge.find_interfaces eth0 [eth1...] | salt/modules/bridge.py | def find_interfaces(*args):
'''
Returns the bridge to which the interfaces are bond to
CLI Example:
.. code-block:: bash
salt '*' bridge.find_interfaces eth0 [eth1...]
'''
brs = _os_dispatch('brshow')
if not brs:
return None
iflist = {}
for iface in args:
... | def find_interfaces(*args):
'''
Returns the bridge to which the interfaces are bond to
CLI Example:
.. code-block:: bash
salt '*' bridge.find_interfaces eth0 [eth1...]
'''
brs = _os_dispatch('brshow')
if not brs:
return None
iflist = {}
for iface in args:
... | [
"Returns",
"the",
"bridge",
"to",
"which",
"the",
"interfaces",
"are",
"bond",
"to"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L380-L404 | [
"def",
"find_interfaces",
"(",
"*",
"args",
")",
":",
"brs",
"=",
"_os_dispatch",
"(",
"'brshow'",
")",
"if",
"not",
"brs",
":",
"return",
"None",
"iflist",
"=",
"{",
"}",
"for",
"iface",
"in",
"args",
":",
"for",
"br",
"in",
"brs",
":",
"try",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stp | Sets Spanning Tree Protocol state for a bridge
CLI Example:
.. code-block:: bash
salt '*' bridge.stp br0 enable
salt '*' bridge.stp br0 disable
For BSD-like operating systems, it is required to add the interface on
which to enable the STP.
CLI Example:
.. code-block:: bash
... | salt/modules/bridge.py | def stp(br=None, state='disable', iface=None):
'''
Sets Spanning Tree Protocol state for a bridge
CLI Example:
.. code-block:: bash
salt '*' bridge.stp br0 enable
salt '*' bridge.stp br0 disable
For BSD-like operating systems, it is required to add the interface on
which to e... | def stp(br=None, state='disable', iface=None):
'''
Sets Spanning Tree Protocol state for a bridge
CLI Example:
.. code-block:: bash
salt '*' bridge.stp br0 enable
salt '*' bridge.stp br0 disable
For BSD-like operating systems, it is required to add the interface on
which to e... | [
"Sets",
"Spanning",
"Tree",
"Protocol",
"state",
"for",
"a",
"bridge"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L459-L488 | [
"def",
"stp",
"(",
"br",
"=",
"None",
",",
"state",
"=",
"'disable'",
",",
"iface",
"=",
"None",
")",
":",
"kernel",
"=",
"__grains__",
"[",
"'kernel'",
"]",
"if",
"kernel",
"==",
"'Linux'",
":",
"states",
"=",
"{",
"'enable'",
":",
"'on'",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.