partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get
.. versionadded:: 2016.3.0 Retrieves the given list of properties zpool : string Name of storage pool prop : string Optional name of property to retrieve show_source : boolean Show source of property parsable : boolean Display numbers in parsable (exact) values ...
salt/modules/zpool.py
def get(zpool, prop=None, show_source=False, parsable=True): ''' .. versionadded:: 2016.3.0 Retrieves the given list of properties zpool : string Name of storage pool prop : string Optional name of property to retrieve show_source : boolean Show source of property ...
def get(zpool, prop=None, show_source=False, parsable=True): ''' .. versionadded:: 2016.3.0 Retrieves the given list of properties zpool : string Name of storage pool prop : string Optional name of property to retrieve show_source : boolean Show source of property ...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L445-L523
[ "def", "get", "(", "zpool", ",", "prop", "=", "None", ",", "show_source", "=", "False", ",", "parsable", "=", "True", ")", ":", "ret", "=", "OrderedDict", "(", ")", "value_properties", "=", "[", "'name'", ",", "'property'", ",", "'value'", ",", "'sourc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set
Sets the given property on the specified pool zpool : string Name of storage pool prop : string Name of property to set value : string Value to set for the specified property .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' zpool.set my...
salt/modules/zpool.py
def set(zpool, prop, value): ''' Sets the given property on the specified pool zpool : string Name of storage pool prop : string Name of property to set value : string Value to set for the specified property .. versionadded:: 2016.3.0 CLI Example: .. code-bl...
def set(zpool, prop, value): ''' Sets the given property on the specified pool zpool : string Name of storage pool prop : string Name of property to set value : string Value to set for the specified property .. versionadded:: 2016.3.0 CLI Example: .. code-bl...
[ "Sets", "the", "given", "property", "on", "the", "specified", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L526-L561
[ "def", "set", "(", "zpool", ",", "prop", ",", "value", ")", ":", "ret", "=", "OrderedDict", "(", ")", "# set property", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'set'", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check if a ZFS storage pool is active zpool : string Name of storage pool CLI Example: .. code-block:: bash salt '*' zpool.exists myzpool
salt/modules/zpool.py
def exists(zpool): ''' Check if a ZFS storage pool is active zpool : string Name of storage pool CLI Example: .. code-block:: bash salt '*' zpool.exists myzpool ''' # list for zpool # NOTE: retcode > 0 if zpool does not exists res = __salt__['cmd.run_all']( ...
def exists(zpool): ''' Check if a ZFS storage pool is active zpool : string Name of storage pool CLI Example: .. code-block:: bash salt '*' zpool.exists myzpool ''' # list for zpool # NOTE: retcode > 0 if zpool does not exists res = __salt__['cmd.run_all']( ...
[ "Check", "if", "a", "ZFS", "storage", "pool", "is", "active" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L564-L589
[ "def", "exists", "(", "zpool", ")", ":", "# list for zpool", "# NOTE: retcode > 0 if zpool does not exists", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'list'", ",", "target", "=", "z...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroys a storage pool zpool : string Name of storage pool force : boolean Force destroy of pool CLI Example: .. code-block:: bash salt '*' zpool.destroy myzpool
salt/modules/zpool.py
def destroy(zpool, force=False): ''' Destroys a storage pool zpool : string Name of storage pool force : boolean Force destroy of pool CLI Example: .. code-block:: bash salt '*' zpool.destroy myzpool ''' # destroy zpool res = __salt__['cmd.run_all']( ...
def destroy(zpool, force=False): ''' Destroys a storage pool zpool : string Name of storage pool force : boolean Force destroy of pool CLI Example: .. code-block:: bash salt '*' zpool.destroy myzpool ''' # destroy zpool res = __salt__['cmd.run_all']( ...
[ "Destroys", "a", "storage", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L592-L619
[ "def", "destroy", "(", "zpool", ",", "force", "=", "False", ")", ":", "# destroy zpool", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'destroy'", ",", "flags", "=", "[", "'-f'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
scrub
Scrub a storage pool zpool : string Name of storage pool stop : boolean If ``True``, cancel ongoing scrub pause : boolean If ``True``, pause ongoing scrub .. versionadded:: 2018.3.0 .. note:: Pause is only available on recent versions of ZFS. ...
salt/modules/zpool.py
def scrub(zpool, stop=False, pause=False): ''' Scrub a storage pool zpool : string Name of storage pool stop : boolean If ``True``, cancel ongoing scrub pause : boolean If ``True``, pause ongoing scrub .. versionadded:: 2018.3.0 .. note:: Pau...
def scrub(zpool, stop=False, pause=False): ''' Scrub a storage pool zpool : string Name of storage pool stop : boolean If ``True``, cancel ongoing scrub pause : boolean If ``True``, pause ongoing scrub .. versionadded:: 2018.3.0 .. note:: Pau...
[ "Scrub", "a", "storage", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L622-L677
[ "def", "scrub", "(", "zpool", ",", "stop", "=", "False", ",", "pause", "=", "False", ")", ":", "## select correct action", "if", "stop", ":", "action", "=", "[", "'-s'", "]", "elif", "pause", ":", "action", "=", "[", "'-p'", "]", "else", ":", "action...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
.. versionadded:: 2015.5.0 Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3 zpool : string Name of storage pool vdevs : string One or move devices force : boolean ...
salt/modules/zpool.py
def create(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3 zpool : string Name of storage pool vdevs : string ...
def create(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3 zpool : string Name of storage pool vdevs : string ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L680-L807
[ "def", "create", "(", "zpool", ",", "*", "vdevs", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "opts", "=", "{", "}", "target", "=", "[", "]", "# NOTE: push pool and filesystem properties", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the specified vdev\'s to the given storage pool zpool : string Name of storage pool vdevs : string One or more devices force : boolean Forces use of device CLI Example: .. code-block:: bash salt '*' zpool.add myzpool /path/to/vdev1 /path/to/vdev2 [...]
salt/modules/zpool.py
def add(zpool, *vdevs, **kwargs): ''' Add the specified vdev\'s to the given storage pool zpool : string Name of storage pool vdevs : string One or more devices force : boolean Forces use of device CLI Example: .. code-block:: bash salt '*' zpool.add myz...
def add(zpool, *vdevs, **kwargs): ''' Add the specified vdev\'s to the given storage pool zpool : string Name of storage pool vdevs : string One or more devices force : boolean Forces use of device CLI Example: .. code-block:: bash salt '*' zpool.add myz...
[ "Add", "the", "specified", "vdev", "\\", "s", "to", "the", "given", "storage", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L810-L860
[ "def", "add", "(", "zpool", ",", "*", "vdevs", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "target", "=", "[", "]", "# NOTE: set extra config based on kwargs", "if", "kwargs", ".", "get", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
attach
Attach specified device to zpool zpool : string Name of storage pool device : string Existing device name too new_device : string New device name (to be attached to ``device``) force : boolean Forces use of device CLI Example: .. code-block:: bash s...
salt/modules/zpool.py
def attach(zpool, device, new_device, force=False): ''' Attach specified device to zpool zpool : string Name of storage pool device : string Existing device name too new_device : string New device name (to be attached to ``device``) force : boolean Forces use ...
def attach(zpool, device, new_device, force=False): ''' Attach specified device to zpool zpool : string Name of storage pool device : string Existing device name too new_device : string New device name (to be attached to ``device``) force : boolean Forces use ...
[ "Attach", "specified", "device", "to", "zpool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L863-L917
[ "def", "attach", "(", "zpool", ",", "device", ",", "new_device", ",", "force", "=", "False", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "target", "=", "[", "]", "# NOTE: set extra config", "if", "force", ":", "fla...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
detach
Detach specified device to zpool zpool : string Name of storage pool device : string Device to detach CLI Example: .. code-block:: bash salt '*' zpool.detach myzpool /path/to/vdev1
salt/modules/zpool.py
def detach(zpool, device): ''' Detach specified device to zpool zpool : string Name of storage pool device : string Device to detach CLI Example: .. code-block:: bash salt '*' zpool.detach myzpool /path/to/vdev1 ''' ## Update storage pool res = __salt__[...
def detach(zpool, device): ''' Detach specified device to zpool zpool : string Name of storage pool device : string Device to detach CLI Example: .. code-block:: bash salt '*' zpool.detach myzpool /path/to/vdev1 ''' ## Update storage pool res = __salt__[...
[ "Detach", "specified", "device", "to", "zpool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L920-L953
[ "def", "detach", "(", "zpool", ",", "device", ")", ":", "## Update storage pool", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'detach'", ",", "target", "=", "[", "zpool", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
split
.. versionadded:: 2018.3.0 Splits devices off pool creating newpool. .. note:: All vdevs in pool must be mirrors. At the time of the split, ``newzpool`` will be a replica of ``zpool``. After splitting, do not forget to import the new pool! zpool : string Name of storage...
salt/modules/zpool.py
def split(zpool, newzpool, **kwargs): ''' .. versionadded:: 2018.3.0 Splits devices off pool creating newpool. .. note:: All vdevs in pool must be mirrors. At the time of the split, ``newzpool`` will be a replica of ``zpool``. After splitting, do not forget to import the new...
def split(zpool, newzpool, **kwargs): ''' .. versionadded:: 2018.3.0 Splits devices off pool creating newpool. .. note:: All vdevs in pool must be mirrors. At the time of the split, ``newzpool`` will be a replica of ``zpool``. After splitting, do not forget to import the new...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L956-L1038
[ "def", "split", "(", "zpool", ",", "newzpool", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "opts", "=", "{", "}", "# NOTE: push pool and filesystem properties", "pool_properties", "=", "kwargs", ".", "get", "(", "'prope...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
replace
Replaces ``old_device`` with ``new_device`` .. note:: This is equivalent to attaching ``new_device``, waiting for it to resilver, and then detaching ``old_device``. The size of ``new_device`` must be greater than or equal to the minimum size of all the devices in a mirror or raidz...
salt/modules/zpool.py
def replace(zpool, old_device, new_device=None, force=False): ''' Replaces ``old_device`` with ``new_device`` .. note:: This is equivalent to attaching ``new_device``, waiting for it to resilver, and then detaching ``old_device``. The size of ``new_device`` must be greater than or...
def replace(zpool, old_device, new_device=None, force=False): ''' Replaces ``old_device`` with ``new_device`` .. note:: This is equivalent to attaching ``new_device``, waiting for it to resilver, and then detaching ``old_device``. The size of ``new_device`` must be greater than or...
[ "Replaces", "old_device", "with", "new_device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1041-L1104
[ "def", "replace", "(", "zpool", ",", "old_device", ",", "new_device", "=", "None", ",", "force", "=", "False", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "target", "=", "[", "]", "# NOTE: set extra config", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_file_vdev
Creates file based virtual devices for a zpool CLI Example: .. code-block:: bash salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...] .. note:: Depending on file size, the above command may take a while to return.
salt/modules/zpool.py
def create_file_vdev(size, *vdevs): ''' Creates file based virtual devices for a zpool CLI Example: .. code-block:: bash salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...] .. note:: Depending on file size, the above command may take a while to return. ...
def create_file_vdev(size, *vdevs): ''' Creates file based virtual devices for a zpool CLI Example: .. code-block:: bash salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...] .. note:: Depending on file size, the above command may take a while to return. ...
[ "Creates", "file", "based", "virtual", "devices", "for", "a", "zpool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1108-L1148
[ "def", "create_file_vdev", "(", "size", ",", "*", "vdevs", ")", ":", "ret", "=", "OrderedDict", "(", ")", "err", "=", "OrderedDict", "(", ")", "_mkfile_cmd", "=", "salt", ".", "utils", ".", "path", ".", "which", "(", "'mkfile'", ")", "for", "vdev", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
export
.. versionadded:: 2015.5.0 Export storage pools pools : string One or more storage pools to export force : boolean Force export of storage pools CLI Example: .. code-block:: bash salt '*' zpool.export myzpool ... [force=True|False] salt '*' zpool.export myzpool2...
salt/modules/zpool.py
def export(*pools, **kwargs): ''' .. versionadded:: 2015.5.0 Export storage pools pools : string One or more storage pools to export force : boolean Force export of storage pools CLI Example: .. code-block:: bash salt '*' zpool.export myzpool ... [force=True|Fal...
def export(*pools, **kwargs): ''' .. versionadded:: 2015.5.0 Export storage pools pools : string One or more storage pools to export force : boolean Force export of storage pools CLI Example: .. code-block:: bash salt '*' zpool.export myzpool ... [force=True|Fal...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1151-L1193
[ "def", "export", "(", "*", "pools", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "targets", "=", "[", "]", "# NOTE: set extra config based on kwargs", "if", "kwargs", ".", "get", "(", "'force'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
import_
.. versionadded:: 2015.5.0 Import storage pools or list pools available for import zpool : string Optional name of storage pool new_name : string Optional new name for the storage pool mntopts : string Comma-separated list of mount options to use when mounting datasets ...
salt/modules/zpool.py
def import_(zpool=None, new_name=None, **kwargs): ''' .. versionadded:: 2015.5.0 Import storage pools or list pools available for import zpool : string Optional name of storage pool new_name : string Optional new name for the storage pool mntopts : string Comma-separa...
def import_(zpool=None, new_name=None, **kwargs): ''' .. versionadded:: 2015.5.0 Import storage pools or list pools available for import zpool : string Optional name of storage pool new_name : string Optional new name for the storage pool mntopts : string Comma-separa...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1196-L1316
[ "def", "import_", "(", "zpool", "=", "None", ",", "new_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "opts", "=", "{", "}", "target", "=", "[", "]", "# NOTE: push pool...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
online
.. versionadded:: 2015.5.0 Ensure that the specified devices are online zpool : string name of storage pool vdevs : string one or more devices expand : boolean Expand the device to use all available space. .. note:: If the device is part of a mirror or r...
salt/modules/zpool.py
def online(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Ensure that the specified devices are online zpool : string name of storage pool vdevs : string one or more devices expand : boolean Expand the device to use all available space. .. note:: ...
def online(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Ensure that the specified devices are online zpool : string name of storage pool vdevs : string one or more devices expand : boolean Expand the device to use all available space. .. note:: ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1319-L1381
[ "def", "online", "(", "zpool", ",", "*", "vdevs", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# default options", "flags", "=", "[", "]", "target", "=", "[", "]", "# set flags and options", "if", "kwargs", ".", "get", "(", "'expand'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
offline
.. versionadded:: 2015.5.0 Ensure that the specified devices are offline .. warning:: By default, the ``OFFLINE`` state is persistent. The device remains offline when the system is rebooted. To temporarily take a device offline, use ``temporary=True``. zpool : string name...
salt/modules/zpool.py
def offline(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Ensure that the specified devices are offline .. warning:: By default, the ``OFFLINE`` state is persistent. The device remains offline when the system is rebooted. To temporarily take a device offline, use ``...
def offline(zpool, *vdevs, **kwargs): ''' .. versionadded:: 2015.5.0 Ensure that the specified devices are offline .. warning:: By default, the ``OFFLINE`` state is persistent. The device remains offline when the system is rebooted. To temporarily take a device offline, use ``...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1384-L1435
[ "def", "offline", "(", "zpool", ",", "*", "vdevs", ",", "*", "*", "kwargs", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "target", "=", "[", "]", "# NOTE: set extra config based on kwargs", "if", "kwargs", ".", "get",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
labelclear
.. versionadded:: 2018.3.0 Removes ZFS label information from the specified device device : string Device name; must not be part of an active pool configuration. force : boolean Treat exported or foreign devices as inactive CLI Example: .. code-block:: bash salt '*' zpo...
salt/modules/zpool.py
def labelclear(device, force=False): ''' .. versionadded:: 2018.3.0 Removes ZFS label information from the specified device device : string Device name; must not be part of an active pool configuration. force : boolean Treat exported or foreign devices as inactive CLI Example...
def labelclear(device, force=False): ''' .. versionadded:: 2018.3.0 Removes ZFS label information from the specified device device : string Device name; must not be part of an active pool configuration. force : boolean Treat exported or foreign devices as inactive CLI Example...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1438-L1467
[ "def", "labelclear", "(", "device", ",", "force", "=", "False", ")", ":", "## clear label for all specified device", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'labelclear'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear
Clears device errors in a pool. .. warning:: The device must not be part of an active pool configuration. zpool : string name of storage pool device : string (optional) specific device to clear .. versionadded:: 2018.3.1 CLI Example: .. code-block:: bash sa...
salt/modules/zpool.py
def clear(zpool, device=None): ''' Clears device errors in a pool. .. warning:: The device must not be part of an active pool configuration. zpool : string name of storage pool device : string (optional) specific device to clear .. versionadded:: 2018.3.1 CLI Exa...
def clear(zpool, device=None): ''' Clears device errors in a pool. .. warning:: The device must not be part of an active pool configuration. zpool : string name of storage pool device : string (optional) specific device to clear .. versionadded:: 2018.3.1 CLI Exa...
[ "Clears", "device", "errors", "in", "a", "pool", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1470-L1510
[ "def", "clear", "(", "zpool", ",", "device", "=", "None", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "target", "=", "[", "]", "# NOTE: append the pool name and specifications", "target", ".", "append", "(", "zpool", ")", "target", ".", "append...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reguid
Generates a new unique identifier for the pool .. warning:: You must ensure that all devices in this pool are online and healthy before performing this action. zpool : string name of storage pool .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt ...
salt/modules/zpool.py
def reguid(zpool): ''' Generates a new unique identifier for the pool .. warning:: You must ensure that all devices in this pool are online and healthy before performing this action. zpool : string name of storage pool .. versionadded:: 2016.3.0 CLI Example: .. c...
def reguid(zpool): ''' Generates a new unique identifier for the pool .. warning:: You must ensure that all devices in this pool are online and healthy before performing this action. zpool : string name of storage pool .. versionadded:: 2016.3.0 CLI Example: .. c...
[ "Generates", "a", "new", "unique", "identifier", "for", "the", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1513-L1541
[ "def", "reguid", "(", "zpool", ")", ":", "## generate new GUID for pool", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "__utils__", "[", "'zfs.zpool_command'", "]", "(", "command", "=", "'reguid'", ",", "target", "=", "zpool", ",", ")", ",", "pyth...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
upgrade
.. versionadded:: 2016.3.0 Enables all supported features on the given pool zpool : string Optional storage pool, applies to all otherwize version : int Version to upgrade to, if unspecified upgrade to the highest possible .. warning:: Once this is done, the pool will no long...
salt/modules/zpool.py
def upgrade(zpool=None, version=None): ''' .. versionadded:: 2016.3.0 Enables all supported features on the given pool zpool : string Optional storage pool, applies to all otherwize version : int Version to upgrade to, if unspecified upgrade to the highest possible .. warning...
def upgrade(zpool=None, version=None): ''' .. versionadded:: 2016.3.0 Enables all supported features on the given pool zpool : string Optional storage pool, applies to all otherwize version : int Version to upgrade to, if unspecified upgrade to the highest possible .. warning...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1572-L1618
[ "def", "upgrade", "(", "zpool", "=", "None", ",", "version", "=", "None", ")", ":", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "opts", "=", "{", "}", "# NOTE: set extra config", "if", "version", ":", "opts", "[", "'-V'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
history
.. versionadded:: 2016.3.0 Displays the command history of the specified pools, or all pools if no pool is specified zpool : string Optional storage pool internal : boolean Toggle display of internally logged ZFS events verbose : boolean Toggle display of the user name, t...
salt/modules/zpool.py
def history(zpool=None, internal=False, verbose=False): ''' .. versionadded:: 2016.3.0 Displays the command history of the specified pools, or all pools if no pool is specified zpool : string Optional storage pool internal : boolean Toggle display of internally logged ZFS even...
def history(zpool=None, internal=False, verbose=False): ''' .. versionadded:: 2016.3.0 Displays the command history of the specified pools, or all pools if no pool is specified zpool : string Optional storage pool internal : boolean Toggle display of internally logged ZFS even...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1621-L1682
[ "def", "history", "(", "zpool", "=", "None", ",", "internal", "=", "False", ",", "verbose", "=", "False", ")", ":", "ret", "=", "OrderedDict", "(", ")", "## Configure pool", "# NOTE: initialize the defaults", "flags", "=", "[", "]", "# NOTE: set extra config", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the user is present with the specified properties name The name of the user to manage passwd The password of the user to manage user MongoDB user with sufficient privilege to create the user password Password for the admin user specified with the ``user`` ...
salt/states/mongodb_user.py
def present(name, passwd, database="admin", user=None, password=None, host="localhost", port=27017, authdb=None, roles=None): ''' Ensure that the user is present with the specified properties name The na...
def present(name, passwd, database="admin", user=None, password=None, host="localhost", port=27017, authdb=None, roles=None): ''' Ensure that the user is present with the specified properties name The na...
[ "Ensure", "that", "the", "user", "is", "present", "with", "the", "specified", "properties" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mongodb_user.py#L20-L145
[ "def", "present", "(", "name", ",", "passwd", ",", "database", "=", "\"admin\"", ",", "user", "=", "None", ",", "password", "=", "None", ",", "host", "=", "\"localhost\"", ",", "port", "=", "27017", ",", "authdb", "=", "None", ",", "roles", "=", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure that the named user is absent name The name of the user to remove user MongoDB user with sufficient privilege to create the user password Password for the admin user specified by the ``user`` parameter host The hostname/IP address of the MongoDB server por...
salt/states/mongodb_user.py
def absent(name, user=None, password=None, host=None, port=None, database="admin", authdb=None): ''' Ensure that the named user is absent name The name of the user to remove user MongoDB user with sufficient privilege to...
def absent(name, user=None, password=None, host=None, port=None, database="admin", authdb=None): ''' Ensure that the named user is absent name The name of the user to remove user MongoDB user with sufficient privilege to...
[ "Ensure", "that", "the", "named", "user", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mongodb_user.py#L148-L207
[ "def", "absent", "(", "name", ",", "user", "=", "None", ",", "password", "=", "None", ",", "host", "=", "None", ",", "port", "=", "None", ",", "database", "=", "\"admin\"", ",", "authdb", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check to see if an autoscale group exists. CLI example:: salt myminion boto_asg.exists myasg region=us-east-1
salt/modules/boto_asg.py
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an autoscale group exists. CLI example:: salt myminion boto_asg.exists myasg region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) retries = 30 while True: ...
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an autoscale group exists. CLI example:: salt myminion boto_asg.exists myasg region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) retries = 30 while True: ...
[ "Check", "to", "see", "if", "an", "autoscale", "group", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L103-L129
[ "def", "exists", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config
Get the configuration for an autoscale group. CLI example:: salt myminion boto_asg.get_config myasg region=us-east-1
salt/modules/boto_asg.py
def get_config(name, region=None, key=None, keyid=None, profile=None): ''' Get the configuration for an autoscale group. CLI example:: salt myminion boto_asg.get_config myasg region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) retries = 30 wh...
def get_config(name, region=None, key=None, keyid=None, profile=None): ''' Get the configuration for an autoscale group. CLI example:: salt myminion boto_asg.get_config myasg region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) retries = 30 wh...
[ "Get", "the", "configuration", "for", "an", "autoscale", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L132-L215
[ "def", "get_config", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create an autoscale group. CLI example:: salt myminion boto_asg.create myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
salt/modules/boto_asg.py
def create(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=No...
def create(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=No...
[ "Create", "an", "autoscale", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L218-L300
[ "def", "create", "(", "name", ",", "launch_config_name", ",", "availability_zones", ",", "min_size", ",", "max_size", ",", "desired_capacity", "=", "None", ",", "load_balancers", "=", "None", ",", "default_cooldown", "=", "None", ",", "health_check_type", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Update an autoscale group. CLI example:: salt myminion boto_asg.update myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
salt/modules/boto_asg.py
def update(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=No...
def update(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=No...
[ "Update", "an", "autoscale", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L303-L429
[ "def", "update", "(", "name", ",", "launch_config_name", ",", "availability_zones", ",", "min_size", ",", "max_size", ",", "desired_capacity", "=", "None", ",", "load_balancers", "=", "None", ",", "default_cooldown", "=", "None", ",", "health_check_type", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_scaling_policies
helper function to create scaling policies
salt/modules/boto_asg.py
def _create_scaling_policies(conn, as_name, scaling_policies): 'helper function to create scaling policies' if scaling_policies: for policy in scaling_policies: policy = autoscale.policy.ScalingPolicy( name=policy["name"], as_name=as_name, adju...
def _create_scaling_policies(conn, as_name, scaling_policies): 'helper function to create scaling policies' if scaling_policies: for policy in scaling_policies: policy = autoscale.policy.ScalingPolicy( name=policy["name"], as_name=as_name, adju...
[ "helper", "function", "to", "create", "scaling", "policies" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L432-L443
[ "def", "_create_scaling_policies", "(", "conn", ",", "as_name", ",", "scaling_policies", ")", ":", "if", "scaling_policies", ":", "for", "policy", "in", "scaling_policies", ":", "policy", "=", "autoscale", ".", "policy", ".", "ScalingPolicy", "(", "name", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_scheduled_actions
Helper function to create scheduled actions
salt/modules/boto_asg.py
def _create_scheduled_actions(conn, as_name, scheduled_actions): ''' Helper function to create scheduled actions ''' if scheduled_actions: for name, action in six.iteritems(scheduled_actions): if 'start_time' in action and isinstance(action['start_time'], six.string_types): ...
def _create_scheduled_actions(conn, as_name, scheduled_actions): ''' Helper function to create scheduled actions ''' if scheduled_actions: for name, action in six.iteritems(scheduled_actions): if 'start_time' in action and isinstance(action['start_time'], six.string_types): ...
[ "Helper", "function", "to", "create", "scheduled", "actions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L446-L467
[ "def", "_create_scheduled_actions", "(", "conn", ",", "as_name", ",", "scheduled_actions", ")", ":", "if", "scheduled_actions", ":", "for", "name", ",", "action", "in", "six", ".", "iteritems", "(", "scheduled_actions", ")", ":", "if", "'start_time'", "in", "a...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_cloud_init_mime
Get a mime multipart encoded string from a cloud-init dict. Currently supports boothooks, scripts and cloud-config. CLI Example: .. code-block:: bash salt myminion boto.get_cloud_init_mime <cloud init>
salt/modules/boto_asg.py
def get_cloud_init_mime(cloud_init): ''' Get a mime multipart encoded string from a cloud-init dict. Currently supports boothooks, scripts and cloud-config. CLI Example: .. code-block:: bash salt myminion boto.get_cloud_init_mime <cloud init> ''' if isinstance(cloud_init, six.stri...
def get_cloud_init_mime(cloud_init): ''' Get a mime multipart encoded string from a cloud-init dict. Currently supports boothooks, scripts and cloud-config. CLI Example: .. code-block:: bash salt myminion boto.get_cloud_init_mime <cloud init> ''' if isinstance(cloud_init, six.stri...
[ "Get", "a", "mime", "multipart", "encoded", "string", "from", "a", "cloud", "-", "init", "dict", ".", "Currently", "supports", "boothooks", "scripts", "and", "cloud", "-", "config", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L498-L526
[ "def", "get_cloud_init_mime", "(", "cloud_init", ")", ":", "if", "isinstance", "(", "cloud_init", ",", "six", ".", "string_types", ")", ":", "cloud_init", "=", "salt", ".", "utils", ".", "json", ".", "loads", "(", "cloud_init", ")", "_cloud_init", "=", "em...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
launch_configuration_exists
Check for a launch configuration's existence. CLI example:: salt myminion boto_asg.launch_configuration_exists mylc
salt/modules/boto_asg.py
def launch_configuration_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check for a launch configuration's existence. CLI example:: salt myminion boto_asg.launch_configuration_exists mylc ''' conn = _get_conn(region=region, key=key, keyid...
def launch_configuration_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check for a launch configuration's existence. CLI example:: salt myminion boto_asg.launch_configuration_exists mylc ''' conn = _get_conn(region=region, key=key, keyid...
[ "Check", "for", "a", "launch", "configuration", "s", "existence", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L529-L556
[ "def", "launch_configuration_exists", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_launch_configurations
Fetch and return all Launch Configuration with details. CLI example:: salt myminion boto_asg.get_all_launch_configurations
salt/modules/boto_asg.py
def get_all_launch_configurations(region=None, key=None, keyid=None, profile=None): ''' Fetch and return all Launch Configuration with details. CLI example:: salt myminion boto_asg.get_all_launch_configurations ''' conn = _get_conn(region=region, key=key, ...
def get_all_launch_configurations(region=None, key=None, keyid=None, profile=None): ''' Fetch and return all Launch Configuration with details. CLI example:: salt myminion boto_asg.get_all_launch_configurations ''' conn = _get_conn(region=region, key=key, ...
[ "Fetch", "and", "return", "all", "Launch", "Configuration", "with", "details", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L559-L580
[ "def", "get_all_launch_configurations", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_launch_configurations
List all Launch Configurations. CLI example:: salt myminion boto_asg.list_launch_configurations
salt/modules/boto_asg.py
def list_launch_configurations(region=None, key=None, keyid=None, profile=None): ''' List all Launch Configurations. CLI example:: salt myminion boto_asg.list_launch_configurations ''' ret = get_all_launch_configurations(region, key, keyid, profile) retu...
def list_launch_configurations(region=None, key=None, keyid=None, profile=None): ''' List all Launch Configurations. CLI example:: salt myminion boto_asg.list_launch_configurations ''' ret = get_all_launch_configurations(region, key, keyid, profile) retu...
[ "List", "all", "Launch", "Configurations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L583-L593
[ "def", "list_launch_configurations", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "get_all_launch_configurations", "(", "region", ",", "key", ",", "keyid", ",", "profile"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_launch_configuration
Create a launch configuration. CLI example:: salt myminion boto_asg.create_launch_configuration mylc image_id=ami-0b9c9f62 key_name='mykey' security_groups='["mygroup"]' instance_type='c3.2xlarge'
salt/modules/boto_asg.py
def create_launch_configuration(name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, bloc...
def create_launch_configuration(name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, bloc...
[ "Create", "a", "launch", "configuration", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L626-L699
[ "def", "create_launch_configuration", "(", "name", ",", "image_id", ",", "key_name", "=", "None", ",", "vpc_id", "=", "None", ",", "vpc_name", "=", "None", ",", "security_groups", "=", "None", ",", "user_data", "=", "None", ",", "instance_type", "=", "'m1.sm...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_launch_configuration
Delete a launch configuration. CLI example:: salt myminion boto_asg.delete_launch_configuration mylc
salt/modules/boto_asg.py
def delete_launch_configuration(name, region=None, key=None, keyid=None, profile=None): ''' Delete a launch configuration. CLI example:: salt myminion boto_asg.delete_launch_configuration mylc ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
def delete_launch_configuration(name, region=None, key=None, keyid=None, profile=None): ''' Delete a launch configuration. CLI example:: salt myminion boto_asg.delete_launch_configuration mylc ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
[ "Delete", "a", "launch", "configuration", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L702-L727
[ "def", "delete_launch_configuration", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_scaling_policy_arn
Return the arn for a scaling policy in a specific autoscale group or None if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for linking alarms to scaling policies. CLI Example:: salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy
salt/modules/boto_asg.py
def get_scaling_policy_arn(as_group, scaling_policy_name, region=None, key=None, keyid=None, profile=None): ''' Return the arn for a scaling policy in a specific autoscale group or None if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for linking alarms ...
def get_scaling_policy_arn(as_group, scaling_policy_name, region=None, key=None, keyid=None, profile=None): ''' Return the arn for a scaling policy in a specific autoscale group or None if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for linking alarms ...
[ "Return", "the", "arn", "for", "a", "scaling", "policy", "in", "a", "specific", "autoscale", "group", "or", "None", "if", "not", "found", ".", "Mainly", "used", "as", "a", "helper", "method", "for", "boto_cloudwatch_alarm", "for", "linking", "alarms", "to", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L730-L759
[ "def", "get_scaling_policy_arn", "(", "as_group", ",", "scaling_policy_name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_groups
Return all AutoScale Groups visible in the account (as a list of boto.ec2.autoscale.group.AutoScalingGroup). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.get_all_groups region=us-east-1 --output yaml
salt/modules/boto_asg.py
def get_all_groups(region=None, key=None, keyid=None, profile=None): ''' Return all AutoScale Groups visible in the account (as a list of boto.ec2.autoscale.group.AutoScalingGroup). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.get_all_groups region...
def get_all_groups(region=None, key=None, keyid=None, profile=None): ''' Return all AutoScale Groups visible in the account (as a list of boto.ec2.autoscale.group.AutoScalingGroup). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.get_all_groups region...
[ "Return", "all", "AutoScale", "Groups", "visible", "in", "the", "account", "(", "as", "a", "list", "of", "boto", ".", "ec2", ".", "autoscale", ".", "group", ".", "AutoScalingGroup", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L762-L794
[ "def", "get_all_groups", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "=", "keyi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_groups
Return all AutoScale Groups visible in the account (as a list of names). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.list_groups region=us-east-1
salt/modules/boto_asg.py
def list_groups(region=None, key=None, keyid=None, profile=None): ''' Return all AutoScale Groups visible in the account (as a list of names). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.list_groups region=us-east-1 ''' return [a.name for...
def list_groups(region=None, key=None, keyid=None, profile=None): ''' Return all AutoScale Groups visible in the account (as a list of names). .. versionadded:: 2016.11.0 CLI example: .. code-block:: bash salt-call boto_asg.list_groups region=us-east-1 ''' return [a.name for...
[ "Return", "all", "AutoScale", "Groups", "visible", "in", "the", "account", "(", "as", "a", "list", "of", "names", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L797-L811
[ "def", "list_groups", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "return", "[", "a", ".", "name", "for", "a", "in", "get_all_groups", "(", "region", "=", "region", ",", "ke...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_instances
return attribute of all instances in the named autoscale group. CLI example:: salt-call boto_asg.get_instances my_autoscale_group_name
salt/modules/boto_asg.py
def get_instances(name, lifecycle_state="InService", health_status="Healthy", attribute="private_ip_address", attributes=None, region=None, key=None, keyid=None, profile=None): ''' return attribute of all instances in the named autoscale group. CLI example:: sal...
def get_instances(name, lifecycle_state="InService", health_status="Healthy", attribute="private_ip_address", attributes=None, region=None, key=None, keyid=None, profile=None): ''' return attribute of all instances in the named autoscale group. CLI example:: sal...
[ "return", "attribute", "of", "all", "instances", "in", "the", "named", "autoscale", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L814-L858
[ "def", "get_instances", "(", "name", ",", "lifecycle_state", "=", "\"InService\"", ",", "health_status", "=", "\"Healthy\"", ",", "attribute", "=", "\"private_ip_address\"", ",", "attributes", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exit_standby
Exit desired instances from StandBy mode .. versionadded:: 2016.11.0 CLI example:: salt-call boto_asg.exit_standby my_autoscale_group_name '["i-xxxxxx"]'
salt/modules/boto_asg.py
def exit_standby(name, instance_ids, should_decrement_desired_capacity=False, region=None, key=None, keyid=None, profile=None): ''' Exit desired instances from StandBy mode .. versionadded:: 2016.11.0 CLI example:: salt-call boto_asg.exit_standby my_autoscale_group_name '["i...
def exit_standby(name, instance_ids, should_decrement_desired_capacity=False, region=None, key=None, keyid=None, profile=None): ''' Exit desired instances from StandBy mode .. versionadded:: 2016.11.0 CLI example:: salt-call boto_asg.exit_standby my_autoscale_group_name '["i...
[ "Exit", "desired", "instances", "from", "StandBy", "mode" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L895-L918
[ "def", "exit_standby", "(", "name", ",", "instance_ids", ",", "should_decrement_desired_capacity", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ls_
List SCSI devices, with details CLI Examples: .. code-block:: bash salt '*' scsi.ls salt '*' scsi.ls get_size=False get_size : True Get the size information for scsi devices. This option should be set to False for older OS distributions (RHEL6 and older) due to l...
salt/modules/scsi.py
def ls_(get_size=True): ''' List SCSI devices, with details CLI Examples: .. code-block:: bash salt '*' scsi.ls salt '*' scsi.ls get_size=False get_size : True Get the size information for scsi devices. This option should be set to False for older OS distribution...
def ls_(get_size=True): ''' List SCSI devices, with details CLI Examples: .. code-block:: bash salt '*' scsi.ls salt '*' scsi.ls get_size=False get_size : True Get the size information for scsi devices. This option should be set to False for older OS distribution...
[ "List", "SCSI", "devices", "with", "details" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/scsi.py#L18-L89
[ "def", "ls_", "(", "get_size", "=", "True", ")", ":", "if", "not", "salt", ".", "utils", ".", "path", ".", "which", "(", "'lsscsi'", ")", ":", "__context__", "[", "'retcode'", "]", "=", "1", "return", "'scsi.ls not available - lsscsi command not found'", "if...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rescan_all
List scsi devices CLI Example: .. code-block:: bash salt '*' scsi.rescan_all 0
salt/modules/scsi.py
def rescan_all(host): ''' List scsi devices CLI Example: .. code-block:: bash salt '*' scsi.rescan_all 0 ''' if os.path.isdir('/sys/class/scsi_host/host{0}'.format(host)): cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host) else: return 'Host {0} ...
def rescan_all(host): ''' List scsi devices CLI Example: .. code-block:: bash salt '*' scsi.rescan_all 0 ''' if os.path.isdir('/sys/class/scsi_host/host{0}'.format(host)): cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host) else: return 'Host {0} ...
[ "List", "scsi", "devices" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/scsi.py#L92-L106
[ "def", "rescan_all", "(", "host", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "'/sys/class/scsi_host/host{0}'", ".", "format", "(", "host", ")", ")", ":", "cmd", "=", "'echo \"- - -\" > /sys/class/scsi_host/host{0}/scan'", ".", "format", "(", "host", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_vsan_datastore
Retrieves the vsan_datastore
salt/states/esxcluster.py
def _get_vsan_datastore(si, cluster_name): '''Retrieves the vsan_datastore''' log.trace('Retrieving vsan datastore') vsan_datastores = [ds for ds in __salt__['vsphere.list_datastores_via_proxy']( service_instance=si) if ds['type'] == ...
def _get_vsan_datastore(si, cluster_name): '''Retrieves the vsan_datastore''' log.trace('Retrieving vsan datastore') vsan_datastores = [ds for ds in __salt__['vsphere.list_datastores_via_proxy']( service_instance=si) if ds['type'] == ...
[ "Retrieves", "the", "vsan_datastore" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L95-L108
[ "def", "_get_vsan_datastore", "(", "si", ",", "cluster_name", ")", ":", "log", ".", "trace", "(", "'Retrieving vsan datastore'", ")", "vsan_datastores", "=", "[", "ds", "for", "ds", "in", "__salt__", "[", "'vsphere.list_datastores_via_proxy'", "]", "(", "service_i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_configured
Configures a cluster. Creates a new cluster, if it doesn't exist on the vCenter or reconfigures it if configured differently Supported proxies: esxdatacenter, esxcluster name Name of the state. If the state is run in by an ``esxdatacenter`` proxy, it will be the name of the cluster. c...
salt/states/esxcluster.py
def cluster_configured(name, cluster_config): ''' Configures a cluster. Creates a new cluster, if it doesn't exist on the vCenter or reconfigures it if configured differently Supported proxies: esxdatacenter, esxcluster name Name of the state. If the state is run in by an ``esxdatacenter``...
def cluster_configured(name, cluster_config): ''' Configures a cluster. Creates a new cluster, if it doesn't exist on the vCenter or reconfigures it if configured differently Supported proxies: esxdatacenter, esxcluster name Name of the state. If the state is run in by an ``esxdatacenter``...
[ "Configures", "a", "cluster", ".", "Creates", "a", "new", "cluster", "if", "it", "doesn", "t", "exist", "on", "the", "vCenter", "or", "reconfigures", "it", "if", "configured", "differently" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L111-L285
[ "def", "cluster_configured", "(", "name", ",", "cluster_config", ")", ":", "proxy_type", "=", "__salt__", "[", "'vsphere.get_proxy_type'", "]", "(", ")", "if", "proxy_type", "==", "'esxdatacenter'", ":", "cluster_name", ",", "datacenter_name", "=", "name", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vsan_datastore_configured
Configures the cluster's VSAN datastore WARNING: The VSAN datastore is created automatically after the first ESXi host is added to the cluster; the state assumes that the datastore exists and errors if it doesn't.
salt/states/esxcluster.py
def vsan_datastore_configured(name, datastore_name): ''' Configures the cluster's VSAN datastore WARNING: The VSAN datastore is created automatically after the first ESXi host is added to the cluster; the state assumes that the datastore exists and errors if it doesn't. ''' cluster_name, d...
def vsan_datastore_configured(name, datastore_name): ''' Configures the cluster's VSAN datastore WARNING: The VSAN datastore is created automatically after the first ESXi host is added to the cluster; the state assumes that the datastore exists and errors if it doesn't. ''' cluster_name, d...
[ "Configures", "the", "cluster", "s", "VSAN", "datastore" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L288-L350
[ "def", "vsan_datastore_configured", "(", "name", ",", "datastore_name", ")", ":", "cluster_name", ",", "datacenter_name", "=", "__salt__", "[", "'esxcluster.get_details'", "]", "(", ")", "[", "'cluster'", "]", ",", "__salt__", "[", "'esxcluster.get_details'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
licenses_configured
Configures licenses on the cluster entity Checks if each license exists on the server: - if it doesn't, it creates it Check if license is assigned to the cluster: - if it's not assigned to the cluster: - assign it to the cluster if there is space - error if there's no sp...
salt/states/esxcluster.py
def licenses_configured(name, licenses=None): ''' Configures licenses on the cluster entity Checks if each license exists on the server: - if it doesn't, it creates it Check if license is assigned to the cluster: - if it's not assigned to the cluster: - assign it to the clus...
def licenses_configured(name, licenses=None): ''' Configures licenses on the cluster entity Checks if each license exists on the server: - if it doesn't, it creates it Check if license is assigned to the cluster: - if it's not assigned to the cluster: - assign it to the clus...
[ "Configures", "licenses", "on", "the", "cluster", "entity" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L353-L537
[ "def", "licenses_configured", "(", "name", ",", "licenses", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "'Default'", "}", "if", "not", "licenses", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_system_encoding
Get system encoding. Most of this code is a part of salt/__init__.py
salt/client/ssh/ssh_py_shim.py
def get_system_encoding(): ''' Get system encoding. Most of this code is a part of salt/__init__.py ''' # This is the most trustworthy source of the system encoding, though, if # salt is being imported after being daemonized, this information is lost # and reset to None encoding = None ...
def get_system_encoding(): ''' Get system encoding. Most of this code is a part of salt/__init__.py ''' # This is the most trustworthy source of the system encoding, though, if # salt is being imported after being daemonized, this information is lost # and reset to None encoding = None ...
[ "Get", "system", "encoding", ".", "Most", "of", "this", "code", "is", "a", "part", "of", "salt", "/", "__init__", ".", "py" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L48-L93
[ "def", "get_system_encoding", "(", ")", ":", "# This is the most trustworthy source of the system encoding, though, if", "# salt is being imported after being daemonized, this information is lost", "# and reset to None", "encoding", "=", "None", "if", "not", "sys", ".", "platform", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
need_deployment
Salt thin needs to be deployed - prep the target directory and emit the delimiter and exit code that signals a required deployment.
salt/client/ssh/ssh_py_shim.py
def need_deployment(): ''' Salt thin needs to be deployed - prep the target directory and emit the delimiter and exit code that signals a required deployment. ''' if os.path.exists(OPTIONS.saltdir): shutil.rmtree(OPTIONS.saltdir) old_umask = os.umask(0o077) # pylint: disable=blacklisted...
def need_deployment(): ''' Salt thin needs to be deployed - prep the target directory and emit the delimiter and exit code that signals a required deployment. ''' if os.path.exists(OPTIONS.saltdir): shutil.rmtree(OPTIONS.saltdir) old_umask = os.umask(0o077) # pylint: disable=blacklisted...
[ "Salt", "thin", "needs", "to", "be", "deployed", "-", "prep", "the", "target", "directory", "and", "emit", "the", "delimiter", "and", "exit", "code", "that", "signals", "a", "required", "deployment", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L103-L139
[ "def", "need_deployment", "(", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "OPTIONS", ".", "saltdir", ")", ":", "shutil", ".", "rmtree", "(", "OPTIONS", ".", "saltdir", ")", "old_umask", "=", "os", ".", "umask", "(", "0o077", ")", "# pylin...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_hash
Generate a hash digest string for a file.
salt/client/ssh/ssh_py_shim.py
def get_hash(path, form='sha1', chunk_size=4096): ''' Generate a hash digest string for a file. ''' try: hash_type = getattr(hashlib, form) except AttributeError: raise ValueError('Invalid hash type: {0}'.format(form)) with open(path, 'rb') as ifile: hash_obj = hash_type(...
def get_hash(path, form='sha1', chunk_size=4096): ''' Generate a hash digest string for a file. ''' try: hash_type = getattr(hashlib, form) except AttributeError: raise ValueError('Invalid hash type: {0}'.format(form)) with open(path, 'rb') as ifile: hash_obj = hash_type(...
[ "Generate", "a", "hash", "digest", "string", "for", "a", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L143-L156
[ "def", "get_hash", "(", "path", ",", "form", "=", "'sha1'", ",", "chunk_size", "=", "4096", ")", ":", "try", ":", "hash_type", "=", "getattr", "(", "hashlib", ",", "form", ")", "except", "AttributeError", ":", "raise", "ValueError", "(", "'Invalid hash typ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unpack_thin
Unpack the Salt thin archive.
salt/client/ssh/ssh_py_shim.py
def unpack_thin(thin_path): ''' Unpack the Salt thin archive. ''' tfile = tarfile.TarFile.gzopen(thin_path) old_umask = os.umask(0o077) # pylint: disable=blacklisted-function tfile.extractall(path=OPTIONS.saltdir) tfile.close() os.umask(old_umask) # pylint: disable=blacklisted-function...
def unpack_thin(thin_path): ''' Unpack the Salt thin archive. ''' tfile = tarfile.TarFile.gzopen(thin_path) old_umask = os.umask(0o077) # pylint: disable=blacklisted-function tfile.extractall(path=OPTIONS.saltdir) tfile.close() os.umask(old_umask) # pylint: disable=blacklisted-function...
[ "Unpack", "the", "Salt", "thin", "archive", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L159-L172
[ "def", "unpack_thin", "(", "thin_path", ")", ":", "tfile", "=", "tarfile", ".", "TarFile", ".", "gzopen", "(", "thin_path", ")", "old_umask", "=", "os", ".", "umask", "(", "0o077", ")", "# pylint: disable=blacklisted-function", "tfile", ".", "extractall", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
need_ext
Signal that external modules need to be deployed.
salt/client/ssh/ssh_py_shim.py
def need_ext(): ''' Signal that external modules need to be deployed. ''' sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter)) sys.exit(EX_MOD_DEPLOY)
def need_ext(): ''' Signal that external modules need to be deployed. ''' sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter)) sys.exit(EX_MOD_DEPLOY)
[ "Signal", "that", "external", "modules", "need", "to", "be", "deployed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L175-L180
[ "def", "need_ext", "(", ")", ":", "sys", ".", "stdout", ".", "write", "(", "\"{0}\\next_mods\\n\"", ".", "format", "(", "OPTIONS", ".", "delimiter", ")", ")", "sys", ".", "exit", "(", "EX_MOD_DEPLOY", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unpack_ext
Unpack the external modules.
salt/client/ssh/ssh_py_shim.py
def unpack_ext(ext_path): ''' Unpack the external modules. ''' modcache = os.path.join( OPTIONS.saltdir, 'running_data', 'var', 'cache', 'salt', 'minion', 'extmods') tfile = tarfile.TarFile.gzopen(ext_path) old_u...
def unpack_ext(ext_path): ''' Unpack the external modules. ''' modcache = os.path.join( OPTIONS.saltdir, 'running_data', 'var', 'cache', 'salt', 'minion', 'extmods') tfile = tarfile.TarFile.gzopen(ext_path) old_u...
[ "Unpack", "the", "external", "modules", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L183-L203
[ "def", "unpack_ext", "(", "ext_path", ")", ":", "modcache", "=", "os", ".", "path", ".", "join", "(", "OPTIONS", ".", "saltdir", ",", "'running_data'", ",", "'var'", ",", "'cache'", ",", "'salt'", ",", "'minion'", ",", "'extmods'", ")", "tfile", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reset_time
Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp.
salt/client/ssh/ssh_py_shim.py
def reset_time(path='.', amt=None): ''' Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp. ''' if not amt: amt = int(time.time()) for fname in os.listdir(path): fname = os.path.join(path, fname) if os.path.isdir(fname): re...
def reset_time(path='.', amt=None): ''' Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp. ''' if not amt: amt = int(time.time()) for fname in os.listdir(path): fname = os.path.join(path, fname) if os.path.isdir(fname): re...
[ "Reset", "atime", "/", "mtime", "on", "all", "files", "to", "prevent", "systemd", "swipes", "only", "part", "of", "the", "files", "in", "the", "/", "tmp", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L206-L216
[ "def", "reset_time", "(", "path", "=", "'.'", ",", "amt", "=", "None", ")", ":", "if", "not", "amt", ":", "amt", "=", "int", "(", "time", ".", "time", "(", ")", ")", "for", "fname", "in", "os", ".", "listdir", "(", "path", ")", ":", "fname", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_executable
Find executable which matches supported python version in the thin
salt/client/ssh/ssh_py_shim.py
def get_executable(): ''' Find executable which matches supported python version in the thin ''' pymap = {} with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp: for line in _fp.readlines(): ns, v_maj, v_min = line.strip().split(':') pymap[ns] = (int(...
def get_executable(): ''' Find executable which matches supported python version in the thin ''' pymap = {} with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp: for line in _fp.readlines(): ns, v_maj, v_min = line.strip().split(':') pymap[ns] = (int(...
[ "Find", "executable", "which", "matches", "supported", "python", "version", "in", "the", "thin" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L219-L244
[ "def", "get_executable", "(", ")", ":", "pymap", "=", "{", "}", "with", "open", "(", "os", ".", "path", ".", "join", "(", "OPTIONS", ".", "saltdir", ",", "'supported-versions'", ")", ")", "as", "_fp", ":", "for", "line", "in", "_fp", ".", "readlines"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
main
Main program body
salt/client/ssh/ssh_py_shim.py
def main(argv): # pylint: disable=W0613 ''' Main program body ''' thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE) if os.path.isfile(thin_path): if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc): need_deployment() unpack_thin(thin_path) # Salt t...
def main(argv): # pylint: disable=W0613 ''' Main program body ''' thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE) if os.path.isfile(thin_path): if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc): need_deployment() unpack_thin(thin_path) # Salt t...
[ "Main", "program", "body" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L247-L357
[ "def", "main", "(", "argv", ")", ":", "# pylint: disable=W0613", "thin_path", "=", "os", ".", "path", ".", "join", "(", "OPTIONS", ".", "saltdir", ",", "THIN_ARCHIVE", ")", "if", "os", ".", "path", ".", "isfile", "(", "thin_path", ")", ":", "if", "OPTI...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_mount
Mount the device in a temporary place.
salt/states/btrfs.py
def _mount(device): ''' Mount the device in a temporary place. ''' dest = tempfile.mkdtemp() res = __states__['mount.mounted'](dest, device=device, fstype='btrfs', opts='subvol=/', persist=False) if not res['result']: log.error('Cannot mount device %...
def _mount(device): ''' Mount the device in a temporary place. ''' dest = tempfile.mkdtemp() res = __states__['mount.mounted'](dest, device=device, fstype='btrfs', opts='subvol=/', persist=False) if not res['result']: log.error('Cannot mount device %...
[ "Mount", "the", "device", "in", "a", "temporary", "place", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L44-L55
[ "def", "_mount", "(", "device", ")", ":", "dest", "=", "tempfile", ".", "mkdtemp", "(", ")", "res", "=", "__states__", "[", "'mount.mounted'", "]", "(", "dest", ",", "device", "=", "device", ",", "fstype", "=", "'btrfs'", ",", "opts", "=", "'subvol=/'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_is_default
Check if the subvolume is the current default.
salt/states/btrfs.py
def _is_default(path, dest, name): ''' Check if the subvolume is the current default. ''' subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id'] def_id = __salt__['btrfs.subvolume_get_default'](dest)['id'] return subvol_id == def_id
def _is_default(path, dest, name): ''' Check if the subvolume is the current default. ''' subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id'] def_id = __salt__['btrfs.subvolume_get_default'](dest)['id'] return subvol_id == def_id
[ "Check", "if", "the", "subvolume", "is", "the", "current", "default", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L66-L72
[ "def", "_is_default", "(", "path", ",", "dest", ",", "name", ")", ":", "subvol_id", "=", "__salt__", "[", "'btrfs.subvolume_show'", "]", "(", "path", ")", "[", "name", "]", "[", "'subvolume id'", "]", "def_id", "=", "__salt__", "[", "'btrfs.subvolume_get_def...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_default
Set the subvolume as the current default.
salt/states/btrfs.py
def _set_default(path, dest, name): ''' Set the subvolume as the current default. ''' subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id'] return __salt__['btrfs.subvolume_set_default'](subvol_id, dest)
def _set_default(path, dest, name): ''' Set the subvolume as the current default. ''' subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id'] return __salt__['btrfs.subvolume_set_default'](subvol_id, dest)
[ "Set", "the", "subvolume", "as", "the", "current", "default", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L75-L80
[ "def", "_set_default", "(", "path", ",", "dest", ",", "name", ")", ":", "subvol_id", "=", "__salt__", "[", "'btrfs.subvolume_show'", "]", "(", "path", ")", "[", "name", "]", "[", "'subvolume id'", "]", "return", "__salt__", "[", "'btrfs.subvolume_set_default'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_is_cow
Check if the subvolume is copy on write
salt/states/btrfs.py
def _is_cow(path): ''' Check if the subvolume is copy on write ''' dirname = os.path.dirname(path) return 'C' not in __salt__['file.lsattr'](dirname)[path]
def _is_cow(path): ''' Check if the subvolume is copy on write ''' dirname = os.path.dirname(path) return 'C' not in __salt__['file.lsattr'](dirname)[path]
[ "Check", "if", "the", "subvolume", "is", "copy", "on", "write" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L83-L88
[ "def", "_is_cow", "(", "path", ")", ":", "dirname", "=", "os", ".", "path", ".", "dirname", "(", "path", ")", "return", "'C'", "not", "in", "__salt__", "[", "'file.lsattr'", "]", "(", "dirname", ")", "[", "path", "]" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__mount_device
Small decorator to makes sure that the mount and umount happends in a transactional way.
salt/states/btrfs.py
def __mount_device(action): ''' Small decorator to makes sure that the mount and umount happends in a transactional way. ''' @functools.wraps(action) def wrapper(*args, **kwargs): name = kwargs['name'] device = kwargs['device'] ret = { 'name': name, ...
def __mount_device(action): ''' Small decorator to makes sure that the mount and umount happends in a transactional way. ''' @functools.wraps(action) def wrapper(*args, **kwargs): name = kwargs['name'] device = kwargs['device'] ret = { 'name': name, ...
[ "Small", "decorator", "to", "makes", "sure", "that", "the", "mount", "and", "umount", "happends", "in", "a", "transactional", "way", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L98-L127
[ "def", "__mount_device", "(", "action", ")", ":", "@", "functools", ".", "wraps", "(", "action", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", "[", "'name'", "]", "device", "=", "kwargs", "[", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subvolume_created
Makes sure that a btrfs subvolume is present. name Name of the subvolume to add device Device where to create the subvolume qgroupids Add the newly created subcolume to a qgroup. This parameter is a list set_default If True, this new subvolume will be set as...
salt/states/btrfs.py
def subvolume_created(name, device, qgroupids=None, set_default=False, copy_on_write=True, force_set_default=True, __dest=None): ''' Makes sure that a btrfs subvolume is present. name Name of the subvolume to add device Device where to create...
def subvolume_created(name, device, qgroupids=None, set_default=False, copy_on_write=True, force_set_default=True, __dest=None): ''' Makes sure that a btrfs subvolume is present. name Name of the subvolume to add device Device where to create...
[ "Makes", "sure", "that", "a", "btrfs", "subvolume", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L131-L208
[ "def", "subvolume_created", "(", "name", ",", "device", ",", "qgroupids", "=", "None", ",", "set_default", "=", "False", ",", "copy_on_write", "=", "True", ",", "force_set_default", "=", "True", ",", "__dest", "=", "None", ")", ":", "ret", "=", "{", "'na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subvolume_deleted
Makes sure that a btrfs subvolume is removed. name Name of the subvolume to remove device Device where to remove the subvolume commit Wait until the transaction is over
salt/states/btrfs.py
def subvolume_deleted(name, device, commit=False, __dest=None): ''' Makes sure that a btrfs subvolume is removed. name Name of the subvolume to remove device Device where to remove the subvolume commit Wait until the transaction is over ''' ret = { 'name':...
def subvolume_deleted(name, device, commit=False, __dest=None): ''' Makes sure that a btrfs subvolume is removed. name Name of the subvolume to remove device Device where to remove the subvolume commit Wait until the transaction is over ''' ret = { 'name':...
[ "Makes", "sure", "that", "a", "btrfs", "subvolume", "is", "removed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L212-L258
[ "def", "subvolume_deleted", "(", "name", ",", "device", ",", "commit", "=", "False", ",", "__dest", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Execute a command and read the output as YAML
salt/pillar/cmd_yaml.py
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 command): ''' Execute a command and read the output as YAML ''' try: command = command.replace('%s', minion_id) output = __salt__['cmd.run_stdout'](command, python_shell=True...
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 command): ''' Execute a command and read the output as YAML ''' try: command = command.replace('%s', minion_id) output = __salt__['cmd.run_stdout'](command, python_shell=True...
[ "Execute", "a", "command", "and", "read", "the", "output", "as", "YAML" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_yaml.py#L20-L35
[ "def", "ext_pillar", "(", "minion_id", ",", "# pylint: disable=W0613", "pillar", ",", "# pylint: disable=W0613", "command", ")", ":", "try", ":", "command", "=", "command", ".", "replace", "(", "'%s'", ",", "minion_id", ")", "output", "=", "__salt__", "[", "'c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
zone_present
.. versionadded:: Fluorine Ensure a DNS zone exists. :param name: Name of the DNS zone (without a terminating dot). :param resource_group: The resource group assigned to the DNS zone. :param etag: The etag of the zone. `Etags <https://docs.microsoft.com/en-us/azure/dns/dns-zo...
salt/states/azurearm_dns.py
def zone_present(name, resource_group, etag=None, if_match=None, if_none_match=None, registration_virtual_networks=None, resolution_virtual_networks=None, tags=None, zone_type='Public', connection_auth=None, **kwargs): ''' .. versionadded:: Fluorine Ensure a DNS zone exist...
def zone_present(name, resource_group, etag=None, if_match=None, if_none_match=None, registration_virtual_networks=None, resolution_virtual_networks=None, tags=None, zone_type='Public', connection_auth=None, **kwargs): ''' .. versionadded:: Fluorine Ensure a DNS zone exist...
[ "..", "versionadded", "::", "Fluorine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L131-L297
[ "def", "zone_present", "(", "name", ",", "resource_group", ",", "etag", "=", "None", ",", "if_match", "=", "None", ",", "if_none_match", "=", "None", ",", "registration_virtual_networks", "=", "None", ",", "resolution_virtual_networks", "=", "None", ",", "tags",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
zone_absent
.. versionadded:: Fluorine Ensure a DNS zone does not exist in the resource group. :param name: Name of the DNS zone. :param resource_group: The resource group assigned to the DNS zone. :param connection_auth: A dict with subscription and authentication parameters to be used ...
salt/states/azurearm_dns.py
def zone_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: Fluorine Ensure a DNS zone does not exist in the resource group. :param name: Name of the DNS zone. :param resource_group: The resource group assigned to the DNS zone. :param connection_auth: ...
def zone_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: Fluorine Ensure a DNS zone does not exist in the resource group. :param name: Name of the DNS zone. :param resource_group: The resource group assigned to the DNS zone. :param connection_auth: ...
[ "..", "versionadded", "::", "Fluorine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L300-L360
[ "def", "zone_absent", "(", "name", ",", "resource_group", ",", "connection_auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
record_set_present
.. versionadded:: Fluorine Ensure a record set exists in a DNS zone. :param name: The name of the record set, relative to the name of the zone. :param zone_name: Name of the DNS zone (without a terminating dot). :param resource_group: The resource group assigned to the DNS zo...
salt/states/azurearm_dns.py
def record_set_present(name, zone_name, resource_group, record_type, if_match=None, if_none_match=None, etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record...
def record_set_present(name, zone_name, resource_group, record_type, if_match=None, if_none_match=None, etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record...
[ "..", "versionadded", "::", "Fluorine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L363-L616
[ "def", "record_set_present", "(", "name", ",", "zone_name", ",", "resource_group", ",", "record_type", ",", "if_match", "=", "None", ",", "if_none_match", "=", "None", ",", "etag", "=", "None", ",", "metadata", "=", "None", ",", "ttl", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
record_set_absent
.. versionadded:: Fluorine Ensure a record set does not exist in the DNS zone. :param name: Name of the record set. :param zone_name: Name of the DNS zone. :param resource_group: The resource group assigned to the DNS zone. :param connection_auth: A dict with sub...
salt/states/azurearm_dns.py
def record_set_absent(name, zone_name, resource_group, connection_auth=None): ''' .. versionadded:: Fluorine Ensure a record set does not exist in the DNS zone. :param name: Name of the record set. :param zone_name: Name of the DNS zone. :param resource_group: The res...
def record_set_absent(name, zone_name, resource_group, connection_auth=None): ''' .. versionadded:: Fluorine Ensure a record set does not exist in the DNS zone. :param name: Name of the record set. :param zone_name: Name of the DNS zone. :param resource_group: The res...
[ "..", "versionadded", "::", "Fluorine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L619-L683
[ "def", "record_set_absent", "(", "name", ",", "zone_name", ",", "resource_group", ",", "connection_auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_config_file
Parse the given atom, allowing access to its parts Success does not mean that the atom exists, just that it is in the correct format. Returns none if the atom is invalid.
salt/modules/portage_config.py
def _get_config_file(conf, atom): ''' Parse the given atom, allowing access to its parts Success does not mean that the atom exists, just that it is in the correct format. Returns none if the atom is invalid. ''' if '*' in atom: parts = portage.dep.Atom(atom, allow_wildcard=True) ...
def _get_config_file(conf, atom): ''' Parse the given atom, allowing access to its parts Success does not mean that the atom exists, just that it is in the correct format. Returns none if the atom is invalid. ''' if '*' in atom: parts = portage.dep.Atom(atom, allow_wildcard=True) ...
[ "Parse", "the", "given", "atom", "allowing", "access", "to", "its", "parts", "Success", "does", "not", "mean", "that", "the", "atom", "exists", "just", "that", "it", "is", "in", "the", "correct", "format", ".", "Returns", "none", "if", "the", "atom", "is...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L68-L93
[ "def", "_get_config_file", "(", "conf", ",", "atom", ")", ":", "if", "'*'", "in", "atom", ":", "parts", "=", "portage", ".", "dep", ".", "Atom", "(", "atom", ",", "allow_wildcard", "=", "True", ")", "if", "not", "parts", ":", "return", "if", "parts",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cpv
add version to category/package @cp - name of package in format category/name @installed - boolean value, if False, function returns cpv for latest available package
salt/modules/portage_config.py
def _get_cpv(cp, installed=True): ''' add version to category/package @cp - name of package in format category/name @installed - boolean value, if False, function returns cpv for latest available package ''' if installed: return _get_portage().db[portage.root]['vartree'].dep_bestmatc...
def _get_cpv(cp, installed=True): ''' add version to category/package @cp - name of package in format category/name @installed - boolean value, if False, function returns cpv for latest available package ''' if installed: return _get_portage().db[portage.root]['vartree'].dep_bestmatc...
[ "add", "version", "to", "category", "/", "package" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L125-L135
[ "def", "_get_cpv", "(", "cp", ",", "installed", "=", "True", ")", ":", "if", "installed", ":", "return", "_get_portage", "(", ")", ".", "db", "[", "portage", ".", "root", "]", "[", "'vartree'", "]", ".", "dep_bestmatch", "(", "cp", ")", "else", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_unify_keywords
Merge /etc/portage/package.keywords and /etc/portage/package.accept_keywords.
salt/modules/portage_config.py
def _unify_keywords(): ''' Merge /etc/portage/package.keywords and /etc/portage/package.accept_keywords. ''' old_path = BASE_PATH.format('keywords') if os.path.exists(old_path): if os.path.isdir(old_path): for triplet in salt.utils.path.os_walk(old_path): for ...
def _unify_keywords(): ''' Merge /etc/portage/package.keywords and /etc/portage/package.accept_keywords. ''' old_path = BASE_PATH.format('keywords') if os.path.exists(old_path): if os.path.isdir(old_path): for triplet in salt.utils.path.os_walk(old_path): for ...
[ "Merge", "/", "etc", "/", "portage", "/", "package", ".", "keywords", "and", "/", "etc", "/", "portage", "/", "package", ".", "accept_keywords", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L176-L200
[ "def", "_unify_keywords", "(", ")", ":", "old_path", "=", "BASE_PATH", ".", "format", "(", "'keywords'", ")", "if", "os", ".", "path", ".", "exists", "(", "old_path", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "old_path", ")", ":", "for", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_package_conf_file_to_dir
Convert a config file to a config directory.
salt/modules/portage_config.py
def _package_conf_file_to_dir(file_name): ''' Convert a config file to a config directory. ''' if file_name in SUPPORTED_CONFS: path = BASE_PATH.format(file_name) if os.path.exists(path): if os.path.isdir(path): return False else: o...
def _package_conf_file_to_dir(file_name): ''' Convert a config file to a config directory. ''' if file_name in SUPPORTED_CONFS: path = BASE_PATH.format(file_name) if os.path.exists(path): if os.path.isdir(path): return False else: o...
[ "Convert", "a", "config", "file", "to", "a", "config", "directory", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L203-L219
[ "def", "_package_conf_file_to_dir", "(", "file_name", ")", ":", "if", "file_name", "in", "SUPPORTED_CONFS", ":", "path", "=", "BASE_PATH", ".", "format", "(", "file_name", ")", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "if", "os", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_package_conf_ordering
Move entries in the correct file.
salt/modules/portage_config.py
def _package_conf_ordering(conf, clean=True, keep_backup=False): ''' Move entries in the correct file. ''' if conf in SUPPORTED_CONFS: rearrange = [] path = BASE_PATH.format(conf) backup_files = [] for triplet in salt.utils.path.os_walk(path): for file_name ...
def _package_conf_ordering(conf, clean=True, keep_backup=False): ''' Move entries in the correct file. ''' if conf in SUPPORTED_CONFS: rearrange = [] path = BASE_PATH.format(conf) backup_files = [] for triplet in salt.utils.path.os_walk(path): for file_name ...
[ "Move", "entries", "in", "the", "correct", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L222-L280
[ "def", "_package_conf_ordering", "(", "conf", ",", "clean", "=", "True", ",", "keep_backup", "=", "False", ")", ":", "if", "conf", "in", "SUPPORTED_CONFS", ":", "rearrange", "=", "[", "]", "path", "=", "BASE_PATH", ".", "format", "(", "conf", ")", "backu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_accept_keywords
check compatibility of accept_keywords
salt/modules/portage_config.py
def _check_accept_keywords(approved, flag): '''check compatibility of accept_keywords''' if flag in approved: return False elif (flag.startswith('~') and flag[1:] in approved) \ or ('~'+flag in approved): return False else: return True
def _check_accept_keywords(approved, flag): '''check compatibility of accept_keywords''' if flag in approved: return False elif (flag.startswith('~') and flag[1:] in approved) \ or ('~'+flag in approved): return False else: return True
[ "check", "compatibility", "of", "accept_keywords" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L283-L291
[ "def", "_check_accept_keywords", "(", "approved", ",", "flag", ")", ":", "if", "flag", "in", "approved", ":", "return", "False", "elif", "(", "flag", ".", "startswith", "(", "'~'", ")", "and", "flag", "[", "1", ":", "]", "in", "approved", ")", "or", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_merge_flags
Merges multiple lists of flags removing duplicates and resolving conflicts giving priority to lasts lists.
salt/modules/portage_config.py
def _merge_flags(new_flags, old_flags=None, conf='any'): ''' Merges multiple lists of flags removing duplicates and resolving conflicts giving priority to lasts lists. ''' if not old_flags: old_flags = [] args = [old_flags, new_flags] if conf == 'accept_keywords': tmp = new_f...
def _merge_flags(new_flags, old_flags=None, conf='any'): ''' Merges multiple lists of flags removing duplicates and resolving conflicts giving priority to lasts lists. ''' if not old_flags: old_flags = [] args = [old_flags, new_flags] if conf == 'accept_keywords': tmp = new_f...
[ "Merges", "multiple", "lists", "of", "flags", "removing", "duplicates", "and", "resolving", "conflicts", "giving", "priority", "to", "lasts", "lists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L294-L323
[ "def", "_merge_flags", "(", "new_flags", ",", "old_flags", "=", "None", ",", "conf", "=", "'any'", ")", ":", "if", "not", "old_flags", ":", "old_flags", "=", "[", "]", "args", "=", "[", "old_flags", ",", "new_flags", "]", "if", "conf", "==", "'accept_k...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
append_to_package_conf
Append a string or a list of flags for a given package or DEPEND atom to a given configuration file. CLI Example: .. code-block:: bash salt '*' portage_config.append_to_package_conf use string="app-admin/salt ldap -libvirt" salt '*' portage_config.append_to_package_conf use atom="> = app-...
salt/modules/portage_config.py
def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False): ''' Append a string or a list of flags for a given package or DEPEND atom to a given configuration file. CLI Example: .. code-block:: bash salt '*' portage_config.append_to_package_conf use string="app-admi...
def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False): ''' Append a string or a list of flags for a given package or DEPEND atom to a given configuration file. CLI Example: .. code-block:: bash salt '*' portage_config.append_to_package_conf use string="app-admi...
[ "Append", "a", "string", "or", "a", "list", "of", "flags", "for", "a", "given", "package", "or", "DEPEND", "atom", "to", "a", "given", "configuration", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L326-L437
[ "def", "append_to_package_conf", "(", "conf", ",", "atom", "=", "''", ",", "flags", "=", "None", ",", "string", "=", "''", ",", "overwrite", "=", "False", ")", ":", "if", "flags", "is", "None", ":", "flags", "=", "[", "]", "if", "conf", "in", "SUPP...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
append_use_flags
Append a list of use flags for a given package or DEPEND atom CLI Example: .. code-block:: bash salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]" salt '*' portage_config.append_use_flags ">=app-admin/salt-0.14.1" "['ldap', '-libvirt']"
salt/modules/portage_config.py
def append_use_flags(atom, uses=None, overwrite=False): ''' Append a list of use flags for a given package or DEPEND atom CLI Example: .. code-block:: bash salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]" salt '*' portage_config.append_use_flags ">=app-admin/s...
def append_use_flags(atom, uses=None, overwrite=False): ''' Append a list of use flags for a given package or DEPEND atom CLI Example: .. code-block:: bash salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]" salt '*' portage_config.append_use_flags ">=app-admin/s...
[ "Append", "a", "list", "of", "use", "flags", "for", "a", "given", "package", "or", "DEPEND", "atom" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L440-L456
[ "def", "append_use_flags", "(", "atom", ",", "uses", "=", "None", ",", "overwrite", "=", "False", ")", ":", "if", "not", "uses", ":", "uses", "=", "portage", ".", "dep", ".", "dep_getusedeps", "(", "atom", ")", "if", "not", "uses", ":", "return", "at...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_flags_from_package_conf
Get flags for a given package or DEPEND atom. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.get_flags_from_package_conf license salt
salt/modules/portage_config.py
def get_flags_from_package_conf(conf, atom): ''' Get flags for a given package or DEPEND atom. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.get_flag...
def get_flags_from_package_conf(conf, atom): ''' Get flags for a given package or DEPEND atom. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.get_flag...
[ "Get", "flags", "for", "a", "given", "package", "or", "DEPEND", "atom", ".", "Warning", ":", "This", "only", "works", "if", "the", "configuration", "files", "tree", "is", "in", "the", "correct", "format", "(", "the", "one", "enforced", "by", "enforce_nice_...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L459-L507
[ "def", "get_flags_from_package_conf", "(", "conf", ",", "atom", ")", ":", "if", "conf", "in", "SUPPORTED_CONFS", ":", "package_file", "=", "_get_config_file", "(", "conf", ",", "atom", ")", "if", "'/'", "not", "in", "atom", ":", "atom", "=", "_p_to_cp", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
has_flag
Verify if the given package or DEPEND atom has the given flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.has_flag license salt Apache-2.0
salt/modules/portage_config.py
def has_flag(conf, atom, flag): ''' Verify if the given package or DEPEND atom has the given flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.has_...
def has_flag(conf, atom, flag): ''' Verify if the given package or DEPEND atom has the given flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.has_...
[ "Verify", "if", "the", "given", "package", "or", "DEPEND", "atom", "has", "the", "given", "flag", ".", "Warning", ":", "This", "only", "works", "if", "the", "configuration", "files", "tree", "is", "in", "the", "correct", "format", "(", "the", "one", "enf...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L510-L524
[ "def", "has_flag", "(", "conf", ",", "atom", ",", "flag", ")", ":", "if", "flag", "in", "get_flags_from_package_conf", "(", "conf", ",", "atom", ")", ":", "return", "True", "return", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_missing_flags
Find out which of the given flags are currently not set. CLI Example: .. code-block:: bash salt '*' portage_config.get_missing_flags use salt "['ldap', '-libvirt', 'openssl']"
salt/modules/portage_config.py
def get_missing_flags(conf, atom, flags): ''' Find out which of the given flags are currently not set. CLI Example: .. code-block:: bash salt '*' portage_config.get_missing_flags use salt "['ldap', '-libvirt', 'openssl']" ''' new_flags = [] for flag in flags: if not has_fla...
def get_missing_flags(conf, atom, flags): ''' Find out which of the given flags are currently not set. CLI Example: .. code-block:: bash salt '*' portage_config.get_missing_flags use salt "['ldap', '-libvirt', 'openssl']" ''' new_flags = [] for flag in flags: if not has_fla...
[ "Find", "out", "which", "of", "the", "given", "flags", "are", "currently", "not", "set", ".", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L527-L540
[ "def", "get_missing_flags", "(", "conf", ",", "atom", ",", "flags", ")", ":", "new_flags", "=", "[", "]", "for", "flag", "in", "flags", ":", "if", "not", "has_flag", "(", "conf", ",", "atom", ",", "flag", ")", ":", "new_flags", ".", "append", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_present
Tell if a given package or DEPEND atom is present in the configuration files tree. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*' portage_config.is_present unmask salt
salt/modules/portage_config.py
def is_present(conf, atom): ''' Tell if a given package or DEPEND atom is present in the configuration files tree. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*'...
def is_present(conf, atom): ''' Tell if a given package or DEPEND atom is present in the configuration files tree. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config) CLI Example: .. code-block:: bash salt '*'...
[ "Tell", "if", "a", "given", "package", "or", "DEPEND", "atom", "is", "present", "in", "the", "configuration", "files", "tree", ".", "Warning", ":", "This", "only", "works", "if", "the", "configuration", "files", "tree", "is", "in", "the", "correct", "forma...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L558-L599
[ "def", "is_present", "(", "conf", ",", "atom", ")", ":", "if", "conf", "in", "SUPPORTED_CONFS", ":", "if", "not", "isinstance", "(", "atom", ",", "portage", ".", "dep", ".", "Atom", ")", ":", "atom", "=", "portage", ".", "dep", ".", "Atom", "(", "a...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_iuse
.. versionadded:: 2015.8.0 Gets the current IUSE flags from the tree. @type: cpv: string @param cpv: cat/pkg @rtype list @returns [] or the list of IUSE flags
salt/modules/portage_config.py
def get_iuse(cp): ''' .. versionadded:: 2015.8.0 Gets the current IUSE flags from the tree. @type: cpv: string @param cpv: cat/pkg @rtype list @returns [] or the list of IUSE flags ''' cpv = _get_cpv(cp) try: # aux_get might return dupes, so run them through set() to re...
def get_iuse(cp): ''' .. versionadded:: 2015.8.0 Gets the current IUSE flags from the tree. @type: cpv: string @param cpv: cat/pkg @rtype list @returns [] or the list of IUSE flags ''' cpv = _get_cpv(cp) try: # aux_get might return dupes, so run them through set() to re...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L602-L619
[ "def", "get_iuse", "(", "cp", ")", ":", "cpv", "=", "_get_cpv", "(", "cp", ")", "try", ":", "# aux_get might return dupes, so run them through set() to remove them", "dirty_flags", "=", "_porttree", "(", ")", ".", "dbapi", ".", "aux_get", "(", "cpv", ",", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_installed_use
.. versionadded:: 2015.8.0 Gets the installed USE flags from the VARDB. @type: cp: string @param cp: cat/pkg @type use: string @param use: 1 of ["USE", "PKGUSE"] @rtype list @returns [] or the list of IUSE flags
salt/modules/portage_config.py
def get_installed_use(cp, use="USE"): ''' .. versionadded:: 2015.8.0 Gets the installed USE flags from the VARDB. @type: cp: string @param cp: cat/pkg @type use: string @param use: 1 of ["USE", "PKGUSE"] @rtype list @returns [] or the list of IUSE flags ''' portage = _get_p...
def get_installed_use(cp, use="USE"): ''' .. versionadded:: 2015.8.0 Gets the installed USE flags from the VARDB. @type: cp: string @param cp: cat/pkg @type use: string @param use: 1 of ["USE", "PKGUSE"] @rtype list @returns [] or the list of IUSE flags ''' portage = _get_p...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L622-L637
[ "def", "get_installed_use", "(", "cp", ",", "use", "=", "\"USE\"", ")", ":", "portage", "=", "_get_portage", "(", ")", "cpv", "=", "_get_cpv", "(", "cp", ")", "return", "portage", ".", "db", "[", "portage", ".", "root", "]", "[", "\"vartree\"", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filter_flags
.. versionadded:: 2015.8.0 Filter function to remove hidden or otherwise not normally visible USE flags from a list. @type use: list @param use: the USE flag list to be filtered. @type use_expand_hidden: list @param use_expand_hidden: list of flags hidden. @type usemasked: list @param...
salt/modules/portage_config.py
def filter_flags(use, use_expand_hidden, usemasked, useforced): ''' .. versionadded:: 2015.8.0 Filter function to remove hidden or otherwise not normally visible USE flags from a list. @type use: list @param use: the USE flag list to be filtered. @type use_expand_hidden: list @param u...
def filter_flags(use, use_expand_hidden, usemasked, useforced): ''' .. versionadded:: 2015.8.0 Filter function to remove hidden or otherwise not normally visible USE flags from a list. @type use: list @param use: the USE flag list to be filtered. @type use_expand_hidden: list @param u...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L640-L676
[ "def", "filter_flags", "(", "use", ",", "use_expand_hidden", ",", "usemasked", ",", "useforced", ")", ":", "portage", "=", "_get_portage", "(", ")", "# clean out some environment flags, since they will most probably", "# be confusing for the user", "for", "f", "in", "use_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_cpv_use
.. versionadded:: 2015.8.0 Uses portage to determine final USE flags and settings for an emerge. @type cp: string @param cp: eg cat/pkg @rtype: lists @return use, use_expand_hidden, usemask, useforce
salt/modules/portage_config.py
def get_all_cpv_use(cp): ''' .. versionadded:: 2015.8.0 Uses portage to determine final USE flags and settings for an emerge. @type cp: string @param cp: eg cat/pkg @rtype: lists @return use, use_expand_hidden, usemask, useforce ''' cpv = _get_cpv(cp) portage = _get_portage() ...
def get_all_cpv_use(cp): ''' .. versionadded:: 2015.8.0 Uses portage to determine final USE flags and settings for an emerge. @type cp: string @param cp: eg cat/pkg @rtype: lists @return use, use_expand_hidden, usemask, useforce ''' cpv = _get_cpv(cp) portage = _get_portage() ...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L679-L707
[ "def", "get_all_cpv_use", "(", "cp", ")", ":", "cpv", "=", "_get_cpv", "(", "cp", ")", "portage", "=", "_get_portage", "(", ")", "use", "=", "None", "_porttree", "(", ")", ".", "dbapi", ".", "settings", ".", "unlock", "(", ")", "try", ":", "_porttree...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_cleared_flags
.. versionadded:: 2015.8.0 Uses portage for compare use flags which is used for installing package and use flags which now exist int /etc/portage/package.use/ @type cp: string @param cp: eg cat/pkg @rtype: tuple @rparam: tuple with two lists - list of used flags and list of flags which wil...
salt/modules/portage_config.py
def get_cleared_flags(cp): ''' .. versionadded:: 2015.8.0 Uses portage for compare use flags which is used for installing package and use flags which now exist int /etc/portage/package.use/ @type cp: string @param cp: eg cat/pkg @rtype: tuple @rparam: tuple with two lists - list of use...
def get_cleared_flags(cp): ''' .. versionadded:: 2015.8.0 Uses portage for compare use flags which is used for installing package and use flags which now exist int /etc/portage/package.use/ @type cp: string @param cp: eg cat/pkg @rtype: tuple @rparam: tuple with two lists - list of use...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L710-L729
[ "def", "get_cleared_flags", "(", "cp", ")", ":", "cpv", "=", "_get_cpv", "(", "cp", ")", "final_use", ",", "use_expand_hidden", ",", "usemasked", ",", "useforced", "=", "get_all_cpv_use", "(", "cpv", ")", "inst_flags", "=", "filter_flags", "(", "get_installed_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_changed_uses
.. versionadded:: 2015.8.0 Uses portage for determine if the use flags of installed package is compatible with use flags in portage configs. @type cp: string @param cp: eg cat/pkg
salt/modules/portage_config.py
def is_changed_uses(cp): ''' .. versionadded:: 2015.8.0 Uses portage for determine if the use flags of installed package is compatible with use flags in portage configs. @type cp: string @param cp: eg cat/pkg ''' cpv = _get_cpv(cp) i_flags, conf_flags = get_cleared_flags(cpv) f...
def is_changed_uses(cp): ''' .. versionadded:: 2015.8.0 Uses portage for determine if the use flags of installed package is compatible with use flags in portage configs. @type cp: string @param cp: eg cat/pkg ''' cpv = _get_cpv(cp) i_flags, conf_flags = get_cleared_flags(cpv) f...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L732-L749
[ "def", "is_changed_uses", "(", "cp", ")", ":", "cpv", "=", "_get_cpv", "(", "cp", ")", "i_flags", ",", "conf_flags", "=", "get_cleared_flags", "(", "cpv", ")", "for", "i", "in", "i_flags", ":", "try", ":", "conf_flags", ".", "remove", "(", "i", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
active
List existing device-mapper device details.
salt/modules/cryptdev.py
def active(): ''' List existing device-mapper device details. ''' ret = {} # TODO: This command should be extended to collect more information, such as UUID. devices = __salt__['cmd.run_stdout']('dmsetup ls --target crypt') out_regex = re.compile(r'(?P<devname>\w+)\W+\((?P<major>\d+), (?P<mi...
def active(): ''' List existing device-mapper device details. ''' ret = {} # TODO: This command should be extended to collect more information, such as UUID. devices = __salt__['cmd.run_stdout']('dmsetup ls --target crypt') out_regex = re.compile(r'(?P<devname>\w+)\W+\((?P<major>\d+), (?P<mi...
[ "List", "existing", "device", "-", "mapper", "device", "details", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L111-L129
[ "def", "active", "(", ")", ":", "ret", "=", "{", "}", "# TODO: This command should be extended to collect more information, such as UUID.", "devices", "=", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'dmsetup ls --target crypt'", ")", "out_regex", "=", "re", ".", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
crypttab
List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab
salt/modules/cryptdev.py
def crypttab(config='/etc/crypttab'): ''' List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile: ...
def crypttab(config='/etc/crypttab'): ''' List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile: ...
[ "List", "the", "contents", "of", "the", "crypttab" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L132-L161
[ "def", "crypttab", "(", "config", "=", "'/etc/crypttab'", ")", ":", "ret", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "config", ")", ":", "return", "ret", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "confi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_crypttab
Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash salt '*' cryptdev.rm_crypttab foo
salt/modules/cryptdev.py
def rm_crypttab(name, config='/etc/crypttab'): ''' Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash ...
def rm_crypttab(name, config='/etc/crypttab'): ''' Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash ...
[ "Remove", "the", "named", "mapping", "from", "the", "crypttab", ".", "If", "the", "described", "entry", "does", "not", "exist", "nothing", "is", "changed", "but", "the", "command", "succeeds", "by", "returning", "absent", ".", "If", "a", "line", "is", "rem...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L164-L208
[ "def", "rm_crypttab", "(", "name", ",", "config", "=", "'/etc/crypttab'", ")", ":", "modified", "=", "False", "criteria", "=", "_crypttab_entry", "(", "name", "=", "name", ")", "# For each line in the config that does not match the criteria, add it to", "# the list. At th...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_crypttab
Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not present. CLI Example: .. code-block:: bash salt '*' cryptdev.set_crypttab foo /dev/sdz1 mypassword swap,size=256
salt/modules/cryptdev.py
def set_crypttab( name, device, password='none', options='', config='/etc/crypttab', test=False, match_on='name'): ''' Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not pres...
def set_crypttab( name, device, password='none', options='', config='/etc/crypttab', test=False, match_on='name'): ''' Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not pres...
[ "Verify", "that", "this", "device", "is", "represented", "in", "the", "crypttab", "change", "the", "device", "to", "match", "the", "name", "passed", "or", "add", "the", "name", "if", "it", "is", "not", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L211-L316
[ "def", "set_crypttab", "(", "name", ",", "device", ",", "password", "=", "'none'", ",", "options", "=", "''", ",", "config", "=", "'/etc/crypttab'", ",", "test", "=", "False", ",", "match_on", "=", "'name'", ")", ":", "# Fix the options type if it is not a str...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
open
Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/keyfile
salt/modules/cryptdev.py
def open(name, device, keyfile): ''' Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/...
def open(name, device, keyfile): ''' Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/...
[ "Open", "a", "crypt", "device", "using", "cryptsetup", ".", "The", "keyfile", "must", "not", "be", "None", "or", "none", "because", "cryptsetup", "will", "otherwise", "ask", "for", "the", "password", "interactively", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L319-L336
[ "def", "open", "(", "name", ",", "device", ",", "keyfile", ")", ":", "if", "keyfile", "is", "None", "or", "keyfile", "==", "'none'", "or", "keyfile", "==", "'-'", ":", "raise", "CommandExecutionError", "(", "'For immediate crypt device mapping, keyfile must not be...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure domain exists and is up-to-date name Name of the domain domain The name or id of the domain enabled Boolean to control if domain is enabled description An arbitrary description of the domain password The user password email The users e...
salt/states/keystone_user.py
def present(name, auth=None, **kwargs): ''' Ensure domain exists and is up-to-date name Name of the domain domain The name or id of the domain enabled Boolean to control if domain is enabled description An arbitrary description of the domain password ...
def present(name, auth=None, **kwargs): ''' Ensure domain exists and is up-to-date name Name of the domain domain The name or id of the domain enabled Boolean to control if domain is enabled description An arbitrary description of the domain password ...
[ "Ensure", "domain", "exists", "and", "is", "up", "-", "to", "-", "date" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_user.py#L59-L118
[ "def", "present", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "kwargs", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the named service is present. name The LVS server name protocol The service protocol service_address The LVS service address server_address The real server address. packet_forward_method The LVS packet forwarding method(``dr`` for direct routi...
salt/states/lvs_server.py
def present(name, protocol=None, service_address=None, server_address=None, packet_forward_method='dr', weight=1 ): ''' Ensure that the named service is present. name The LVS server name protocol The service protoco...
def present(name, protocol=None, service_address=None, server_address=None, packet_forward_method='dr', weight=1 ): ''' Ensure that the named service is present. name The LVS server name protocol The service protoco...
[ "Ensure", "that", "the", "named", "service", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lvs_server.py#L18-L112
[ "def", "present", "(", "name", ",", "protocol", "=", "None", ",", "service_address", "=", "None", ",", "server_address", "=", "None", ",", "packet_forward_method", "=", "'dr'", ",", "weight", "=", "1", ")", ":", "ret", "=", "{", "'name'", ":", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address The LVS service address. server_address The LVS real server address.
salt/states/lvs_server.py
def absent(name, protocol=None, service_address=None, server_address=None): ''' Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address ...
def absent(name, protocol=None, service_address=None, server_address=None): ''' Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address ...
[ "Ensure", "the", "LVS", "Real", "Server", "in", "specified", "service", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lvs_server.py#L115-L159
[ "def", "absent", "(", "name", ",", "protocol", "=", "None", ",", "service_address", "=", "None", ",", "server_address", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of the user database The database to create the user in user The user to connect as (must be able to create the user) password The password ...
salt/states/influxdb08_user.py
def present(name, passwd, database=None, user=None, password=None, host=None, port=None): ''' Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of th...
def present(name, passwd, database=None, user=None, password=None, host=None, port=None): ''' Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of th...
[ "Ensure", "that", "the", "cluster", "admin", "or", "database", "user", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb08_user.py#L25-L90
[ "def", "present", "(", "name", ",", "passwd", ",", "database", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "host", "=", "None", ",", "port", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'chang...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_pkgs
List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs
salt/modules/openbsdpkg.py
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # not yet imple...
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # not yet imple...
[ "List", "the", "packages", "currently", "installed", "as", "a", "dict", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L57-L98
[ "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
install
Install the passed package Return a dict containing the new package names and versions:: {'<package>': {'old': '<old-version>', 'new': '<new-version>'}} CLI Example, Install one package: .. code-block:: bash salt '*' pkg.install <package name> CLI Example, In...
salt/modules/openbsdpkg.py
def install(name=None, pkgs=None, sources=None, **kwargs): ''' Install the passed package Return a dict containing the new package names and versions:: {'<package>': {'old': '<old-version>', 'new': '<new-version>'}} CLI Example, Install one package: .. code-block::...
def install(name=None, pkgs=None, sources=None, **kwargs): ''' Install the passed package Return a dict containing the new package names and versions:: {'<package>': {'old': '<old-version>', 'new': '<new-version>'}} CLI Example, Install one package: .. code-block::...
[ "Install", "the", "passed", "package" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L184-L250
[ "def", "install", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "sources", "=", "None", ",", "*", "*", "kwargs", ")", ":", "try", ":", "pkg_params", ",", "pkg_type", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.16.0 Returns a dict containing the changes. CLI Example: ...
salt/modules/openbsdpkg.py
def remove(name=None, pkgs=None, purge=False, **kwargs): ''' Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.1...
def remove(name=None, pkgs=None, purge=False, **kwargs): ''' Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.1...
[ "Remove", "a", "single", "package", "with", "pkg_delete" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L253-L314
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "purge", "=", "False", ",", "*", "*", "kwargs", ")", ":", "try", ":", "pkg_params", "=", "[", "x", ".", "split", "(", "'--'", ")", "[", "0", "]", "for", "x", "in", "__s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
purge
Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.16.0...
salt/modules/openbsdpkg.py
def purge(name=None, pkgs=None, **kwargs): ''' Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored ...
def purge(name=None, pkgs=None, **kwargs): ''' Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored ...
[ "Remove", "a", "package", "and", "extra", "configuration", "files", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L317-L344
[ "def", "purge", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "remove", "(", "name", "=", "name", ",", "pkgs", "=", "pkgs", ",", "purge", "=", "True", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
upgrade
Run a full package upgrade (``pkg_add -u``), or upgrade a specific package if ``name`` or ``pkgs`` is provided. ``name`` is ignored when ``pkgs`` is specified. Returns a dictionary containing the changes: .. versionadded:: 2019.2.0 .. code-block:: python {'<package>': {'old': '<old-versi...
salt/modules/openbsdpkg.py
def upgrade(name=None, pkgs=None, **kwargs): ''' Run a full package upgrade (``pkg_add -u``), or upgrade a specific package if ``name`` or ``pkgs`` is provided. ``name`` is ignored when ``pkgs`` is specified. Returns a dictionary containing the changes: .. versionadded:...
def upgrade(name=None, pkgs=None, **kwargs): ''' Run a full package upgrade (``pkg_add -u``), or upgrade a specific package if ``name`` or ``pkgs`` is provided. ``name`` is ignored when ``pkgs`` is specified. Returns a dictionary containing the changes: .. versionadded:...
[ "Run", "a", "full", "package", "upgrade", "(", "pkg_add", "-", "u", ")", "or", "upgrade", "a", "specific", "package", "if", "name", "or", "pkgs", "is", "provided", ".", "name", "is", "ignored", "when", "pkgs", "is", "specified", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L362-L413
[ "def", "upgrade", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "old", "=", "list_pkgs", "(", ")", "cmd", "=", "[", "'pkg_add'", ",", "'-Ix'", ",", "'-u'", "]", "if", "kwargs", ".", "get", "(", "'noop'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46