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 | _update_repo | Update the repo to a given revision. Using clean passes -C to the hg up | salt/states/hg.py | def _update_repo(ret, name, target, clean, user, identity, rev, opts, update_head):
'''
Update the repo to a given revision. Using clean passes -C to the hg up
'''
log.debug('target %s is found, "hg pull && hg up is probably required"', target)
current_rev = __salt__['hg.revision'](target, user=use... | def _update_repo(ret, name, target, clean, user, identity, rev, opts, update_head):
'''
Update the repo to a given revision. Using clean passes -C to the hg up
'''
log.debug('target %s is found, "hg pull && hg up is probably required"', target)
current_rev = __salt__['hg.revision'](target, user=use... | [
"Update",
"the",
"repo",
"to",
"a",
"given",
"revision",
".",
"Using",
"clean",
"passes",
"-",
"C",
"to",
"the",
"hg",
"up"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/hg.py#L113-L175 | [
"def",
"_update_repo",
"(",
"ret",
",",
"name",
",",
"target",
",",
"clean",
",",
"user",
",",
"identity",
",",
"rev",
",",
"opts",
",",
"update_head",
")",
":",
"log",
".",
"debug",
"(",
"'target %s is found, \"hg pull && hg up is probably required\"'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exists | Check if a ZFS filesystem or volume or snapshot exists.
name : string
name of dataset
type : string
also check if dataset is of a certain type, valid choices are:
filesystem, snapshot, volume, bookmark, or all.
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
... | salt/modules/zfs.py | def exists(name, **kwargs):
'''
Check if a ZFS filesystem or volume or snapshot exists.
name : string
name of dataset
type : string
also check if dataset is of a certain type, valid choices are:
filesystem, snapshot, volume, bookmark, or all.
.. versionadded:: 2015.5.0
... | def exists(name, **kwargs):
'''
Check if a ZFS filesystem or volume or snapshot exists.
name : string
name of dataset
type : string
also check if dataset is of a certain type, valid choices are:
filesystem, snapshot, volume, bookmark, or all.
.. versionadded:: 2015.5.0
... | [
"Check",
"if",
"a",
"ZFS",
"filesystem",
"or",
"volume",
"or",
"snapshot",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L48-L87 | [
"def",
"exists",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"opts",
"=",
"{",
"}",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'type'",
",",
"False",
")",
":",
"opts",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a ZFS File System.
name : string
name of dataset or volume
volume_size : string
if specified, a zvol will be created instead of a dataset
sparse : boolean
create sparse volume
create_parent : boolean
creates all the non-existing parent datasets. any property speci... | salt/modules/zfs.py | def create(name, **kwargs):
'''
Create a ZFS File System.
name : string
name of dataset or volume
volume_size : string
if specified, a zvol will be created instead of a dataset
sparse : boolean
create sparse volume
create_parent : boolean
creates all the non-exis... | def create(name, **kwargs):
'''
Create a ZFS File System.
name : string
name of dataset or volume
volume_size : string
if specified, a zvol will be created instead of a dataset
sparse : boolean
create sparse volume
create_parent : boolean
creates all the non-exis... | [
"Create",
"a",
"ZFS",
"File",
"System",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L90-L154 | [
"def",
"create",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"opts",
"=",
"{",
"}",
"# NOTE: push filesystem properties",
"filesystem_properties",
"=",
"kwargs",
".",
"get",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy a ZFS File System.
name : string
name of dataset, volume, or snapshot
force : boolean
force an unmount of any file systems using the unmount -f command.
recursive : boolean
recursively destroy all children. (-r)
recursive_all : boolean
recursively destroy all dep... | salt/modules/zfs.py | def destroy(name, **kwargs):
'''
Destroy a ZFS File System.
name : string
name of dataset, volume, or snapshot
force : boolean
force an unmount of any file systems using the unmount -f command.
recursive : boolean
recursively destroy all children. (-r)
recursive_all : bo... | def destroy(name, **kwargs):
'''
Destroy a ZFS File System.
name : string
name of dataset, volume, or snapshot
force : boolean
force an unmount of any file systems using the unmount -f command.
recursive : boolean
recursively destroy all children. (-r)
recursive_all : bo... | [
"Destroy",
"a",
"ZFS",
"File",
"System",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L157-L205 | [
"def",
"destroy",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'force'",
",",
"False",
")",
":",
"flag... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename | Rename or Relocate a ZFS File System.
name : string
name of dataset, volume, or snapshot
new_name : string
new name of dataset, volume, or snapshot
force : boolean
force unmount any filesystems that need to be unmounted in the process.
create_parent : boolean
creates all... | salt/modules/zfs.py | def rename(name, new_name, **kwargs):
'''
Rename or Relocate a ZFS File System.
name : string
name of dataset, volume, or snapshot
new_name : string
new name of dataset, volume, or snapshot
force : boolean
force unmount any filesystems that need to be unmounted in the proces... | def rename(name, new_name, **kwargs):
'''
Rename or Relocate a ZFS File System.
name : string
name of dataset, volume, or snapshot
new_name : string
new name of dataset, volume, or snapshot
force : boolean
force unmount any filesystems that need to be unmounted in the proces... | [
"Rename",
"or",
"Relocate",
"a",
"ZFS",
"File",
"System",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L208-L270 | [
"def",
"rename",
"(",
"name",
",",
"new_name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"__utils__",
"[",
"'zfs.is_s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | Return a list of all datasets or a specified dataset on the system and the
values of their used, available, referenced, and mountpoint properties.
name : string
name of dataset, volume, or snapshot
recursive : boolean
recursively list children
depth : int
limit recursion to dept... | salt/modules/zfs.py | def list_(name=None, **kwargs):
'''
Return a list of all datasets or a specified dataset on the system and the
values of their used, available, referenced, and mountpoint properties.
name : string
name of dataset, volume, or snapshot
recursive : boolean
recursively list children
... | def list_(name=None, **kwargs):
'''
Return a list of all datasets or a specified dataset on the system and the
values of their used, available, referenced, and mountpoint properties.
name : string
name of dataset, volume, or snapshot
recursive : boolean
recursively list children
... | [
"Return",
"a",
"list",
"of",
"all",
"datasets",
"or",
"a",
"specified",
"dataset",
"on",
"the",
"system",
"and",
"the",
"values",
"of",
"their",
"used",
"available",
"referenced",
"and",
"mountpoint",
"properties",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L273-L374 | [
"def",
"list_",
"(",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"## update properties",
"# NOTE: properties should be a list",
"properties",
"=",
"kwargs",
".",
"get",
"(",
"'properties'",
",",
"'used,avail,refer... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_mount | List mounted zfs filesystems
.. versionadded:: 2018.3.1
CLI Example:
.. code-block:: bash
salt '*' zfs.list_mount | salt/modules/zfs.py | def list_mount():
'''
List mounted zfs filesystems
.. versionadded:: 2018.3.1
CLI Example:
.. code-block:: bash
salt '*' zfs.list_mount
'''
## List mounted filesystem
res = __salt__['cmd.run_all'](
__utils__['zfs.zfs_command'](
command='mount',
),... | def list_mount():
'''
List mounted zfs filesystems
.. versionadded:: 2018.3.1
CLI Example:
.. code-block:: bash
salt '*' zfs.list_mount
'''
## List mounted filesystem
res = __salt__['cmd.run_all'](
__utils__['zfs.zfs_command'](
command='mount',
),... | [
"List",
"mounted",
"zfs",
"filesystems"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L377-L405 | [
"def",
"list_mount",
"(",
")",
":",
"## List mounted filesystem",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zfs_command'",
"]",
"(",
"command",
"=",
"'mount'",
",",
")",
",",
"python_shell",
"=",
"False",
",",
")",
"if",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mount | Mounts ZFS file systems
name : string
name of the filesystem, having this set to None will mount all filesystems. (this is the default)
overlay : boolean
perform an overlay mount.
options : string
optional comma-separated list of mount options to use temporarily for
the dura... | salt/modules/zfs.py | def mount(name=None, **kwargs):
'''
Mounts ZFS file systems
name : string
name of the filesystem, having this set to None will mount all filesystems. (this is the default)
overlay : boolean
perform an overlay mount.
options : string
optional comma-separated list of mount opt... | def mount(name=None, **kwargs):
'''
Mounts ZFS file systems
name : string
name of the filesystem, having this set to None will mount all filesystems. (this is the default)
overlay : boolean
perform an overlay mount.
options : string
optional comma-separated list of mount opt... | [
"Mounts",
"ZFS",
"file",
"systems"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L408-L471 | [
"def",
"mount",
"(",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"opts",
"=",
"{",
"}",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'ov... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unmount | Unmounts ZFS file systems
name : string
name of the filesystem, you can use None to unmount all mounted filesystems.
force : boolean
forcefully unmount the file system, even if it is currently in use.
.. warning::
Using ``-a`` for the name parameter will probably break your system... | salt/modules/zfs.py | def unmount(name, **kwargs):
'''
Unmounts ZFS file systems
name : string
name of the filesystem, you can use None to unmount all mounted filesystems.
force : boolean
forcefully unmount the file system, even if it is currently in use.
.. warning::
Using ``-a`` for the name ... | def unmount(name, **kwargs):
'''
Unmounts ZFS file systems
name : string
name of the filesystem, you can use None to unmount all mounted filesystems.
force : boolean
forcefully unmount the file system, even if it is currently in use.
.. warning::
Using ``-a`` for the name ... | [
"Unmounts",
"ZFS",
"file",
"systems"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L474-L525 | [
"def",
"unmount",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'force'",
",",
"False",
")",
":",
"flag... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | inherit | Clears the specified property
prop : string
name of property
name : string
name of the filesystem, volume, or snapshot
recursive : boolean
recursively inherit the given property for all children.
revert : boolean
revert the property to the received value if one exists; o... | salt/modules/zfs.py | def inherit(prop, name, **kwargs):
'''
Clears the specified property
prop : string
name of property
name : string
name of the filesystem, volume, or snapshot
recursive : boolean
recursively inherit the given property for all children.
revert : boolean
revert the ... | def inherit(prop, name, **kwargs):
'''
Clears the specified property
prop : string
name of property
name : string
name of the filesystem, volume, or snapshot
recursive : boolean
recursively inherit the given property for all children.
revert : boolean
revert the ... | [
"Clears",
"the",
"specified",
"property"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L528-L572 | [
"def",
"inherit",
"(",
"prop",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'recursive'",
",",
"False",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | diff | Display the difference between a snapshot of a given filesystem and
another snapshot of that filesystem from a later time or the current
contents of the filesystem.
name_a : string
name of snapshot
name_b : string
(optional) name of snapshot or filesystem
show_changetime : boolean
... | salt/modules/zfs.py | def diff(name_a, name_b=None, **kwargs):
'''
Display the difference between a snapshot of a given filesystem and
another snapshot of that filesystem from a later time or the current
contents of the filesystem.
name_a : string
name of snapshot
name_b : string
(optional) name of s... | def diff(name_a, name_b=None, **kwargs):
'''
Display the difference between a snapshot of a given filesystem and
another snapshot of that filesystem from a later time or the current
contents of the filesystem.
name_a : string
name of snapshot
name_b : string
(optional) name of s... | [
"Display",
"the",
"difference",
"between",
"a",
"snapshot",
"of",
"a",
"given",
"filesystem",
"and",
"another",
"snapshot",
"of",
"that",
"filesystem",
"from",
"a",
"later",
"time",
"or",
"the",
"current",
"contents",
"of",
"the",
"filesystem",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L575-L639 | [
"def",
"diff",
"(",
"name_a",
",",
"name_b",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"'-H'",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rollback | Roll back the given dataset to a previous snapshot.
name : string
name of snapshot
recursive : boolean
destroy any snapshots and bookmarks more recent than the one
specified.
recursive_all : boolean
destroy any more recent snapshots and bookmarks, as well as any
clon... | salt/modules/zfs.py | def rollback(name, **kwargs):
'''
Roll back the given dataset to a previous snapshot.
name : string
name of snapshot
recursive : boolean
destroy any snapshots and bookmarks more recent than the one
specified.
recursive_all : boolean
destroy any more recent snapshots ... | def rollback(name, **kwargs):
'''
Roll back the given dataset to a previous snapshot.
name : string
name of snapshot
recursive : boolean
destroy any snapshots and bookmarks more recent than the one
specified.
recursive_all : boolean
destroy any more recent snapshots ... | [
"Roll",
"back",
"the",
"given",
"dataset",
"to",
"a",
"previous",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L642-L702 | [
"def",
"rollback",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'recursive_all'",
",",
"False",
")",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | clone | Creates a clone of the given snapshot.
name_a : string
name of snapshot
name_b : string
name of filesystem or volume
create_parent : boolean
creates all the non-existing parent datasets. any property specified on the
command line using the -o option is ignored.
propertie... | salt/modules/zfs.py | def clone(name_a, name_b, **kwargs):
'''
Creates a clone of the given snapshot.
name_a : string
name of snapshot
name_b : string
name of filesystem or volume
create_parent : boolean
creates all the non-existing parent datasets. any property specified on the
command l... | def clone(name_a, name_b, **kwargs):
'''
Creates a clone of the given snapshot.
name_a : string
name of snapshot
name_b : string
name of filesystem or volume
create_parent : boolean
creates all the non-existing parent datasets. any property specified on the
command l... | [
"Creates",
"a",
"clone",
"of",
"the",
"given",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L705-L763 | [
"def",
"clone",
"(",
"name_a",
",",
"name_b",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: push filesystem properties",
"filesystem_properties",
"=",
"kwargs",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | promote | Promotes a clone file system to no longer be dependent on its "origin"
snapshot.
.. note::
This makes it possible to destroy the file system that the
clone was created from. The clone parent-child dependency relationship
is reversed, so that the origin file system becomes a clone of th... | salt/modules/zfs.py | def promote(name):
'''
Promotes a clone file system to no longer be dependent on its "origin"
snapshot.
.. note::
This makes it possible to destroy the file system that the
clone was created from. The clone parent-child dependency relationship
is reversed, so that the origin fi... | def promote(name):
'''
Promotes a clone file system to no longer be dependent on its "origin"
snapshot.
.. note::
This makes it possible to destroy the file system that the
clone was created from. The clone parent-child dependency relationship
is reversed, so that the origin fi... | [
"Promotes",
"a",
"clone",
"file",
"system",
"to",
"no",
"longer",
"be",
"dependent",
"on",
"its",
"origin",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L766-L807 | [
"def",
"promote",
"(",
"name",
")",
":",
"## Promote clone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zfs_command'",
"]",
"(",
"command",
"=",
"'promote'",
",",
"target",
"=",
"name",
",",
")",
",",
"python_shell",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bookmark | Creates a bookmark of the given snapshot
.. note::
Bookmarks mark the point in time when the snapshot was created,
and can be used as the incremental source for a zfs send command.
This feature must be enabled to be used. See zpool-features(5) for
details on ZFS feature flags and ... | salt/modules/zfs.py | def bookmark(snapshot, bookmark):
'''
Creates a bookmark of the given snapshot
.. note::
Bookmarks mark the point in time when the snapshot was created,
and can be used as the incremental source for a zfs send command.
This feature must be enabled to be used. See zpool-features(5)... | def bookmark(snapshot, bookmark):
'''
Creates a bookmark of the given snapshot
.. note::
Bookmarks mark the point in time when the snapshot was created,
and can be used as the incremental source for a zfs send command.
This feature must be enabled to be used. See zpool-features(5)... | [
"Creates",
"a",
"bookmark",
"of",
"the",
"given",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L810-L857 | [
"def",
"bookmark",
"(",
"snapshot",
",",
"bookmark",
")",
":",
"# abort if we do not have feature flags",
"if",
"not",
"__utils__",
"[",
"'zfs.has_feature_flags'",
"]",
"(",
")",
":",
"return",
"OrderedDict",
"(",
"[",
"(",
"'error'",
",",
"'bookmarks are not suppor... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | holds | Lists all existing user references for the given snapshot or snapshots.
snapshot : string
name of snapshot
recursive : boolean
lists the holds that are set on the named descendent snapshots also.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zfs.h... | salt/modules/zfs.py | def holds(snapshot, **kwargs):
'''
Lists all existing user references for the given snapshot or snapshots.
snapshot : string
name of snapshot
recursive : boolean
lists the holds that are set on the named descendent snapshots also.
.. versionadded:: 2016.3.0
CLI Example:
.... | def holds(snapshot, **kwargs):
'''
Lists all existing user references for the given snapshot or snapshots.
snapshot : string
name of snapshot
recursive : boolean
lists the holds that are set on the named descendent snapshots also.
.. versionadded:: 2016.3.0
CLI Example:
.... | [
"Lists",
"all",
"existing",
"user",
"references",
"for",
"the",
"given",
"snapshot",
"or",
"snapshots",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L860-L909 | [
"def",
"holds",
"(",
"snapshot",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"'-H'",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'rec... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hold | Adds a single reference, named with the tag argument, to the specified
snapshot or snapshots.
.. note::
Each snapshot has its own tag namespace, and tags must be unique within that space.
If a hold exists on a snapshot, attempts to destroy that snapshot by
using the zfs destroy comman... | salt/modules/zfs.py | def hold(tag, *snapshot, **kwargs):
'''
Adds a single reference, named with the tag argument, to the specified
snapshot or snapshots.
.. note::
Each snapshot has its own tag namespace, and tags must be unique within that space.
If a hold exists on a snapshot, attempts to destroy that ... | def hold(tag, *snapshot, **kwargs):
'''
Adds a single reference, named with the tag argument, to the specified
snapshot or snapshots.
.. note::
Each snapshot has its own tag namespace, and tags must be unique within that space.
If a hold exists on a snapshot, attempts to destroy that ... | [
"Adds",
"a",
"single",
"reference",
"named",
"with",
"the",
"tag",
"argument",
"to",
"the",
"specified",
"snapshot",
"or",
"snapshots",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L912-L978 | [
"def",
"hold",
"(",
"tag",
",",
"*",
"snapshot",
",",
"*",
"*",
"kwargs",
")",
":",
"## warn about tag change",
"if",
"','",
"in",
"tag",
":",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'A comma-separated tag is no suppo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | snapshot | Creates snapshots with the given names.
snapshot : string
name of snapshot(s)
recursive : boolean
recursively create snapshots of all descendent datasets.
properties : dict
additional zfs properties (-o)
.. note::
ZFS properties can be specified at the time of creation... | salt/modules/zfs.py | def snapshot(*snapshot, **kwargs):
'''
Creates snapshots with the given names.
snapshot : string
name of snapshot(s)
recursive : boolean
recursively create snapshots of all descendent datasets.
properties : dict
additional zfs properties (-o)
.. note::
ZFS prop... | def snapshot(*snapshot, **kwargs):
'''
Creates snapshots with the given names.
snapshot : string
name of snapshot(s)
recursive : boolean
recursively create snapshots of all descendent datasets.
properties : dict
additional zfs properties (-o)
.. note::
ZFS prop... | [
"Creates",
"snapshots",
"with",
"the",
"given",
"names",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L1049-L1100 | [
"def",
"snapshot",
"(",
"*",
"snapshot",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: push filesystem properties",
"filesystem_properties",
"=",
"kwargs",
".",
"get",
"(",
"'properties'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set | Sets the property or list of properties to the given value(s) for each dataset.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
additional zfs properties pairs
.. note::
properties are passed as key-value pairs. e.g.
compression=o... | salt/modules/zfs.py | def set(*dataset, **kwargs):
'''
Sets the property or list of properties to the given value(s) for each dataset.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
additional zfs properties pairs
.. note::
properties are passed as key-val... | def set(*dataset, **kwargs):
'''
Sets the property or list of properties to the given value(s) for each dataset.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
additional zfs properties pairs
.. note::
properties are passed as key-val... | [
"Sets",
"the",
"property",
"or",
"list",
"of",
"properties",
"to",
"the",
"given",
"value",
"(",
"s",
")",
"for",
"each",
"dataset",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L1103-L1155 | [
"def",
"set",
"(",
"*",
"dataset",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: push filesystem properties",
"filesystem_properties",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"## Set proper... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get | Displays properties for the given datasets.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
comma-separated list of properties to list, defaults to all
recursive : boolean
recursively list children
depth : int
recursively list childr... | salt/modules/zfs.py | def get(*dataset, **kwargs):
'''
Displays properties for the given datasets.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
comma-separated list of properties to list, defaults to all
recursive : boolean
recursively list children
de... | def get(*dataset, **kwargs):
'''
Displays properties for the given datasets.
dataset : string
name of snapshot(s), filesystem(s), or volume(s)
properties : string
comma-separated list of properties to list, defaults to all
recursive : boolean
recursively list children
de... | [
"Displays",
"properties",
"for",
"the",
"given",
"datasets",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zfs.py#L1158-L1264 | [
"def",
"get",
"(",
"*",
"dataset",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure command",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"'-H'",
"]",
"opts",
"=",
"{",
"}",
"# NOTE: set extra config from kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'d... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | warn_until | Helper function to raise a warning, by default, a ``DeprecationWarning``,
until the provided ``version``, after which, a ``RuntimeError`` will
be raised to remind the developers to remove the warning because the
target version has been reached.
:param version: The version info or name after which the w... | salt/utils/versions.py | def warn_until(version,
message,
category=DeprecationWarning,
stacklevel=None,
_version_info_=None,
_dont_call_warnings=False):
'''
Helper function to raise a warning, by default, a ``DeprecationWarning``,
until the provided ``versio... | def warn_until(version,
message,
category=DeprecationWarning,
stacklevel=None,
_version_info_=None,
_dont_call_warnings=False):
'''
Helper function to raise a warning, by default, a ``DeprecationWarning``,
until the provided ``versio... | [
"Helper",
"function",
"to",
"raise",
"a",
"warning",
"by",
"default",
"a",
"DeprecationWarning",
"until",
"the",
"provided",
"version",
"after",
"which",
"a",
"RuntimeError",
"will",
"be",
"raised",
"to",
"remind",
"the",
"developers",
"to",
"remove",
"the",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/versions.py#L78-L162 | [
"def",
"warn_until",
"(",
"version",
",",
"message",
",",
"category",
"=",
"DeprecationWarning",
",",
"stacklevel",
"=",
"None",
",",
"_version_info_",
"=",
"None",
",",
"_dont_call_warnings",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"version",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | kwargs_warn_until | Helper function to raise a warning (by default, a ``DeprecationWarning``)
when unhandled keyword arguments are passed to function, until the
provided ``version_info``, after which, a ``RuntimeError`` will be raised
to remind the developers to remove the ``**kwargs`` because the target
version has been r... | salt/utils/versions.py | def kwargs_warn_until(kwargs,
version,
category=DeprecationWarning,
stacklevel=None,
_version_info_=None,
_dont_call_warnings=False):
'''
Helper function to raise a warning (by default, a ``DeprecationW... | def kwargs_warn_until(kwargs,
version,
category=DeprecationWarning,
stacklevel=None,
_version_info_=None,
_dont_call_warnings=False):
'''
Helper function to raise a warning (by default, a ``DeprecationW... | [
"Helper",
"function",
"to",
"raise",
"a",
"warning",
"(",
"by",
"default",
"a",
"DeprecationWarning",
")",
"when",
"unhandled",
"keyword",
"arguments",
"are",
"passed",
"to",
"function",
"until",
"the",
"provided",
"version_info",
"after",
"which",
"a",
"Runtime... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/versions.py#L165-L232 | [
"def",
"kwargs_warn_until",
"(",
"kwargs",
",",
"version",
",",
"category",
"=",
"DeprecationWarning",
",",
"stacklevel",
"=",
"None",
",",
"_version_info_",
"=",
"None",
",",
"_dont_call_warnings",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"vers... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version_cmp | Compares two version strings using salt.utils.versions.LooseVersion. This
is a fallback for providers which don't have a version comparison utility
built into them. Return -1 if version1 < version2, 0 if version1 ==
version2, and 1 if version1 > version2. Return None if there was a problem
making the c... | salt/utils/versions.py | def version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using salt.utils.versions.LooseVersion. This
is a fallback for providers which don't have a version comparison utility
built into them. Return -1 if version1 < version2, 0 if version1 ==
version2, and 1 if version1 > ... | def version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using salt.utils.versions.LooseVersion. This
is a fallback for providers which don't have a version comparison utility
built into them. Return -1 if version1 < version2, 0 if version1 ==
version2, and 1 if version1 > ... | [
"Compares",
"two",
"version",
"strings",
"using",
"salt",
".",
"utils",
".",
"versions",
".",
"LooseVersion",
".",
"This",
"is",
"a",
"fallback",
"for",
"providers",
"which",
"don",
"t",
"have",
"a",
"version",
"comparison",
"utility",
"built",
"into",
"them... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/versions.py#L235-L258 | [
"def",
"version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
")",
":",
"normalize",
"=",
"lambda",
"x",
":",
"six",
".",
"text_type",
"(",
"x",
")",
".",
"split",
"(",
"':'",
",",
"1",
")",
"[",
"-",
"1",
"]",
"if",
"ignore_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | compare | Compares two version numbers. Accepts a custom function to perform the
cmp-style version comparison, otherwise uses version_cmp(). | salt/utils/versions.py | def compare(ver1='', oper='==', ver2='', cmp_func=None, ignore_epoch=False):
'''
Compares two version numbers. Accepts a custom function to perform the
cmp-style version comparison, otherwise uses version_cmp().
'''
cmp_map = {'<': (-1,), '<=': (-1, 0), '==': (0,),
'>=': (0, 1), '>': ... | def compare(ver1='', oper='==', ver2='', cmp_func=None, ignore_epoch=False):
'''
Compares two version numbers. Accepts a custom function to perform the
cmp-style version comparison, otherwise uses version_cmp().
'''
cmp_map = {'<': (-1,), '<=': (-1, 0), '==': (0,),
'>=': (0, 1), '>': ... | [
"Compares",
"two",
"version",
"numbers",
".",
"Accepts",
"a",
"custom",
"function",
"to",
"perform",
"the",
"cmp",
"-",
"style",
"version",
"comparison",
"otherwise",
"uses",
"version_cmp",
"()",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/versions.py#L261-L294 | [
"def",
"compare",
"(",
"ver1",
"=",
"''",
",",
"oper",
"=",
"'=='",
",",
"ver2",
"=",
"''",
",",
"cmp_func",
"=",
"None",
",",
"ignore_epoch",
"=",
"False",
")",
":",
"cmp_map",
"=",
"{",
"'<'",
":",
"(",
"-",
"1",
",",
")",
",",
"'<='",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_boto_reqs | Checks for the version of various required boto libs in one central location. Most
boto states and modules rely on a single version of the boto, boto3, or botocore libs.
However, some require newer versions of any of these dependencies. This function allows
the module to pass in a version to override the de... | salt/utils/versions.py | def check_boto_reqs(boto_ver=None,
boto3_ver=None,
botocore_ver=None,
check_boto=True,
check_boto3=True):
'''
Checks for the version of various required boto libs in one central location. Most
boto states and modules rely on a s... | def check_boto_reqs(boto_ver=None,
boto3_ver=None,
botocore_ver=None,
check_boto=True,
check_boto3=True):
'''
Checks for the version of various required boto libs in one central location. Most
boto states and modules rely on a s... | [
"Checks",
"for",
"the",
"version",
"of",
"various",
"required",
"boto",
"libs",
"in",
"one",
"central",
"location",
".",
"Most",
"boto",
"states",
"and",
"modules",
"rely",
"on",
"a",
"single",
"version",
"of",
"the",
"boto",
"boto3",
"or",
"botocore",
"li... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/versions.py#L297-L364 | [
"def",
"check_boto_reqs",
"(",
"boto_ver",
"=",
"None",
",",
"boto3_ver",
"=",
"None",
",",
"botocore_ver",
"=",
"None",
",",
"check_boto",
"=",
"True",
",",
"check_boto3",
"=",
"True",
")",
":",
"if",
"check_boto",
"is",
"True",
":",
"try",
":",
"# Late... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_target_group | .. versionadded:: 2017.11.0
Create target group if not present.
name
(string) - The name of the target group.
protocol
(string) - The protocol to use for routing traffic to the targets
port
(int) - The port on which the targets receive traffic. This port is used unless
... | salt/states/boto_elbv2.py | def create_target_group(name, protocol, port, vpc_id,
region=None, key=None, keyid=None, profile=None,
health_check_protocol='HTTP', health_check_port='traffic-port',
health_check_path='/', health_check_interval_seconds=30,
... | def create_target_group(name, protocol, port, vpc_id,
region=None, key=None, keyid=None, profile=None,
health_check_protocol='HTTP', health_check_port='traffic-port',
health_check_path='/', health_check_interval_seconds=30,
... | [
"..",
"versionadded",
"::",
"2017",
".",
"11",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elbv2.py#L58-L150 | [
"def",
"create_target_group",
"(",
"name",
",",
"protocol",
",",
"port",
",",
"vpc_id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"health_check_protocol",
"=",
"'HTTP'",
",",
"health... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_target_group | Delete target group.
name
(string) - The Amazon Resource Name (ARN) of the resource.
returns
(bool) - True on success, False on failure.
CLI example:
.. code-block:: bash
check-target:
boto_elb2.delete_targets_group:
- name: myALB
- protocol... | salt/states/boto_elbv2.py | def delete_target_group(name, region=None, key=None, keyid=None, profile=None):
'''
Delete target group.
name
(string) - The Amazon Resource Name (ARN) of the resource.
returns
(bool) - True on success, False on failure.
CLI example:
.. code-block:: bash
check-target... | def delete_target_group(name, region=None, key=None, keyid=None, profile=None):
'''
Delete target group.
name
(string) - The Amazon Resource Name (ARN) of the resource.
returns
(bool) - True on success, False on failure.
CLI example:
.. code-block:: bash
check-target... | [
"Delete",
"target",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elbv2.py#L153-L198 | [
"def",
"delete_target_group",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | targets_registered | .. versionadded:: 2017.7.0
Add targets to an Application Load Balancer target group. This state will not remove targets.
name
The ARN of the Application Load Balancer Target Group to add targets to.
targets
A list of target IDs or a string of a single target that this target group should
... | salt/states/boto_elbv2.py | def targets_registered(name, targets, region=None, key=None, keyid=None,
profile=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Add targets to an Application Load Balancer target group. This state will not remove targets.
name
The ARN of the Application Load Balancer Ta... | def targets_registered(name, targets, region=None, key=None, keyid=None,
profile=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Add targets to an Application Load Balancer target group. This state will not remove targets.
name
The ARN of the Application Load Balancer Ta... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elbv2.py#L201-L279 | [
"def",
"targets_registered",
"(",
"name",
",",
"targets",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_employees | Show all employees for this company.
CLI Example:
salt myminion bamboohr.list_employees
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplicate values (i.e., location is used, for a compan... | salt/modules/bamboohr.py | def list_employees(order_by='id'):
'''
Show all employees for this company.
CLI Example:
salt myminion bamboohr.list_employees
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplica... | def list_employees(order_by='id'):
'''
Show all employees for this company.
CLI Example:
salt myminion bamboohr.list_employees
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplica... | [
"Show",
"all",
"employees",
"for",
"this",
"company",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L45-L79 | [
"def",
"list_employees",
"(",
"order_by",
"=",
"'id'",
")",
":",
"ret",
"=",
"{",
"}",
"status",
",",
"result",
"=",
"_query",
"(",
"action",
"=",
"'employees'",
",",
"command",
"=",
"'directory'",
")",
"root",
"=",
"ET",
".",
"fromstring",
"(",
"resul... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_employee | Show all employees for this company.
CLI Example:
salt myminion bamboohr.show_employee 1138
By default, the fields normally returned from bamboohr.list_employees are
returned. These fields are:
- canUploadPhoto
- department
- displayName
- firstName
- id
... | salt/modules/bamboohr.py | def show_employee(emp_id, fields=None):
'''
Show all employees for this company.
CLI Example:
salt myminion bamboohr.show_employee 1138
By default, the fields normally returned from bamboohr.list_employees are
returned. These fields are:
- canUploadPhoto
- department
... | def show_employee(emp_id, fields=None):
'''
Show all employees for this company.
CLI Example:
salt myminion bamboohr.show_employee 1138
By default, the fields normally returned from bamboohr.list_employees are
returned. These fields are:
- canUploadPhoto
- department
... | [
"Show",
"all",
"employees",
"for",
"this",
"company",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L82-L150 | [
"def",
"show_employee",
"(",
"emp_id",
",",
"fields",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"fields",
"is",
"None",
":",
"fields",
"=",
"','",
".",
"join",
"(",
"(",
"'canUploadPhoto'",
",",
"'department'",
",",
"'displayName'",
",",
"'fir... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_employee | Update one or more items for this employee. Specifying an empty value will
clear it for that employee.
CLI Examples:
salt myminion bamboohr.update_employee 1138 nickname Curly
salt myminion bamboohr.update_employee 1138 nickname ''
salt myminion bamboohr.update_employee 1138 items='{"n... | salt/modules/bamboohr.py | def update_employee(emp_id, key=None, value=None, items=None):
'''
Update one or more items for this employee. Specifying an empty value will
clear it for that employee.
CLI Examples:
salt myminion bamboohr.update_employee 1138 nickname Curly
salt myminion bamboohr.update_employee 1138... | def update_employee(emp_id, key=None, value=None, items=None):
'''
Update one or more items for this employee. Specifying an empty value will
clear it for that employee.
CLI Examples:
salt myminion bamboohr.update_employee 1138 nickname Curly
salt myminion bamboohr.update_employee 1138... | [
"Update",
"one",
"or",
"more",
"items",
"for",
"this",
"employee",
".",
"Specifying",
"an",
"empty",
"value",
"will",
"clear",
"it",
"for",
"that",
"employee",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L153-L184 | [
"def",
"update_employee",
"(",
"emp_id",
",",
"key",
"=",
"None",
",",
"value",
"=",
"None",
",",
"items",
"=",
"None",
")",
":",
"if",
"items",
"is",
"None",
":",
"if",
"key",
"is",
"None",
"or",
"value",
"is",
"None",
":",
"return",
"{",
"'Error'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_users | Show all users for this company.
CLI Example:
salt myminion bamboohr.list_users
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplicate values (i.e., location is used, for a company which ... | salt/modules/bamboohr.py | def list_users(order_by='id'):
'''
Show all users for this company.
CLI Example:
salt myminion bamboohr.list_users
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplicate values (i... | def list_users(order_by='id'):
'''
Show all users for this company.
CLI Example:
salt myminion bamboohr.list_users
By default, the return data will be keyed by ID. However, it can be ordered
by any other field. Keep in mind that if the field that is chosen contains
duplicate values (i... | [
"Show",
"all",
"users",
"for",
"this",
"company",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L187-L221 | [
"def",
"list_users",
"(",
"order_by",
"=",
"'id'",
")",
":",
"ret",
"=",
"{",
"}",
"status",
",",
"result",
"=",
"_query",
"(",
"action",
"=",
"'meta'",
",",
"command",
"=",
"'users'",
")",
"root",
"=",
"ET",
".",
"fromstring",
"(",
"result",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_meta_fields | Show all meta data fields for this company.
CLI Example:
salt myminion bamboohr.list_meta_fields | salt/modules/bamboohr.py | def list_meta_fields():
'''
Show all meta data fields for this company.
CLI Example:
salt myminion bamboohr.list_meta_fields
'''
ret = {}
status, result = _query(action='meta', command='fields')
root = ET.fromstring(result)
fields = root.getchildren()
for field in fields:
... | def list_meta_fields():
'''
Show all meta data fields for this company.
CLI Example:
salt myminion bamboohr.list_meta_fields
'''
ret = {}
status, result = _query(action='meta', command='fields')
root = ET.fromstring(result)
fields = root.getchildren()
for field in fields:
... | [
"Show",
"all",
"meta",
"data",
"fields",
"for",
"this",
"company",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L224-L244 | [
"def",
"list_meta_fields",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"status",
",",
"result",
"=",
"_query",
"(",
"action",
"=",
"'meta'",
",",
"command",
"=",
"'fields'",
")",
"root",
"=",
"ET",
".",
"fromstring",
"(",
"result",
")",
"fields",
"=",
"root... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _query | Make a web call to BambooHR
The password can be any random text, so we chose Salty text. | salt/modules/bamboohr.py | def _query(action=None,
command=None,
args=None,
method='GET',
data=None):
'''
Make a web call to BambooHR
The password can be any random text, so we chose Salty text.
'''
subdomain = __opts__.get('bamboohr', {}).get('subdomain', None)
path = 'https:/... | def _query(action=None,
command=None,
args=None,
method='GET',
data=None):
'''
Make a web call to BambooHR
The password can be any random text, so we chose Salty text.
'''
subdomain = __opts__.get('bamboohr', {}).get('subdomain', None)
path = 'https:/... | [
"Make",
"a",
"web",
"call",
"to",
"BambooHR"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bamboohr.py#L247-L288 | [
"def",
"_query",
"(",
"action",
"=",
"None",
",",
"command",
"=",
"None",
",",
"args",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"data",
"=",
"None",
")",
":",
"subdomain",
"=",
"__opts__",
".",
"get",
"(",
"'bamboohr'",
",",
"{",
"}",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Get an sqlite3 connection, and initialize the package database if necessary | salt/spm/pkgdb/sqlite3.py | def init():
'''
Get an sqlite3 connection, and initialize the package database if necessary
'''
if not os.path.exists(__opts__['spm_cache_dir']):
log.debug('Creating SPM cache directory at %s', __opts__['spm_db'])
os.makedirs(__opts__['spm_cache_dir'])
if not os.path.exists(__opts__... | def init():
'''
Get an sqlite3 connection, and initialize the package database if necessary
'''
if not os.path.exists(__opts__['spm_cache_dir']):
log.debug('Creating SPM cache directory at %s', __opts__['spm_db'])
os.makedirs(__opts__['spm_cache_dir'])
if not os.path.exists(__opts__... | [
"Get",
"an",
"sqlite3",
"connection",
"and",
"initialize",
"the",
"package",
"database",
"if",
"necessary"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L20-L69 | [
"def",
"init",
"(",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"__opts__",
"[",
"'spm_cache_dir'",
"]",
")",
":",
"log",
".",
"debug",
"(",
"'Creating SPM cache directory at %s'",
",",
"__opts__",
"[",
"'spm_db'",
"]",
")",
"os",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info | List info for a package | salt/spm/pkgdb/sqlite3.py | def info(package, conn=None):
'''
List info for a package
'''
close = False
if conn is None:
close = True
conn = init()
fields = (
'package',
'version',
'release',
'installed',
'os',
'os_family',
'dependencies',
'os... | def info(package, conn=None):
'''
List info for a package
'''
close = False
if conn is None:
close = True
conn = init()
fields = (
'package',
'version',
'release',
'installed',
'os',
'os_family',
'dependencies',
'os... | [
"List",
"info",
"for",
"a",
"package"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L72-L107 | [
"def",
"info",
"(",
"package",
",",
"conn",
"=",
"None",
")",
":",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"fields",
"=",
"(",
"'package'",
",",
"'version'",
",",
"'release'",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_packages | List files for an installed package | salt/spm/pkgdb/sqlite3.py | def list_packages(conn=None):
'''
List files for an installed package
'''
close = False
if conn is None:
close = True
conn = init()
ret = []
data = conn.execute('SELECT package FROM packages')
for pkg in data.fetchall():
ret.append(pkg)
if close:
con... | def list_packages(conn=None):
'''
List files for an installed package
'''
close = False
if conn is None:
close = True
conn = init()
ret = []
data = conn.execute('SELECT package FROM packages')
for pkg in data.fetchall():
ret.append(pkg)
if close:
con... | [
"List",
"files",
"for",
"an",
"installed",
"package"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L110-L126 | [
"def",
"list_packages",
"(",
"conn",
"=",
"None",
")",
":",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"ret",
"=",
"[",
"]",
"data",
"=",
"conn",
".",
"execute",
"(",
"'SELECT packag... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_files | List files for an installed package | salt/spm/pkgdb/sqlite3.py | def list_files(package, conn=None):
'''
List files for an installed package
'''
close = False
if conn is None:
close = True
conn = init()
data = conn.execute('SELECT package FROM packages WHERE package=?', (package, ))
if not data.fetchone():
if close:
co... | def list_files(package, conn=None):
'''
List files for an installed package
'''
close = False
if conn is None:
close = True
conn = init()
data = conn.execute('SELECT package FROM packages WHERE package=?', (package, ))
if not data.fetchone():
if close:
co... | [
"List",
"files",
"for",
"an",
"installed",
"package"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L129-L151 | [
"def",
"list_files",
"(",
"package",
",",
"conn",
"=",
"None",
")",
":",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"data",
"=",
"conn",
".",
"execute",
"(",
"'SELECT package FROM packag... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | register_pkg | Register a package in the package database | salt/spm/pkgdb/sqlite3.py | def register_pkg(name, formula_def, conn=None):
'''
Register a package in the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('INSERT INTO packages VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', (
name,
formula_def['version... | def register_pkg(name, formula_def, conn=None):
'''
Register a package in the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('INSERT INTO packages VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', (
name,
formula_def['version... | [
"Register",
"a",
"package",
"in",
"the",
"package",
"database"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L154-L177 | [
"def",
"register_pkg",
"(",
"name",
",",
"formula_def",
",",
"conn",
"=",
"None",
")",
":",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"conn",
".",
"execute",
"(",
"'INSERT INTO packages... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | register_file | Register a file in the package database | salt/spm/pkgdb/sqlite3.py | def register_file(name, member, path, digest='', conn=None):
'''
Register a file in the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('INSERT INTO files VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', (
name,
'{0}/{1}'.... | def register_file(name, member, path, digest='', conn=None):
'''
Register a file in the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('INSERT INTO files VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', (
name,
'{0}/{1}'.... | [
"Register",
"a",
"file",
"in",
"the",
"package",
"database"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L180-L204 | [
"def",
"register_file",
"(",
"name",
",",
"member",
",",
"path",
",",
"digest",
"=",
"''",
",",
"conn",
"=",
"None",
")",
":",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"conn",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unregister_file | Unregister a file from the package database | salt/spm/pkgdb/sqlite3.py | def unregister_file(path, pkg=None, conn=None): # pylint: disable=W0612
'''
Unregister a file from the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('DELETE FROM files WHERE path=?', (path, ))
if close:
conn.close() | def unregister_file(path, pkg=None, conn=None): # pylint: disable=W0612
'''
Unregister a file from the package database
'''
close = False
if conn is None:
close = True
conn = init()
conn.execute('DELETE FROM files WHERE path=?', (path, ))
if close:
conn.close() | [
"Unregister",
"a",
"file",
"from",
"the",
"package",
"database"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgdb/sqlite3.py#L217-L228 | [
"def",
"unregister_file",
"(",
"path",
",",
"pkg",
"=",
"None",
",",
"conn",
"=",
"None",
")",
":",
"# pylint: disable=W0612",
"close",
"=",
"False",
"if",
"conn",
"is",
"None",
":",
"close",
"=",
"True",
"conn",
"=",
"init",
"(",
")",
"conn",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | This function gets called when the proxy starts up. | salt/proxy/bluecoat_sslv.py | def init(opts):
'''
This function gets called when the proxy starts up.
'''
if 'host' not in opts['proxy']:
log.critical('No \'host\' key found in pillar for this proxy.')
return False
if 'username' not in opts['proxy']:
log.critical('No \'username\' key found in pillar for t... | def init(opts):
'''
This function gets called when the proxy starts up.
'''
if 'host' not in opts['proxy']:
log.critical('No \'host\' key found in pillar for this proxy.')
return False
if 'username' not in opts['proxy']:
log.critical('No \'username\' key found in pillar for t... | [
"This",
"function",
"gets",
"called",
"when",
"the",
"proxy",
"starts",
"up",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L110-L142 | [
"def",
"init",
"(",
"opts",
")",
":",
"if",
"'host'",
"not",
"in",
"opts",
"[",
"'proxy'",
"]",
":",
"log",
".",
"critical",
"(",
"'No \\'host\\' key found in pillar for this proxy.'",
")",
"return",
"False",
"if",
"'username'",
"not",
"in",
"opts",
"[",
"'p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | call | Sends a post command to the device and returns the decoded data. | salt/proxy/bluecoat_sslv.py | def call(payload, apply_changes=False):
'''
Sends a post command to the device and returns the decoded data.
'''
session, cookies, csrf_token = logon()
response = _post_request(session, payload, cookies, csrf_token)
if apply_changes:
apply_payload = {"jsonrpc": "2.0",
... | def call(payload, apply_changes=False):
'''
Sends a post command to the device and returns the decoded data.
'''
session, cookies, csrf_token = logon()
response = _post_request(session, payload, cookies, csrf_token)
if apply_changes:
apply_payload = {"jsonrpc": "2.0",
... | [
"Sends",
"a",
"post",
"command",
"to",
"the",
"device",
"and",
"returns",
"the",
"decoded",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L145-L158 | [
"def",
"call",
"(",
"payload",
",",
"apply_changes",
"=",
"False",
")",
":",
"session",
",",
"cookies",
",",
"csrf_token",
"=",
"logon",
"(",
")",
"response",
"=",
"_post_request",
"(",
"session",
",",
"payload",
",",
"cookies",
",",
"csrf_token",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | logon | Logs into the bluecoat_sslv device and returns the session cookies. | salt/proxy/bluecoat_sslv.py | def logon():
'''
Logs into the bluecoat_sslv device and returns the session cookies.
'''
session = requests.session()
payload = {"jsonrpc": "2.0",
"id": "ID0",
"method": "login",
"params": [DETAILS['username'], DETAILS['password'], DETAILS['auth'], True]
... | def logon():
'''
Logs into the bluecoat_sslv device and returns the session cookies.
'''
session = requests.session()
payload = {"jsonrpc": "2.0",
"id": "ID0",
"method": "login",
"params": [DETAILS['username'], DETAILS['password'], DETAILS['auth'], True]
... | [
"Logs",
"into",
"the",
"bluecoat_sslv",
"device",
"and",
"returns",
"the",
"session",
"cookies",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L170-L198 | [
"def",
"logon",
"(",
")",
":",
"session",
"=",
"requests",
".",
"session",
"(",
")",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"login\"",
",",
"\"params\"",
":",
"[",
"DETAILS",
"[",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | logout | Closes the session with the device. | salt/proxy/bluecoat_sslv.py | def logout(session, cookies, csrf_token):
'''
Closes the session with the device.
'''
payload = {"jsonrpc": "2.0",
"id": "ID0",
"method": "logout",
"params": []
}
session.post(DETAILS['url'],
data=json.dumps(payload),
... | def logout(session, cookies, csrf_token):
'''
Closes the session with the device.
'''
payload = {"jsonrpc": "2.0",
"id": "ID0",
"method": "logout",
"params": []
}
session.post(DETAILS['url'],
data=json.dumps(payload),
... | [
"Closes",
"the",
"session",
"with",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L201-L213 | [
"def",
"logout",
"(",
"session",
",",
"cookies",
",",
"csrf_token",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"logout\"",
",",
"\"params\"",
":",
"[",
"]",
"}",
"session",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | grains | Get the grains from the proxied device | salt/proxy/bluecoat_sslv.py | def grains():
'''
Get the grains from the proxied device
'''
if not DETAILS.get('grains_cache', {}):
DETAILS['grains_cache'] = GRAINS_CACHE
try:
DETAILS['grains_cache'] = _get_grain_information()
except salt.exceptions.CommandExecutionError:
pass
e... | def grains():
'''
Get the grains from the proxied device
'''
if not DETAILS.get('grains_cache', {}):
DETAILS['grains_cache'] = GRAINS_CACHE
try:
DETAILS['grains_cache'] = _get_grain_information()
except salt.exceptions.CommandExecutionError:
pass
e... | [
"Get",
"the",
"grains",
"from",
"the",
"proxied",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L250-L262 | [
"def",
"grains",
"(",
")",
":",
"if",
"not",
"DETAILS",
".",
"get",
"(",
"'grains_cache'",
",",
"{",
"}",
")",
":",
"DETAILS",
"[",
"'grains_cache'",
"]",
"=",
"GRAINS_CACHE",
"try",
":",
"DETAILS",
"[",
"'grains_cache'",
"]",
"=",
"_get_grain_information"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ping | Returns true if the device is reachable, else false. | salt/proxy/bluecoat_sslv.py | def ping():
'''
Returns true if the device is reachable, else false.
'''
try:
session, cookies, csrf_token = logon()
logout(session, cookies, csrf_token)
except salt.exceptions.CommandExecutionError:
return False
except Exception as err:
log.debug(err)
ret... | def ping():
'''
Returns true if the device is reachable, else false.
'''
try:
session, cookies, csrf_token = logon()
logout(session, cookies, csrf_token)
except salt.exceptions.CommandExecutionError:
return False
except Exception as err:
log.debug(err)
ret... | [
"Returns",
"true",
"if",
"the",
"device",
"is",
"reachable",
"else",
"false",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/bluecoat_sslv.py#L273-L285 | [
"def",
"ping",
"(",
")",
":",
"try",
":",
"session",
",",
"cookies",
",",
"csrf_token",
"=",
"logon",
"(",
")",
"logout",
"(",
"session",
",",
"cookies",
",",
"csrf_token",
")",
"except",
"salt",
".",
"exceptions",
".",
"CommandExecutionError",
":",
"ret... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cmd | .. versionadded:: 2015.5.0
.. versionchanged:: 2017.7.0
The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
releases must use ``expr_form``.
Execute a single command via the salt-ssh subsystem and return all
routines at once
A wrapper around the :py:meth:`SSHClient.cmd... | salt/runners/ssh.py | def cmd(tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None):
'''
.. versionadded:: 2015.5.0
.. versionchanged:: 2017.7.0
The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
releases must use ``expr_form``.
Execute a singl... | def cmd(tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None):
'''
.. versionadded:: 2015.5.0
.. versionchanged:: 2017.7.0
The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
releases must use ``expr_form``.
Execute a singl... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0",
"..",
"versionchanged",
"::",
"2017",
".",
"7",
".",
"0",
"The",
"expr_form",
"argument",
"has",
"been",
"renamed",
"to",
"tgt_type",
"earlier",
"releases",
"must",
"use",
"expr_form",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/ssh.py#L15-L40 | [
"def",
"cmd",
"(",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"kwarg",
"=",
"None",
")",
":",
"client",
"=",
"salt",
".",
"client",
".",
"ssh",
".",
"client",
".",
"SSHClient",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mk_token | Mint a new token using the config option hash_type and store tdata with 'token' attribute set
to the token.
This module uses the hash of random 512 bytes as a token.
:param opts: Salt master config options
:param tdata: Token data to be stored with 'token' attirbute of this dict set to the token.
:... | salt/tokens/localfs.py | def mk_token(opts, tdata):
'''
Mint a new token using the config option hash_type and store tdata with 'token' attribute set
to the token.
This module uses the hash of random 512 bytes as a token.
:param opts: Salt master config options
:param tdata: Token data to be stored with 'token' attirbu... | def mk_token(opts, tdata):
'''
Mint a new token using the config option hash_type and store tdata with 'token' attribute set
to the token.
This module uses the hash of random 512 bytes as a token.
:param opts: Salt master config options
:param tdata: Token data to be stored with 'token' attirbu... | [
"Mint",
"a",
"new",
"token",
"using",
"the",
"config",
"option",
"hash_type",
"and",
"store",
"tdata",
"with",
"token",
"attribute",
"set",
"to",
"the",
"token",
".",
"This",
"module",
"uses",
"the",
"hash",
"of",
"random",
"512",
"bytes",
"as",
"a",
"to... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tokens/localfs.py#L24-L50 | [
"def",
"mk_token",
"(",
"opts",
",",
"tdata",
")",
":",
"hash_type",
"=",
"getattr",
"(",
"hashlib",
",",
"opts",
".",
"get",
"(",
"'hash_type'",
",",
"'md5'",
")",
")",
"tok",
"=",
"six",
".",
"text_type",
"(",
"hash_type",
"(",
"os",
".",
"urandom"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_token | Fetch the token data from the store.
:param opts: Salt master config options
:param tok: Token value to get
:returns: Token data if successful. Empty dict if failed. | salt/tokens/localfs.py | def get_token(opts, tok):
'''
Fetch the token data from the store.
:param opts: Salt master config options
:param tok: Token value to get
:returns: Token data if successful. Empty dict if failed.
'''
t_path = os.path.join(opts['token_dir'], tok)
if not os.path.isfile(t_path):
re... | def get_token(opts, tok):
'''
Fetch the token data from the store.
:param opts: Salt master config options
:param tok: Token value to get
:returns: Token data if successful. Empty dict if failed.
'''
t_path = os.path.join(opts['token_dir'], tok)
if not os.path.isfile(t_path):
re... | [
"Fetch",
"the",
"token",
"data",
"from",
"the",
"store",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tokens/localfs.py#L53-L72 | [
"def",
"get_token",
"(",
"opts",
",",
"tok",
")",
":",
"t_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'token_dir'",
"]",
",",
"tok",
")",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"t_path",
")",
":",
"return",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rm_token | Remove token from the store.
:param opts: Salt master config options
:param tok: Token to remove
:returns: Empty dict if successful. None if failed. | salt/tokens/localfs.py | def rm_token(opts, tok):
'''
Remove token from the store.
:param opts: Salt master config options
:param tok: Token to remove
:returns: Empty dict if successful. None if failed.
'''
t_path = os.path.join(opts['token_dir'], tok)
try:
os.remove(t_path)
return {}
except... | def rm_token(opts, tok):
'''
Remove token from the store.
:param opts: Salt master config options
:param tok: Token to remove
:returns: Empty dict if successful. None if failed.
'''
t_path = os.path.join(opts['token_dir'], tok)
try:
os.remove(t_path)
return {}
except... | [
"Remove",
"token",
"from",
"the",
"store",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tokens/localfs.py#L75-L88 | [
"def",
"rm_token",
"(",
"opts",
",",
"tok",
")",
":",
"t_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'token_dir'",
"]",
",",
"tok",
")",
"try",
":",
"os",
".",
"remove",
"(",
"t_path",
")",
"return",
"{",
"}",
"except",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_tokens | List all tokens in the store.
:param opts: Salt master config options
:returns: List of dicts (tokens) | salt/tokens/localfs.py | def list_tokens(opts):
'''
List all tokens in the store.
:param opts: Salt master config options
:returns: List of dicts (tokens)
'''
ret = []
for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(opts['token_dir']):
for token in filenames:
ret.append(token)
... | def list_tokens(opts):
'''
List all tokens in the store.
:param opts: Salt master config options
:returns: List of dicts (tokens)
'''
ret = []
for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(opts['token_dir']):
for token in filenames:
ret.append(token)
... | [
"List",
"all",
"tokens",
"in",
"the",
"store",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tokens/localfs.py#L91-L102 | [
"def",
"list_tokens",
"(",
"opts",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"(",
"dirpath",
",",
"dirnames",
",",
"filenames",
")",
"in",
"salt",
".",
"utils",
".",
"path",
".",
"os_walk",
"(",
"opts",
"[",
"'token_dir'",
"]",
")",
":",
"for",
"token... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | islink | Equivalent to os.path.islink() | salt/utils/path.py | def islink(path):
'''
Equivalent to os.path.islink()
'''
if six.PY3 or not salt.utils.platform.is_windows():
return os.path.islink(path)
if not HAS_WIN32FILE:
log.error('Cannot check if %s is a link, missing required modules', path)
if not _is_reparse_point(path):
retur... | def islink(path):
'''
Equivalent to os.path.islink()
'''
if six.PY3 or not salt.utils.platform.is_windows():
return os.path.islink(path)
if not HAS_WIN32FILE:
log.error('Cannot check if %s is a link, missing required modules', path)
if not _is_reparse_point(path):
retur... | [
"Equivalent",
"to",
"os",
".",
"path",
".",
"islink",
"()"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L41-L73 | [
"def",
"islink",
"(",
"path",
")",
":",
"if",
"six",
".",
"PY3",
"or",
"not",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"islink",
"(",
"path",
")",
"if",
"not",
"HAS_WIN32FILE",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | readlink | Equivalent to os.readlink() | salt/utils/path.py | def readlink(path):
'''
Equivalent to os.readlink()
'''
if six.PY3 or not salt.utils.platform.is_windows():
return os.readlink(path)
if not HAS_WIN32FILE:
log.error('Cannot read %s, missing required modules', path)
reparse_data = _get_reparse_data(path)
if not reparse_data... | def readlink(path):
'''
Equivalent to os.readlink()
'''
if six.PY3 or not salt.utils.platform.is_windows():
return os.readlink(path)
if not HAS_WIN32FILE:
log.error('Cannot read %s, missing required modules', path)
reparse_data = _get_reparse_data(path)
if not reparse_data... | [
"Equivalent",
"to",
"os",
".",
"readlink",
"()"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L76-L136 | [
"def",
"readlink",
"(",
"path",
")",
":",
"if",
"six",
".",
"PY3",
"or",
"not",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"return",
"os",
".",
"readlink",
"(",
"path",
")",
"if",
"not",
"HAS_WIN32FILE",
":",
"log",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _is_reparse_point | Returns True if path is a reparse point; False otherwise. | salt/utils/path.py | def _is_reparse_point(path):
'''
Returns True if path is a reparse point; False otherwise.
'''
result = win32file.GetFileAttributesW(path)
if result == -1:
return False
return True if result & 0x400 else False | def _is_reparse_point(path):
'''
Returns True if path is a reparse point; False otherwise.
'''
result = win32file.GetFileAttributesW(path)
if result == -1:
return False
return True if result & 0x400 else False | [
"Returns",
"True",
"if",
"path",
"is",
"a",
"reparse",
"point",
";",
"False",
"otherwise",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L139-L148 | [
"def",
"_is_reparse_point",
"(",
"path",
")",
":",
"result",
"=",
"win32file",
".",
"GetFileAttributesW",
"(",
"path",
")",
"if",
"result",
"==",
"-",
"1",
":",
"return",
"False",
"return",
"True",
"if",
"result",
"&",
"0x400",
"else",
"False"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_reparse_data | Retrieves the reparse point data structure for the given path.
If the path is not a reparse point, None is returned.
See http://msdn.microsoft.com/en-us/library/ff552012.aspx for details on the
REPARSE_DATA_BUFFER structure returned. | salt/utils/path.py | def _get_reparse_data(path):
'''
Retrieves the reparse point data structure for the given path.
If the path is not a reparse point, None is returned.
See http://msdn.microsoft.com/en-us/library/ff552012.aspx for details on the
REPARSE_DATA_BUFFER structure returned.
'''
# ensure paths are ... | def _get_reparse_data(path):
'''
Retrieves the reparse point data structure for the given path.
If the path is not a reparse point, None is returned.
See http://msdn.microsoft.com/en-us/library/ff552012.aspx for details on the
REPARSE_DATA_BUFFER structure returned.
'''
# ensure paths are ... | [
"Retrieves",
"the",
"reparse",
"point",
"data",
"structure",
"for",
"the",
"given",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L151-L188 | [
"def",
"_get_reparse_data",
"(",
"path",
")",
":",
"# ensure paths are using the right slashes",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"if",
"not",
"_is_reparse_point",
"(",
"path",
")",
":",
"return",
"None",
"fileHandle",
"=",
"N... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | which | Python clone of /usr/bin/which | salt/utils/path.py | def which(exe=None):
'''
Python clone of /usr/bin/which
'''
if not exe:
log.error('No executable was passed to be searched by salt.utils.path.which()')
return None
## define some utilities (we use closures here because our predecessor used them)
def is_executable_common(path):
... | def which(exe=None):
'''
Python clone of /usr/bin/which
'''
if not exe:
log.error('No executable was passed to be searched by salt.utils.path.which()')
return None
## define some utilities (we use closures here because our predecessor used them)
def is_executable_common(path):
... | [
"Python",
"clone",
"of",
"/",
"usr",
"/",
"bin",
"/",
"which"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L192-L300 | [
"def",
"which",
"(",
"exe",
"=",
"None",
")",
":",
"if",
"not",
"exe",
":",
"log",
".",
"error",
"(",
"'No executable was passed to be searched by salt.utils.path.which()'",
")",
"return",
"None",
"## define some utilities (we use closures here because our predecessor used th... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | which_bin | Scan over some possible executables and return the first one that is found | salt/utils/path.py | def which_bin(exes):
'''
Scan over some possible executables and return the first one that is found
'''
if not isinstance(exes, Iterable):
return None
for exe in exes:
path = which(exe)
if not path:
continue
return path
return None | def which_bin(exes):
'''
Scan over some possible executables and return the first one that is found
'''
if not isinstance(exes, Iterable):
return None
for exe in exes:
path = which(exe)
if not path:
continue
return path
return None | [
"Scan",
"over",
"some",
"possible",
"executables",
"and",
"return",
"the",
"first",
"one",
"that",
"is",
"found"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L303-L314 | [
"def",
"which_bin",
"(",
"exes",
")",
":",
"if",
"not",
"isinstance",
"(",
"exes",
",",
"Iterable",
")",
":",
"return",
"None",
"for",
"exe",
"in",
"exes",
":",
"path",
"=",
"which",
"(",
"exe",
")",
"if",
"not",
"path",
":",
"continue",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | join | This functions tries to solve some issues when joining multiple absolute
paths on both *nix and windows platforms.
See tests/unit/utils/path_join_test.py for some examples on what's being
talked about here.
The "use_posixpath" kwarg can be be used to force joining using poxixpath,
which is useful ... | salt/utils/path.py | def join(*parts, **kwargs):
'''
This functions tries to solve some issues when joining multiple absolute
paths on both *nix and windows platforms.
See tests/unit/utils/path_join_test.py for some examples on what's being
talked about here.
The "use_posixpath" kwarg can be be used to force joini... | def join(*parts, **kwargs):
'''
This functions tries to solve some issues when joining multiple absolute
paths on both *nix and windows platforms.
See tests/unit/utils/path_join_test.py for some examples on what's being
talked about here.
The "use_posixpath" kwarg can be be used to force joini... | [
"This",
"functions",
"tries",
"to",
"solve",
"some",
"issues",
"when",
"joining",
"multiple",
"absolute",
"paths",
"on",
"both",
"*",
"nix",
"and",
"windows",
"platforms",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L318-L357 | [
"def",
"join",
"(",
"*",
"parts",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"six",
".",
"PY3",
":",
"new_parts",
"=",
"[",
"]",
"for",
"part",
"in",
"parts",
":",
"new_parts",
".",
"append",
"(",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | sanitize_win_path | Remove illegal path characters for windows | salt/utils/path.py | def sanitize_win_path(winpath):
'''
Remove illegal path characters for windows
'''
intab = '<>:|?*'
if isinstance(winpath, six.text_type):
winpath = winpath.translate(dict((ord(c), '_') for c in intab))
elif isinstance(winpath, six.string_types):
outtab = '_' * len(intab)
... | def sanitize_win_path(winpath):
'''
Remove illegal path characters for windows
'''
intab = '<>:|?*'
if isinstance(winpath, six.text_type):
winpath = winpath.translate(dict((ord(c), '_') for c in intab))
elif isinstance(winpath, six.string_types):
outtab = '_' * len(intab)
... | [
"Remove",
"illegal",
"path",
"characters",
"for",
"windows"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L375-L386 | [
"def",
"sanitize_win_path",
"(",
"winpath",
")",
":",
"intab",
"=",
"'<>:|?*'",
"if",
"isinstance",
"(",
"winpath",
",",
"six",
".",
"text_type",
")",
":",
"winpath",
"=",
"winpath",
".",
"translate",
"(",
"dict",
"(",
"(",
"ord",
"(",
"c",
")",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | safe_path | r'''
.. versionadded:: 2017.7.3
Checks that the path is safe for modification by Salt. For example, you
wouldn't want to have salt delete the contents of ``C:\Windows``. The
following directories are considered unsafe:
- C:\, D:\, E:\, etc.
- \
- C:\Windows
Args:
path (str): ... | salt/utils/path.py | def safe_path(path, allow_path=None):
r'''
.. versionadded:: 2017.7.3
Checks that the path is safe for modification by Salt. For example, you
wouldn't want to have salt delete the contents of ``C:\Windows``. The
following directories are considered unsafe:
- C:\, D:\, E:\, etc.
- \
- C... | def safe_path(path, allow_path=None):
r'''
.. versionadded:: 2017.7.3
Checks that the path is safe for modification by Salt. For example, you
wouldn't want to have salt delete the contents of ``C:\Windows``. The
following directories are considered unsafe:
- C:\, D:\, E:\, etc.
- \
- C... | [
"r",
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"3"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L389-L443 | [
"def",
"safe_path",
"(",
"path",
",",
"allow_path",
"=",
"None",
")",
":",
"# Create regex definitions for directories that may be unsafe to modify",
"system_root",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'SystemRoot'",
",",
"'C:\\\\Windows'",
")",
"deny_paths",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | os_walk | This is a helper than ensures that all paths returned from os.walk are
unicode. | salt/utils/path.py | def os_walk(top, *args, **kwargs):
'''
This is a helper than ensures that all paths returned from os.walk are
unicode.
'''
if six.PY2 and salt.utils.platform.is_windows():
top_query = top
else:
top_query = salt.utils.stringutils.to_str(top)
for item in os.walk(top_query, *arg... | def os_walk(top, *args, **kwargs):
'''
This is a helper than ensures that all paths returned from os.walk are
unicode.
'''
if six.PY2 and salt.utils.platform.is_windows():
top_query = top
else:
top_query = salt.utils.stringutils.to_str(top)
for item in os.walk(top_query, *arg... | [
"This",
"is",
"a",
"helper",
"than",
"ensures",
"that",
"all",
"paths",
"returned",
"from",
"os",
".",
"walk",
"are",
"unicode",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/path.py#L446-L456 | [
"def",
"os_walk",
"(",
"top",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"six",
".",
"PY2",
"and",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"(",
")",
":",
"top_query",
"=",
"top",
"else",
":",
"top_query",
"=",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _process_emerge_err | Used to parse emerge output to provide meaningful output when emerge fails | salt/modules/ebuildpkg.py | def _process_emerge_err(stdout, stderr):
'''
Used to parse emerge output to provide meaningful output when emerge fails
'''
ret = {}
rexp = re.compile(r'^[<>=][^ ]+/[^ ]+ [^\n]+', re.M)
slot_conflicts = re.compile(r'^[^ \n]+/[^ ]+:[^ ]', re.M).findall(stderr)
if slot_conflicts:
ret[... | def _process_emerge_err(stdout, stderr):
'''
Used to parse emerge output to provide meaningful output when emerge fails
'''
ret = {}
rexp = re.compile(r'^[<>=][^ ]+/[^ ]+ [^\n]+', re.M)
slot_conflicts = re.compile(r'^[^ \n]+/[^ ]+:[^ ]', re.M).findall(stderr)
if slot_conflicts:
ret[... | [
"Used",
"to",
"parse",
"emerge",
"output",
"to",
"provide",
"meaningful",
"output",
"when",
"emerge",
"fails"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L138-L170 | [
"def",
"_process_emerge_err",
"(",
"stdout",
",",
"stderr",
")",
":",
"ret",
"=",
"{",
"}",
"rexp",
"=",
"re",
".",
"compile",
"(",
"r'^[<>=][^ ]+/[^ ]+ [^\\n]+'",
",",
"re",
".",
"M",
")",
"slot_conflicts",
"=",
"re",
".",
"compile",
"(",
"r'^[^ \\n]+/[^ ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_db | .. versionadded:: 0.17.0
Returns a dict containing the following information for each specified
package:
1. A key ``found``, which will be a boolean value denoting if a match was
found in the package database.
2. If ``found`` is ``False``, then a second key called ``suggestions`` will
be... | salt/modules/ebuildpkg.py | def check_db(*names, **kwargs):
'''
.. versionadded:: 0.17.0
Returns a dict containing the following information for each specified
package:
1. A key ``found``, which will be a boolean value denoting if a match was
found in the package database.
2. If ``found`` is ``False``, then a seco... | def check_db(*names, **kwargs):
'''
.. versionadded:: 0.17.0
Returns a dict containing the following information for each specified
package:
1. A key ``found``, which will be a boolean value denoting if a match was
found in the package database.
2. If ``found`` is ``False``, then a seco... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L173-L211 | [
"def",
"check_db",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"### NOTE: kwargs is not used here but needs to be present due to it being",
"### required in the check_db function in other package providers.",
"ret",
"=",
"{",
"}",
"for",
"name",
"in",
"names",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_upgradable | Utility function to get upgradable packages
Sample return data:
{ 'pkgname': '1.2.3-45', ... } | salt/modules/ebuildpkg.py | def _get_upgradable(backtrack=3):
'''
Utility function to get upgradable packages
Sample return data:
{ 'pkgname': '1.2.3-45', ... }
'''
cmd = ['emerge',
'--ask', 'n',
'--backtrack', '{0}'.format(backtrack),
'--pretend',
'--update',
'--new... | def _get_upgradable(backtrack=3):
'''
Utility function to get upgradable packages
Sample return data:
{ 'pkgname': '1.2.3-45', ... }
'''
cmd = ['emerge',
'--ask', 'n',
'--backtrack', '{0}'.format(backtrack),
'--pretend',
'--update',
'--new... | [
"Utility",
"function",
"to",
"get",
"upgradable",
"packages"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L288-L335 | [
"def",
"_get_upgradable",
"(",
"backtrack",
"=",
"3",
")",
":",
"cmd",
"=",
"[",
"'emerge'",
",",
"'--ask'",
",",
"'n'",
",",
"'--backtrack'",
",",
"'{0}'",
".",
"format",
"(",
"backtrack",
")",
",",
"'--pretend'",
",",
"'--update'",
",",
"'--newuse'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_upgrades | List all available package upgrades.
refresh
Whether or not to sync the portage tree before checking for upgrades.
backtrack
Specifies an integer number of times to backtrack if dependency
calculation fails due to a conflict or an unsatisfied dependency
(default: ´3´).
... | salt/modules/ebuildpkg.py | def list_upgrades(refresh=True, backtrack=3, **kwargs): # pylint: disable=W0613
'''
List all available package upgrades.
refresh
Whether or not to sync the portage tree before checking for upgrades.
backtrack
Specifies an integer number of times to backtrack if dependency
calc... | def list_upgrades(refresh=True, backtrack=3, **kwargs): # pylint: disable=W0613
'''
List all available package upgrades.
refresh
Whether or not to sync the portage tree before checking for upgrades.
backtrack
Specifies an integer number of times to backtrack if dependency
calc... | [
"List",
"all",
"available",
"package",
"upgrades",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L338-L360 | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"backtrack",
"=",
"3",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"refresh",
")",
":",
"refresh_db",
"(",
")",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | porttree_matches | Returns a list containing the matches for a given package name from the
portage tree. Note that the specific version of the package will not be
provided for packages that have several versions in the portage tree, but
rather the name of the package (i.e. "dev-python/paramiko"). | salt/modules/ebuildpkg.py | def porttree_matches(name):
'''
Returns a list containing the matches for a given package name from the
portage tree. Note that the specific version of the package will not be
provided for packages that have several versions in the portage tree, but
rather the name of the package (i.e. "dev-python/p... | def porttree_matches(name):
'''
Returns a list containing the matches for a given package name from the
portage tree. Note that the specific version of the package will not be
provided for packages that have several versions in the portage tree, but
rather the name of the package (i.e. "dev-python/p... | [
"Returns",
"a",
"list",
"containing",
"the",
"matches",
"for",
"a",
"given",
"package",
"name",
"from",
"the",
"portage",
"tree",
".",
"Note",
"that",
"the",
"specific",
"version",
"of",
"the",
"package",
"will",
"not",
"be",
"provided",
"for",
"packages",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L392-L403 | [
"def",
"porttree_matches",
"(",
"name",
")",
":",
"matches",
"=",
"[",
"]",
"for",
"category",
"in",
"_porttree",
"(",
")",
".",
"dbapi",
".",
"categories",
":",
"if",
"_porttree",
"(",
")",
".",
"dbapi",
".",
"cp_list",
"(",
"category",
"+",
"\"/\"",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | salt/modules/ebuildpkg.py | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | [
"List",
"the",
"packages",
"currently",
"installed",
"in",
"a",
"dict",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L406-L442 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# not yet implemented or not applicable",
"if",
"any",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | refresh_db | Update the portage tree using the first available method from the following
list:
- emaint sync
- eix-sync
- emerge-webrsync
- emerge --sync
To prevent the portage tree from being synced within one day of the
previous sync, add the following pillar data for this minion:
.. code-block:... | salt/modules/ebuildpkg.py | def refresh_db(**kwargs):
'''
Update the portage tree using the first available method from the following
list:
- emaint sync
- eix-sync
- emerge-webrsync
- emerge --sync
To prevent the portage tree from being synced within one day of the
previous sync, add the following pillar dat... | def refresh_db(**kwargs):
'''
Update the portage tree using the first available method from the following
list:
- emaint sync
- eix-sync
- emerge-webrsync
- emerge --sync
To prevent the portage tree from being synced within one day of the
previous sync, add the following pillar dat... | [
"Update",
"the",
"portage",
"tree",
"using",
"the",
"first",
"available",
"method",
"from",
"the",
"following",
"list",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L445-L499 | [
"def",
"refresh_db",
"(",
"*",
"*",
"kwargs",
")",
":",
"has_emaint",
"=",
"os",
".",
"path",
".",
"isdir",
"(",
"'/etc/portage/repos.conf'",
")",
"has_eix",
"=",
"True",
"if",
"'eix.sync'",
"in",
"__salt__",
"else",
"False",
"has_webrsync",
"=",
"True",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any emerge commands spawned by Sa... | salt/modules/ebuildpkg.py | def install(name=None,
refresh=False,
pkgs=None,
sources=None,
slot=None,
fromrepo=None,
uses=None,
binhost=None,
**kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=20... | def install(name=None,
refresh=False,
pkgs=None,
sources=None,
slot=None,
fromrepo=None,
uses=None,
binhost=None,
**kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=20... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L521-L767 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"slot",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"uses",
"=",
"None",
",",
"binhost",
"=",
"None",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any emerge commands spawned by Sa... | salt/modules/ebuildpkg.py | def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's cont... | def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's cont... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L770-L860 | [
"def",
"update",
"(",
"pkg",
",",
"slot",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"binhost",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"refr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any emerge commands spawned by Sa... | salt/modules/ebuildpkg.py | def remove(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. T... | def remove(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. T... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L953-L1049 | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"slot",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | purge | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any emerge commands spawned by Sa... | salt/modules/ebuildpkg.py | def purge(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. Th... | def purge(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. Th... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L1052-L1102 | [
"def",
"purge",
"(",
"name",
"=",
"None",
",",
"slot",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"remove",
"(",
"name",
"=",
"name",
",",
"slot",
"=",
"slot",
",",
"fromr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | depclean | Portage has a function to remove unused dependencies. If a package
is provided, it will only removed the package if no other package
depends on it.
name
The name of the package to be cleaned.
slot
Restrict the remove to a specific slot. Ignored if ``name`` is None.
fromrepo
... | salt/modules/ebuildpkg.py | def depclean(name=None, slot=None, fromrepo=None, pkgs=None):
'''
Portage has a function to remove unused dependencies. If a package
is provided, it will only removed the package if no other package
depends on it.
name
The name of the package to be cleaned.
slot
Restrict the re... | def depclean(name=None, slot=None, fromrepo=None, pkgs=None):
'''
Portage has a function to remove unused dependencies. If a package
is provided, it will only removed the package if no other package
depends on it.
name
The name of the package to be cleaned.
slot
Restrict the re... | [
"Portage",
"has",
"a",
"function",
"to",
"remove",
"unused",
"dependencies",
".",
"If",
"a",
"package",
"is",
"provided",
"it",
"will",
"only",
"removed",
"the",
"package",
"if",
"no",
"other",
"package",
"depends",
"on",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L1105-L1154 | [
"def",
"depclean",
"(",
"name",
"=",
"None",
",",
"slot",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version_cmp | Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version_cmp '0.2.4-0' '0.2.4.1-0' | salt/modules/ebuildpkg.py | def version_cmp(pkg1, pkg2, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version_cmp '0.2.4-0' '0.2.... | def version_cmp(pkg1, pkg2, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
CLI Example:
.. code-block:: bash
salt '*' pkg.version_cmp '0.2.4-0' '0.2.... | [
"Do",
"a",
"cmp",
"-",
"style",
"comparison",
"on",
"two",
"packages",
".",
"Return",
"-",
"1",
"if",
"pkg1",
"<",
"pkg2",
"0",
"if",
"pkg1",
"==",
"pkg2",
"and",
"1",
"if",
"pkg1",
">",
"pkg2",
".",
"Return",
"None",
"if",
"there",
"was",
"a",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L1157-L1185 | [
"def",
"version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"*",
"*",
"kwargs",
")",
":",
"# ignore_epoch is not supported here, but has to be included for API",
"# compatibility. Rather than putting this argument into the function",
"# definition (and thus have it show up in the docs), we just... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_extra_requirements | Check if the installed package already has the given requirements.
CLI Example:
.. code-block:: bash
salt '*' pkg.check_extra_requirements 'sys-devel/gcc' '~>4.1.2:4.1::gentoo[nls,fortran]' | salt/modules/ebuildpkg.py | def check_extra_requirements(pkgname, pkgver):
'''
Check if the installed package already has the given requirements.
CLI Example:
.. code-block:: bash
salt '*' pkg.check_extra_requirements 'sys-devel/gcc' '~>4.1.2:4.1::gentoo[nls,fortran]'
'''
keyword = None
match = re.match('^(... | def check_extra_requirements(pkgname, pkgver):
'''
Check if the installed package already has the given requirements.
CLI Example:
.. code-block:: bash
salt '*' pkg.check_extra_requirements 'sys-devel/gcc' '~>4.1.2:4.1::gentoo[nls,fortran]'
'''
keyword = None
match = re.match('^(... | [
"Check",
"if",
"the",
"installed",
"package",
"already",
"has",
"the",
"given",
"requirements",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ebuildpkg.py#L1201-L1256 | [
"def",
"check_extra_requirements",
"(",
"pkgname",
",",
"pkgver",
")",
":",
"keyword",
"=",
"None",
"match",
"=",
"re",
".",
"match",
"(",
"'^(~)?([<>])?(=)?([^<>=]*)$'",
",",
"pkgver",
")",
"if",
"match",
":",
"keyword",
",",
"gt_lt",
",",
"eq",
",",
"ver... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Install a p12 certificate file into the macOS keychain
name
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMENTS section
keychain
The keychain to install the cer... | salt/states/mac_keychain.py | def installed(name, password, keychain="/Library/Keychains/System.keychain", **kwargs):
'''
Install a p12 certificate file into the macOS keychain
name
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openss... | def installed(name, password, keychain="/Library/Keychains/System.keychain", **kwargs):
'''
Install a p12 certificate file into the macOS keychain
name
The certificate to install
password
The password for the certificate being installed formatted in the way
described for openss... | [
"Install",
"a",
"p12",
"certificate",
"file",
"into",
"the",
"macOS",
"keychain"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mac_keychain.py#L36-L98 | [
"def",
"installed",
"(",
"name",
",",
"password",
",",
"keychain",
"=",
"\"/Library/Keychains/System.keychain\"",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | uninstalled | Uninstall a p12 certificate file from the macOS keychain
name
The certificate to uninstall, this can be a path for a .p12 or the friendly
name
password
The password for the certificate being installed formatted in the way
described for openssl command in the PASS PHRASE ARGUMEN... | salt/states/mac_keychain.py | def uninstalled(name, password, keychain="/Library/Keychains/System.keychain", keychain_password=None):
'''
Uninstall a p12 certificate file from the macOS keychain
name
The certificate to uninstall, this can be a path for a .p12 or the friendly
name
password
The password for t... | def uninstalled(name, password, keychain="/Library/Keychains/System.keychain", keychain_password=None):
'''
Uninstall a p12 certificate file from the macOS keychain
name
The certificate to uninstall, this can be a path for a .p12 or the friendly
name
password
The password for t... | [
"Uninstall",
"a",
"p12",
"certificate",
"file",
"from",
"the",
"macOS",
"keychain"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mac_keychain.py#L101-L151 | [
"def",
"uninstalled",
"(",
"name",
",",
"password",
",",
"keychain",
"=",
"\"/Library/Keychains/System.keychain\"",
",",
"keychain_password",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | default_keychain | Set the default keychain to use
name
The chain in which to use as the default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to run as | salt/states/mac_keychain.py | def default_keychain(name, domain="user", user=None):
'''
Set the default keychain to use
name
The chain in which to use as the default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to run as
'''
ret = {'na... | def default_keychain(name, domain="user", user=None):
'''
Set the default keychain to use
name
The chain in which to use as the default
domain
The domain to use valid values are user|system|common|dynamic, the default is user
user
The user to run as
'''
ret = {'na... | [
"Set",
"the",
"default",
"keychain",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mac_keychain.py#L154-L189 | [
"def",
"default_keychain",
"(",
"name",
",",
"domain",
"=",
"\"user\"",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bootstrap_app | Grab the opts dict of the master config by trying to import Salt | salt/netapi/rest_cherrypy/wsgi.py | def bootstrap_app():
'''
Grab the opts dict of the master config by trying to import Salt
'''
from salt.netapi.rest_cherrypy import app
import salt.config
__opts__ = salt.config.client_config(
os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
return app.get_app(__opts__) | def bootstrap_app():
'''
Grab the opts dict of the master config by trying to import Salt
'''
from salt.netapi.rest_cherrypy import app
import salt.config
__opts__ = salt.config.client_config(
os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
return app.get_app(__opts__) | [
"Grab",
"the",
"opts",
"dict",
"of",
"the",
"master",
"config",
"by",
"trying",
"to",
"import",
"Salt"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/wsgi.py#L55-L64 | [
"def",
"bootstrap_app",
"(",
")",
":",
"from",
"salt",
".",
"netapi",
".",
"rest_cherrypy",
"import",
"app",
"import",
"salt",
".",
"config",
"__opts__",
"=",
"salt",
".",
"config",
".",
"client_config",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'SALT... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_application | Returns a WSGI application function. If you supply the WSGI app and config
it will use that, otherwise it will try to obtain them from a local Salt
installation | salt/netapi/rest_cherrypy/wsgi.py | def get_application(*args):
'''
Returns a WSGI application function. If you supply the WSGI app and config
it will use that, otherwise it will try to obtain them from a local Salt
installation
'''
opts_tuple = args
def wsgi_app(environ, start_response):
root, _, conf = opts_tuple or... | def get_application(*args):
'''
Returns a WSGI application function. If you supply the WSGI app and config
it will use that, otherwise it will try to obtain them from a local Salt
installation
'''
opts_tuple = args
def wsgi_app(environ, start_response):
root, _, conf = opts_tuple or... | [
"Returns",
"a",
"WSGI",
"application",
"function",
".",
"If",
"you",
"supply",
"the",
"WSGI",
"app",
"and",
"config",
"it",
"will",
"use",
"that",
"otherwise",
"it",
"will",
"try",
"to",
"obtain",
"them",
"from",
"a",
"local",
"Salt",
"installation"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/wsgi.py#L67-L82 | [
"def",
"get_application",
"(",
"*",
"args",
")",
":",
"opts_tuple",
"=",
"args",
"def",
"wsgi_app",
"(",
"environ",
",",
"start_response",
")",
":",
"root",
",",
"_",
",",
"conf",
"=",
"opts_tuple",
"or",
"bootstrap_app",
"(",
")",
"cherrypy",
".",
"conf... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_conn | Return a sqlite3 database connection | salt/returners/sqlite3_return.py | def _get_conn(ret=None):
'''
Return a sqlite3 database connection
'''
# Possible todo: support detect_types, isolation_level, check_same_thread,
# factory, cached_statements. Do we really need to though?
_options = _get_options(ret)
database = _options.get('database')
timeout = _options.... | def _get_conn(ret=None):
'''
Return a sqlite3 database connection
'''
# Possible todo: support detect_types, isolation_level, check_same_thread,
# factory, cached_statements. Do we really need to though?
_options = _get_options(ret)
database = _options.get('database')
timeout = _options.... | [
"Return",
"a",
"sqlite3",
"database",
"connection"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L131-L149 | [
"def",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
":",
"# Possible todo: support detect_types, isolation_level, check_same_thread,",
"# factory, cached_statements. Do we really need to though?",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"database",
"=",
"_options",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Insert minion return data into the sqlite3 database | salt/returners/sqlite3_return.py | def returner(ret):
'''
Insert minion return data into the sqlite3 database
'''
log.debug('sqlite3 returner <returner> called with data: %s', ret)
conn = _get_conn(ret)
cur = conn.cursor()
sql = '''INSERT INTO salt_returns
(fun, jid, id, fun_args, date, full_ret, success)
... | def returner(ret):
'''
Insert minion return data into the sqlite3 database
'''
log.debug('sqlite3 returner <returner> called with data: %s', ret)
conn = _get_conn(ret)
cur = conn.cursor()
sql = '''INSERT INTO salt_returns
(fun, jid, id, fun_args, date, full_ret, success)
... | [
"Insert",
"minion",
"return",
"data",
"into",
"the",
"sqlite3",
"database"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L161-L179 | [
"def",
"returner",
"(",
"ret",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <returner> called with data: %s'",
",",
"ret",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"sql",
"=",
"'''INSERT INTO salt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save_load | Save the load to the specified jid | salt/returners/sqlite3_return.py | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
log.debug('sqlite3 returner <save_load> called jid: %s load: %s', jid, load)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''INSERT INTO jids (jid, load) VALUES (:jid, :load)'''
cur.execute(sql,
... | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
log.debug('sqlite3 returner <save_load> called jid: %s load: %s', jid, load)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''INSERT INTO jids (jid, load) VALUES (:jid, :load)'''
cur.execute(sql,
... | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L182-L193 | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <save_load> called jid: %s load: %s'",
",",
"jid",
",",
"load",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_load | Return the load from a specified jid | salt/returners/sqlite3_return.py | def get_load(jid):
'''
Return the load from a specified jid
'''
log.debug('sqlite3 returner <get_load> called jid: %s', jid)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT load FROM jids WHERE jid = :jid'''
cur.execute(sql,
{'jid': jid})
data = cur.fet... | def get_load(jid):
'''
Return the load from a specified jid
'''
log.debug('sqlite3 returner <get_load> called jid: %s', jid)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT load FROM jids WHERE jid = :jid'''
cur.execute(sql,
{'jid': jid})
data = cur.fet... | [
"Return",
"the",
"load",
"from",
"a",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L203-L217 | [
"def",
"get_load",
"(",
"jid",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <get_load> called jid: %s'",
",",
"jid",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"sql",
"=",
"'''SELEC... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jid | Return the information returned from a specified jid | salt/returners/sqlite3_return.py | def get_jid(jid):
'''
Return the information returned from a specified jid
'''
log.debug('sqlite3 returner <get_jid> called jid: %s', jid)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT id, full_ret FROM salt_returns WHERE jid = :jid'''
cur.execute(sql,
{'... | def get_jid(jid):
'''
Return the information returned from a specified jid
'''
log.debug('sqlite3 returner <get_jid> called jid: %s', jid)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT id, full_ret FROM salt_returns WHERE jid = :jid'''
cur.execute(sql,
{'... | [
"Return",
"the",
"information",
"returned",
"from",
"a",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L220-L237 | [
"def",
"get_jid",
"(",
"jid",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <get_jid> called jid: %s'",
",",
"jid",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"sql",
"=",
"'''SELECT ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_fun | Return a dict of the last function called for all minions | salt/returners/sqlite3_return.py | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
log.debug('sqlite3 returner <get_fun> called fun: %s', fun)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT s.id, s.full_ret, s.jid
FROM salt_returns s
JOIN ( SELECT MAX... | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
log.debug('sqlite3 returner <get_fun> called fun: %s', fun)
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT s.id, s.full_ret, s.jid
FROM salt_returns s
JOIN ( SELECT MAX... | [
"Return",
"a",
"dict",
"of",
"the",
"last",
"function",
"called",
"for",
"all",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L240-L265 | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <get_fun> called fun: %s'",
",",
"fun",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"sql",
"=",
"'''SELECT ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_minions | Return a list of minions | salt/returners/sqlite3_return.py | def get_minions():
'''
Return a list of minions
'''
log.debug('sqlite3 returner <get_minions> called')
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT DISTINCT id FROM salt_returns'''
cur.execute(sql)
data = cur.fetchall()
ret = []
for minion in data:
r... | def get_minions():
'''
Return a list of minions
'''
log.debug('sqlite3 returner <get_minions> called')
conn = _get_conn(ret=None)
cur = conn.cursor()
sql = '''SELECT DISTINCT id FROM salt_returns'''
cur.execute(sql)
data = cur.fetchall()
ret = []
for minion in data:
r... | [
"Return",
"a",
"list",
"of",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sqlite3_return.py#L285-L299 | [
"def",
"get_minions",
"(",
")",
":",
"log",
".",
"debug",
"(",
"'sqlite3 returner <get_minions> called'",
")",
"conn",
"=",
"_get_conn",
"(",
"ret",
"=",
"None",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"sql",
"=",
"'''SELECT DISTINCT id FROM salt_ret... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_worktree_support | Ensure that we don't try to operate on worktrees in git < 2.5.0. | salt/modules/git.py | def _check_worktree_support(failhard=True):
'''
Ensure that we don't try to operate on worktrees in git < 2.5.0.
'''
git_version = version(versioninfo=False)
if _LooseVersion(git_version) < _LooseVersion('2.5.0'):
if failhard:
raise CommandExecutionError(
'Worktre... | def _check_worktree_support(failhard=True):
'''
Ensure that we don't try to operate on worktrees in git < 2.5.0.
'''
git_version = version(versioninfo=False)
if _LooseVersion(git_version) < _LooseVersion('2.5.0'):
if failhard:
raise CommandExecutionError(
'Worktre... | [
"Ensure",
"that",
"we",
"don",
"t",
"try",
"to",
"operate",
"on",
"worktrees",
"in",
"git",
"<",
"2",
".",
"5",
".",
"0",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L48-L60 | [
"def",
"_check_worktree_support",
"(",
"failhard",
"=",
"True",
")",
":",
"git_version",
"=",
"version",
"(",
"versioninfo",
"=",
"False",
")",
"if",
"_LooseVersion",
"(",
"git_version",
")",
"<",
"_LooseVersion",
"(",
"'2.5.0'",
")",
":",
"if",
"failhard",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _config_getter | Common code for config.get_* functions, builds and runs the git CLI command
and returns the result dict for the calling function to parse. | salt/modules/git.py | def _config_getter(get_opt,
key,
value_regex=None,
cwd=None,
user=None,
password=None,
ignore_retcode=False,
output_encoding=None,
**kwargs):
'''
Common code fo... | def _config_getter(get_opt,
key,
value_regex=None,
cwd=None,
user=None,
password=None,
ignore_retcode=False,
output_encoding=None,
**kwargs):
'''
Common code fo... | [
"Common",
"code",
"for",
"config",
".",
"get_",
"*",
"functions",
"builds",
"and",
"runs",
"the",
"git",
"CLI",
"command",
"and",
"returns",
"the",
"result",
"dict",
"for",
"the",
"calling",
"function",
"to",
"parse",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L63-L110 | [
"def",
"_config_getter",
"(",
"get_opt",
",",
"key",
",",
"value_regex",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"ignore_retcode",
"=",
"False",
",",
"output_encoding",
"=",
"None",
",",
"*",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _expand_path | Expand home directory | salt/modules/git.py | def _expand_path(cwd, user):
'''
Expand home directory
'''
try:
to_expand = '~' + user if user else '~'
except TypeError:
# Users should never be numeric but if we don't account for this then
# we're going to get a traceback if someone passes this invalid input.
to_ex... | def _expand_path(cwd, user):
'''
Expand home directory
'''
try:
to_expand = '~' + user if user else '~'
except TypeError:
# Users should never be numeric but if we don't account for this then
# we're going to get a traceback if someone passes this invalid input.
to_ex... | [
"Expand",
"home",
"directory"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L113-L126 | [
"def",
"_expand_path",
"(",
"cwd",
",",
"user",
")",
":",
"try",
":",
"to_expand",
"=",
"'~'",
"+",
"user",
"if",
"user",
"else",
"'~'",
"except",
"TypeError",
":",
"# Users should never be numeric but if we don't account for this then",
"# we're going to get a tracebac... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _path_is_executable_others | Check every part of path for executable permission | salt/modules/git.py | def _path_is_executable_others(path):
'''
Check every part of path for executable permission
'''
prevpath = None
while path and path != prevpath:
try:
if not os.stat(path).st_mode & stat.S_IXOTH:
return False
except OSError:
return False
... | def _path_is_executable_others(path):
'''
Check every part of path for executable permission
'''
prevpath = None
while path and path != prevpath:
try:
if not os.stat(path).st_mode & stat.S_IXOTH:
return False
except OSError:
return False
... | [
"Check",
"every",
"part",
"of",
"path",
"for",
"executable",
"permission"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L129-L142 | [
"def",
"_path_is_executable_others",
"(",
"path",
")",
":",
"prevpath",
"=",
"None",
"while",
"path",
"and",
"path",
"!=",
"prevpath",
":",
"try",
":",
"if",
"not",
"os",
".",
"stat",
"(",
"path",
")",
".",
"st_mode",
"&",
"stat",
".",
"S_IXOTH",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_opts | Common code to inspect opts and split them if necessary | salt/modules/git.py | def _format_opts(opts):
'''
Common code to inspect opts and split them if necessary
'''
if opts is None:
return []
elif isinstance(opts, list):
new_opts = []
for item in opts:
if isinstance(item, six.string_types):
new_opts.append(item)
... | def _format_opts(opts):
'''
Common code to inspect opts and split them if necessary
'''
if opts is None:
return []
elif isinstance(opts, list):
new_opts = []
for item in opts:
if isinstance(item, six.string_types):
new_opts.append(item)
... | [
"Common",
"code",
"to",
"inspect",
"opts",
"and",
"split",
"them",
"if",
"necessary"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L145-L174 | [
"def",
"_format_opts",
"(",
"opts",
")",
":",
"if",
"opts",
"is",
"None",
":",
"return",
"[",
"]",
"elif",
"isinstance",
"(",
"opts",
",",
"list",
")",
":",
"new_opts",
"=",
"[",
"]",
"for",
"item",
"in",
"opts",
":",
"if",
"isinstance",
"(",
"item... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _format_git_opts | Do a version check and make sure that the installed version of git can
support git -c | salt/modules/git.py | def _format_git_opts(opts):
'''
Do a version check and make sure that the installed version of git can
support git -c
'''
if opts:
version_ = version(versioninfo=False)
if _LooseVersion(version_) < _LooseVersion('1.7.2'):
raise SaltInvocationError(
'git_op... | def _format_git_opts(opts):
'''
Do a version check and make sure that the installed version of git can
support git -c
'''
if opts:
version_ = version(versioninfo=False)
if _LooseVersion(version_) < _LooseVersion('1.7.2'):
raise SaltInvocationError(
'git_op... | [
"Do",
"a",
"version",
"check",
"and",
"make",
"sure",
"that",
"the",
"installed",
"version",
"of",
"git",
"can",
"support",
"git",
"-",
"c"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L177-L189 | [
"def",
"_format_git_opts",
"(",
"opts",
")",
":",
"if",
"opts",
":",
"version_",
"=",
"version",
"(",
"versioninfo",
"=",
"False",
")",
"if",
"_LooseVersion",
"(",
"version_",
")",
"<",
"_LooseVersion",
"(",
"'1.7.2'",
")",
":",
"raise",
"SaltInvocationError... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_ssh_exe | Windows only: search for Git's bundled ssh.exe in known locations | salt/modules/git.py | def _find_ssh_exe():
'''
Windows only: search for Git's bundled ssh.exe in known locations
'''
# Known locations for Git's ssh.exe in Windows
globmasks = [os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'usr', 'bin',
... | def _find_ssh_exe():
'''
Windows only: search for Git's bundled ssh.exe in known locations
'''
# Known locations for Git's ssh.exe in Windows
globmasks = [os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'usr', 'bin',
... | [
"Windows",
"only",
":",
"search",
"for",
"Git",
"s",
"bundled",
"ssh",
".",
"exe",
"in",
"known",
"locations"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L192-L211 | [
"def",
"_find_ssh_exe",
"(",
")",
":",
"# Known locations for Git's ssh.exe in Windows",
"globmasks",
"=",
"[",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"getenv",
"(",
"'SystemDrive'",
")",
",",
"os",
".",
"sep",
",",
"'Program Files*'",
",",
"'Git'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _git_run | simple, throw an exception with the error message on an error return code.
this function may be moved to the command module, spliced with
'cmd.run_all', and used as an alternative to 'cmd.run_all'. Some
commands don't return proper retcodes, so this can't replace 'cmd.run_all'. | salt/modules/git.py | def _git_run(command, cwd=None, user=None, password=None, identity=None,
ignore_retcode=False, failhard=True, redirect_stderr=False,
saltenv='base', output_encoding=None, **kwargs):
'''
simple, throw an exception with the error message on an error return code.
this function may be... | def _git_run(command, cwd=None, user=None, password=None, identity=None,
ignore_retcode=False, failhard=True, redirect_stderr=False,
saltenv='base', output_encoding=None, **kwargs):
'''
simple, throw an exception with the error message on an error return code.
this function may be... | [
"simple",
"throw",
"an",
"exception",
"with",
"the",
"error",
"message",
"on",
"an",
"error",
"return",
"code",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L214-L404 | [
"def",
"_git_run",
"(",
"command",
",",
"cwd",
"=",
"None",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"identity",
"=",
"None",
",",
"ignore_retcode",
"=",
"False",
",",
"failhard",
"=",
"True",
",",
"redirect_stderr",
"=",
"False",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_toplevel | Use git rev-parse to return the top level of a repo | salt/modules/git.py | def _get_toplevel(path, user=None, password=None, output_encoding=None):
'''
Use git rev-parse to return the top level of a repo
'''
return _git_run(
['git', 'rev-parse', '--show-toplevel'],
cwd=path,
user=user,
password=password,
output_encoding=output_encoding)[... | def _get_toplevel(path, user=None, password=None, output_encoding=None):
'''
Use git rev-parse to return the top level of a repo
'''
return _git_run(
['git', 'rev-parse', '--show-toplevel'],
cwd=path,
user=user,
password=password,
output_encoding=output_encoding)[... | [
"Use",
"git",
"rev",
"-",
"parse",
"to",
"return",
"the",
"top",
"level",
"of",
"a",
"repo"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L407-L416 | [
"def",
"_get_toplevel",
"(",
"path",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"output_encoding",
"=",
"None",
")",
":",
"return",
"_git_run",
"(",
"[",
"'git'",
",",
"'rev-parse'",
",",
"'--show-toplevel'",
"]",
",",
"cwd",
"=",
"path... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _git_config | Helper to retrieve git config options | salt/modules/git.py | def _git_config(cwd, user, password, output_encoding=None):
'''
Helper to retrieve git config options
'''
contextkey = 'git.config.' + cwd
if contextkey not in __context__:
git_dir = rev_parse(cwd,
opts=['--git-dir'],
user=user,
... | def _git_config(cwd, user, password, output_encoding=None):
'''
Helper to retrieve git config options
'''
contextkey = 'git.config.' + cwd
if contextkey not in __context__:
git_dir = rev_parse(cwd,
opts=['--git-dir'],
user=user,
... | [
"Helper",
"to",
"retrieve",
"git",
"config",
"options"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L419-L436 | [
"def",
"_git_config",
"(",
"cwd",
",",
"user",
",",
"password",
",",
"output_encoding",
"=",
"None",
")",
":",
"contextkey",
"=",
"'git.config.'",
"+",
"cwd",
"if",
"contextkey",
"not",
"in",
"__context__",
":",
"git_dir",
"=",
"rev_parse",
"(",
"cwd",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _which_git_config | Based on whether global or local config is desired, return a list of CLI
args to include in the git config command. | salt/modules/git.py | def _which_git_config(global_, cwd, user, password, output_encoding=None):
'''
Based on whether global or local config is desired, return a list of CLI
args to include in the git config command.
'''
if global_:
return ['--global']
version_ = _LooseVersion(version(versioninfo=False))
... | def _which_git_config(global_, cwd, user, password, output_encoding=None):
'''
Based on whether global or local config is desired, return a list of CLI
args to include in the git config command.
'''
if global_:
return ['--global']
version_ = _LooseVersion(version(versioninfo=False))
... | [
"Based",
"on",
"whether",
"global",
"or",
"local",
"config",
"is",
"desired",
"return",
"a",
"list",
"of",
"CLI",
"args",
"to",
"include",
"in",
"the",
"git",
"config",
"command",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L439-L453 | [
"def",
"_which_git_config",
"(",
"global_",
",",
"cwd",
",",
"user",
",",
"password",
",",
"output_encoding",
"=",
"None",
")",
":",
"if",
"global_",
":",
"return",
"[",
"'--global'",
"]",
"version_",
"=",
"_LooseVersion",
"(",
"version",
"(",
"versioninfo",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add | .. versionchanged:: 2015.8.0
The ``--verbose`` command line argument is now implied
Interface to `git-add(1)`_
cwd
The path to the git checkout
filename
The location of the file/directory to add, relative to ``cwd``
opts
Any additional options to add to the command li... | salt/modules/git.py | def add(cwd,
filename,
opts='',
git_opts='',
user=None,
password=None,
ignore_retcode=False,
output_encoding=None):
'''
.. versionchanged:: 2015.8.0
The ``--verbose`` command line argument is now implied
Interface to `git-add(1)`_
cwd
... | def add(cwd,
filename,
opts='',
git_opts='',
user=None,
password=None,
ignore_retcode=False,
output_encoding=None):
'''
.. versionchanged:: 2015.8.0
The ``--verbose`` command line argument is now implied
Interface to `git-add(1)`_
cwd
... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"0",
"The",
"--",
"verbose",
"command",
"line",
"argument",
"is",
"now",
"implied"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/git.py#L456-L543 | [
"def",
"add",
"(",
"cwd",
",",
"filename",
",",
"opts",
"=",
"''",
",",
"git_opts",
"=",
"''",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"ignore_retcode",
"=",
"False",
",",
"output_encoding",
"=",
"None",
")",
":",
"cwd",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.