repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/disk.py | blkid | def blkid(device=None, token=None):
'''
Return block device attributes: UUID, LABEL, etc. This function only works
on systems where blkid is available.
device
Device name from the system
token
Any valid token used for the search
CLI Example:
.. code-block:: bash
... | python | def blkid(device=None, token=None):
'''
Return block device attributes: UUID, LABEL, etc. This function only works
on systems where blkid is available.
device
Device name from the system
token
Any valid token used for the search
CLI Example:
.. code-block:: bash
... | [
"def",
"blkid",
"(",
"device",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'blkid'",
"]",
"if",
"device",
":",
"cmd",
".",
"append",
"(",
"device",
")",
"elif",
"token",
":",
"cmd",
".",
"extend",
"(",
"[",
"'-t'",
",",
... | Return block device attributes: UUID, LABEL, etc. This function only works
on systems where blkid is available.
device
Device name from the system
token
Any valid token used for the search
CLI Example:
.. code-block:: bash
salt '*' disk.blkid
salt '*' disk.blkid ... | [
"Return",
"block",
"device",
"attributes",
":",
"UUID",
"LABEL",
"etc",
".",
"This",
"function",
"only",
"works",
"on",
"systems",
"where",
"blkid",
"is",
"available",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L271-L315 | train |
saltstack/salt | salt/modules/disk.py | tune | def tune(device, **kwargs):
'''
Set attributes for the specified device
CLI Example:
.. code-block:: bash
salt '*' disk.tune /dev/sda1 read-ahead=1024 read-write=True
Valid options are: ``read-ahead``, ``filesystem-read-ahead``,
``read-only``, ``read-write``.
See the ``blockdev(... | python | def tune(device, **kwargs):
'''
Set attributes for the specified device
CLI Example:
.. code-block:: bash
salt '*' disk.tune /dev/sda1 read-ahead=1024 read-write=True
Valid options are: ``read-ahead``, ``filesystem-read-ahead``,
``read-only``, ``read-write``.
See the ``blockdev(... | [
"def",
"tune",
"(",
"device",
",",
"*",
"*",
"kwargs",
")",
":",
"kwarg_map",
"=",
"{",
"'read-ahead'",
":",
"'setra'",
",",
"'filesystem-read-ahead'",
":",
"'setfra'",
",",
"'read-only'",
":",
"'setro'",
",",
"'read-write'",
":",
"'setrw'",
"}",
"opts",
"... | Set attributes for the specified device
CLI Example:
.. code-block:: bash
salt '*' disk.tune /dev/sda1 read-ahead=1024 read-write=True
Valid options are: ``read-ahead``, ``filesystem-read-ahead``,
``read-only``, ``read-write``.
See the ``blockdev(8)`` manpage for a more complete descrip... | [
"Set",
"attributes",
"for",
"the",
"specified",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L318-L354 | train |
saltstack/salt | salt/modules/disk.py | wipe | def wipe(device):
'''
Remove the filesystem information
CLI Example:
.. code-block:: bash
salt '*' disk.wipe /dev/sda1
'''
cmd = 'wipefs -a {0}'.format(device)
try:
out = __salt__['cmd.run_all'](cmd, python_shell=False)
except subprocess.CalledProcessError as err:
... | python | def wipe(device):
'''
Remove the filesystem information
CLI Example:
.. code-block:: bash
salt '*' disk.wipe /dev/sda1
'''
cmd = 'wipefs -a {0}'.format(device)
try:
out = __salt__['cmd.run_all'](cmd, python_shell=False)
except subprocess.CalledProcessError as err:
... | [
"def",
"wipe",
"(",
"device",
")",
":",
"cmd",
"=",
"'wipefs -a {0}'",
".",
"format",
"(",
"device",
")",
"try",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"except",
"subprocess",
".",
"C... | Remove the filesystem information
CLI Example:
.. code-block:: bash
salt '*' disk.wipe /dev/sda1 | [
"Remove",
"the",
"filesystem",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L357-L377 | train |
saltstack/salt | salt/modules/disk.py | dump | def dump(device, args=None):
'''
Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' disk.dump /dev/sda1
'''
cmd = 'blockdev --getro --getsz --getss --getpbsz --getiomin --getioopt --getalignoff ' \
'--getmaxsect --getsize --getsi... | python | def dump(device, args=None):
'''
Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' disk.dump /dev/sda1
'''
cmd = 'blockdev --getro --getsz --getss --getpbsz --getiomin --getioopt --getalignoff ' \
'--getmaxsect --getsize --getsi... | [
"def",
"dump",
"(",
"device",
",",
"args",
"=",
"None",
")",
":",
"cmd",
"=",
"'blockdev --getro --getsz --getss --getpbsz --getiomin --getioopt --getalignoff '",
"'--getmaxsect --getsize --getsize64 --getra --getfra {0}'",
".",
"format",
"(",
"device",
")",
"ret",
"=",
"{"... | Return all contents of dumpe2fs for a specified device
CLI Example:
.. code-block:: bash
salt '*' disk.dump /dev/sda1 | [
"Return",
"all",
"contents",
"of",
"dumpe2fs",
"for",
"a",
"specified",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L380-L408 | train |
saltstack/salt | salt/modules/disk.py | resize2fs | def resize2fs(device):
'''
Resizes the filesystem.
CLI Example:
.. code-block:: bash
salt '*' disk.resize2fs /dev/sda1
'''
cmd = 'resize2fs {0}'.format(device)
try:
out = __salt__['cmd.run_all'](cmd, python_shell=False)
except subprocess.CalledProcessError as err:
... | python | def resize2fs(device):
'''
Resizes the filesystem.
CLI Example:
.. code-block:: bash
salt '*' disk.resize2fs /dev/sda1
'''
cmd = 'resize2fs {0}'.format(device)
try:
out = __salt__['cmd.run_all'](cmd, python_shell=False)
except subprocess.CalledProcessError as err:
... | [
"def",
"resize2fs",
"(",
"device",
")",
":",
"cmd",
"=",
"'resize2fs {0}'",
".",
"format",
"(",
"device",
")",
"try",
":",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"except",
"subprocess",
".",... | Resizes the filesystem.
CLI Example:
.. code-block:: bash
salt '*' disk.resize2fs /dev/sda1 | [
"Resizes",
"the",
"filesystem",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L411-L426 | train |
saltstack/salt | salt/modules/disk.py | format_ | def format_(device,
fs_type='ext4',
inode_size=None,
lazy_itable_init=None,
fat=None,
force=False):
'''
Format a filesystem onto a device
.. versionadded:: 2016.11.0
device
The device in which to create the new filesystem
fs_type... | python | def format_(device,
fs_type='ext4',
inode_size=None,
lazy_itable_init=None,
fat=None,
force=False):
'''
Format a filesystem onto a device
.. versionadded:: 2016.11.0
device
The device in which to create the new filesystem
fs_type... | [
"def",
"format_",
"(",
"device",
",",
"fs_type",
"=",
"'ext4'",
",",
"inode_size",
"=",
"None",
",",
"lazy_itable_init",
"=",
"None",
",",
"fat",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"cmd",
"=",
"[",
"'mkfs'",
",",
"'-t'",
",",
"six",
... | Format a filesystem onto a device
.. versionadded:: 2016.11.0
device
The device in which to create the new filesystem
fs_type
The type of filesystem to create
inode_size
Size of the inodes
This option is only enabled for ext and xfs filesystems
lazy_itable_init
... | [
"Format",
"a",
"filesystem",
"onto",
"a",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L431-L502 | train |
saltstack/salt | salt/modules/disk.py | fstype | def fstype(device):
'''
Return the filesystem name of the specified device
.. versionadded:: 2016.11.0
device
The name of the device
CLI Example:
.. code-block:: bash
salt '*' disk.fstype /dev/sdX1
'''
if salt.utils.path.which('lsblk'):
lsblk_out = __salt__['... | python | def fstype(device):
'''
Return the filesystem name of the specified device
.. versionadded:: 2016.11.0
device
The name of the device
CLI Example:
.. code-block:: bash
salt '*' disk.fstype /dev/sdX1
'''
if salt.utils.path.which('lsblk'):
lsblk_out = __salt__['... | [
"def",
"fstype",
"(",
"device",
")",
":",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'lsblk'",
")",
":",
"lsblk_out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'lsblk -o fstype {0}'",
".",
"format",
"(",
"device",
")",
")",
".",
... | Return the filesystem name of the specified device
.. versionadded:: 2016.11.0
device
The name of the device
CLI Example:
.. code-block:: bash
salt '*' disk.fstype /dev/sdX1 | [
"Return",
"the",
"filesystem",
"name",
"of",
"the",
"specified",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L506-L544 | train |
saltstack/salt | salt/modules/disk.py | _hdparm | def _hdparm(args, failhard=True):
'''
Execute hdparm
Fail hard when required
return output when possible
'''
cmd = 'hdparm {0}'.format(args)
result = __salt__['cmd.run_all'](cmd)
if result['retcode'] != 0:
msg = '{0}: {1}'.format(cmd, result['stderr'])
if failhard:
... | python | def _hdparm(args, failhard=True):
'''
Execute hdparm
Fail hard when required
return output when possible
'''
cmd = 'hdparm {0}'.format(args)
result = __salt__['cmd.run_all'](cmd)
if result['retcode'] != 0:
msg = '{0}: {1}'.format(cmd, result['stderr'])
if failhard:
... | [
"def",
"_hdparm",
"(",
"args",
",",
"failhard",
"=",
"True",
")",
":",
"cmd",
"=",
"'hdparm {0}'",
".",
"format",
"(",
"args",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"if",
"result",
"[",
"'retcode'",
"]",
"!=",
"0... | Execute hdparm
Fail hard when required
return output when possible | [
"Execute",
"hdparm",
"Fail",
"hard",
"when",
"required",
"return",
"output",
"when",
"possible"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L548-L563 | train |
saltstack/salt | salt/modules/disk.py | hdparms | def hdparms(disks, args=None):
'''
Retrieve all info's for all disks
parse 'em into a nice dict
(which, considering hdparms output, is quite a hassle)
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' disk.hdparms /dev/sda
'''
all_parms = 'aAbBcCdgHiJkM... | python | def hdparms(disks, args=None):
'''
Retrieve all info's for all disks
parse 'em into a nice dict
(which, considering hdparms output, is quite a hassle)
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' disk.hdparms /dev/sda
'''
all_parms = 'aAbBcCdgHiJkM... | [
"def",
"hdparms",
"(",
"disks",
",",
"args",
"=",
"None",
")",
":",
"all_parms",
"=",
"'aAbBcCdgHiJkMmNnQrRuW'",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"all_parms",
"elif",
"isinstance",
"(",
"args",
",",
"(",
"list",
",",
"tuple",
")",
")",
":"... | Retrieve all info's for all disks
parse 'em into a nice dict
(which, considering hdparms output, is quite a hassle)
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' disk.hdparms /dev/sda | [
"Retrieve",
"all",
"info",
"s",
"for",
"all",
"disks",
"parse",
"em",
"into",
"a",
"nice",
"dict",
"(",
"which",
"considering",
"hdparms",
"output",
"is",
"quite",
"a",
"hassle",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L567-L640 | train |
saltstack/salt | salt/modules/disk.py | hpa | def hpa(disks, size=None):
'''
Get/set Host Protected Area settings
T13 INCITS 346-2001 (1367D) defines the BEER (Boot Engineering Extension Record)
and PARTIES (Protected Area Run Time Interface Extension Services), allowing
for a Host Protected Area on a disk.
It's often used by OEMS to hide... | python | def hpa(disks, size=None):
'''
Get/set Host Protected Area settings
T13 INCITS 346-2001 (1367D) defines the BEER (Boot Engineering Extension Record)
and PARTIES (Protected Area Run Time Interface Extension Services), allowing
for a Host Protected Area on a disk.
It's often used by OEMS to hide... | [
"def",
"hpa",
"(",
"disks",
",",
"size",
"=",
"None",
")",
":",
"hpa_data",
"=",
"{",
"}",
"for",
"disk",
",",
"data",
"in",
"hdparms",
"(",
"disks",
",",
"'N'",
")",
".",
"items",
"(",
")",
":",
"visible",
",",
"total",
",",
"status",
"=",
"da... | Get/set Host Protected Area settings
T13 INCITS 346-2001 (1367D) defines the BEER (Boot Engineering Extension Record)
and PARTIES (Protected Area Run Time Interface Extension Services), allowing
for a Host Protected Area on a disk.
It's often used by OEMS to hide parts of a disk, and for overprovision... | [
"Get",
"/",
"set",
"Host",
"Protected",
"Area",
"settings"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L644-L696 | train |
saltstack/salt | salt/modules/disk.py | smart_attributes | def smart_attributes(dev, attributes=None, values=None):
'''
Fetch SMART attributes
Providing attributes will deliver only requested attributes
Providing values will deliver only requested values for attributes
Default is the Backblaze recommended
set (https://www.backblaze.com/blog/hard-drive-... | python | def smart_attributes(dev, attributes=None, values=None):
'''
Fetch SMART attributes
Providing attributes will deliver only requested attributes
Providing values will deliver only requested values for attributes
Default is the Backblaze recommended
set (https://www.backblaze.com/blog/hard-drive-... | [
"def",
"smart_attributes",
"(",
"dev",
",",
"attributes",
"=",
"None",
",",
"values",
"=",
"None",
")",
":",
"if",
"not",
"dev",
".",
"startswith",
"(",
"'/dev/'",
")",
":",
"dev",
"=",
"'/dev/'",
"+",
"dev",
"cmd",
"=",
"'smartctl --attributes {0}'",
".... | Fetch SMART attributes
Providing attributes will deliver only requested attributes
Providing values will deliver only requested values for attributes
Default is the Backblaze recommended
set (https://www.backblaze.com/blog/hard-drive-smart-stats/):
(5,187,188,197,198)
.. versionadded:: 2016.3.... | [
"Fetch",
"SMART",
"attributes",
"Providing",
"attributes",
"will",
"deliver",
"only",
"requested",
"attributes",
"Providing",
"values",
"will",
"deliver",
"only",
"requested",
"values",
"for",
"attributes"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L699-L769 | train |
saltstack/salt | salt/modules/disk.py | iostat | def iostat(interval=1, count=5, disks=None):
'''
Gather and return (averaged) IO stats.
.. versionadded:: 2016.3.0
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' disk.iostat 1 5 disks=sda
'''
if salt.utils.platform.is_l... | python | def iostat(interval=1, count=5, disks=None):
'''
Gather and return (averaged) IO stats.
.. versionadded:: 2016.3.0
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' disk.iostat 1 5 disks=sda
'''
if salt.utils.platform.is_l... | [
"def",
"iostat",
"(",
"interval",
"=",
"1",
",",
"count",
"=",
"5",
",",
"disks",
"=",
"None",
")",
":",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_linux",
"(",
")",
":",
"return",
"_iostat_linux",
"(",
"interval",
",",
"count",
",",
"di... | Gather and return (averaged) IO stats.
.. versionadded:: 2016.3.0
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' disk.iostat 1 5 disks=sda | [
"Gather",
"and",
"return",
"(",
"averaged",
")",
"IO",
"stats",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L773-L793 | train |
saltstack/salt | salt/modules/disk.py | _iostats_dict | def _iostats_dict(header, stats):
'''
Transpose collected data, average it, stomp it in dict using header
Use Decimals so we can properly calc & round, convert to float 'caus' we can't transmit Decimals over 0mq
'''
stats = [float((sum(stat) / len(stat)).quantize(decimal.Decimal('.01'))) for stat i... | python | def _iostats_dict(header, stats):
'''
Transpose collected data, average it, stomp it in dict using header
Use Decimals so we can properly calc & round, convert to float 'caus' we can't transmit Decimals over 0mq
'''
stats = [float((sum(stat) / len(stat)).quantize(decimal.Decimal('.01'))) for stat i... | [
"def",
"_iostats_dict",
"(",
"header",
",",
"stats",
")",
":",
"stats",
"=",
"[",
"float",
"(",
"(",
"sum",
"(",
"stat",
")",
"/",
"len",
"(",
"stat",
")",
")",
".",
"quantize",
"(",
"decimal",
".",
"Decimal",
"(",
"'.01'",
")",
")",
")",
"for",
... | Transpose collected data, average it, stomp it in dict using header
Use Decimals so we can properly calc & round, convert to float 'caus' we can't transmit Decimals over 0mq | [
"Transpose",
"collected",
"data",
"average",
"it",
"stomp",
"it",
"in",
"dict",
"using",
"header"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L796-L804 | train |
saltstack/salt | salt/modules/disk.py | _iostat_fbsd | def _iostat_fbsd(interval, count, disks):
'''
Tested on FreeBSD, quite likely other BSD's only need small changes in cmd syntax
'''
if disks is None:
iostat_cmd = 'iostat -xC -w {0} -c {1} '.format(interval, count)
elif isinstance(disks, six.string_types):
iostat_cmd = 'iostat -x -w ... | python | def _iostat_fbsd(interval, count, disks):
'''
Tested on FreeBSD, quite likely other BSD's only need small changes in cmd syntax
'''
if disks is None:
iostat_cmd = 'iostat -xC -w {0} -c {1} '.format(interval, count)
elif isinstance(disks, six.string_types):
iostat_cmd = 'iostat -x -w ... | [
"def",
"_iostat_fbsd",
"(",
"interval",
",",
"count",
",",
"disks",
")",
":",
"if",
"disks",
"is",
"None",
":",
"iostat_cmd",
"=",
"'iostat -xC -w {0} -c {1} '",
".",
"format",
"(",
"interval",
",",
"count",
")",
"elif",
"isinstance",
"(",
"disks",
",",
"s... | Tested on FreeBSD, quite likely other BSD's only need small changes in cmd syntax | [
"Tested",
"on",
"FreeBSD",
"quite",
"likely",
"other",
"BSD",
"s",
"only",
"need",
"small",
"changes",
"in",
"cmd",
"syntax"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L807-L860 | train |
saltstack/salt | salt/modules/disk.py | _iostat_aix | def _iostat_aix(interval, count, disks):
'''
AIX support to gather and return (averaged) IO stats.
'''
log.debug('DGM disk iostat entry')
if disks is None:
iostat_cmd = 'iostat -dD {0} {1} '.format(interval, count)
elif isinstance(disks, six.string_types):
iostat_cmd = 'iostat -... | python | def _iostat_aix(interval, count, disks):
'''
AIX support to gather and return (averaged) IO stats.
'''
log.debug('DGM disk iostat entry')
if disks is None:
iostat_cmd = 'iostat -dD {0} {1} '.format(interval, count)
elif isinstance(disks, six.string_types):
iostat_cmd = 'iostat -... | [
"def",
"_iostat_aix",
"(",
"interval",
",",
"count",
",",
"disks",
")",
":",
"log",
".",
"debug",
"(",
"'DGM disk iostat entry'",
")",
"if",
"disks",
"is",
"None",
":",
"iostat_cmd",
"=",
"'iostat -dD {0} {1} '",
".",
"format",
"(",
"interval",
",",
"count",... | AIX support to gather and return (averaged) IO stats. | [
"AIX",
"support",
"to",
"gather",
"and",
"return",
"(",
"averaged",
")",
"IO",
"stats",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/disk.py#L906-L1003 | train |
saltstack/salt | salt/beacons/http_status.py | validate | def validate(config):
'''
Validate the beacon configuration
'''
valid = True
messages = []
if not isinstance(config, list):
valid = False
messages.append('[-] Configuration for %s beacon must be a list', config)
else:
_config = {}
list(map(_config.update, con... | python | def validate(config):
'''
Validate the beacon configuration
'''
valid = True
messages = []
if not isinstance(config, list):
valid = False
messages.append('[-] Configuration for %s beacon must be a list', config)
else:
_config = {}
list(map(_config.update, con... | [
"def",
"validate",
"(",
"config",
")",
":",
"valid",
"=",
"True",
"messages",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"valid",
"=",
"False",
"messages",
".",
"append",
"(",
"'[-] Configuration for %s beacon must be a l... | Validate the beacon configuration | [
"Validate",
"the",
"beacon",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/http_status.py#L45-L85 | train |
saltstack/salt | salt/beacons/http_status.py | beacon | def beacon(config):
'''
Check on different service status reported by the django-server-status
library.
.. code-block:: yaml
beacons:
http_status:
- sites:
example-site-1:
url: "https://example.com/status"
timeout: 30
... | python | def beacon(config):
'''
Check on different service status reported by the django-server-status
library.
.. code-block:: yaml
beacons:
http_status:
- sites:
example-site-1:
url: "https://example.com/status"
timeout: 30
... | [
"def",
"beacon",
"(",
"config",
")",
":",
"ret",
"=",
"[",
"]",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"for",
"site",
",",
"site_config",
"in",
"_config",
".",
"get",
"(",
"'sites'",
... | Check on different service status reported by the django-server-status
library.
.. code-block:: yaml
beacons:
http_status:
- sites:
example-site-1:
url: "https://example.com/status"
timeout: 30
content-type: js... | [
"Check",
"on",
"different",
"service",
"status",
"reported",
"by",
"the",
"django",
"-",
"server",
"-",
"status",
"library",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/http_status.py#L88-L158 | train |
saltstack/salt | salt/modules/http.py | query | def query(url, **kwargs):
'''
Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
.. autofunction:: salt.utils.http.query
CLI Example:
.. code-block:: bash
salt '*' http.que... | python | def query(url, **kwargs):
'''
Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
.. autofunction:: salt.utils.http.query
CLI Example:
.. code-block:: bash
salt '*' http.que... | [
"def",
"query",
"(",
"url",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"__opts__",
".",
"copy",
"(",
")",
"if",
"'opts'",
"in",
"kwargs",
":",
"opts",
".",
"update",
"(",
"kwargs",
"[",
"'opts'",
"]",
")",
"del",
"kwargs",
"[",
"'opts'",
"]"... | Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
.. autofunction:: salt.utils.http.query
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '... | [
"Query",
"a",
"resource",
"and",
"decode",
"the",
"return",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/http.py#L17-L44 | train |
saltstack/salt | salt/modules/http.py | wait_for_successful_query | def wait_for_successful_query(url, wait_for=300, **kwargs):
'''
Query a resource until a successful response, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.wait_for_successful_query http://somelink.com/ wait_for=160
'''
starttime = time.time()
while ... | python | def wait_for_successful_query(url, wait_for=300, **kwargs):
'''
Query a resource until a successful response, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.wait_for_successful_query http://somelink.com/ wait_for=160
'''
starttime = time.time()
while ... | [
"def",
"wait_for_successful_query",
"(",
"url",
",",
"wait_for",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"while",
"True",
":",
"caught_exception",
"=",
"None",
"result",
"=",
"None",
"try",
":",
"... | Query a resource until a successful response, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.wait_for_successful_query http://somelink.com/ wait_for=160 | [
"Query",
"a",
"resource",
"until",
"a",
"successful",
"response",
"and",
"decode",
"the",
"return",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/http.py#L47-L75 | train |
saltstack/salt | salt/modules/http.py | update_ca_bundle | def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*'... | python | def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*'... | [
"def",
"update_ca_bundle",
"(",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"merge_files",
"=",
"None",
")",
":",
"if",
"target",
"is",
"None",
":",
"target",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'ca_bundle'",
",",
"None",
")",
... | Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``ta... | [
"Update",
"the",
"local",
"CA",
"bundle",
"file",
"from",
"a",
"URL"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/http.py#L78-L119 | train |
saltstack/salt | salt/modules/boto_secgroup.py | exists | def exists(name=None, region=None, key=None, keyid=None, profile=None,
vpc_id=None, vpc_name=None, group_id=None):
'''
Check to see if a security group exists.
CLI example::
salt myminion boto_secgroup.exists mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, p... | python | def exists(name=None, region=None, key=None, keyid=None, profile=None,
vpc_id=None, vpc_name=None, group_id=None):
'''
Check to see if a security group exists.
CLI example::
salt myminion boto_secgroup.exists mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, p... | [
"def",
"exists",
"(",
"name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"group_id",
"=",
"None",
")",
"... | Check to see if a security group exists.
CLI example::
salt myminion boto_secgroup.exists mysecgroup | [
"Check",
"to",
"see",
"if",
"a",
"security",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L91-L108 | train |
saltstack/salt | salt/modules/boto_secgroup.py | _split_rules | def _split_rules(rules):
'''
Split rules with combined grants into individual rules.
Amazon returns a set of rules with the same protocol, from and to ports
together as a single rule with a set of grants. Authorizing and revoking
rules, however, is done as a split set of rules. This function splits... | python | def _split_rules(rules):
'''
Split rules with combined grants into individual rules.
Amazon returns a set of rules with the same protocol, from and to ports
together as a single rule with a set of grants. Authorizing and revoking
rules, however, is done as a split set of rules. This function splits... | [
"def",
"_split_rules",
"(",
"rules",
")",
":",
"split",
"=",
"[",
"]",
"for",
"rule",
"in",
"rules",
":",
"ip_protocol",
"=",
"rule",
".",
"get",
"(",
"'ip_protocol'",
")",
"to_port",
"=",
"rule",
".",
"get",
"(",
"'to_port'",
")",
"from_port",
"=",
... | Split rules with combined grants into individual rules.
Amazon returns a set of rules with the same protocol, from and to ports
together as a single rule with a set of grants. Authorizing and revoking
rules, however, is done as a split set of rules. This function splits the
rules up. | [
"Split",
"rules",
"with",
"combined",
"grants",
"into",
"individual",
"rules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L118-L140 | train |
saltstack/salt | salt/modules/boto_secgroup.py | _get_group | def _get_group(conn=None, name=None, vpc_id=None, vpc_name=None, group_id=None,
region=None, key=None, keyid=None, profile=None): # pylint: disable=W0613
'''
Get a group object given a name, name and vpc_id/vpc_name or group_id. Return
a boto.ec2.securitygroup.SecurityGroup object if the gro... | python | def _get_group(conn=None, name=None, vpc_id=None, vpc_name=None, group_id=None,
region=None, key=None, keyid=None, profile=None): # pylint: disable=W0613
'''
Get a group object given a name, name and vpc_id/vpc_name or group_id. Return
a boto.ec2.securitygroup.SecurityGroup object if the gro... | [
"def",
"_get_group",
"(",
"conn",
"=",
"None",
",",
"name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
... | Get a group object given a name, name and vpc_id/vpc_name or group_id. Return
a boto.ec2.securitygroup.SecurityGroup object if the group is found, else
return None. | [
"Get",
"a",
"group",
"object",
"given",
"a",
"name",
"name",
"and",
"vpc_id",
"/",
"vpc_name",
"or",
"group_id",
".",
"Return",
"a",
"boto",
".",
"ec2",
".",
"securitygroup",
".",
"SecurityGroup",
"object",
"if",
"the",
"group",
"is",
"found",
"else",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L143-L200 | train |
saltstack/salt | salt/modules/boto_secgroup.py | get_all_security_groups | def get_all_security_groups(groupnames=None, group_ids=None, filters=None,
region=None, key=None, keyid=None, profile=None):
'''
Return a list of all Security Groups matching the given criteria and filters.
Note that the 'groupnames' argument only functions correctly for EC2 Cla... | python | def get_all_security_groups(groupnames=None, group_ids=None, filters=None,
region=None, key=None, keyid=None, profile=None):
'''
Return a list of all Security Groups matching the given criteria and filters.
Note that the 'groupnames' argument only functions correctly for EC2 Cla... | [
"def",
"get_all_security_groups",
"(",
"groupnames",
"=",
"None",
",",
"group_ids",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",... | Return a list of all Security Groups matching the given criteria and filters.
Note that the 'groupnames' argument only functions correctly for EC2 Classic
and default VPC Security Groups. To find groups by name in other VPCs you'll
want to use the 'group-name' filter instead.
Valid keys for the filte... | [
"Return",
"a",
"list",
"of",
"all",
"Security",
"Groups",
"matching",
"the",
"given",
"criteria",
"and",
"filters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L239-L298 | train |
saltstack/salt | salt/modules/boto_secgroup.py | get_group_id | def get_group_id(name, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup
'''
conn = _get_conn(region=region, key=key... | python | def get_group_id(name, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup
'''
conn = _get_conn(region=region, key=key... | [
"def",
"get_group_id",
"(",
"name",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"reg... | Get a Group ID given a Group Name or Group Name and VPC ID
CLI example::
salt myminion boto_secgroup.get_group_id mysecgroup | [
"Get",
"a",
"Group",
"ID",
"given",
"a",
"Group",
"Name",
"or",
"Group",
"Name",
"and",
"VPC",
"ID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L301-L316 | train |
saltstack/salt | salt/modules/boto_secgroup.py | convert_to_group_ids | def convert_to_group_ids(groups, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt... | python | def convert_to_group_ids(groups, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt... | [
"def",
"convert_to_group_ids",
"(",
"groups",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
... | Given a list of security groups and a vpc_id, convert_to_group_ids will
convert all list items in the given list to security group ids.
CLI example::
salt myminion boto_secgroup.convert_to_group_ids mysecgroup vpc-89yhh7h | [
"Given",
"a",
"list",
"of",
"security",
"groups",
"and",
"a",
"vpc_id",
"convert_to_group_ids",
"will",
"convert",
"all",
"list",
"items",
"in",
"the",
"given",
"list",
"to",
"security",
"group",
"ids",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L319-L342 | train |
saltstack/salt | salt/modules/boto_secgroup.py | get_config | def get_config(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup
'''
conn = _get_conn(region=region, key=key,... | python | def get_config(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup
'''
conn = _get_conn(region=region, key=key,... | [
"def",
"get_config",
"(",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
")",... | Get the configuration for a security group.
CLI example::
salt myminion boto_secgroup.get_config mysecgroup | [
"Get",
"the",
"configuration",
"for",
"a",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L345-L374 | train |
saltstack/salt | salt/modules/boto_secgroup.py | create | def create(name, description, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group'
'''
conn = _get_conn(region=region, key=key, keyid=keyid, prof... | python | def create(name, description, vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group'
'''
conn = _get_conn(region=region, key=key, keyid=keyid, prof... | [
"def",
"create",
"(",
"name",
",",
"description",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_co... | Create a security group.
CLI example::
salt myminion boto_secgroup.create mysecgroup 'My Security Group' | [
"Create",
"a",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L377-L403 | train |
saltstack/salt | salt/modules/boto_secgroup.py | delete | def delete(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | python | def delete(name=None, group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None):
'''
Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | [
"def",
"delete",
"(",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
")",
"... | Delete a security group.
CLI example::
salt myminion boto_secgroup.delete mysecgroup | [
"Delete",
"a",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L406-L431 | train |
saltstack/salt | salt/modules/boto_secgroup.py | authorize | def authorize(name=None, source_group_name=None,
source_group_owner_id=None, ip_protocol=None,
from_port=None, to_port=None, cidr_ip=None, group_id=None,
source_group_group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None, egres... | python | def authorize(name=None, source_group_name=None,
source_group_owner_id=None, ip_protocol=None,
from_port=None, to_port=None, cidr_ip=None, group_id=None,
source_group_group_id=None, region=None, key=None, keyid=None,
profile=None, vpc_id=None, vpc_name=None, egres... | [
"def",
"authorize",
"(",
"name",
"=",
"None",
",",
"source_group_name",
"=",
"None",
",",
"source_group_owner_id",
"=",
"None",
",",
"ip_protocol",
"=",
"None",
",",
"from_port",
"=",
"None",
",",
"to_port",
"=",
"None",
",",
"cidr_ip",
"=",
"None",
",",
... | Add a new rule to an existing security group.
CLI example::
salt myminion boto_secgroup.authorize mysecgroup ip_protocol=tcp from_port=80 to_port=80 cidr_ip='['10.0.0.0/8', '192.168.0.0/24']' | [
"Add",
"a",
"new",
"rule",
"to",
"an",
"existing",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L434-L486 | train |
saltstack/salt | salt/modules/boto_secgroup.py | _find_vpcs | def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library
'''
if all((vpc_id, vpc_name)):
... | python | def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library
'''
if all((vpc_id, vpc_name)):
... | [
"def",
"_find_vpcs",
"(",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"cidr",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
"... | Given VPC properties, find and return matching VPC ids.
Borrowed from boto_vpc; these could be refactored into a common library | [
"Given",
"VPC",
"properties",
"find",
"and",
"return",
"matching",
"VPC",
"ids",
".",
"Borrowed",
"from",
"boto_vpc",
";",
"these",
"could",
"be",
"refactored",
"into",
"a",
"common",
"library"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L542-L580 | train |
saltstack/salt | salt/modules/boto_secgroup.py | set_tags | def set_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
sets tags on a security group
.. versionadded:: 2016.3.0
tags
a... | python | def set_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
sets tags on a security group
.. versionadded:: 2016.3.0
tags
a... | [
"def",
"set_tags",
"(",
"tags",
",",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
... | sets tags on a security group
.. versionadded:: 2016.3.0
tags
a dict of key:value pair of tags to set on the security group
name
the name of the security group
group_id
the group id of the security group (in lie of a name/vpc combo)
vpc_name
the name of the vpc t... | [
"sets",
"tags",
"on",
"a",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L583-L644 | train |
saltstack/salt | salt/modules/boto_secgroup.py | delete_tags | def delete_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
deletes tags from a security group
.. versionadde... | python | def delete_tags(tags,
name=None,
group_id=None,
vpc_name=None,
vpc_id=None,
region=None,
key=None,
keyid=None,
profile=None):
'''
deletes tags from a security group
.. versionadde... | [
"def",
"delete_tags",
"(",
"tags",
",",
"name",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"="... | deletes tags from a security group
.. versionadded:: 2016.3.0
tags
a list of tags to remove
name
the name of the security group
group_id
the group id of the security group (in lie of a name/vpc combo)
vpc_name
the name of the vpc to search the named group for
... | [
"deletes",
"tags",
"from",
"a",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_secgroup.py#L647-L710 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_upgrades | def list_upgrades(refresh=True, root=None, **kwargs):
'''
List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
... | python | def list_upgrades(refresh=True, root=None, **kwargs):
'''
List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
... | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"dict",
"(",
")",
"cmd",
"=",
"[",
"'list-updates'",
"]",
"if",
"'fr... | List all available package upgrades on this system
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list... | [
"List",
"all",
"available",
"package",
"upgrades",
"on",
"this",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L455-L487 | train |
saltstack/salt | salt/modules/zypperpkg.py | info_available | def info_available(*names, **kwargs):
'''
Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root direc... | python | def info_available(*names, **kwargs):
'''
Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root direc... | [
"def",
"info_available",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"names",
":",
"return",
"ret",
"else",
":",
"names",
"=",
"sorted",
"(",
"list",
"(",
"set",
"(",
"names",
")",
")",
")",
"root",
... | Return the information of the named package available for the system.
refresh
force a refresh if set to True (default).
If set to False it depends on zypper if a refresh is
executed or not.
root
operate on a different root directory.
CLI example:
.. code-block:: bash
... | [
"Return",
"the",
"information",
"of",
"the",
"named",
"package",
"available",
"for",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L554-L613 | train |
saltstack/salt | salt/modules/zypperpkg.py | version_cmp | def version_cmp(ver1, ver2, ignore_epoch=False, **kwargs):
'''
.. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ... | python | def version_cmp(ver1, ver2, ignore_epoch=False, **kwargs):
'''
.. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ... | [
"def",
"version_cmp",
"(",
"ver1",
",",
"ver2",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"__salt__",
"[",
"'lowpkg.version_cmp'",
"]",
"(",
"ver1",
",",
"ver2",
",",
"ignore_epoch",
"=",
"ignore_epoch",
")"
] | .. versionadded:: 2015.5.4
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if
ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ``True`` to ignore the epoch when comparing versions
.. versio... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"4"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L707-L726 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_pkgs | def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs):
'''
List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the vers... | python | def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs):
'''
List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the vers... | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"root",
"=",
"None",
",",
"includes",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")"... | List the packages currently installed as a dict. By default, the dict
contains versions as a comma separated string::
{'<package_name>': '<version>[,<version>...]'}
versions_as_list:
If set to true, the versions are provided as a list
{'<package_name>': ['<version>', '<version>']}
... | [
"List",
"the",
"packages",
"currently",
"installed",
"as",
"a",
"dict",
".",
"By",
"default",
"the",
"dict",
"contains",
"versions",
"as",
"a",
"comma",
"separated",
"string",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L729-L858 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_repo_pkgs | def list_repo_pkgs(*args, **kwargs):
'''
.. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
... | python | def list_repo_pkgs(*args, **kwargs):
'''
.. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
... | [
"def",
"list_repo_pkgs",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"byrepo",
"=",
"kwargs",
".",
"pop",
"(",
"'byrepo'",
",",
"False",
")",
"fromrepo",
"=",
"kwargs",
".",
"pop",
"(",
"'fromrepo'",
",",
"''",
")",
"or",
"''",
"ret",
"=",... | .. versionadded:: 2017.7.5,2018.3.1
Returns all available packages. Optionally, package names (and name globs)
can be passed and the results will be filtered to packages matching those
names. This is recommended as it speeds up the function considerably.
This function can be helpful in discovering the... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"5",
"2018",
".",
"3",
".",
"1"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L861-L979 | train |
saltstack/salt | salt/modules/zypperpkg.py | _get_configured_repos | def _get_configured_repos(root=None):
'''
Get all the info about repositories from the configurations.
'''
repos = os.path.join(root, os.path.relpath(REPOS, os.path.sep)) if root else REPOS
repos_cfg = configparser.ConfigParser()
if os.path.exists(repos):
repos_cfg.read([repos + '/' + f... | python | def _get_configured_repos(root=None):
'''
Get all the info about repositories from the configurations.
'''
repos = os.path.join(root, os.path.relpath(REPOS, os.path.sep)) if root else REPOS
repos_cfg = configparser.ConfigParser()
if os.path.exists(repos):
repos_cfg.read([repos + '/' + f... | [
"def",
"_get_configured_repos",
"(",
"root",
"=",
"None",
")",
":",
"repos",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"REPOS",
",",
"os",
".",
"path",
".",
"sep",
")",
")",
"if",
"root",
"else... | Get all the info about repositories from the configurations. | [
"Get",
"all",
"the",
"info",
"about",
"repositories",
"from",
"the",
"configurations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L982-L994 | train |
saltstack/salt | salt/modules/zypperpkg.py | _get_repo_info | def _get_repo_info(alias, repos_cfg=None, root=None):
'''
Get one repo meta-data.
'''
try:
meta = dict((repos_cfg or _get_configured_repos(root=root)).items(alias))
meta['alias'] = alias
for key, val in six.iteritems(meta):
if val in ['0', '1']:
meta[k... | python | def _get_repo_info(alias, repos_cfg=None, root=None):
'''
Get one repo meta-data.
'''
try:
meta = dict((repos_cfg or _get_configured_repos(root=root)).items(alias))
meta['alias'] = alias
for key, val in six.iteritems(meta):
if val in ['0', '1']:
meta[k... | [
"def",
"_get_repo_info",
"(",
"alias",
",",
"repos_cfg",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"try",
":",
"meta",
"=",
"dict",
"(",
"(",
"repos_cfg",
"or",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
")",
".",
"items",
"(",
"a... | Get one repo meta-data. | [
"Get",
"one",
"repo",
"meta",
"-",
"data",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L997-L1011 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_repos | def list_repos(root=None, **kwargs):
'''
Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos_cfg = _get_configured_repos(root=root)
all_repos = {}
for alias in repos_cfg.sections():
... | python | def list_repos(root=None, **kwargs):
'''
Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos_cfg = _get_configured_repos(root=root)
all_repos = {}
for alias in repos_cfg.sections():
... | [
"def",
"list_repos",
"(",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"all_repos",
"=",
"{",
"}",
"for",
"alias",
"in",
"repos_cfg",
".",
"sections",
"(",
")",
":",
... | Lists all repos.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos | [
"Lists",
"all",
"repos",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1030-L1048 | train |
saltstack/salt | salt/modules/zypperpkg.py | del_repo | def del_repo(repo, root=None):
'''
Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias
'''
repos_cfg = _get_configured_repos(root=root)
for alias in repos_cfg.sections():
if alias == repo:
... | python | def del_repo(repo, root=None):
'''
Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias
'''
repos_cfg = _get_configured_repos(root=root)
for alias in repos_cfg.sections():
if alias == repo:
... | [
"def",
"del_repo",
"(",
"repo",
",",
"root",
"=",
"None",
")",
":",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"for",
"alias",
"in",
"repos_cfg",
".",
"sections",
"(",
")",
":",
"if",
"alias",
"==",
"repo",
":",
"doc",
... | Delete a repo.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo alias | [
"Delete",
"a",
"repo",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1051-L1075 | train |
saltstack/salt | salt/modules/zypperpkg.py | mod_repo | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as the following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
... | python | def mod_repo(repo, **kwargs):
'''
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as the following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
... | [
"def",
"mod_repo",
"(",
"repo",
",",
"*",
"*",
"kwargs",
")",
":",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"or",
"None",
"repos_cfg",
"=",
"_get_configured_repos",
"(",
"root",
"=",
"root",
")",
"added",
"=",
"False",
"# An attempt to add ... | Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as the following values are specified:
repo or alias
alias by which Zypper refers to the repo
url, mirrorlist or baseurl
the URL for Zypper to reference
enabled
Enable or disable (Tru... | [
"Modify",
"one",
"or",
"more",
"values",
"for",
"a",
"repo",
".",
"If",
"the",
"repo",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"so",
"long",
"as",
"the",
"following",
"values",
"are",
"specified",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1078-L1233 | train |
saltstack/salt | salt/modules/zypperpkg.py | refresh_db | def refresh_db(root=None):
'''
Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file... | python | def refresh_db(root=None):
'''
Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file... | [
"def",
"refresh_db",
"(",
"root",
"=",
"None",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"ret",
"=",
"{",
"}",
"out",
"=",
"__zypper__",
"(",
... | Force a repository refresh by calling ``zypper refresh --force``, return a dict::
{'<database name>': Bool}
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | [
"Force",
"a",
"repository",
"refresh",
"by",
"calling",
"zypper",
"refresh",
"--",
"force",
"return",
"a",
"dict",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1236-L1270 | train |
saltstack/salt | salt/modules/zypperpkg.py | _find_types | def _find_types(pkgs):
'''Form a package names list, find prefixes of packages types.'''
return sorted({pkg.split(':', 1)[0] for pkg in pkgs
if len(pkg.split(':', 1)) == 2}) | python | def _find_types(pkgs):
'''Form a package names list, find prefixes of packages types.'''
return sorted({pkg.split(':', 1)[0] for pkg in pkgs
if len(pkg.split(':', 1)) == 2}) | [
"def",
"_find_types",
"(",
"pkgs",
")",
":",
"return",
"sorted",
"(",
"{",
"pkg",
".",
"split",
"(",
"':'",
",",
"1",
")",
"[",
"0",
"]",
"for",
"pkg",
"in",
"pkgs",
"if",
"len",
"(",
"pkg",
".",
"split",
"(",
"':'",
",",
"1",
")",
")",
"==",... | Form a package names list, find prefixes of packages types. | [
"Form",
"a",
"package",
"names",
"list",
"find",
"prefixes",
"of",
"packages",
"types",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1273-L1276 | train |
saltstack/salt | salt/modules/zypperpkg.py | install | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
downloadonly=None,
skip_verify=False,
version=None,
ignore_repo_failure=False,
no_recommends=False,
root=None,
... | python | def install(name=None,
refresh=False,
fromrepo=None,
pkgs=None,
sources=None,
downloadonly=None,
skip_verify=False,
version=None,
ignore_repo_failure=False,
no_recommends=False,
root=None,
... | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"downloadonly",
"=",
"None",
",",
"skip_verify",
"=",
"False",
",",
"version",
"=",
"N... | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1279-L1528 | train |
saltstack/salt | salt/modules/zypperpkg.py | upgrade | def upgrade(refresh=True,
dryrun=False,
dist_upgrade=False,
fromrepo=None,
novendorchange=False,
skip_verify=False,
no_recommends=False,
root=None,
**kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:... | python | def upgrade(refresh=True,
dryrun=False,
dist_upgrade=False,
fromrepo=None,
novendorchange=False,
skip_verify=False,
no_recommends=False,
root=None,
**kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:... | [
"def",
"upgrade",
"(",
"refresh",
"=",
"True",
",",
"dryrun",
"=",
"False",
",",
"dist_upgrade",
"=",
"False",
",",
"fromrepo",
"=",
"None",
",",
"novendorchange",
"=",
"False",
",",
"skip_verify",
"=",
"False",
",",
"no_recommends",
"=",
"False",
",",
"... | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1531-L1656 | train |
saltstack/salt | salt/modules/zypperpkg.py | _uninstall | def _uninstall(name=None, pkgs=None, root=None):
'''
Remove and purge do identical things but with different Zypper commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
raise Comm... | python | def _uninstall(name=None, pkgs=None, root=None):
'''
Remove and purge do identical things but with different Zypper commands,
this function performs the common logic.
'''
try:
pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
except MinionError as exc:
raise Comm... | [
"def",
"_uninstall",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
")",
"[",
"0",
"]",
"except",
... | Remove and purge do identical things but with different Zypper commands,
this function performs the common logic. | [
"Remove",
"and",
"purge",
"do",
"identical",
"things",
"but",
"with",
"different",
"Zypper",
"commands",
"this",
"function",
"performs",
"the",
"common",
"logic",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1659-L1699 | train |
saltstack/salt | salt/modules/zypperpkg.py | remove | def remove(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemo... | python | def remove(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemo... | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"return",
"_uninstall",
"(",
"name",
"=",
"name",
",",
"pkgs",
"=",
"pkgs",
",",
"roo... | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1728-L1772 | train |
saltstack/salt | salt/modules/zypperpkg.py | purge | def purge(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon... | python | def purge(name=None, pkgs=None, root=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon... | [
"def",
"purge",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"return",
"_uninstall",
"(",
"name",
"=",
"name",
",",
"pkgs",
"=",
"pkgs",
",",
"root... | .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done to keep systemd
from killing any zypper commands spawned by Sa... | [
"..",
"versionchanged",
"::",
"2015",
".",
"8",
".",
"12",
"2016",
".",
"3",
".",
"3",
"2016",
".",
"11",
".",
"0",
"On",
"minions",
"running",
"systemd",
">",
"=",
"205",
"systemd",
"-",
"run",
"(",
"1",
")",
"_",
"is",
"now",
"used",
"to",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1775-L1820 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_locks | def list_locks(root=None):
'''
List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
... | python | def list_locks(root=None):
'''
List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
... | [
"def",
"list_locks",
"(",
"root",
"=",
"None",
")",
":",
"locks",
"=",
"{",
"}",
"_locks",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"LOCKS",
",",
"os",
".",
"path",
".",
"sep",
")",
")",
"... | List current package locks.
root
operate on a different root directory.
Return a dict containing the locked package with attributes::
{'<package>': {'case_sensitive': '<case_sensitive>',
'match_type': '<match_type>'
'type': '<type>'}}
CLI Exa... | [
"List",
"current",
"package",
"locks",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1823-L1859 | train |
saltstack/salt | salt/modules/zypperpkg.py | clean_locks | def clean_locks(root=None):
'''
Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks
'''
LCK = "removed"
out = {LCK: 0}... | python | def clean_locks(root=None):
'''
Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks
'''
LCK = "removed"
out = {LCK: 0}... | [
"def",
"clean_locks",
"(",
"root",
"=",
"None",
")",
":",
"LCK",
"=",
"\"removed\"",
"out",
"=",
"{",
"LCK",
":",
"0",
"}",
"locks",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"os",
".",
"path",
".",
"relpath",
"(",
"LOCKS",
",",
"o... | Remove unused locks that do not currently (with regard to repositories
used) lock any package.
root
Operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.clean_locks | [
"Remove",
"unused",
"locks",
"that",
"do",
"not",
"currently",
"(",
"with",
"regard",
"to",
"repositories",
"used",
")",
"lock",
"any",
"package",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1862-L1888 | train |
saltstack/salt | salt/modules/zypperpkg.py | unhold | def unhold(name=None, pkgs=None, **kwargs):
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' ... | python | def unhold(name=None, pkgs=None, **kwargs):
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' ... | [
"def",
"unhold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"if",
"(",
"not",
"name",
"and",
"not",
"pkgs",
")",
"or",
"(... | Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' pkg.remove_lock pkgs='["foo", "bar"]' | [
"Remove",
"specified",
"package",
"lock",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1891-L1932 | train |
saltstack/salt | salt/modules/zypperpkg.py | remove_lock | def remove_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,... | python | def remove_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,... | [
"def",
"remove_lock",
"(",
"packages",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'This function is deprecated. Please use unhold(... | Remove specified package lock.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.remove_lock <package name>
salt '*' pkg.remove_lock <package1>,<package2>,<package3>
salt '*' pkg.remove_lock pkgs='["foo", "bar"]' | [
"Remove",
"specified",
"package",
"lock",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1935-L1968 | train |
saltstack/salt | salt/modules/zypperpkg.py | hold | def hold(name=None, pkgs=None, **kwargs):
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<packag... | python | def hold(name=None, pkgs=None, **kwargs):
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<packag... | [
"def",
"hold",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
")",
"if",
"(",
"not",
"name",
"and",
"not",
"pkgs",
")",
"or",
"(",... | Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<package3>
salt '*' pkg.add_lock pkgs='["foo", "bar"]... | [
"Add",
"a",
"package",
"lock",
".",
"Specify",
"packages",
"to",
"lock",
"by",
"exact",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L1971-L2016 | train |
saltstack/salt | salt/modules/zypperpkg.py | add_lock | def add_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.... | python | def add_lock(packages, root=None, **kwargs): # pylint: disable=unused-argument
'''
Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.... | [
"def",
"add_lock",
"(",
"packages",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'This function is deprecated. Please use hold() ins... | Add a package lock. Specify packages to lock by exact name.
root
operate on a different root directory.
CLI Example:
.. code-block:: bash
salt '*' pkg.add_lock <package name>
salt '*' pkg.add_lock <package1>,<package2>,<package3>
salt '*' pkg.add_lock pkgs='["foo", "bar"]... | [
"Add",
"a",
"package",
"lock",
".",
"Specify",
"packages",
"to",
"lock",
"by",
"exact",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2019-L2049 | train |
saltstack/salt | salt/modules/zypperpkg.py | _get_patterns | def _get_patterns(installed_only=None, root=None):
'''
List all known patterns in repos.
'''
patterns = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (insta... | python | def _get_patterns(installed_only=None, root=None):
'''
List all known patterns in repos.
'''
patterns = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (insta... | [
"def",
"_get_patterns",
"(",
"installed_only",
"=",
"None",
",",
"root",
"=",
"None",
")",
":",
"patterns",
"=",
"{",
"}",
"for",
"element",
"in",
"__zypper__",
"(",
"root",
"=",
"root",
")",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
... | List all known patterns in repos. | [
"List",
"all",
"known",
"patterns",
"in",
"repos",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2185-L2198 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_patterns | def list_patterns(refresh=False, root=None):
'''
List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:... | python | def list_patterns(refresh=False, root=None):
'''
List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:... | [
"def",
"list_patterns",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"return",
"_get_patterns",
"(",
"root",
"=",
"root",
")"
] | List all known patterns from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.list_pat... | [
"List",
"all",
"known",
"patterns",
"from",
"available",
"repos",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2201-L2222 | train |
saltstack/salt | salt/modules/zypperpkg.py | search | def search(criteria, refresh=False, **kwargs):
'''
List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search fo... | python | def search(criteria, refresh=False, **kwargs):
'''
List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search fo... | [
"def",
"search",
"(",
"criteria",
",",
"refresh",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ALLOWED_SEARCH_OPTIONS",
"=",
"{",
"'provides'",
":",
"'--provides'",
",",
"'recommends'",
":",
"'--recommends'",
",",
"'requires'",
":",
"'--requires'",
",",
... | List known packages, available to the system.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
match (str)
One of `exact`, `words`, `substrings`. Search for an `exact` match
or for the whole `words` only. D... | [
"List",
"known",
"packages",
"available",
"to",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2241-L2345 | train |
saltstack/salt | salt/modules/zypperpkg.py | _get_first_aggregate_text | def _get_first_aggregate_text(node_list):
'''
Extract text from the first occurred DOM aggregate.
'''
if not node_list:
return ''
out = []
for node in node_list[0].childNodes:
if node.nodeType == dom.Document.TEXT_NODE:
out.append(node.nodeValue)
return '\n'.join... | python | def _get_first_aggregate_text(node_list):
'''
Extract text from the first occurred DOM aggregate.
'''
if not node_list:
return ''
out = []
for node in node_list[0].childNodes:
if node.nodeType == dom.Document.TEXT_NODE:
out.append(node.nodeValue)
return '\n'.join... | [
"def",
"_get_first_aggregate_text",
"(",
"node_list",
")",
":",
"if",
"not",
"node_list",
":",
"return",
"''",
"out",
"=",
"[",
"]",
"for",
"node",
"in",
"node_list",
"[",
"0",
"]",
".",
"childNodes",
":",
"if",
"node",
".",
"nodeType",
"==",
"dom",
".... | Extract text from the first occurred DOM aggregate. | [
"Extract",
"text",
"from",
"the",
"first",
"occurred",
"DOM",
"aggregate",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2348-L2359 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_products | def list_products(all=False, refresh=False, root=None):
'''
List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is... | python | def list_products(all=False, refresh=False, root=None):
'''
List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is... | [
"def",
"list_products",
"(",
"all",
"=",
"False",
",",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"list",
"(",
")",
"OEM_PATH",
"=",
"'/var/lib/suseRegister/OEM'",
"if",
... | List all available or installed SUSE products.
all
List all products available or only installed. Default is False.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root dir... | [
"List",
"all",
"available",
"or",
"installed",
"SUSE",
"products",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2362-L2431 | train |
saltstack/salt | salt/modules/zypperpkg.py | download | def download(*packages, **kwargs):
'''
Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:... | python | def download(*packages, **kwargs):
'''
Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:... | [
"def",
"download",
"(",
"*",
"packages",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"packages",
":",
"raise",
"SaltInvocationError",
"(",
"'No packages specified'",
")",
"root",
"=",
"kwargs",
".",
"get",
"(",
"'root'",
",",
"None",
")",
"refresh",
... | Download packages to the local disk.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI example:
.. code-block:: bash
salt '*' pkg.download httpd
... | [
"Download",
"packages",
"to",
"the",
"local",
"disk",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2434-L2485 | train |
saltstack/salt | salt/modules/zypperpkg.py | _get_patches | def _get_patches(installed_only=False, root=None):
'''
List all known patches in repos.
'''
patches = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'patch').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (installed... | python | def _get_patches(installed_only=False, root=None):
'''
List all known patches in repos.
'''
patches = {}
for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'patch').getElementsByTagName('solvable'):
installed = element.getAttribute('status') == 'installed'
if (installed... | [
"def",
"_get_patches",
"(",
"installed_only",
"=",
"False",
",",
"root",
"=",
"None",
")",
":",
"patches",
"=",
"{",
"}",
"for",
"element",
"in",
"__zypper__",
"(",
"root",
"=",
"root",
")",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
... | List all known patches in repos. | [
"List",
"all",
"known",
"patches",
"in",
"repos",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2563-L2576 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_patches | def list_patches(refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate ... | python | def list_patches(refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate ... | [
"def",
"list_patches",
"(",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"return",
"_get_patches",
"(",
"root",
"=",
"root",
")"
] | .. versionadded:: 2017.7.0
List all known advisory patches from available repos.
refresh
force a refresh if set to True.
If set to False (default) it depends on zypper if a refresh is
executed.
root
operate on a different root directory.
CLI Examples:
.. code-blo... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2579-L2602 | train |
saltstack/salt | salt/modules/zypperpkg.py | list_provides | def list_provides(root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
sal... | python | def list_provides(root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
sal... | [
"def",
"list_provides",
"(",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"__context__",
".",
"get",
"(",
"'pkg.list_provides'",
")",
"if",
"not",
"ret",
":",
"cmd",
"=",
"[",
"'rpm'",
"]",
"if",
"root",
":",
"cmd",
".",
"ext... | .. versionadded:: 2018.3.0
List package provides of installed packages as a dict.
{'<provided_name>': ['<package_name>', '<package_name>', ...]}
root
operate on a different root directory.
CLI Examples:
.. code-block:: bash
salt '*' pkg.list_provides | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2623-L2657 | train |
saltstack/salt | salt/modules/zypperpkg.py | resolve_capabilities | def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unc... | python | def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
'''
.. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unc... | [
"def",
"resolve_capabilities",
"(",
"pkgs",
",",
"refresh",
"=",
"False",
",",
"root",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"refresh",
":",
"refresh_db",
"(",
"root",
")",
"ret",
"=",
"list",
"(",
")",
"for",
"pkg",
"in",
"pkgs",
"... | .. versionadded:: 2018.3.0
Convert name provides in ``pkgs`` into real package names if
``resolve_capabilities`` parameter is set to True. In case of
``resolve_capabilities`` is set to False the package list
is returned unchanged.
refresh
force a refresh if set to True.
If set to F... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L2660-L2723 | train |
saltstack/salt | salt/modules/zypperpkg.py | _Zypper._reset | def _reset(self):
'''
Resets values of the call setup.
:return:
'''
self.__cmd = ['zypper', '--non-interactive']
self.__exit_code = 0
self.__call_result = dict()
self.__error_msg = ''
self.__env = salt.utils.environment.get_module_environment(glob... | python | def _reset(self):
'''
Resets values of the call setup.
:return:
'''
self.__cmd = ['zypper', '--non-interactive']
self.__exit_code = 0
self.__call_result = dict()
self.__error_msg = ''
self.__env = salt.utils.environment.get_module_environment(glob... | [
"def",
"_reset",
"(",
"self",
")",
":",
"self",
".",
"__cmd",
"=",
"[",
"'zypper'",
",",
"'--non-interactive'",
"]",
"self",
".",
"__exit_code",
"=",
"0",
"self",
".",
"__call_result",
"=",
"dict",
"(",
")",
"self",
".",
"__error_msg",
"=",
"''",
"self... | Resets values of the call setup.
:return: | [
"Resets",
"values",
"of",
"the",
"call",
"setup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L112-L134 | train |
saltstack/salt | salt/modules/zypperpkg.py | _Zypper._is_error | def _is_error(self):
'''
Is this is an error code?
:return:
'''
if self.exit_code:
msg = self.SUCCESS_EXIT_CODES.get(self.exit_code)
if msg:
log.info(msg)
msg = self.WARNING_EXIT_CODES.get(self.exit_code)
if msg:
... | python | def _is_error(self):
'''
Is this is an error code?
:return:
'''
if self.exit_code:
msg = self.SUCCESS_EXIT_CODES.get(self.exit_code)
if msg:
log.info(msg)
msg = self.WARNING_EXIT_CODES.get(self.exit_code)
if msg:
... | [
"def",
"_is_error",
"(",
"self",
")",
":",
"if",
"self",
".",
"exit_code",
":",
"msg",
"=",
"self",
".",
"SUCCESS_EXIT_CODES",
".",
"get",
"(",
"self",
".",
"exit_code",
")",
"if",
"msg",
":",
"log",
".",
"info",
"(",
"msg",
")",
"msg",
"=",
"self"... | Is this is an error code?
:return: | [
"Is",
"this",
"is",
"an",
"error",
"code?"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L214-L228 | train |
saltstack/salt | salt/modules/zypperpkg.py | _Zypper._is_xml_mode | def _is_xml_mode(self):
'''
Is Zypper's output is in XML format?
:return:
'''
return [itm for itm in self.XML_DIRECTIVES if itm in self.__cmd] and True or False | python | def _is_xml_mode(self):
'''
Is Zypper's output is in XML format?
:return:
'''
return [itm for itm in self.XML_DIRECTIVES if itm in self.__cmd] and True or False | [
"def",
"_is_xml_mode",
"(",
"self",
")",
":",
"return",
"[",
"itm",
"for",
"itm",
"in",
"self",
".",
"XML_DIRECTIVES",
"if",
"itm",
"in",
"self",
".",
"__cmd",
"]",
"and",
"True",
"or",
"False"
] | Is Zypper's output is in XML format?
:return: | [
"Is",
"Zypper",
"s",
"output",
"is",
"in",
"XML",
"format?"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L238-L244 | train |
saltstack/salt | salt/modules/zypperpkg.py | _Zypper._check_result | def _check_result(self):
'''
Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all
'''
if not self.__call_result:
... | python | def _check_result(self):
'''
Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all
'''
if not self.__call_result:
... | [
"def",
"_check_result",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"__call_result",
":",
"raise",
"CommandExecutionError",
"(",
"'No output result from Zypper?'",
")",
"self",
".",
"exit_code",
"=",
"self",
".",
"__call_result",
"[",
"'retcode'",
"]",
"if"... | Check and set the result of a zypper command. In case of an error,
either raise a CommandExecutionError or extract the error.
result
The result of a zypper command called with cmd.run_all | [
"Check",
"and",
"set",
"the",
"result",
"of",
"a",
"zypper",
"command",
".",
"In",
"case",
"of",
"an",
"error",
"either",
"raise",
"a",
"CommandExecutionError",
"or",
"extract",
"the",
"error",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L246-L281 | train |
saltstack/salt | salt/modules/zypperpkg.py | _Zypper.__call | def __call(self, *args, **kwargs):
'''
Call Zypper.
:param state:
:return:
'''
self.__called = True
if self.__xml:
self.__cmd.append('--xmlout')
if not self.__refresh and '--no-refresh' not in args:
self.__cmd.append('--no-refresh'... | python | def __call(self, *args, **kwargs):
'''
Call Zypper.
:param state:
:return:
'''
self.__called = True
if self.__xml:
self.__cmd.append('--xmlout')
if not self.__refresh and '--no-refresh' not in args:
self.__cmd.append('--no-refresh'... | [
"def",
"__call",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"__called",
"=",
"True",
"if",
"self",
".",
"__xml",
":",
"self",
".",
"__cmd",
".",
"append",
"(",
"'--xmlout'",
")",
"if",
"not",
"self",
".",
"__re... | Call Zypper.
:param state:
:return: | [
"Call",
"Zypper",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L283-L356 | train |
saltstack/salt | salt/modules/zypperpkg.py | Wildcard._get_available_versions | def _get_available_versions(self):
'''
Get available versions of the package.
:return:
'''
solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
if not solvables:
raise CommandExecutionError('No packages found matchin... | python | def _get_available_versions(self):
'''
Get available versions of the package.
:return:
'''
solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
if not solvables:
raise CommandExecutionError('No packages found matchin... | [
"def",
"_get_available_versions",
"(",
"self",
")",
":",
"solvables",
"=",
"self",
".",
"zypper",
".",
"nolock",
".",
"xml",
".",
"call",
"(",
"'se'",
",",
"'-xv'",
",",
"self",
".",
"name",
")",
".",
"getElementsByTagName",
"(",
"'solvable'",
")",
"if",... | Get available versions of the package.
:return: | [
"Get",
"available",
"versions",
"of",
"the",
"package",
".",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L402-L412 | train |
saltstack/salt | salt/modules/zypperpkg.py | Wildcard._get_scope_versions | def _get_scope_versions(self, pkg_versions):
'''
Get available difference between next possible matches.
:return:
'''
get_in_versions = []
for p_version in pkg_versions:
if fnmatch.fnmatch(p_version, self.version):
get_in_versions.append(p_ver... | python | def _get_scope_versions(self, pkg_versions):
'''
Get available difference between next possible matches.
:return:
'''
get_in_versions = []
for p_version in pkg_versions:
if fnmatch.fnmatch(p_version, self.version):
get_in_versions.append(p_ver... | [
"def",
"_get_scope_versions",
"(",
"self",
",",
"pkg_versions",
")",
":",
"get_in_versions",
"=",
"[",
"]",
"for",
"p_version",
"in",
"pkg_versions",
":",
"if",
"fnmatch",
".",
"fnmatch",
"(",
"p_version",
",",
"self",
".",
"version",
")",
":",
"get_in_versi... | Get available difference between next possible matches.
:return: | [
"Get",
"available",
"difference",
"between",
"next",
"possible",
"matches",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L414-L424 | train |
saltstack/salt | salt/modules/zypperpkg.py | Wildcard._set_version | def _set_version(self, version):
'''
Stash operator from the version, if any.
:return:
'''
if not version:
return
exact_version = re.sub(r'[<>=+]*', '', version)
self._op = version.replace(exact_version, '') or None
if self._op and self._op n... | python | def _set_version(self, version):
'''
Stash operator from the version, if any.
:return:
'''
if not version:
return
exact_version = re.sub(r'[<>=+]*', '', version)
self._op = version.replace(exact_version, '') or None
if self._op and self._op n... | [
"def",
"_set_version",
"(",
"self",
",",
"version",
")",
":",
"if",
"not",
"version",
":",
"return",
"exact_version",
"=",
"re",
".",
"sub",
"(",
"r'[<>=+]*'",
",",
"''",
",",
"version",
")",
"self",
".",
"_op",
"=",
"version",
".",
"replace",
"(",
"... | Stash operator from the version, if any.
:return: | [
"Stash",
"operator",
"from",
"the",
"version",
"if",
"any",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zypperpkg.py#L426-L439 | train |
saltstack/salt | salt/utils/vt.py | _cleanup | def _cleanup():
'''
Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up.
'''
for inst in _ACTIVE[:]:
res = inst.isalive()
if res is not True:
try:
_ACTIVE.remove(inst)
except ValueError:
... | python | def _cleanup():
'''
Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up.
'''
for inst in _ACTIVE[:]:
res = inst.isalive()
if res is not True:
try:
_ACTIVE.remove(inst)
except ValueError:
... | [
"def",
"_cleanup",
"(",
")",
":",
"for",
"inst",
"in",
"_ACTIVE",
"[",
":",
"]",
":",
"res",
"=",
"inst",
".",
"isalive",
"(",
")",
"if",
"res",
"is",
"not",
"True",
":",
"try",
":",
"_ACTIVE",
".",
"remove",
"(",
"inst",
")",
"except",
"ValueErr... | Make sure that any terminal processes still running when __del__ was called
to the waited and cleaned up. | [
"Make",
"sure",
"that",
"any",
"terminal",
"processes",
"still",
"running",
"when",
"__del__",
"was",
"called",
"to",
"the",
"waited",
"and",
"cleaned",
"up",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L78-L91 | train |
saltstack/salt | salt/utils/vt.py | Terminal.sendline | def sendline(self, data, linesep=os.linesep):
'''
Send the provided data to the terminal appending a line feed.
'''
return self.send('{0}{1}'.format(data, linesep)) | python | def sendline(self, data, linesep=os.linesep):
'''
Send the provided data to the terminal appending a line feed.
'''
return self.send('{0}{1}'.format(data, linesep)) | [
"def",
"sendline",
"(",
"self",
",",
"data",
",",
"linesep",
"=",
"os",
".",
"linesep",
")",
":",
"return",
"self",
".",
"send",
"(",
"'{0}{1}'",
".",
"format",
"(",
"data",
",",
"linesep",
")",
")"
] | Send the provided data to the terminal appending a line feed. | [
"Send",
"the",
"provided",
"data",
"to",
"the",
"terminal",
"appending",
"a",
"line",
"feed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L295-L299 | train |
saltstack/salt | salt/utils/vt.py | Terminal.recv | def recv(self, maxsize=None):
'''
Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process.
'''
if maxsize is None:
maxsize = 1024
elif maxsize < 1:
... | python | def recv(self, maxsize=None):
'''
Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process.
'''
if maxsize is None:
maxsize = 1024
elif maxsize < 1:
... | [
"def",
"recv",
"(",
"self",
",",
"maxsize",
"=",
"None",
")",
":",
"if",
"maxsize",
"is",
"None",
":",
"maxsize",
"=",
"1024",
"elif",
"maxsize",
"<",
"1",
":",
"maxsize",
"=",
"1",
"return",
"self",
".",
"_recv",
"(",
"maxsize",
")"
] | Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If
any of those is ``None`` we can no longer communicate with the
terminal's child process. | [
"Receive",
"data",
"from",
"the",
"terminal",
"as",
"a",
"(",
"stdout",
"stderr",
")",
"tuple",
".",
"If",
"any",
"of",
"those",
"is",
"None",
"we",
"can",
"no",
"longer",
"communicate",
"with",
"the",
"terminal",
"s",
"child",
"process",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L301-L311 | train |
saltstack/salt | salt/utils/vt.py | Terminal.close | def close(self, terminate=True, kill=False):
'''
Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough.
'''
... | python | def close(self, terminate=True, kill=False):
'''
Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough.
'''
... | [
"def",
"close",
"(",
"self",
",",
"terminate",
"=",
"True",
",",
"kill",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"closed",
":",
"if",
"self",
".",
"child_fd",
"is",
"not",
"None",
":",
"os",
".",
"close",
"(",
"self",
".",
"child_fd",
"... | Close the communication with the terminal's child.
If ``terminate`` is ``True`` then additionally try to terminate the
terminal, and if ``kill`` is also ``True``, kill the terminal if
terminating it was not enough. | [
"Close",
"the",
"communication",
"with",
"the",
"terminal",
"s",
"child",
".",
"If",
"terminate",
"is",
"True",
"then",
"additionally",
"try",
"to",
"terminate",
"the",
"terminal",
"and",
"if",
"kill",
"is",
"also",
"True",
"kill",
"the",
"terminal",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt.py#L313-L331 | train |
saltstack/salt | salt/states/pyrax_queues.py | present | def present(name, provider):
'''
Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', provider=pr... | python | def present(name, provider):
'''
Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', provider=pr... | [
"def",
"present",
"(",
"name",
",",
"provider",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_present",
"=",
"list",
"(",
"__salt__",
"[",
"'cl... | Ensure the RackSpace queue exists.
name
Name of the Rackspace queue.
provider
Salt Cloud Provider | [
"Ensure",
"the",
"RackSpace",
"queue",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyrax_queues.py#L36-L68 | train |
saltstack/salt | salt/states/pyrax_queues.py | absent | def absent(name, provider):
'''
Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', pr... | python | def absent(name, provider):
'''
Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
is_present = list(__salt__['cloud.action']('queues_exists', pr... | [
"def",
"absent",
"(",
"name",
",",
"provider",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"is_present",
"=",
"list",
"(",
"__salt__",
"[",
"'clo... | Ensure the named Rackspace queue is deleted.
name
Name of the Rackspace queue.
provider
Salt Cloud provider | [
"Ensure",
"the",
"named",
"Rackspace",
"queue",
"is",
"deleted",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyrax_queues.py#L71-L102 | train |
saltstack/salt | salt/runners/drac.py | __connect | def __connect(hostname, timeout=20, username=None, password=None):
'''
Connect to the DRAC
'''
drac_cred = __opts__.get('drac')
err_msg = 'No drac login credentials found. Please add the \'username\' and \'password\' ' \
'fields beneath a \'drac\' key in the master configuration file. ... | python | def __connect(hostname, timeout=20, username=None, password=None):
'''
Connect to the DRAC
'''
drac_cred = __opts__.get('drac')
err_msg = 'No drac login credentials found. Please add the \'username\' and \'password\' ' \
'fields beneath a \'drac\' key in the master configuration file. ... | [
"def",
"__connect",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"drac_cred",
"=",
"__opts__",
".",
"get",
"(",
"'drac'",
")",
"err_msg",
"=",
"'No drac login credentials found. Please add th... | Connect to the DRAC | [
"Connect",
"to",
"the",
"DRAC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L37-L66 | train |
saltstack/salt | salt/runners/drac.py | __version | def __version(client):
'''
Grab DRAC version
'''
versions = {9: 'CMC',
8: 'iDRAC6',
10: 'iDRAC6',
11: 'iDRAC6',
16: 'iDRAC7',
17: 'iDRAC7'}
if isinstance(client, paramiko.SSHClient):
(stdin, stdout, stderr) = cl... | python | def __version(client):
'''
Grab DRAC version
'''
versions = {9: 'CMC',
8: 'iDRAC6',
10: 'iDRAC6',
11: 'iDRAC6',
16: 'iDRAC7',
17: 'iDRAC7'}
if isinstance(client, paramiko.SSHClient):
(stdin, stdout, stderr) = cl... | [
"def",
"__version",
"(",
"client",
")",
":",
"versions",
"=",
"{",
"9",
":",
"'CMC'",
",",
"8",
":",
"'iDRAC6'",
",",
"10",
":",
"'iDRAC6'",
",",
"11",
":",
"'iDRAC6'",
",",
"16",
":",
"'iDRAC7'",
",",
"17",
":",
"'iDRAC7'",
"}",
"if",
"isinstance"... | Grab DRAC version | [
"Grab",
"DRAC",
"version"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L69-L87 | train |
saltstack/salt | salt/runners/drac.py | pxe | def pxe(hostname, timeout=20, username=None, password=None):
'''
Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com
'''
_cmds = [
'racadm config -g cfgServerInfo... | python | def pxe(hostname, timeout=20, username=None, password=None):
'''
Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com
'''
_cmds = [
'racadm config -g cfgServerInfo... | [
"def",
"pxe",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"_cmds",
"=",
"[",
"'racadm config -g cfgServerInfo -o cfgServerFirstBootDevice pxe'",
",",
"'racadm config -g cfgServerInfo -o cfgServerBootO... | Connect to the Dell DRAC and have the boot order set to PXE
and power cycle the system to PXE boot
CLI Example:
.. code-block:: bash
salt-run drac.pxe example.com | [
"Connect",
"to",
"the",
"Dell",
"DRAC",
"and",
"have",
"the",
"boot",
"order",
"set",
"to",
"PXE",
"and",
"power",
"cycle",
"the",
"system",
"to",
"PXE",
"boot"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L90-L121 | train |
saltstack/salt | salt/runners/drac.py | reboot | def reboot(hostname, timeout=20, username=None, password=None):
'''
Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com
'''
client = __connect(hostname, timeout, username, password)
if isinstance(client, paramiko.SSHClient):
... | python | def reboot(hostname, timeout=20, username=None, password=None):
'''
Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com
'''
client = __connect(hostname, timeout, username, password)
if isinstance(client, paramiko.SSHClient):
... | [
"def",
"reboot",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"client",
"=",
"__connect",
"(",
"hostname",
",",
"timeout",
",",
"username",
",",
"password",
")",
"if",
"isinstance",
"... | Reboot a server using the Dell DRAC
CLI Example:
.. code-block:: bash
salt-run drac.reboot example.com | [
"Reboot",
"a",
"server",
"using",
"the",
"Dell",
"DRAC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L124-L148 | train |
saltstack/salt | salt/runners/drac.py | version | def version(hostname, timeout=20, username=None, password=None):
'''
Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com
'''
return __version(__connect(hostname, timeout, username, password)) | python | def version(hostname, timeout=20, username=None, password=None):
'''
Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com
'''
return __version(__connect(hostname, timeout, username, password)) | [
"def",
"version",
"(",
"hostname",
",",
"timeout",
"=",
"20",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"return",
"__version",
"(",
"__connect",
"(",
"hostname",
",",
"timeout",
",",
"username",
",",
"password",
")",
")"
] | Display the version of DRAC
CLI Example:
.. code-block:: bash
salt-run drac.version example.com | [
"Display",
"the",
"version",
"of",
"DRAC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/drac.py#L205-L215 | train |
saltstack/salt | salt/beacons/glxinfo.py | beacon | def beacon(config):
'''
Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True
'''
log.t... | python | def beacon(config):
'''
Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True
'''
log.t... | [
"def",
"beacon",
"(",
"config",
")",
":",
"log",
".",
"trace",
"(",
"'glxinfo beacon starting'",
")",
"ret",
"=",
"[",
"]",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"retcode",
"=",
"__salt_... | Emit the status of a connected display to the minion
Mainly this is used to detect when the display fails to connect
for whatever reason.
.. code-block:: yaml
beacons:
glxinfo:
- user: frank
- screen_event: True | [
"Emit",
"the",
"status",
"of",
"a",
"connected",
"display",
"to",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/glxinfo.py#L49-L82 | train |
saltstack/salt | salt/runners/config.py | get | def get(key, default='', delimiter=':'):
'''
Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels ... | python | def get(key, default='', delimiter=':'):
'''
Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels ... | [
"def",
"get",
"(",
"key",
",",
"default",
"=",
"''",
",",
"delimiter",
"=",
"':'",
")",
":",
"ret",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"traverse_dict_and_list",
"(",
"__opts__",
",",
"key",
",",
"default",
"=",
"'_|-'",
",",
"delimiter",
"=... | Retrieve master config options, with optional nesting via the delimiter
argument.
**Arguments**
default
If the key is not found, the default will be returned instead
delimiter
Override the delimiter used to separate nested levels of a data
structure.
CLI Example:
.... | [
"Retrieve",
"master",
"config",
"options",
"with",
"optional",
"nesting",
"via",
"the",
"delimiter",
"argument",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/config.py#L12-L40 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | reissue | def reissue(csr_file,
certificate_id,
web_server_type,
approver_email=None,
http_dc_validation=False,
**kwargs):
'''
Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Requ... | python | def reissue(csr_file,
certificate_id,
web_server_type,
approver_email=None,
http_dc_validation=False,
**kwargs):
'''
Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Requ... | [
"def",
"reissue",
"(",
"csr_file",
",",
"certificate_id",
",",
"web_server_type",
",",
"approver_email",
"=",
"None",
",",
"http_dc_validation",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"__get_certificates",
"(",
"'namecheap.ssl.reissue'",
",",
... | Reissues a purchased SSL certificate. Returns a dictionary of result
values.
csr_file
Path to Certificate Signing Request file
certificate_id
Unique ID of the SSL certificate you wish to activate
web_server_type
The type of certificate format to return. Possible values include... | [
"Reissues",
"a",
"purchased",
"SSL",
"certificate",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"values",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L58-L128 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | renew | def renew(years, certificate_id, certificate_type, promotion_code=None):
'''
Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
... | python | def renew(years, certificate_id, certificate_type, promotion_code=None):
'''
Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
... | [
"def",
"renew",
"(",
"years",
",",
"certificate_id",
",",
"certificate_type",
",",
"promotion_code",
"=",
"None",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'InstantSSL'",
",",... | Renews an SSL certificate if it is ACTIVE and Expires <= 30 days. Returns
the following information:
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
years : 1
Number of years to register
certificate_id
Unique ID of the SSL certif... | [
"Renews",
"an",
"SSL",
"certificate",
"if",
"it",
"is",
"ACTIVE",
"and",
"Expires",
"<",
"=",
"30",
"days",
".",
"Returns",
"the",
"following",
"information",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L295-L407 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | create | def create(years, certificate_type, promotion_code=None, sans_to_add=None):
'''
Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- T... | python | def create(years, certificate_type, promotion_code=None, sans_to_add=None):
'''
Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- T... | [
"def",
"create",
"(",
"years",
",",
"certificate_type",
",",
"promotion_code",
"=",
"None",
",",
"sans_to_add",
"=",
"None",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'Insta... | Creates a new SSL certificate. Returns the following information:
- Whether or not the SSL order was successful
- The certificate ID
- The order ID
- The transaction ID
- The amount charged for the order
- The date on which the certificate was created
- The date on which the certificate wil... | [
"Creates",
"a",
"new",
"SSL",
"certificate",
".",
"Returns",
"the",
"following",
"information",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L410-L591 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | parse_csr | def parse_csr(csr_file, certificate_type, http_dc_validation=False):
'''
Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- ... | python | def parse_csr(csr_file, certificate_type, http_dc_validation=False):
'''
Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- ... | [
"def",
"parse_csr",
"(",
"csr_file",
",",
"certificate_type",
",",
"http_dc_validation",
"=",
"False",
")",
":",
"valid_certs",
"=",
"(",
"'QuickSSL Premium'",
",",
"'RapidSSL'",
",",
"'RapidSSL Wildcard'",
",",
"'PremiumSSL'",
",",
"'InstantSSL'",
",",
"'PositiveSS... | Parses the CSR. Returns a dictionary of result values.
csr_file
Path to Certificate Signing Request file
certificate_type
Type of SSL Certificate. Possible values include:
- EV Multi Domain SSL
- EV SSL
- EV SSL SGC
- EssentialSSL
- EssentialSSL Wildcar... | [
"Parses",
"the",
"CSR",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"values",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L594-L696 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | get_list | def get_list(**kwargs):
'''
Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled... | python | def get_list(**kwargs):
'''
Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled... | [
"def",
"get_list",
"(",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.ssl.getList'",
")",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"kwargs",
")",
":",
"opts",... | Returns a list of SSL certificates for a particular user
ListType : All
Possible values:
- All
- Processing
- EmailSent
- TechnicalProblem
- InProgress
- Completed
- Deactivated
- Active
- Cancelled
- NewPurchase
- New... | [
"Returns",
"a",
"list",
"of",
"SSL",
"certificates",
"for",
"a",
"particular",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L699-L755 | train |
saltstack/salt | salt/modules/namecheap_ssl.py | get_info | def get_info(certificate_id, returncertificate=False, returntype=None):
'''
Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details ... | python | def get_info(certificate_id, returncertificate=False, returntype=None):
'''
Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details ... | [
"def",
"get_info",
"(",
"certificate_id",
",",
"returncertificate",
"=",
"False",
",",
"returntype",
"=",
"None",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.ssl.getinfo'",
")",
"opts",
"[",
"'certificateID'... | Retrieves information about the requested SSL certificate. Returns a
dictionary of information about the SSL certificate with two keys:
- **ssl** - Contains the metadata information
- **certificate** - Contains the details for the certificate such as the
CSR, Approver, and certificate data
certi... | [
"Retrieves",
"information",
"about",
"the",
"requested",
"SSL",
"certificate",
".",
"Returns",
"a",
"dictionary",
"of",
"information",
"about",
"the",
"SSL",
"certificate",
"with",
"two",
"keys",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_ssl.py#L758-L806 | train |
saltstack/salt | salt/states/cron.py | _check_cron | def _check_cron(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
comment=None,
commented=None,
identifier=None,
special=None):
''... | python | def _check_cron(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
comment=None,
commented=None,
identifier=None,
special=None):
''... | [
"def",
"_check_cron",
"(",
"user",
",",
"cmd",
",",
"minute",
"=",
"None",
",",
"hour",
"=",
"None",
",",
"daymonth",
"=",
"None",
",",
"month",
"=",
"None",
",",
"dayweek",
"=",
"None",
",",
"comment",
"=",
"None",
",",
"commented",
"=",
"None",
"... | Return the changes | [
"Return",
"the",
"changes"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L161-L214 | train |
saltstack/salt | salt/states/cron.py | _check_cron_env | def _check_cron_env(user,
name,
value=None):
'''
Return the environment changes
'''
if value is None:
value = "" # Matching value set in salt.modules.cron._render_tab
lst = __salt__['cron.list_tab'](user)
for env in lst['env']:
if name == ... | python | def _check_cron_env(user,
name,
value=None):
'''
Return the environment changes
'''
if value is None:
value = "" # Matching value set in salt.modules.cron._render_tab
lst = __salt__['cron.list_tab'](user)
for env in lst['env']:
if name == ... | [
"def",
"_check_cron_env",
"(",
"user",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"\"\"",
"# Matching value set in salt.modules.cron._render_tab",
"lst",
"=",
"__salt__",
"[",
"'cron.list_tab'",
"]",
"(",
... | Return the environment changes | [
"Return",
"the",
"environment",
"changes"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L217-L231 | train |
saltstack/salt | salt/states/cron.py | _get_cron_info | def _get_cron_info():
'''
Returns the proper group owner and path to the cron directory
'''
owner = 'root'
if __grains__['os'] == 'FreeBSD':
group = 'wheel'
crontab_dir = '/var/cron/tabs'
elif __grains__['os'] == 'OpenBSD':
group = 'crontab'
crontab_dir = '/var/cr... | python | def _get_cron_info():
'''
Returns the proper group owner and path to the cron directory
'''
owner = 'root'
if __grains__['os'] == 'FreeBSD':
group = 'wheel'
crontab_dir = '/var/cron/tabs'
elif __grains__['os'] == 'OpenBSD':
group = 'crontab'
crontab_dir = '/var/cr... | [
"def",
"_get_cron_info",
"(",
")",
":",
"owner",
"=",
"'root'",
"if",
"__grains__",
"[",
"'os'",
"]",
"==",
"'FreeBSD'",
":",
"group",
"=",
"'wheel'",
"crontab_dir",
"=",
"'/var/cron/tabs'",
"elif",
"__grains__",
"[",
"'os'",
"]",
"==",
"'OpenBSD'",
":",
"... | Returns the proper group owner and path to the cron directory | [
"Returns",
"the",
"proper",
"group",
"owner",
"and",
"path",
"to",
"the",
"cron",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L234-L254 | train |
saltstack/salt | salt/states/cron.py | present | def present(name,
user='root',
minute='*',
hour='*',
daymonth='*',
month='*',
dayweek='*',
comment=None,
commented=False,
identifier=False,
special=None):
'''
Verifies that the specified cron ... | python | def present(name,
user='root',
minute='*',
hour='*',
daymonth='*',
month='*',
dayweek='*',
comment=None,
commented=False,
identifier=False,
special=None):
'''
Verifies that the specified cron ... | [
"def",
"present",
"(",
"name",
",",
"user",
"=",
"'root'",
",",
"minute",
"=",
"'*'",
",",
"hour",
"=",
"'*'",
",",
"daymonth",
"=",
"'*'",
",",
"month",
"=",
"'*'",
",",
"dayweek",
"=",
"'*'",
",",
"comment",
"=",
"None",
",",
"commented",
"=",
... | Verifies that the specified cron job is present for the specified user.
It is recommended to use `identifier`. Otherwise the cron job is installed
twice if you change the name.
For more advanced information about what exactly can be set in the cron
timing parameters, check your cron system's documentati... | [
"Verifies",
"that",
"the",
"specified",
"cron",
"job",
"is",
"present",
"for",
"the",
"specified",
"user",
".",
"It",
"is",
"recommended",
"to",
"use",
"identifier",
".",
"Otherwise",
"the",
"cron",
"job",
"is",
"installed",
"twice",
"if",
"you",
"change",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L257-L383 | train |
saltstack/salt | salt/states/cron.py | absent | def absent(name,
user='root',
identifier=False,
special=None,
**kwargs):
'''
Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user c... | python | def absent(name,
user='root',
identifier=False,
special=None,
**kwargs):
'''
Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user c... | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"'root'",
",",
"identifier",
"=",
"False",
",",
"special",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# NOTE: The keyword arguments in **kwargs are ignored in this state, but",
"# cannot be removed from the fun... | Verifies that the specified cron job is absent for the specified user; only
the name is matched when removing a cron job.
name
The command that should be absent in the user crontab.
user
The name of the user whose crontab needs to be modified, defaults to
the root user
identif... | [
"Verifies",
"that",
"the",
"specified",
"cron",
"job",
"is",
"absent",
"for",
"the",
"specified",
"user",
";",
"only",
"the",
"name",
"is",
"matched",
"when",
"removing",
"a",
"cron",
"job",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L386-L448 | train |
saltstack/salt | salt/states/cron.py | file | def file(name,
source_hash='',
source_hash_name=None,
user='root',
template=None,
context=None,
replace=True,
defaults=None,
backup='',
**kwargs):
'''
Provides file.managed-like functionality (templating, etc.) for a pre-made
c... | python | def file(name,
source_hash='',
source_hash_name=None,
user='root',
template=None,
context=None,
replace=True,
defaults=None,
backup='',
**kwargs):
'''
Provides file.managed-like functionality (templating, etc.) for a pre-made
c... | [
"def",
"file",
"(",
"name",
",",
"source_hash",
"=",
"''",
",",
"source_hash_name",
"=",
"None",
",",
"user",
"=",
"'root'",
",",
"template",
"=",
"None",
",",
"context",
"=",
"None",
",",
"replace",
"=",
"True",
",",
"defaults",
"=",
"None",
",",
"b... | Provides file.managed-like functionality (templating, etc.) for a pre-made
crontab file, to be assigned to a given user.
name
The source file to be used as the crontab. This source file can be
hosted on either the salt master server, or on an HTTP or FTP server.
For files hosted on the ... | [
"Provides",
"file",
".",
"managed",
"-",
"like",
"functionality",
"(",
"templating",
"etc",
".",
")",
"for",
"a",
"pre",
"-",
"made",
"crontab",
"file",
"to",
"be",
"assigned",
"to",
"a",
"given",
"user",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L451-L669 | train |
saltstack/salt | salt/states/cron.py | env_present | def env_present(name,
value=None,
user='root'):
'''
Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whos... | python | def env_present(name,
value=None,
user='root'):
'''
Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whos... | [
"def",
"env_present",
"(",
"name",
",",
"value",
"=",
"None",
",",
"user",
"=",
"'root'",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
"}",
"if",
"__... | Verifies that the specified environment variable is present in the crontab
for the specified user.
name
The name of the environment variable to set in the user crontab
user
The name of the user whose crontab needs to be modified, defaults to
the root user
value
The val... | [
"Verifies",
"that",
"the",
"specified",
"environment",
"variable",
"is",
"present",
"in",
"the",
"crontab",
"for",
"the",
"specified",
"user",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cron.py#L672-L722 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.