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 | subvolume_get_default | Get the default subvolume of the filesystem path
path
Mount point for the subvolume
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_get_default /var/volumes/tmp | salt/modules/btrfs.py | def subvolume_get_default(path):
'''
Get the default subvolume of the filesystem path
path
Mount point for the subvolume
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_get_default /var/volumes/tmp
'''
cmd = ['btrfs', 'subvolume', 'get-default', path]
res... | def subvolume_get_default(path):
'''
Get the default subvolume of the filesystem path
path
Mount point for the subvolume
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_get_default /var/volumes/tmp
'''
cmd = ['btrfs', 'subvolume', 'get-default', path]
res... | [
"Get",
"the",
"default",
"subvolume",
"of",
"the",
"filesystem",
"path"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L835-L869 | [
"def",
"subvolume_get_default",
"(",
"path",
")",
":",
"cmd",
"=",
"[",
"'btrfs'",
",",
"'subvolume'",
",",
"'get-default'",
",",
"path",
"]",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _pop | Helper for the line parser.
If key is a prefix of line, will remove ir from the line and will
extract the value (space separation), and the rest of the line.
If use_rest is True, the value will be the rest of the line.
Return a tuple with the value and the rest of the line. | salt/modules/btrfs.py | def _pop(line, key, use_rest):
'''
Helper for the line parser.
If key is a prefix of line, will remove ir from the line and will
extract the value (space separation), and the rest of the line.
If use_rest is True, the value will be the rest of the line.
Return a tuple with the value and the r... | def _pop(line, key, use_rest):
'''
Helper for the line parser.
If key is a prefix of line, will remove ir from the line and will
extract the value (space separation), and the rest of the line.
If use_rest is True, the value will be the rest of the line.
Return a tuple with the value and the r... | [
"Helper",
"for",
"the",
"line",
"parser",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L872-L891 | [
"def",
"_pop",
"(",
"line",
",",
"key",
",",
"use_rest",
")",
":",
"value",
"=",
"None",
"if",
"line",
".",
"startswith",
"(",
"key",
")",
":",
"line",
"=",
"line",
"[",
"len",
"(",
"key",
")",
":",
"]",
".",
"strip",
"(",
")",
"if",
"use_rest"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_list | List the subvolumes present in the filesystem.
path
Mount point for the subvolume
parent_id
Print parent ID
absolute
Print all the subvolumes in the filesystem and distinguish
between absolute and relative path with respect to the given
<path>
ogeneration
... | salt/modules/btrfs.py | def subvolume_list(path, parent_id=False, absolute=False,
ogeneration=False, generation=False,
subvolumes=False, uuid=False, parent_uuid=False,
sent_subvolume_uuid=False, snapshots=False,
readonly=False, deleted=False, generation_cmp=None,
... | def subvolume_list(path, parent_id=False, absolute=False,
ogeneration=False, generation=False,
subvolumes=False, uuid=False, parent_uuid=False,
sent_subvolume_uuid=False, snapshots=False,
readonly=False, deleted=False, generation_cmp=None,
... | [
"List",
"the",
"subvolumes",
"present",
"in",
"the",
"filesystem",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L894-L1031 | [
"def",
"subvolume_list",
"(",
"path",
",",
"parent_id",
"=",
"False",
",",
"absolute",
"=",
"False",
",",
"ogeneration",
"=",
"False",
",",
"generation",
"=",
"False",
",",
"subvolumes",
"=",
"False",
",",
"uuid",
"=",
"False",
",",
"parent_uuid",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_set_default | Set the subvolume as default
subvolid
ID of the new default subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_set_default 257 /var/volumes/tmp | salt/modules/btrfs.py | def subvolume_set_default(subvolid, path):
'''
Set the subvolume as default
subvolid
ID of the new default subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_set_default 257 /var/volumes/tmp
'''
cmd = ['b... | def subvolume_set_default(subvolid, path):
'''
Set the subvolume as default
subvolid
ID of the new default subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_set_default 257 /var/volumes/tmp
'''
cmd = ['b... | [
"Set",
"the",
"subvolume",
"as",
"default"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L1034-L1055 | [
"def",
"subvolume_set_default",
"(",
"subvolid",
",",
"path",
")",
":",
"cmd",
"=",
"[",
"'btrfs'",
",",
"'subvolume'",
",",
"'set-default'",
",",
"subvolid",
",",
"path",
"]",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"salt",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_show | Show information of a given subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_show /var/volumes/tmp | salt/modules/btrfs.py | def subvolume_show(path):
'''
Show information of a given subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_show /var/volumes/tmp
'''
cmd = ['btrfs', 'subvolume', 'show', path]
res = __salt__['cmd.run_all'](cmd)... | def subvolume_show(path):
'''
Show information of a given subvolume
path
Mount point for the filesystem
CLI Example:
.. code-block:: bash
salt '*' btrfs.subvolume_show /var/volumes/tmp
'''
cmd = ['btrfs', 'subvolume', 'show', path]
res = __salt__['cmd.run_all'](cmd)... | [
"Show",
"information",
"of",
"a",
"given",
"subvolume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L1058-L1088 | [
"def",
"subvolume_show",
"(",
"path",
")",
":",
"cmd",
"=",
"[",
"'btrfs'",
",",
"'subvolume'",
",",
"'show'",
",",
"path",
"]",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"salt",
".",
"utils",
".",
"fsutils",
".",
"_verify_run... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_snapshot | Create a snapshot of a source subvolume
source
Source subvolume from where to create the snapshot
dest
If only dest is given, the subvolume will be named as the
basename of the source
name
Name of the snapshot
read_only
Create a read only snapshot
CLI Exam... | salt/modules/btrfs.py | def subvolume_snapshot(source, dest=None, name=None, read_only=False):
'''
Create a snapshot of a source subvolume
source
Source subvolume from where to create the snapshot
dest
If only dest is given, the subvolume will be named as the
basename of the source
name
Na... | def subvolume_snapshot(source, dest=None, name=None, read_only=False):
'''
Create a snapshot of a source subvolume
source
Source subvolume from where to create the snapshot
dest
If only dest is given, the subvolume will be named as the
basename of the source
name
Na... | [
"Create",
"a",
"snapshot",
"of",
"a",
"source",
"subvolume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L1091-L1131 | [
"def",
"subvolume_snapshot",
"(",
"source",
",",
"dest",
"=",
"None",
",",
"name",
"=",
"None",
",",
"read_only",
"=",
"False",
")",
":",
"if",
"not",
"dest",
"and",
"not",
"name",
":",
"raise",
"CommandExecutionError",
"(",
"'Provide parameter dest, name, or ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subvolume_sync | Wait until given subvolume are completely removed from the
filesystem after deletion.
path
Mount point for the filesystem
subvolids
List of IDs of subvolumes to wait for
sleep
Sleep N seconds betwenn checks (default: 1)
CLI Example:
.. code-block:: bash
salt... | salt/modules/btrfs.py | def subvolume_sync(path, subvolids=None, sleep=None):
'''
Wait until given subvolume are completely removed from the
filesystem after deletion.
path
Mount point for the filesystem
subvolids
List of IDs of subvolumes to wait for
sleep
Sleep N seconds betwenn checks (def... | def subvolume_sync(path, subvolids=None, sleep=None):
'''
Wait until given subvolume are completely removed from the
filesystem after deletion.
path
Mount point for the filesystem
subvolids
List of IDs of subvolumes to wait for
sleep
Sleep N seconds betwenn checks (def... | [
"Wait",
"until",
"given",
"subvolume",
"are",
"completely",
"removed",
"from",
"the",
"filesystem",
"after",
"deletion",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/btrfs.py#L1134-L1169 | [
"def",
"subvolume_sync",
"(",
"path",
",",
"subvolids",
"=",
"None",
",",
"sleep",
"=",
"None",
")",
":",
"if",
"subvolids",
"and",
"type",
"(",
"subvolids",
")",
"is",
"not",
"list",
":",
"raise",
"CommandExecutionError",
"(",
"'Subvolids parameter must be a ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add | Add a user to the minion.
Args:
name (str): User name
password (str, optional): User's password in plain text.
fullname (str, optional): The user's full name.
description (str, optional): A brief description of the user account.
groups (str, optional): A list of groups t... | salt/modules/win_useradd.py | def add(name,
password=None,
fullname=None,
description=None,
groups=None,
home=None,
homedrive=None,
profile=None,
logonscript=None):
'''
Add a user to the minion.
Args:
name (str): User name
password (str, optional): User's ... | def add(name,
password=None,
fullname=None,
description=None,
groups=None,
home=None,
homedrive=None,
profile=None,
logonscript=None):
'''
Add a user to the minion.
Args:
name (str): User name
password (str, optional): User's ... | [
"Add",
"a",
"user",
"to",
"the",
"minion",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L99-L182 | [
"def",
"add",
"(",
"name",
",",
"password",
"=",
"None",
",",
"fullname",
"=",
"None",
",",
"description",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"home",
"=",
"None",
",",
"homedrive",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"logonscrip... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update | Updates settings for the windows user. Name is the only required parameter.
Settings will only be changed if the parameter is passed a value.
.. versionadded:: 2015.8.0
Args:
name (str): The user name to update.
password (str, optional): New user password in plain text.
fullname ... | salt/modules/win_useradd.py | def update(name,
password=None,
fullname=None,
description=None,
home=None,
homedrive=None,
logonscript=None,
profile=None,
expiration_date=None,
expired=None,
account_disabled=None,
unlock_account=N... | def update(name,
password=None,
fullname=None,
description=None,
home=None,
homedrive=None,
logonscript=None,
profile=None,
expiration_date=None,
expired=None,
account_disabled=None,
unlock_account=N... | [
"Updates",
"settings",
"for",
"the",
"windows",
"user",
".",
"Name",
"is",
"the",
"only",
"required",
"parameter",
".",
"Settings",
"will",
"only",
"be",
"changed",
"if",
"the",
"parameter",
"is",
"passed",
"a",
"value",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L185-L337 | [
"def",
"update",
"(",
"name",
",",
"password",
"=",
"None",
",",
"fullname",
"=",
"None",
",",
"description",
"=",
"None",
",",
"home",
"=",
"None",
",",
"homedrive",
"=",
"None",
",",
"logonscript",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"ex... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Remove a user from the minion
Args:
name (str): The name of the user to delete
purge (bool, optional): Boolean value indicating that the user profile
should also be removed when the user account is deleted. If set to
True the profile will be removed. Default is False.
... | salt/modules/win_useradd.py | def delete(name,
purge=False,
force=False):
'''
Remove a user from the minion
Args:
name (str): The name of the user to delete
purge (bool, optional): Boolean value indicating that the user profile
should also be removed when the user account is deleted. I... | def delete(name,
purge=False,
force=False):
'''
Remove a user from the minion
Args:
name (str): The name of the user to delete
purge (bool, optional): Boolean value indicating that the user profile
should also be removed when the user account is deleted. I... | [
"Remove",
"a",
"user",
"from",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L340-L439 | [
"def",
"delete",
"(",
"name",
",",
"purge",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"# Check if the user exists",
"try",
":",
"user_info",
"=",
"win32net",
".",
"Ne... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getUserSid | Get the Security ID for the user
Args:
username (str): The user name for which to look up the SID
Returns:
str: The user SID
CLI Example:
.. code-block:: bash
salt '*' user.getUserSid jsnuffy | salt/modules/win_useradd.py | def getUserSid(username):
'''
Get the Security ID for the user
Args:
username (str): The user name for which to look up the SID
Returns:
str: The user SID
CLI Example:
.. code-block:: bash
salt '*' user.getUserSid jsnuffy
'''
if six.PY2:
username = _t... | def getUserSid(username):
'''
Get the Security ID for the user
Args:
username (str): The user name for which to look up the SID
Returns:
str: The user SID
CLI Example:
.. code-block:: bash
salt '*' user.getUserSid jsnuffy
'''
if six.PY2:
username = _t... | [
"Get",
"the",
"Security",
"ID",
"for",
"the",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L442-L467 | [
"def",
"getUserSid",
"(",
"username",
")",
":",
"if",
"six",
".",
"PY2",
":",
"username",
"=",
"_to_unicode",
"(",
"username",
")",
"domain",
"=",
"win32api",
".",
"GetComputerName",
"(",
")",
"if",
"username",
".",
"find",
"(",
"'\\\\'",
")",
"!=",
"-... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | addgroup | Add user to a group
Args:
name (str): The user name to add to the group
group (str): The name of the group to which to add the user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' user.addgroup jsnuffy 'Power Users' | salt/modules/win_useradd.py | def addgroup(name, group):
'''
Add user to a group
Args:
name (str): The user name to add to the group
group (str): The name of the group to which to add the user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' u... | def addgroup(name, group):
'''
Add user to a group
Args:
name (str): The user name to add to the group
group (str): The name of the group to which to add the user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' u... | [
"Add",
"user",
"to",
"a",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L491-L525 | [
"def",
"addgroup",
"(",
"name",
",",
"group",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"group",
"=",
"_to_unicode",
"(",
"group",
")",
"name",
"=",
"_cmd_quote",
"(",
"name",
")",
"group",
"=",
"_cmd_quote... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chhome | Change the home directory of the user, pass True for persist to move files
to the new home directory if the old home directory exist.
Args:
name (str): The name of the user whose home directory you wish to change
home (str): The new location of the home directory
Returns:
bool: Tr... | salt/modules/win_useradd.py | def chhome(name, home, **kwargs):
'''
Change the home directory of the user, pass True for persist to move files
to the new home directory if the old home directory exist.
Args:
name (str): The name of the user whose home directory you wish to change
home (str): The new location of the... | def chhome(name, home, **kwargs):
'''
Change the home directory of the user, pass True for persist to move files
to the new home directory if the old home directory exist.
Args:
name (str): The name of the user whose home directory you wish to change
home (str): The new location of the... | [
"Change",
"the",
"home",
"directory",
"of",
"the",
"user",
"pass",
"True",
"for",
"persist",
"to",
"move",
"files",
"to",
"the",
"new",
"home",
"directory",
"if",
"the",
"old",
"home",
"directory",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L567-L612 | [
"def",
"chhome",
"(",
"name",
",",
"home",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"home",
"=",
"_to_unicode",
"(",
"home",
")",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"arg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chgroups | Change the groups this user belongs to, add append=False to make the user a
member of only the specified groups
Args:
name (str): The user name for which to change groups
groups (str, list): A single group or a list of groups to assign to the
user. For multiple groups this can be a... | salt/modules/win_useradd.py | def chgroups(name, groups, append=True):
'''
Change the groups this user belongs to, add append=False to make the user a
member of only the specified groups
Args:
name (str): The user name for which to change groups
groups (str, list): A single group or a list of groups to assign to th... | def chgroups(name, groups, append=True):
'''
Change the groups this user belongs to, add append=False to make the user a
member of only the specified groups
Args:
name (str): The user name for which to change groups
groups (str, list): A single group or a list of groups to assign to th... | [
"Change",
"the",
"groups",
"this",
"user",
"belongs",
"to",
"add",
"append",
"=",
"False",
"to",
"make",
"the",
"user",
"a",
"member",
"of",
"only",
"the",
"specified",
"groups"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L657-L716 | [
"def",
"chgroups",
"(",
"name",
",",
"groups",
",",
"append",
"=",
"True",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"if",
"isinstance",
"(",
"groups",
",",
"string_types",
")",
":",
"groups",
"=",
"groups"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info | Return user information
Args:
name (str): Username for which to display information
Returns:
dict: A dictionary containing user information
- fullname
- username
- SID
- passwd (will always return None)
- comment (same as description,... | salt/modules/win_useradd.py | def info(name):
'''
Return user information
Args:
name (str): Username for which to display information
Returns:
dict: A dictionary containing user information
- fullname
- username
- SID
- passwd (will always return None)
- c... | def info(name):
'''
Return user information
Args:
name (str): Username for which to display information
Returns:
dict: A dictionary containing user information
- fullname
- username
- SID
- passwd (will always return None)
- c... | [
"Return",
"user",
"information"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L719-L825 | [
"def",
"info",
"(",
"name",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"ret",
"=",
"{",
"}",
"items",
"=",
"{",
"}",
"try",
":",
"items",
"=",
"win32net",
".",
"NetUserGetInfo",
"(",
"None",
",",
"name",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_userprofile_from_registry | In case net user doesn't return the userprofile we can get it from the
registry
Args:
user (str): The user name, used in debug message
sid (str): The sid to lookup in the registry
Returns:
str: Profile directory | salt/modules/win_useradd.py | def _get_userprofile_from_registry(user, sid):
'''
In case net user doesn't return the userprofile we can get it from the
registry
Args:
user (str): The user name, used in debug message
sid (str): The sid to lookup in the registry
Returns:
str: Profile directory
'''
... | def _get_userprofile_from_registry(user, sid):
'''
In case net user doesn't return the userprofile we can get it from the
registry
Args:
user (str): The user name, used in debug message
sid (str): The sid to lookup in the registry
Returns:
str: Profile directory
'''
... | [
"In",
"case",
"net",
"user",
"doesn",
"t",
"return",
"the",
"userprofile",
"we",
"can",
"get",
"it",
"from",
"the",
"registry"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L828-L850 | [
"def",
"_get_userprofile_from_registry",
"(",
"user",
",",
"sid",
")",
":",
"profile_dir",
"=",
"__utils__",
"[",
"'reg.read_value'",
"]",
"(",
"'HKEY_LOCAL_MACHINE'",
",",
"'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\ProfileList\\\\{0}'",
".",
"format",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_groups | Return a list of groups the named user belongs to
Args:
name (str): The user name for which to list groups
Returns:
list: A list of groups to which the user belongs
CLI Example:
.. code-block:: bash
salt '*' user.list_groups foo | salt/modules/win_useradd.py | def list_groups(name):
'''
Return a list of groups the named user belongs to
Args:
name (str): The user name for which to list groups
Returns:
list: A list of groups to which the user belongs
CLI Example:
.. code-block:: bash
salt '*' user.list_groups foo
'''
... | def list_groups(name):
'''
Return a list of groups the named user belongs to
Args:
name (str): The user name for which to list groups
Returns:
list: A list of groups to which the user belongs
CLI Example:
.. code-block:: bash
salt '*' user.list_groups foo
'''
... | [
"Return",
"a",
"list",
"of",
"groups",
"the",
"named",
"user",
"belongs",
"to"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L853-L880 | [
"def",
"list_groups",
"(",
"name",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"ugrp",
"=",
"set",
"(",
")",
"try",
":",
"user",
"=",
"info",
"(",
"name",
")",
"[",
"'groups'",
"]",
"except",
"KeyError",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getent | Return the list of all info for all users
Args:
refresh (bool, optional): Refresh the cached user information. Useful
when used from within a state function. Default is False.
Returns:
dict: A dictionary containing information about all users on the system
CLI Example:
..... | salt/modules/win_useradd.py | def getent(refresh=False):
'''
Return the list of all info for all users
Args:
refresh (bool, optional): Refresh the cached user information. Useful
when used from within a state function. Default is False.
Returns:
dict: A dictionary containing information about all users ... | def getent(refresh=False):
'''
Return the list of all info for all users
Args:
refresh (bool, optional): Refresh the cached user information. Useful
when used from within a state function. Default is False.
Returns:
dict: A dictionary containing information about all users ... | [
"Return",
"the",
"list",
"of",
"all",
"info",
"for",
"all",
"users"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L883-L919 | [
"def",
"getent",
"(",
"refresh",
"=",
"False",
")",
":",
"if",
"'user.getent'",
"in",
"__context__",
"and",
"not",
"refresh",
":",
"return",
"__context__",
"[",
"'user.getent'",
"]",
"ret",
"=",
"[",
"]",
"for",
"user",
"in",
"__salt__",
"[",
"'user.list_u... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_users | Return a list of all users on Windows
Returns:
list: A list of all users on the system
CLI Example:
.. code-block:: bash
salt '*' user.list_users | salt/modules/win_useradd.py | def list_users():
'''
Return a list of all users on Windows
Returns:
list: A list of all users on the system
CLI Example:
.. code-block:: bash
salt '*' user.list_users
'''
res = 0
user_list = []
dowhile = True
try:
while res or dowhile:
dow... | def list_users():
'''
Return a list of all users on Windows
Returns:
list: A list of all users on the system
CLI Example:
.. code-block:: bash
salt '*' user.list_users
'''
res = 0
user_list = []
dowhile = True
try:
while res or dowhile:
dow... | [
"Return",
"a",
"list",
"of",
"all",
"users",
"on",
"Windows"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L922-L952 | [
"def",
"list_users",
"(",
")",
":",
"res",
"=",
"0",
"user_list",
"=",
"[",
"]",
"dowhile",
"=",
"True",
"try",
":",
"while",
"res",
"or",
"dowhile",
":",
"dowhile",
"=",
"False",
"(",
"users",
",",
"_",
",",
"res",
")",
"=",
"win32net",
".",
"Ne... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename | Change the username for a named user
Args:
name (str): The user name to change
new_name (str): The new name for the current user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' user.rename jsnuffy jshmoe | salt/modules/win_useradd.py | def rename(name, new_name):
'''
Change the username for a named user
Args:
name (str): The user name to change
new_name (str): The new name for the current user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' use... | def rename(name, new_name):
'''
Change the username for a named user
Args:
name (str): The user name to change
new_name (str): The new name for the current user
Returns:
bool: True if successful, otherwise False
CLI Example:
.. code-block:: bash
salt '*' use... | [
"Change",
"the",
"username",
"for",
"a",
"named",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L955-L1022 | [
"def",
"rename",
"(",
"name",
",",
"new_name",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"new_name",
"=",
"_to_unicode",
"(",
"new_name",
")",
"# Load information for the current name",
"current_info",
"=",
"info",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | current | Get the username that salt-minion is running under. If salt-minion is
running as a service it should return the Local System account. If salt is
running from a command prompt it should return the username that started the
command prompt.
.. versionadded:: 2015.5.6
Args:
sam (bool, optional... | salt/modules/win_useradd.py | def current(sam=False):
'''
Get the username that salt-minion is running under. If salt-minion is
running as a service it should return the Local System account. If salt is
running from a command prompt it should return the username that started the
command prompt.
.. versionadded:: 2015.5.6
... | def current(sam=False):
'''
Get the username that salt-minion is running under. If salt-minion is
running as a service it should return the Local System account. If salt is
running from a command prompt it should return the username that started the
command prompt.
.. versionadded:: 2015.5.6
... | [
"Get",
"the",
"username",
"that",
"salt",
"-",
"minion",
"is",
"running",
"under",
".",
"If",
"salt",
"-",
"minion",
"is",
"running",
"as",
"a",
"service",
"it",
"should",
"return",
"the",
"Local",
"System",
"account",
".",
"If",
"salt",
"is",
"running",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_useradd.py#L1025-L1063 | [
"def",
"current",
"(",
"sam",
"=",
"False",
")",
":",
"try",
":",
"if",
"sam",
":",
"user_name",
"=",
"win32api",
".",
"GetUserNameEx",
"(",
"win32con",
".",
"NameSamCompatible",
")",
"else",
":",
"user_name",
"=",
"win32api",
".",
"GetUserName",
"(",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mac | Validates a mac address | salt/utils/validate/net.py | def mac(addr):
'''
Validates a mac address
'''
valid = re.compile(r'''
(^([0-9A-F]{1,2}[-]){5}([0-9A-F]{1,2})$
|^([0-9A-F]{1,2}[:]){5}([0-9A-F]{1,2})$
|^([0-9A-F]{1,2}[.]){5}([0-9A-F]{1,2})$)
''',
... | def mac(addr):
'''
Validates a mac address
'''
valid = re.compile(r'''
(^([0-9A-F]{1,2}[-]){5}([0-9A-F]{1,2})$
|^([0-9A-F]{1,2}[:]){5}([0-9A-F]{1,2})$
|^([0-9A-F]{1,2}[.]){5}([0-9A-F]{1,2})$)
''',
... | [
"Validates",
"a",
"mac",
"address"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/validate/net.py#L20-L30 | [
"def",
"mac",
"(",
"addr",
")",
":",
"valid",
"=",
"re",
".",
"compile",
"(",
"r'''\n (^([0-9A-F]{1,2}[-]){5}([0-9A-F]{1,2})$\n |^([0-9A-F]{1,2}[:]){5}([0-9A-F]{1,2})$\n |^([0-9A-F]{1,2}[.]){5}([0-9A-F]{1,2})$)\n ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | __ip_addr | Returns True if the IP address (and optional subnet) are valid, otherwise
returns False. | salt/utils/validate/net.py | def __ip_addr(addr, address_family=socket.AF_INET):
'''
Returns True if the IP address (and optional subnet) are valid, otherwise
returns False.
'''
mask_max = '32'
if address_family == socket.AF_INET6:
mask_max = '128'
try:
if '/' not in addr:
addr = '{addr}/{ma... | def __ip_addr(addr, address_family=socket.AF_INET):
'''
Returns True if the IP address (and optional subnet) are valid, otherwise
returns False.
'''
mask_max = '32'
if address_family == socket.AF_INET6:
mask_max = '128'
try:
if '/' not in addr:
addr = '{addr}/{ma... | [
"Returns",
"True",
"if",
"the",
"IP",
"address",
"(",
"and",
"optional",
"subnet",
")",
"are",
"valid",
"otherwise",
"returns",
"False",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/validate/net.py#L33-L65 | [
"def",
"__ip_addr",
"(",
"addr",
",",
"address_family",
"=",
"socket",
".",
"AF_INET",
")",
":",
"mask_max",
"=",
"'32'",
"if",
"address_family",
"==",
"socket",
".",
"AF_INET6",
":",
"mask_max",
"=",
"'128'",
"try",
":",
"if",
"'/'",
"not",
"in",
"addr"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | netmask | Returns True if the value passed is a valid netmask, otherwise return False | salt/utils/validate/net.py | def netmask(mask):
'''
Returns True if the value passed is a valid netmask, otherwise return False
'''
if not isinstance(mask, string_types):
return False
octets = mask.split('.')
if not len(octets) == 4:
return False
return ipv4_addr(mask) and octets == sorted(octets, reve... | def netmask(mask):
'''
Returns True if the value passed is a valid netmask, otherwise return False
'''
if not isinstance(mask, string_types):
return False
octets = mask.split('.')
if not len(octets) == 4:
return False
return ipv4_addr(mask) and octets == sorted(octets, reve... | [
"Returns",
"True",
"if",
"the",
"value",
"passed",
"is",
"a",
"valid",
"netmask",
"otherwise",
"return",
"False"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/validate/net.py#L92-L103 | [
"def",
"netmask",
"(",
"mask",
")",
":",
"if",
"not",
"isinstance",
"(",
"mask",
",",
"string_types",
")",
":",
"return",
"False",
"octets",
"=",
"mask",
".",
"split",
"(",
"'.'",
")",
"if",
"not",
"len",
"(",
"octets",
")",
"==",
"4",
":",
"return... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _connect | Returns a tuple of (user, host, port) with config, pillar, or default
values assigned to missing values. | salt/modules/memcached.py | def _connect(host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Returns a tuple of (user, host, port) with config, pillar, or default
values assigned to missing values.
'''
if six.text_type(port).isdigit():
return memcache.Client(['{0}:{1}'.format(host, port)], debug=0)
raise SaltInvocationError... | def _connect(host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Returns a tuple of (user, host, port) with config, pillar, or default
values assigned to missing values.
'''
if six.text_type(port).isdigit():
return memcache.Client(['{0}:{1}'.format(host, port)], debug=0)
raise SaltInvocationError... | [
"Returns",
"a",
"tuple",
"of",
"(",
"user",
"host",
"port",
")",
"with",
"config",
"pillar",
"or",
"default",
"values",
"assigned",
"to",
"missing",
"values",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L51-L58 | [
"def",
"_connect",
"(",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
")",
":",
"if",
"six",
".",
"text_type",
"(",
"port",
")",
".",
"isdigit",
"(",
")",
":",
"return",
"memcache",
".",
"Client",
"(",
"[",
"'{0}:{1}'",
".",
"format",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | status | Get memcached status
CLI Example:
.. code-block:: bash
salt '*' memcached.status | salt/modules/memcached.py | def status(host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Get memcached status
CLI Example:
.. code-block:: bash
salt '*' memcached.status
'''
conn = _connect(host, port)
try:
stats = _check_stats(conn)[0]
except (CommandExecutionError, IndexError):
return False
... | def status(host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Get memcached status
CLI Example:
.. code-block:: bash
salt '*' memcached.status
'''
conn = _connect(host, port)
try:
stats = _check_stats(conn)[0]
except (CommandExecutionError, IndexError):
return False
... | [
"Get",
"memcached",
"status"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L74-L90 | [
"def",
"status",
"(",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
")",
":",
"conn",
"=",
"_connect",
"(",
"host",
",",
"port",
")",
"try",
":",
"stats",
"=",
"_check_stats",
"(",
"conn",
")",
"[",
"0",
"]",
"except",
"(",
"CommandE... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get | Retrieve value for a key
CLI Example:
.. code-block:: bash
salt '*' memcached.get <key> | salt/modules/memcached.py | def get(key, host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Retrieve value for a key
CLI Example:
.. code-block:: bash
salt '*' memcached.get <key>
'''
conn = _connect(host, port)
_check_stats(conn)
return conn.get(key) | def get(key, host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Retrieve value for a key
CLI Example:
.. code-block:: bash
salt '*' memcached.get <key>
'''
conn = _connect(host, port)
_check_stats(conn)
return conn.get(key) | [
"Retrieve",
"value",
"for",
"a",
"key"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L93-L105 | [
"def",
"get",
"(",
"key",
",",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
")",
":",
"conn",
"=",
"_connect",
"(",
"host",
",",
"port",
")",
"_check_stats",
"(",
"conn",
")",
"return",
"conn",
".",
"get",
"(",
"key",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_ | Set a key on the memcached server, overwriting the value if it exists.
CLI Example:
.. code-block:: bash
salt '*' memcached.set <key> <value> | salt/modules/memcached.py | def set_(key,
value,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME,
min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
'''
Set a key on the memcached server, overwriting the value if it exists.
CLI Example:
.. code-block:: bash
salt '*' memcache... | def set_(key,
value,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME,
min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
'''
Set a key on the memcached server, overwriting the value if it exists.
CLI Example:
.. code-block:: bash
salt '*' memcache... | [
"Set",
"a",
"key",
"on",
"the",
"memcached",
"server",
"overwriting",
"the",
"value",
"if",
"it",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L108-L129 | [
"def",
"set_",
"(",
"key",
",",
"value",
",",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
",",
"time",
"=",
"DEFAULT_TIME",
",",
"min_compress_len",
"=",
"DEFAULT_MIN_COMPRESS_LEN",
")",
":",
"if",
"not",
"isinstance",
"(",
"time",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete a key from memcache server
CLI Example:
.. code-block:: bash
salt '*' memcached.delete <key> | salt/modules/memcached.py | def delete(key,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME):
'''
Delete a key from memcache server
CLI Example:
.. code-block:: bash
salt '*' memcached.delete <key>
'''
if not isinstance(time, six.integer_types):
raise SaltInvocati... | def delete(key,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME):
'''
Delete a key from memcache server
CLI Example:
.. code-block:: bash
salt '*' memcached.delete <key>
'''
if not isinstance(time, six.integer_types):
raise SaltInvocati... | [
"Delete",
"a",
"key",
"from",
"memcache",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L132-L149 | [
"def",
"delete",
"(",
"key",
",",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
",",
"time",
"=",
"DEFAULT_TIME",
")",
":",
"if",
"not",
"isinstance",
"(",
"time",
",",
"six",
".",
"integer_types",
")",
":",
"raise",
"SaltInvocationError",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | replace | Replace a key on the memcached server. This only succeeds if the key
already exists. This is the opposite of :mod:`memcached.add
<salt.modules.memcached.add>`
CLI Example:
.. code-block:: bash
salt '*' memcached.replace <key> <value> | salt/modules/memcached.py | def replace(key,
value,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME,
min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
'''
Replace a key on the memcached server. This only succeeds if the key
already exists. This is the opposite of :mod:`memc... | def replace(key,
value,
host=DEFAULT_HOST,
port=DEFAULT_PORT,
time=DEFAULT_TIME,
min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
'''
Replace a key on the memcached server. This only succeeds if the key
already exists. This is the opposite of :mod:`memc... | [
"Replace",
"a",
"key",
"on",
"the",
"memcached",
"server",
".",
"This",
"only",
"succeeds",
"if",
"the",
"key",
"already",
"exists",
".",
"This",
"is",
"the",
"opposite",
"of",
":",
"mod",
":",
"memcached",
".",
"add",
"<salt",
".",
"modules",
".",
"me... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L182-L210 | [
"def",
"replace",
"(",
"key",
",",
"value",
",",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
",",
"time",
"=",
"DEFAULT_TIME",
",",
"min_compress_len",
"=",
"DEFAULT_MIN_COMPRESS_LEN",
")",
":",
"if",
"not",
"isinstance",
"(",
"time",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | increment | Increment the value of a key
CLI Example:
.. code-block:: bash
salt '*' memcached.increment <key>
salt '*' memcached.increment <key> 2 | salt/modules/memcached.py | def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Increment the value of a key
CLI Example:
.. code-block:: bash
salt '*' memcached.increment <key>
salt '*' memcached.increment <key> 2
'''
conn = _connect(host, port)
_check_stats(conn)
cur = get(ke... | def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT):
'''
Increment the value of a key
CLI Example:
.. code-block:: bash
salt '*' memcached.increment <key>
salt '*' memcached.increment <key> 2
'''
conn = _connect(host, port)
_check_stats(conn)
cur = get(ke... | [
"Increment",
"the",
"value",
"of",
"a",
"key"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/memcached.py#L213-L239 | [
"def",
"increment",
"(",
"key",
",",
"delta",
"=",
"1",
",",
"host",
"=",
"DEFAULT_HOST",
",",
"port",
"=",
"DEFAULT_PORT",
")",
":",
"conn",
"=",
"_connect",
"(",
"host",
",",
"port",
")",
"_check_stats",
"(",
"conn",
")",
"cur",
"=",
"get",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _publish | Publish a command "from the minion out to other minions". In reality, the
minion does not execute this function, it is executed by the master. Thus,
no access control is enabled, as minions cannot initiate publishes
themselves.
Salt-ssh publishes will default to whichever roster was used for the
in... | salt/client/ssh/wrapper/publish.py | def _publish(tgt,
fun,
arg=None,
tgt_type='glob',
returner='',
timeout=None,
form='clean',
roster=None):
'''
Publish a command "from the minion out to other minions". In reality, the
minion does not execute this funct... | def _publish(tgt,
fun,
arg=None,
tgt_type='glob',
returner='',
timeout=None,
form='clean',
roster=None):
'''
Publish a command "from the minion out to other minions". In reality, the
minion does not execute this funct... | [
"Publish",
"a",
"command",
"from",
"the",
"minion",
"out",
"to",
"other",
"minions",
".",
"In",
"reality",
"the",
"minion",
"does",
"not",
"execute",
"this",
"function",
"it",
"is",
"executed",
"by",
"the",
"master",
".",
"Thus",
"no",
"access",
"control",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/publish.py#L25-L105 | [
"def",
"_publish",
"(",
"tgt",
",",
"fun",
",",
"arg",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"returner",
"=",
"''",
",",
"timeout",
"=",
"None",
",",
"form",
"=",
"'clean'",
",",
"roster",
"=",
"None",
")",
":",
"if",
"fun",
".",
"sta... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | publish | Publish a command "from the minion out to other minions". In reality, the
minion does not execute this function, it is executed by the master. Thus,
no access control is enabled, as minions cannot initiate publishes
themselves.
Salt-ssh publishes will default to whichever roster was used for the
i... | salt/client/ssh/wrapper/publish.py | def publish(tgt,
fun,
arg=None,
tgt_type='glob',
returner='',
timeout=5,
roster=None):
'''
Publish a command "from the minion out to other minions". In reality, the
minion does not execute this function, it is executed by the master. Th... | def publish(tgt,
fun,
arg=None,
tgt_type='glob',
returner='',
timeout=5,
roster=None):
'''
Publish a command "from the minion out to other minions". In reality, the
minion does not execute this function, it is executed by the master. Th... | [
"Publish",
"a",
"command",
"from",
"the",
"minion",
"out",
"to",
"other",
"minions",
".",
"In",
"reality",
"the",
"minion",
"does",
"not",
"execute",
"this",
"function",
"it",
"is",
"executed",
"by",
"the",
"master",
".",
"Thus",
"no",
"access",
"control",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/publish.py#L108-L180 | [
"def",
"publish",
"(",
"tgt",
",",
"fun",
",",
"arg",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"returner",
"=",
"''",
",",
"timeout",
"=",
"5",
",",
"roster",
"=",
"None",
")",
":",
"return",
"_publish",
"(",
"tgt",
",",
"fun",
",",
"arg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | runner | Execute a runner on the master and return the data from the runnr function
CLI Example:
.. code-block:: bash
salt-ssh '*' publish.runner jobs.lookup_jid 20140916125524463507 | salt/client/ssh/wrapper/publish.py | def runner(fun, arg=None, timeout=5):
'''
Execute a runner on the master and return the data from the runnr function
CLI Example:
.. code-block:: bash
salt-ssh '*' publish.runner jobs.lookup_jid 20140916125524463507
'''
# Form args as list
if not isinstance(arg, list):
arg... | def runner(fun, arg=None, timeout=5):
'''
Execute a runner on the master and return the data from the runnr function
CLI Example:
.. code-block:: bash
salt-ssh '*' publish.runner jobs.lookup_jid 20140916125524463507
'''
# Form args as list
if not isinstance(arg, list):
arg... | [
"Execute",
"a",
"runner",
"on",
"the",
"master",
"and",
"return",
"the",
"data",
"from",
"the",
"runnr",
"function"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/publish.py#L221-L241 | [
"def",
"runner",
"(",
"fun",
",",
"arg",
"=",
"None",
",",
"timeout",
"=",
"5",
")",
":",
"# Form args as list",
"if",
"not",
"isinstance",
"(",
"arg",
",",
"list",
")",
":",
"arg",
"=",
"[",
"salt",
".",
"utils",
".",
"args",
".",
"yamlify_arg",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RackspaceQueues.create | Create RackSpace Queue. | salt/utils/openstack/pyrax/queues.py | def create(self, qname):
'''
Create RackSpace Queue.
'''
try:
if self.exists(qname):
log.error('Queues "%s" already exists. Nothing done.', qname)
return True
self.conn.create(qname)
return True
except pyrax.ex... | def create(self, qname):
'''
Create RackSpace Queue.
'''
try:
if self.exists(qname):
log.error('Queues "%s" already exists. Nothing done.', qname)
return True
self.conn.create(qname)
return True
except pyrax.ex... | [
"Create",
"RackSpace",
"Queue",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/pyrax/queues.py#L25-L40 | [
"def",
"create",
"(",
"self",
",",
"qname",
")",
":",
"try",
":",
"if",
"self",
".",
"exists",
"(",
"qname",
")",
":",
"log",
".",
"error",
"(",
"'Queues \"%s\" already exists. Nothing done.'",
",",
"qname",
")",
"return",
"True",
"self",
".",
"conn",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RackspaceQueues.delete | Delete an existings RackSpace Queue. | salt/utils/openstack/pyrax/queues.py | def delete(self, qname):
'''
Delete an existings RackSpace Queue.
'''
try:
q = self.exists(qname)
if not q:
return False
queue = self.show(qname)
if queue:
queue.delete()
except pyrax.exceptions as er... | def delete(self, qname):
'''
Delete an existings RackSpace Queue.
'''
try:
q = self.exists(qname)
if not q:
return False
queue = self.show(qname)
if queue:
queue.delete()
except pyrax.exceptions as er... | [
"Delete",
"an",
"existings",
"RackSpace",
"Queue",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/pyrax/queues.py#L42-L58 | [
"def",
"delete",
"(",
"self",
",",
"qname",
")",
":",
"try",
":",
"q",
"=",
"self",
".",
"exists",
"(",
"qname",
")",
"if",
"not",
"q",
":",
"return",
"False",
"queue",
"=",
"self",
".",
"show",
"(",
"qname",
")",
"if",
"queue",
":",
"queue",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RackspaceQueues.exists | Check to see if a Queue exists. | salt/utils/openstack/pyrax/queues.py | def exists(self, qname):
'''
Check to see if a Queue exists.
'''
try:
# First if not exists() -> exit
if self.conn.queue_exists(qname):
return True
return False
except pyrax.exceptions as err_msg:
log.error('RackSpac... | def exists(self, qname):
'''
Check to see if a Queue exists.
'''
try:
# First if not exists() -> exit
if self.conn.queue_exists(qname):
return True
return False
except pyrax.exceptions as err_msg:
log.error('RackSpac... | [
"Check",
"to",
"see",
"if",
"a",
"Queue",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/pyrax/queues.py#L60-L73 | [
"def",
"exists",
"(",
"self",
",",
"qname",
")",
":",
"try",
":",
"# First if not exists() -> exit",
"if",
"self",
".",
"conn",
".",
"queue_exists",
"(",
"qname",
")",
":",
"return",
"True",
"return",
"False",
"except",
"pyrax",
".",
"exceptions",
"as",
"e... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RackspaceQueues.show | Show information about Queue | salt/utils/openstack/pyrax/queues.py | def show(self, qname):
'''
Show information about Queue
'''
try:
# First if not exists() -> exit
if not self.conn.queue_exists(qname):
return {}
# If exist, search the queue to return the Queue Object
for queue in self.conn.... | def show(self, qname):
'''
Show information about Queue
'''
try:
# First if not exists() -> exit
if not self.conn.queue_exists(qname):
return {}
# If exist, search the queue to return the Queue Object
for queue in self.conn.... | [
"Show",
"information",
"about",
"Queue"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/pyrax/queues.py#L75-L90 | [
"def",
"show",
"(",
"self",
",",
"qname",
")",
":",
"try",
":",
"# First if not exists() -> exit",
"if",
"not",
"self",
".",
"conn",
".",
"queue_exists",
"(",
"qname",
")",
":",
"return",
"{",
"}",
"# If exist, search the queue to return the Queue Object",
"for",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_dirs | Return a list of startup dirs | salt/modules/win_autoruns.py | def _get_dirs(user_dir, startup_dir):
'''
Return a list of startup dirs
'''
try:
users = os.listdir(user_dir)
except WindowsError: # pylint: disable=E0602
users = []
full_dirs = []
for user in users:
full_dir = os.path.join(user_dir, user, startup_dir)
if os... | def _get_dirs(user_dir, startup_dir):
'''
Return a list of startup dirs
'''
try:
users = os.listdir(user_dir)
except WindowsError: # pylint: disable=E0602
users = []
full_dirs = []
for user in users:
full_dir = os.path.join(user_dir, user, startup_dir)
if os... | [
"Return",
"a",
"list",
"of",
"startup",
"dirs"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_autoruns.py#L34-L48 | [
"def",
"_get_dirs",
"(",
"user_dir",
",",
"startup_dir",
")",
":",
"try",
":",
"users",
"=",
"os",
".",
"listdir",
"(",
"user_dir",
")",
"except",
"WindowsError",
":",
"# pylint: disable=E0602",
"users",
"=",
"[",
"]",
"full_dirs",
"=",
"[",
"]",
"for",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | Get a list of automatically running programs
CLI Example:
.. code-block:: bash
salt '*' autoruns.list | salt/modules/win_autoruns.py | def list_():
'''
Get a list of automatically running programs
CLI Example:
.. code-block:: bash
salt '*' autoruns.list
'''
autoruns = {}
# Find autoruns in registry
keys = ['HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
'HKLM\\Software\\Microsoft\\Windows\... | def list_():
'''
Get a list of automatically running programs
CLI Example:
.. code-block:: bash
salt '*' autoruns.list
'''
autoruns = {}
# Find autoruns in registry
keys = ['HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
'HKLM\\Software\\Microsoft\\Windows\... | [
"Get",
"a",
"list",
"of",
"automatically",
"running",
"programs"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_autoruns.py#L51-L90 | [
"def",
"list_",
"(",
")",
":",
"autoruns",
"=",
"{",
"}",
"# Find autoruns in registry",
"keys",
"=",
"[",
"'HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run'",
",",
"'HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run /reg:64'",
",",
"'HKCU\\\\Softw... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ext_pillar | Get pillar data from Vault for the configuration ``conf``. | salt/pillar/vault.py | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
conf,
nesting_key=None):
'''
Get pillar data from Vault for the configuration ``conf``.
'''
comps = conf.split()
paths = [comp for comp in comps if comp.startswith('path=... | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
conf,
nesting_key=None):
'''
Get pillar data from Vault for the configuration ``conf``.
'''
comps = conf.split()
paths = [comp for comp in comps if comp.startswith('path=... | [
"Get",
"pillar",
"data",
"from",
"Vault",
"for",
"the",
"configuration",
"conf",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vault.py#L142-L172 | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"# pylint: disable=W0613",
"pillar",
",",
"# pylint: disable=W0613",
"conf",
",",
"nesting_key",
"=",
"None",
")",
":",
"comps",
"=",
"conf",
".",
"split",
"(",
")",
"paths",
"=",
"[",
"comp",
"for",
"comp",
"in",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | export | Export a file or directory from an SVN repository
name
Address and path to the file or directory to be exported.
target
Name of the target directory where the checkout will put the working
directory
rev : None
The name revision number to checkout. Enable "force" if the dir... | salt/states/svn.py | def export(name,
target=None,
rev=None,
user=None,
username=None,
password=None,
force=False,
overwrite=False,
externals=True,
trust=False,
trust_failures=None):
'''
Export a file or directory from an S... | def export(name,
target=None,
rev=None,
user=None,
username=None,
password=None,
force=False,
overwrite=False,
externals=True,
trust=False,
trust_failures=None):
'''
Export a file or directory from an S... | [
"Export",
"a",
"file",
"or",
"directory",
"from",
"an",
"SVN",
"repository"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/svn.py#L190-L291 | [
"def",
"export",
"(",
"name",
",",
"target",
"=",
"None",
",",
"rev",
"=",
"None",
",",
"user",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"force",
"=",
"False",
",",
"overwrite",
"=",
"False",
",",
"externals",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dirty | Determine if the working directory has been changed. | salt/states/svn.py | def dirty(name,
target,
user=None,
username=None,
password=None,
ignore_unversioned=False):
'''
Determine if the working directory has been changed.
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
return _fail(ret, 'This functi... | def dirty(name,
target,
user=None,
username=None,
password=None,
ignore_unversioned=False):
'''
Determine if the working directory has been changed.
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
return _fail(ret, 'This functi... | [
"Determine",
"if",
"the",
"working",
"directory",
"has",
"been",
"changed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/svn.py#L294-L304 | [
"def",
"dirty",
"(",
"name",
",",
"target",
",",
"user",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"ignore_unversioned",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ext_pillar | Compile pillar data | salt/pillar/saltclass.py | def ext_pillar(minion_id, pillar, *args, **kwargs):
'''
Compile pillar data
'''
# Node definitions path will be retrieved from args (or set to default),
# then added to 'salt_data' dict that is passed to the 'get_pillars'
# function. The dictionary contains:
# - __opts__
# - __sa... | def ext_pillar(minion_id, pillar, *args, **kwargs):
'''
Compile pillar data
'''
# Node definitions path will be retrieved from args (or set to default),
# then added to 'salt_data' dict that is passed to the 'get_pillars'
# function. The dictionary contains:
# - __opts__
# - __sa... | [
"Compile",
"pillar",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/saltclass.py#L30-L65 | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Node definitions path will be retrieved from args (or set to default),",
"# then added to 'salt_data' dict that is passed to the 'get_pillars'",
"# function. The dictionary... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_present | Ensures a container is present.
:param name: Container name
:type name: ``str``
:param profile: The profile key
:type profile: ``str`` | salt/states/libcloud_storage.py | def container_present(name, profile):
'''
Ensures a container is present.
:param name: Container name
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
'''
containers = __salt__['libcloud_storage.list_containers'](profile)
match = [z for z in containers i... | def container_present(name, profile):
'''
Ensures a container is present.
:param name: Container name
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
'''
containers = __salt__['libcloud_storage.list_containers'](profile)
match = [z for z in containers i... | [
"Ensures",
"a",
"container",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_storage.py#L92-L108 | [
"def",
"container_present",
"(",
"name",
",",
"profile",
")",
":",
"containers",
"=",
"__salt__",
"[",
"'libcloud_storage.list_containers'",
"]",
"(",
"profile",
")",
"match",
"=",
"[",
"z",
"for",
"z",
"in",
"containers",
"if",
"z",
"[",
"'name'",
"]",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | object_present | Ensures a object is presnt.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str``
:param profile: The profile key
:type profile: ``str`` | salt/states/libcloud_storage.py | def object_present(container, name, path, profile):
'''
Ensures a object is presnt.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str``
:param profile: The profile k... | def object_present(container, name, path, profile):
'''
Ensures a object is presnt.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str``
:param profile: The profile k... | [
"Ensures",
"a",
"object",
"is",
"presnt",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_storage.py#L130-L151 | [
"def",
"object_present",
"(",
"container",
",",
"name",
",",
"path",
",",
"profile",
")",
":",
"existing_object",
"=",
"__salt__",
"[",
"'libcloud_storage.get_container_object'",
"]",
"(",
"container",
",",
"name",
",",
"profile",
")",
"if",
"existing_object",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | object_absent | Ensures a object is absent.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param profile: The profile key
:type profile: ``str`` | salt/states/libcloud_storage.py | def object_absent(container, name, profile):
'''
Ensures a object is absent.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
'''
existing_object = __salt__... | def object_absent(container, name, profile):
'''
Ensures a object is absent.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
'''
existing_object = __salt__... | [
"Ensures",
"a",
"object",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_storage.py#L154-L172 | [
"def",
"object_absent",
"(",
"container",
",",
"name",
",",
"profile",
")",
":",
"existing_object",
"=",
"__salt__",
"[",
"'libcloud_storage.get_container_object'",
"]",
"(",
"container",
",",
"name",
",",
"profile",
")",
"if",
"existing_object",
"is",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_present | Ensures a object is downloaded locally.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str``
:param profile: The profile key
:type profile: ``str``
:param overwrite... | salt/states/libcloud_storage.py | def file_present(container, name, path, profile, overwrite_existing=False):
'''
Ensures a object is downloaded locally.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str`... | def file_present(container, name, path, profile, overwrite_existing=False):
'''
Ensures a object is downloaded locally.
:param container: Container name
:type container: ``str``
:param name: Object name in cloud
:type name: ``str``
:param path: Local path to file
:type path: ``str`... | [
"Ensures",
"a",
"object",
"is",
"downloaded",
"locally",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_storage.py#L175-L195 | [
"def",
"file_present",
"(",
"container",
",",
"name",
",",
"path",
",",
"profile",
",",
"overwrite_existing",
"=",
"False",
")",
":",
"result",
"=",
"__salt__",
"[",
"'libcloud_storage.download_object'",
"]",
"(",
"path",
",",
"container",
",",
"name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Required.
Initialize device connection using ssh or nxapi connection type. | salt/proxy/nxos.py | def init(opts=None):
'''
Required.
Initialize device connection using ssh or nxapi connection type.
'''
global CONNECTION
if __opts__.get('proxy').get('connection') is not None:
CONNECTION = __opts__.get('proxy').get('connection')
if CONNECTION == 'ssh':
log.info('NXOS PROXY... | def init(opts=None):
'''
Required.
Initialize device connection using ssh or nxapi connection type.
'''
global CONNECTION
if __opts__.get('proxy').get('connection') is not None:
CONNECTION = __opts__.get('proxy').get('connection')
if CONNECTION == 'ssh':
log.info('NXOS PROXY... | [
"Required",
".",
"Initialize",
"device",
"connection",
"using",
"ssh",
"or",
"nxapi",
"connection",
"type",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L210-L227 | [
"def",
"init",
"(",
"opts",
"=",
"None",
")",
":",
"global",
"CONNECTION",
"if",
"__opts__",
".",
"get",
"(",
"'proxy'",
")",
".",
"get",
"(",
"'connection'",
")",
"is",
"not",
"None",
":",
"CONNECTION",
"=",
"__opts__",
".",
"get",
"(",
"'proxy'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | grains | Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains | salt/proxy/nxos.py | def grains(**kwargs):
'''
Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains
'''
import __main__ as main # pylint: disable=unused-import
if not DEVICE_DETAILS['grains_cache']:
data = sendline('show version')
if CONNECTION == 'nxapi':
data =... | def grains(**kwargs):
'''
Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains
'''
import __main__ as main # pylint: disable=unused-import
if not DEVICE_DETAILS['grains_cache']:
data = sendline('show version')
if CONNECTION == 'nxapi':
data =... | [
"Get",
"grains",
"for",
"minion",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L256-L272 | [
"def",
"grains",
"(",
"*",
"*",
"kwargs",
")",
":",
"import",
"__main__",
"as",
"main",
"# pylint: disable=unused-import",
"if",
"not",
"DEVICE_DETAILS",
"[",
"'grains_cache'",
"]",
":",
"data",
"=",
"sendline",
"(",
"'show version'",
")",
"if",
"CONNECTION",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | sendline | Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
Defaults to `... | salt/proxy/nxos.py | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_co... | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitrary show or config commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_co... | [
"Send",
"arbitrary",
"show",
"or",
"config",
"commands",
"to",
"the",
"NX",
"-",
"OS",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L297-L327 | [
"def",
"sendline",
"(",
"command",
",",
"method",
"=",
"'cli_show_ascii'",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"CONNECTION",
"==",
"'ssh'",
":",
"result",
"=",
"_sendline_ssh",
"(",
"command",
",",
"*",
"*",
"kwargs",
")",
"elif",
"CON... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | proxy_config | Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block: bash
sal... | salt/proxy/nxos.py | def proxy_config(commands, **kwargs):
'''
Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
De... | def proxy_config(commands, **kwargs):
'''
Send configuration commands over SSH or NX-API
commands
List of configuration commands
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
De... | [
"Send",
"configuration",
"commands",
"over",
"SSH",
"or",
"NX",
"-",
"API"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L330-L376 | [
"def",
"proxy_config",
"(",
"commands",
",",
"*",
"*",
"kwargs",
")",
":",
"no_save_config",
"=",
"DEVICE_DETAILS",
"[",
"'no_save_config'",
"]",
"no_save_config",
"=",
"kwargs",
".",
"get",
"(",
"'no_save_config'",
",",
"no_save_config",
")",
"if",
"not",
"is... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _init_ssh | Open a connection to the NX-OS switch over SSH. | salt/proxy/nxos.py | def _init_ssh(opts):
'''
Open a connection to the NX-OS switch over SSH.
'''
if opts is None:
opts = __opts__
try:
this_prompt = None
if 'prompt_regex' in opts['proxy']:
this_prompt = opts['proxy']['prompt_regex']
elif 'prompt_name' in opts['proxy']:
... | def _init_ssh(opts):
'''
Open a connection to the NX-OS switch over SSH.
'''
if opts is None:
opts = __opts__
try:
this_prompt = None
if 'prompt_regex' in opts['proxy']:
this_prompt = opts['proxy']['prompt_regex']
elif 'prompt_name' in opts['proxy']:
... | [
"Open",
"a",
"connection",
"to",
"the",
"NX",
"-",
"OS",
"switch",
"over",
"SSH",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L382-L415 | [
"def",
"_init_ssh",
"(",
"opts",
")",
":",
"if",
"opts",
"is",
"None",
":",
"opts",
"=",
"__opts__",
"try",
":",
"this_prompt",
"=",
"None",
"if",
"'prompt_regex'",
"in",
"opts",
"[",
"'proxy'",
"]",
":",
"this_prompt",
"=",
"opts",
"[",
"'proxy'",
"]"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_output_for_errors | Helper method to parse command output for error information | salt/proxy/nxos.py | def _parse_output_for_errors(data, command, **kwargs):
'''
Helper method to parse command output for error information
'''
if re.search('% Invalid', data):
raise CommandExecutionError({
'rejected_input': command,
'message': 'CLI excution error',
'code': '400',... | def _parse_output_for_errors(data, command, **kwargs):
'''
Helper method to parse command output for error information
'''
if re.search('% Invalid', data):
raise CommandExecutionError({
'rejected_input': command,
'message': 'CLI excution error',
'code': '400',... | [
"Helper",
"method",
"to",
"parse",
"command",
"output",
"for",
"error",
"information"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L446-L465 | [
"def",
"_parse_output_for_errors",
"(",
"data",
",",
"command",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"re",
".",
"search",
"(",
"'% Invalid'",
",",
"data",
")",
":",
"raise",
"CommandExecutionError",
"(",
"{",
"'rejected_input'",
":",
"command",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _init_nxapi | Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock``)
which doesn't come with muc... | salt/proxy/nxos.py | def _init_nxapi(opts):
'''
Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock... | def _init_nxapi(opts):
'''
Open a connection to the NX-OS switch over NX-API.
As the communication is HTTP(S) based, there is no connection to maintain,
however, in order to test the connectivity and make sure we are able to
bring up this Minion, we are executing a very simple command (``show clock... | [
"Open",
"a",
"connection",
"to",
"the",
"NX",
"-",
"OS",
"switch",
"over",
"NX",
"-",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L475-L506 | [
"def",
"_init_nxapi",
"(",
"opts",
")",
":",
"proxy_dict",
"=",
"opts",
".",
"get",
"(",
"'proxy'",
",",
"{",
"}",
")",
"conn_args",
"=",
"copy",
".",
"deepcopy",
"(",
"proxy_dict",
")",
"conn_args",
".",
"pop",
"(",
"'proxytype'",
",",
"None",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _nxapi_request | Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
... | salt/proxy/nxos.py | def _nxapi_request(commands, method='cli_conf', **kwargs):
'''
Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output... | def _nxapi_request(commands, method='cli_conf', **kwargs):
'''
Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output... | [
"Executes",
"an",
"nxapi_request",
"request",
"over",
"NX",
"-",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/nxos.py#L521-L539 | [
"def",
"_nxapi_request",
"(",
"commands",
",",
"method",
"=",
"'cli_conf'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"CONNECTION",
"==",
"'ssh'",
":",
"return",
"'_nxapi_request is not available for ssh proxy'",
"conn_args",
"=",
"DEVICE_DETAILS",
"[",
"'conn_args'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | availability_set_create_or_update | .. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_create_or... | salt/modules/azurearm_compute.py | def availability_set_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availabil... | def availability_set_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availabil... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L80-L145 | [
"def",
"availability_set_create_or_update",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"if",
"'location'",
"not",
"in",
"kwargs",
":",
"rg_props",
"=",
"__salt__",
"[",
"'azurearm_resource.resource_group_get'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | availability_set_delete | .. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_delete testset test... | salt/modules/azurearm_compute.py | def availability_set_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash... | def availability_set_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L148-L178 | [
"def",
"availability_set_delete",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | availability_set_get | .. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.ava... | salt/modules/azurearm_compute.py | def availability_set_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Exam... | def availability_set_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Exam... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L181-L211 | [
"def",
"availability_set_get",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"av_set",
"=",
"compconn",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | availability_sets_list | .. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_sets_list testgroup | salt/modules/azurearm_compute.py | def availability_sets_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_comp... | def availability_sets_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_comp... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L214-L245 | [
"def",
"availability_sets_list",
"(",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"avail_sets",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | availability_sets_list_available_sizes | .. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set name to list available
virtual machine sizes within.
:param resource_group: The resource group name to lis... | salt/modules/azurearm_compute.py | def availability_sets_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set... | def availability_sets_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L248-L284 | [
"def",
"availability_sets_list_available_sizes",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machine_capture | .. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virtual machine.
:param destination_name: The destination container name.
:param resource_group: The resource group name ... | salt/modules/azurearm_compute.py | def virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs):
'''
.. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virt... | def virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs):
'''
.. versionadded:: 2019.2.0
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virt... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L287-L336 | [
"def",
"virtual_machine_capture",
"(",
"name",
",",
"destination_name",
",",
"resource_group",
",",
"prefix",
"=",
"'capture-'",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"VirtualMachineCaptureParameters",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machine_get | .. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
s... | salt/modules/azurearm_compute.py | def virtual_machine_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
vi... | def virtual_machine_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
vi... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L339-L373 | [
"def",
"virtual_machine_get",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"expand",
"=",
"kwargs",
".",
"get",
"(",
"'expand'",
")",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machine_convert_to_managed_disks | .. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The name of the virtual machine to convert.
:param resource_group: The resource group name assigned to the
virtual ... | salt/modules/azurearm_compute.py | def virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The na... | def virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The na... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L376-L409 | [
"def",
"virtual_machine_convert_to_managed_disks",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machine_generalize | .. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_mac... | salt/modules/azurearm_compute.py | def virtual_machine_generalize(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Exampl... | def virtual_machine_generalize(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Exampl... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L447-L476 | [
"def",
"virtual_machine_generalize",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machines_list | .. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list testgroup | salt/modules/azurearm_compute.py | def virtual_machines_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute... | def virtual_machines_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L479-L509 | [
"def",
"virtual_machines_list",
"(",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"vms",
"=",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machines_list_all | .. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all | salt/modules/azurearm_compute.py | def virtual_machines_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all
'''
result = {}
compconn = __utils__['azurearm.get_client']('comput... | def virtual_machines_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all
'''
result = {}
compconn = __utils__['azurearm.get_client']('comput... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L512-L537 | [
"def",
"virtual_machines_list_all",
"(",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"vms",
"=",
"__utils__",
"[",
"'a... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_machines_list_available_sizes | .. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash... | salt/modules/azurearm_compute.py | def virtual_machines_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resou... | def virtual_machines_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resou... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_compute.py#L540-L574 | [
"def",
"virtual_machines_list_available_sizes",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=invalid-name",
"result",
"=",
"{",
"}",
"compconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'compute'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | output | Print out YAML using the block mode | salt/output/yaml_out.py | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out YAML using the block mode
'''
params = {}
if 'output_indent' not in __opts__:
# default indentation
params.update(default_flow_style=False)
elif __opts__['output_indent'] >= 0:
# custom indent
... | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out YAML using the block mode
'''
params = {}
if 'output_indent' not in __opts__:
# default indentation
params.update(default_flow_style=False)
elif __opts__['output_indent'] >= 0:
# custom indent
... | [
"Print",
"out",
"YAML",
"using",
"the",
"block",
"mode"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/yaml_out.py#L38-L61 | [
"def",
"output",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"params",
"=",
"{",
"}",
"if",
"'output_indent'",
"not",
"in",
"__opts__",
":",
"# default indentation",
"params",
".",
"update",
"(",
"default_flow_style",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mksls | Convert an AutoYAST file to an SLS file | salt/utils/yast.py | def mksls(src, dst=None):
'''
Convert an AutoYAST file to an SLS file
'''
with salt.utils.files.fopen(src, 'r') as fh_:
ps_opts = xml.to_dict(ET.fromstring(fh_.read()))
if dst is not None:
with salt.utils.files.fopen(dst, 'w') as fh_:
salt.utils.yaml.safe_dump(ps_opts, f... | def mksls(src, dst=None):
'''
Convert an AutoYAST file to an SLS file
'''
with salt.utils.files.fopen(src, 'r') as fh_:
ps_opts = xml.to_dict(ET.fromstring(fh_.read()))
if dst is not None:
with salt.utils.files.fopen(dst, 'w') as fh_:
salt.utils.yaml.safe_dump(ps_opts, f... | [
"Convert",
"an",
"AutoYAST",
"file",
"to",
"an",
"SLS",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/yast.py#L14-L25 | [
"def",
"mksls",
"(",
"src",
",",
"dst",
"=",
"None",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"src",
",",
"'r'",
")",
"as",
"fh_",
":",
"ps_opts",
"=",
"xml",
".",
"to_dict",
"(",
"ET",
".",
"fromstring",
"(",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_color_theme | Return the color theme to use | salt/utils/color.py | def get_color_theme(theme):
'''
Return the color theme to use
'''
# Keep the heavy lifting out of the module space
import salt.utils.data
import salt.utils.files
import salt.utils.yaml
if not os.path.isfile(theme):
log.warning('The named theme %s if not available', theme)
tr... | def get_color_theme(theme):
'''
Return the color theme to use
'''
# Keep the heavy lifting out of the module space
import salt.utils.data
import salt.utils.files
import salt.utils.yaml
if not os.path.isfile(theme):
log.warning('The named theme %s if not available', theme)
tr... | [
"Return",
"the",
"color",
"theme",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/color.py#L18-L41 | [
"def",
"get_color_theme",
"(",
"theme",
")",
":",
"# Keep the heavy lifting out of the module space",
"import",
"salt",
".",
"utils",
".",
"data",
"import",
"salt",
".",
"utils",
".",
"files",
"import",
"salt",
".",
"utils",
".",
"yaml",
"if",
"not",
"os",
"."... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_colors | Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = get_colors() # enable all colors
no_color... | salt/utils/color.py | def get_colors(use=True, theme=None):
'''
Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = ... | def get_colors(use=True, theme=None):
'''
Return the colors as an easy to use dict. Pass `False` to deactivate all
colors by setting them to empty strings. Pass a string containing only the
name of a single color to be used in place of all colors. Examples:
.. code-block:: python
colors = ... | [
"Return",
"the",
"colors",
"as",
"an",
"easy",
"to",
"use",
"dict",
".",
"Pass",
"False",
"to",
"deactivate",
"all",
"colors",
"by",
"setting",
"them",
"to",
"empty",
"strings",
".",
"Pass",
"a",
"string",
"containing",
"only",
"the",
"name",
"of",
"a",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/color.py#L44-L93 | [
"def",
"get_colors",
"(",
"use",
"=",
"True",
",",
"theme",
"=",
"None",
")",
":",
"colors",
"=",
"{",
"'BLACK'",
":",
"TextFormat",
"(",
"'black'",
")",
",",
"'DARK_GRAY'",
":",
"TextFormat",
"(",
"'bold'",
",",
"'black'",
")",
",",
"'RED'",
":",
"T... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versionadded:: 2016.3.0
:param name: name of... | salt/states/zabbix_usergroup.py | def present(name, **kwargs):
'''
Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versiona... | def present(name, **kwargs):
'''
Creates new user group.
NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
zabbix version, see:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/usergroup/definitions#user_group
.. versiona... | [
"Creates",
"new",
"user",
"group",
".",
"NOTE",
":",
"This",
"function",
"accepts",
"all",
"standard",
"user",
"group",
"properties",
":",
"keyword",
"argument",
"names",
"differ",
"depending",
"on",
"your",
"zabbix",
"version",
"see",
":",
"https",
":",
"//... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_usergroup.py#L23-L182 | [
"def",
"present",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"connection_args",
"=",
"{",
"}",
"if",
"'_connection_user'",
"in",
"kwargs",
":",
"connection_args",
"[",
"'_connection_user'",
"]",
"=",
"kwargs",
"[",
"'_connection_user'",
"]",
"if",
"'_co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (... | salt/states/zabbix_usergroup.py | def absent(name, **kwargs):
'''
Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connectio... | def absent(name, **kwargs):
'''
Ensures that the user group does not exist, eventually delete user group.
.. versionadded:: 2016.3.0
:param name: name of the user group
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connectio... | [
"Ensures",
"that",
"the",
"user",
"group",
"does",
"not",
"exist",
"eventually",
"delete",
"user",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_usergroup.py#L185-L253 | [
"def",
"absent",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"connection_args",
"=",
"{",
"}",
"if",
"'_connection_user'",
"in",
"kwargs",
":",
"connection_args",
"[",
"'_connection_user'",
"]",
"=",
"kwargs",
"[",
"'_connection_user'",
"]",
"if",
"'_con... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_config | Return configuration | salt/modules/highstate_doc.py | def _get_config(**kwargs):
'''
Return configuration
'''
config = {
'filter_id_regex': ['.*!doc_skip'],
'filter_function_regex': [],
'replace_text_regex': {},
'proccesser': 'highstate_doc.proccesser_markdown',
'max_render_file_size': 10000,
'note': None
... | def _get_config(**kwargs):
'''
Return configuration
'''
config = {
'filter_id_regex': ['.*!doc_skip'],
'filter_function_regex': [],
'replace_text_regex': {},
'proccesser': 'highstate_doc.proccesser_markdown',
'max_render_file_size': 10000,
'note': None
... | [
"Return",
"configuration"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L365-L383 | [
"def",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"{",
"'filter_id_regex'",
":",
"[",
"'.*!doc_skip'",
"]",
",",
"'filter_function_regex'",
":",
"[",
"]",
",",
"'replace_text_regex'",
":",
"{",
"}",
",",
"'proccesser'",
":",
"'highstate... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read_file | output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
#!/bin/python
import os
... | salt/modules/highstate_doc.py | def read_file(name):
'''
output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
... | def read_file(name):
'''
output the contents of a file:
this is a workaround if the cp.push module does not work.
https://github.com/saltstack/salt/issues/37133
help the master output the contents of a document
that might be saved on the minions filesystem.
.. code-block:: python
... | [
"output",
"the",
"contents",
"of",
"a",
"file",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L386-L421 | [
"def",
"read_file",
"(",
"name",
")",
":",
"out",
"=",
"''",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"name",
",",
"'r'",
")",
"as",
"f",
":",
"out",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicod... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | render | Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses to create the document.
jinja_template_function: a salt module call that returns template text.
options:
hig... | salt/modules/highstate_doc.py | def render(jinja_template_text=None, jinja_template_function='highstate_doc.markdown_default_jinja_template', **kwargs):
'''
Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses... | def render(jinja_template_text=None, jinja_template_function='highstate_doc.markdown_default_jinja_template', **kwargs):
'''
Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses... | [
"Render",
"highstate",
"to",
"a",
"text",
"format",
"(",
"default",
"Markdown",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L424-L461 | [
"def",
"render",
"(",
"jinja_template_text",
"=",
"None",
",",
"jinja_template_function",
"=",
"'highstate_doc.markdown_default_jinja_template'",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
"lowstates",
"=",
"proc... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | proccess_lowstates | return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate | salt/modules/highstate_doc.py | def proccess_lowstates(**kwargs):
'''
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate
'''
states = []
config = _get_config(**kwargs)
proccesser = config.get('proccesser')
ls = __salt__['state.show... | def proccess_lowstates(**kwargs):
'''
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate
'''
states = []
config = _get_config(**kwargs)
proccesser = config.get('proccesser')
ls = __salt__['state.show... | [
"return",
"proccessed",
"lowstate",
"data",
"that",
"was",
"not",
"blacklisted"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L477-L501 | [
"def",
"proccess_lowstates",
"(",
"*",
"*",
"kwargs",
")",
":",
"states",
"=",
"[",
"]",
"config",
"=",
"_get_config",
"(",
"*",
"*",
"kwargs",
")",
"proccesser",
"=",
"config",
".",
"get",
"(",
"'proccesser'",
")",
"ls",
"=",
"__salt__",
"[",
"'state.... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _state_data_to_yaml_string | return a data dict in yaml string format. | salt/modules/highstate_doc.py | def _state_data_to_yaml_string(data, whitelist=None, blacklist=None):
'''
return a data dict in yaml string format.
'''
y = {}
if blacklist is None:
# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTERNAL_KEYWORDS
blacklist = ['__env__', '__id__',... | def _state_data_to_yaml_string(data, whitelist=None, blacklist=None):
'''
return a data dict in yaml string format.
'''
y = {}
if blacklist is None:
# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTERNAL_KEYWORDS
blacklist = ['__env__', '__id__',... | [
"return",
"a",
"data",
"dict",
"in",
"yaml",
"string",
"format",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L504-L521 | [
"def",
"_state_data_to_yaml_string",
"(",
"data",
",",
"whitelist",
"=",
"None",
",",
"blacklist",
"=",
"None",
")",
":",
"y",
"=",
"{",
"}",
"if",
"blacklist",
"is",
"None",
":",
"# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTER... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_markdown_requisite | format requisite as a link users can click | salt/modules/highstate_doc.py | def _format_markdown_requisite(state, stateid, makelink=True):
'''
format requisite as a link users can click
'''
fmt_id = '{0}: {1}'.format(state, stateid)
if makelink:
return ' * [{0}](#{1})\n'.format(fmt_id, _format_markdown_link(fmt_id))
else:
return ' * `{0}`\n'.format(fmt_i... | def _format_markdown_requisite(state, stateid, makelink=True):
'''
format requisite as a link users can click
'''
fmt_id = '{0}: {1}'.format(state, stateid)
if makelink:
return ' * [{0}](#{1})\n'.format(fmt_id, _format_markdown_link(fmt_id))
else:
return ' * `{0}`\n'.format(fmt_i... | [
"format",
"requisite",
"as",
"a",
"link",
"users",
"can",
"click"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L569-L577 | [
"def",
"_format_markdown_requisite",
"(",
"state",
",",
"stateid",
",",
"makelink",
"=",
"True",
")",
":",
"fmt_id",
"=",
"'{0}: {1}'",
".",
"format",
"(",
"state",
",",
"stateid",
")",
"if",
"makelink",
":",
"return",
"' * [{0}](#{1})\\n'",
".",
"format",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | proccesser_markdown | Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: yaml
vars: # the raw lowstate_item that was proccessed
... | salt/modules/highstate_doc.py | def proccesser_markdown(lowstate_item, config, **kwargs):
'''
Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: ya... | def proccesser_markdown(lowstate_item, config, **kwargs):
'''
Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: ya... | [
"Takes",
"low",
"state",
"data",
"and",
"returns",
"a",
"dict",
"of",
"proccessed",
"data",
"that",
"is",
"by",
"default",
"used",
"in",
"a",
"jinja",
"template",
"when",
"rendering",
"a",
"markdown",
"highstate_doc",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/highstate_doc.py#L580-L692 | [
"def",
"proccesser_markdown",
"(",
"lowstate_item",
",",
"config",
",",
"*",
"*",
"kwargs",
")",
":",
"# TODO: switch or ... ext call.",
"s",
"=",
"lowstate_item",
"state_function",
"=",
"'{0}.{1}'",
".",
"format",
"(",
"s",
"[",
"'state'",
"]",
",",
"s",
"[",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | os_version_info_ex | Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info | salt/utils/win_osinfo.py | def os_version_info_ex():
'''
Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info
'''
if not HAS_WIN32:
return
clas... | def os_version_info_ex():
'''
Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info
'''
if not HAS_WIN32:
return
clas... | [
"Helper",
"function",
"to",
"return",
"the",
"results",
"of",
"the",
"GetVersionExW",
"Windows",
"API",
"call",
".",
"It",
"is",
"a",
"ctypes",
"Structure",
"that",
"contains",
"Windows",
"OS",
"Version",
"information",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_osinfo.py#L35-L66 | [
"def",
"os_version_info_ex",
"(",
")",
":",
"if",
"not",
"HAS_WIN32",
":",
"return",
"class",
"OSVersionInfo",
"(",
"ctypes",
".",
"Structure",
")",
":",
"_fields_",
"=",
"(",
"(",
"'dwOSVersionInfoSize'",
",",
"DWORD",
")",
",",
"(",
"'dwMajorVersion'",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_join_info | Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status | salt/utils/win_osinfo.py | def get_join_info():
'''
Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status
'''
info = win32net.NetGetJoinInformat... | def get_join_info():
'''
Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status
'''
info = win32net.NetGetJoinInformat... | [
"Gets",
"information",
"about",
"the",
"domain",
"/",
"workgroup",
".",
"This",
"will",
"tell",
"you",
"if",
"the",
"system",
"is",
"joined",
"to",
"a",
"domain",
"or",
"a",
"workgroup"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_osinfo.py#L83-L99 | [
"def",
"get_join_info",
"(",
")",
":",
"info",
"=",
"win32net",
".",
"NetGetJoinInformation",
"(",
")",
"status",
"=",
"{",
"win32netcon",
".",
"NetSetupUnknown",
":",
"'Unknown'",
",",
"win32netcon",
".",
"NetSetupUnjoined",
":",
"'Unjoined'",
",",
"win32netcon... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _dscl | Run a dscl -create command | salt/modules/mac_user.py | def _dscl(cmd, ctype='create'):
'''
Run a dscl -create command
'''
if __grains__['osrelease_info'] < (10, 8):
source, noderoot = '.', ''
else:
source, noderoot = 'localhost', '/Local/Default'
if noderoot:
cmd[0] = noderoot + cmd[0]
return __salt__['cmd.run_all'](
... | def _dscl(cmd, ctype='create'):
'''
Run a dscl -create command
'''
if __grains__['osrelease_info'] < (10, 8):
source, noderoot = '.', ''
else:
source, noderoot = 'localhost', '/Local/Default'
if noderoot:
cmd[0] = noderoot + cmd[0]
return __salt__['cmd.run_all'](
... | [
"Run",
"a",
"dscl",
"-",
"create",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L56-L71 | [
"def",
"_dscl",
"(",
"cmd",
",",
"ctype",
"=",
"'create'",
")",
":",
"if",
"__grains__",
"[",
"'osrelease_info'",
"]",
"<",
"(",
"10",
",",
"8",
")",
":",
"source",
",",
"noderoot",
"=",
"'.'",
",",
"''",
"else",
":",
"source",
",",
"noderoot",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add | Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <shell> | salt/modules/mac_user.py | def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
fullname=None,
createhome=True,
**kwargs):
'''
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <s... | def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
fullname=None,
createhome=True,
**kwargs):
'''
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <s... | [
"Add",
"a",
"user",
"to",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L81-L136 | [
"def",
"add",
"(",
"name",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"home",
"=",
"None",
",",
"shell",
"=",
"None",
",",
"fullname",
"=",
"None",
",",
"createhome",
"=",
"True",
",",
"*",
"*",
"kwargs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True | salt/modules/mac_user.py | def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
'''
if salt.utils.stringutils.contains_whitespace(name):
raise SaltInvocationError('Username cannot contain whitesp... | def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
'''
if salt.utils.stringutils.contains_whitespace(name):
raise SaltInvocationError('Username cannot contain whitesp... | [
"Remove",
"a",
"user",
"from",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L139-L166 | [
"def",
"delete",
"(",
"name",
",",
"remove",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"if",
"salt",
".",
"utils",
".",
"stringutils",
".",
"contains_whitespace",
"(",
"name",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'Username cannot contain... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getent | Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent | salt/modules/mac_user.py | def getent(refresh=False):
'''
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
'''
if 'user.getent' in __context__ and not refresh:
return __context__['user.getent']
ret = []
for data in pwd.getpwall():
ret.appe... | def getent(refresh=False):
'''
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
'''
if 'user.getent' in __context__ and not refresh:
return __context__['user.getent']
ret = []
for data in pwd.getpwall():
ret.appe... | [
"Return",
"the",
"list",
"of",
"all",
"info",
"for",
"all",
"users"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L169-L186 | [
"def",
"getent",
"(",
"refresh",
"=",
"False",
")",
":",
"if",
"'user.getent'",
"in",
"__context__",
"and",
"not",
"refresh",
":",
"return",
"__context__",
"[",
"'user.getent'",
"]",
"ret",
"=",
"[",
"]",
"for",
"data",
"in",
"pwd",
".",
"getpwall",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chuid | Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376 | salt/modules/mac_user.py | def chuid(name, uid):
'''
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
'''
if not isinstance(uid, int):
raise SaltInvocationError('uid must be an integer')
pre_info = info(name)
if not pre_info:
raise CommandExe... | def chuid(name, uid):
'''
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
'''
if not isinstance(uid, int):
raise SaltInvocationError('uid must be an integer')
pre_info = info(name)
if not pre_info:
raise CommandExe... | [
"Change",
"the",
"uid",
"for",
"a",
"named",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L189-L213 | [
"def",
"chuid",
"(",
"name",
",",
"uid",
")",
":",
"if",
"not",
"isinstance",
"(",
"uid",
",",
"int",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'uid must be an integer'",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chgid | Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376 | salt/modules/mac_user.py | def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
if not isinstance(gid, int):
raise SaltInvocationError('gid must be an integer')
pre_info = info(name)
if not pre_info:
raise Comma... | def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
if not isinstance(gid, int):
raise SaltInvocationError('gid must be an integer')
pre_info = info(name)
if not pre_info:
raise Comma... | [
"Change",
"the",
"default",
"group",
"of",
"the",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L216-L240 | [
"def",
"chgid",
"(",
"name",
",",
"gid",
")",
":",
"if",
"not",
"isinstance",
"(",
"gid",
",",
"int",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'gid must be an integer'",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chshell | Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh | salt/modules/mac_user.py | def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
if shell == pre_in... | def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
if shell == pre_in... | [
"Change",
"the",
"default",
"shell",
"of",
"the",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L243-L265 | [
"def",
"chshell",
"(",
"name",
",",
"shell",
")",
":",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",
"raise",
"CommandExecutionError",
"(",
"'User \\'{0}\\' does not exist'",
".",
"format",
"(",
"name",
")",
")",
"if",
"shell",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chhome | Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo | salt/modules/mac_user.py | def chhome(name, home, **kwargs):
'''
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
persist = kwargs.pop('persist', False)
if kwargs:
salt.utils.args.inval... | def chhome(name, home, **kwargs):
'''
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
persist = kwargs.pop('persist', False)
if kwargs:
salt.utils.args.inval... | [
"Change",
"the",
"home",
"directory",
"of",
"the",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L268-L298 | [
"def",
"chhome",
"(",
"name",
",",
"home",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"persist",
"=",
"kwargs",
".",
"pop",
"(",
"'persist'",
",",
"False",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chfullname | Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar' | salt/modules/mac_user.py | def chfullname(name, fullname):
'''
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
'''
fullname = salt.utils.data.decode(fullname)
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' doe... | def chfullname(name, fullname):
'''
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
'''
fullname = salt.utils.data.decode(fullname)
pre_info = info(name)
if not pre_info:
raise CommandExecutionError('User \'{0}\' doe... | [
"Change",
"the",
"user",
"s",
"Full",
"Name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L301-L330 | [
"def",
"chfullname",
"(",
"name",
",",
"fullname",
")",
":",
"fullname",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"fullname",
")",
"pre_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"pre_info",
":",
"raise",
"CommandExecutionError... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | chgroups | Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be passed either as a
python list or a comma-sepa... | salt/modules/mac_user.py | def chgroups(name, groups, append=False):
'''
Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be ... | def chgroups(name, groups, append=False):
'''
Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be ... | [
"Change",
"the",
"groups",
"to",
"which",
"the",
"user",
"belongs",
".",
"Note",
"that",
"the",
"user",
"s",
"primary",
"group",
"does",
"not",
"have",
"to",
"be",
"one",
"of",
"the",
"groups",
"passed",
"membership",
"in",
"the",
"user",
"s",
"primary",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L333-L387 | [
"def",
"chgroups",
"(",
"name",
",",
"groups",
",",
"append",
"=",
"False",
")",
":",
"### NOTE: **args isn't used here but needs to be included in this",
"### function for compatibility with the user.present state",
"uinfo",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"u... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_info | Return user information in a pretty way | salt/modules/mac_user.py | def _format_info(data):
'''
Return user information in a pretty way
'''
return {'gid': data.pw_gid,
'groups': list_groups(data.pw_name),
'home': data.pw_dir,
'name': data.pw_name,
'shell': data.pw_shell,
'uid': data.pw_uid,
'fullnam... | def _format_info(data):
'''
Return user information in a pretty way
'''
return {'gid': data.pw_gid,
'groups': list_groups(data.pw_name),
'home': data.pw_dir,
'name': data.pw_name,
'shell': data.pw_shell,
'uid': data.pw_uid,
'fullnam... | [
"Return",
"user",
"information",
"in",
"a",
"pretty",
"way"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L408-L418 | [
"def",
"_format_info",
"(",
"data",
")",
":",
"return",
"{",
"'gid'",
":",
"data",
".",
"pw_gid",
",",
"'groups'",
":",
"list_groups",
"(",
"data",
".",
"pw_name",
")",
",",
"'home'",
":",
"data",
".",
"pw_dir",
",",
"'name'",
":",
"data",
".",
"pw_n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_groups | Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.0
CLI Example:
.. code-bl... | salt/modules/mac_user.py | def list_groups(name):
'''
Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.... | def list_groups(name):
'''
Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.... | [
"Return",
"a",
"list",
"of",
"groups",
"the",
"named",
"user",
"belongs",
"to",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L437-L456 | [
"def",
"list_groups",
"(",
"name",
")",
":",
"groups",
"=",
"[",
"group",
"for",
"group",
"in",
"salt",
".",
"utils",
".",
"user",
".",
"get_group_list",
"(",
"name",
")",
"]",
"return",
"groups"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename | Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name | salt/modules/mac_user.py | def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = info(name)
if not current_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
new_info... | def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = info(name)
if not current_info:
raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
new_info... | [
"Change",
"the",
"username",
"for",
"a",
"named",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L473-L498 | [
"def",
"rename",
"(",
"name",
",",
"new_name",
")",
":",
"current_info",
"=",
"info",
"(",
"name",
")",
"if",
"not",
"current_info",
":",
"raise",
"CommandExecutionError",
"(",
"'User \\'{0}\\' does not exist'",
".",
"format",
"(",
"name",
")",
")",
"new_info"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_auto_login | .. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login | salt/modules/mac_user.py | def get_auto_login():
'''
.. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login
'''
cmd = ['defaults',
... | def get_auto_login():
'''
.. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login
'''
cmd = ['defaults',
... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L501-L521 | [
"def",
"get_auto_login",
"(",
")",
":",
"cmd",
"=",
"[",
"'defaults'",
",",
"'read'",
",",
"'/Library/Preferences/com.apple.loginwindow.plist'",
",",
"'autoLoginUser'",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"ignore_retcode",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _kcpassword | Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpassword.py
Args:
password(str)... | salt/modules/mac_user.py | def _kcpassword(password):
'''
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpasswo... | def _kcpassword(password):
'''
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpasswo... | [
"Internal",
"function",
"for",
"obfuscating",
"the",
"password",
"used",
"for",
"AutoLogin",
"This",
"is",
"later",
"written",
"as",
"the",
"contents",
"of",
"the",
"/",
"etc",
"/",
"kcpassword",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L524-L571 | [
"def",
"_kcpassword",
"(",
"password",
")",
":",
"# The magic 11 bytes - these are just repeated",
"# 0x7D 0x89 0x52 0x23 0xD2 0xBC 0xDD 0xEA 0xA3 0xB9 0x1F",
"key",
"=",
"[",
"125",
",",
"137",
",",
"82",
",",
"35",
",",
"210",
",",
"188",
",",
"221",
",",
"234",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | enable_auto_login | .. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Returns:
bool: ``True`` if successful, otherw... | salt/modules/mac_user.py | def enable_auto_login(name, password):
'''
.. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Re... | def enable_auto_login(name, password):
'''
.. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Re... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L574-L612 | [
"def",
"enable_auto_login",
"(",
"name",
",",
"password",
")",
":",
"# Make the entry into the defaults file",
"cmd",
"=",
"[",
"'defaults'",
",",
"'write'",
",",
"'/Library/Preferences/com.apple.loginwindow.plist'",
",",
"'autoLoginUser'",
",",
"name",
"]",
"__salt__",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | disable_auto_login | .. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login | salt/modules/mac_user.py | def disable_auto_login():
'''
.. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login
'''
# Remove the kcpassword file
cmd = 'rm -f... | def disable_auto_login():
'''
.. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login
'''
# Remove the kcpassword file
cmd = 'rm -f... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_user.py#L615-L640 | [
"def",
"disable_auto_login",
"(",
")",
":",
"# Remove the kcpassword file",
"cmd",
"=",
"'rm -f /etc/kcpassword'",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"# Remove the entry from the defaults file",
"cmd",
"=",
"[",
"'defaults'",
",",
"'delete'",
",",
"'/... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.