partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
_get_proc_status
Returns the status of a Process instance. It's backward compatible with < 2.0 versions of psutil.
salt/modules/ps.py
def _get_proc_status(proc): ''' Returns the status of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.status() if PSUTIL2 else proc.status) except (psutil.NoSuchProcess, psutil.AccessDenied): return None
def _get_proc_status(proc): ''' Returns the status of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.status() if PSUTIL2 else proc.status) except (psutil.NoSuchProcess, psutil.AccessDenied): return None
[ "Returns", "the", "status", "of", "a", "Process", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L86-L95
[ "def", "_get_proc_status", "(", "proc", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "status", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "status", ")", "except", "(", "psutil", ".", "NoSuch...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_proc_username
Returns the username of a Process instance. It's backward compatible with < 2.0 versions of psutil.
salt/modules/ps.py
def _get_proc_username(proc): ''' Returns the username of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.username() if PSUTIL2 else proc.username) except (psutil.NoSuchProcess, psutil.AccessDenied, KeyError): ...
def _get_proc_username(proc): ''' Returns the username of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.username() if PSUTIL2 else proc.username) except (psutil.NoSuchProcess, psutil.AccessDenied, KeyError): ...
[ "Returns", "the", "username", "of", "a", "Process", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L98-L107
[ "def", "_get_proc_username", "(", "proc", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "username", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "username", ")", "except", "(", "psutil", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
top
Return a list of top CPU consuming processes during the interval. num_processes = return the top N CPU consuming processes interval = the number of seconds to sample CPU usage over CLI Examples: .. code-block:: bash salt '*' ps.top salt '*' ps.top 5 10
salt/modules/ps.py
def top(num_processes=5, interval=3): ''' Return a list of top CPU consuming processes during the interval. num_processes = return the top N CPU consuming processes interval = the number of seconds to sample CPU usage over CLI Examples: .. code-block:: bash salt '*' ps.top sa...
def top(num_processes=5, interval=3): ''' Return a list of top CPU consuming processes during the interval. num_processes = return the top N CPU consuming processes interval = the number of seconds to sample CPU usage over CLI Examples: .. code-block:: bash salt '*' ps.top sa...
[ "Return", "a", "list", "of", "top", "CPU", "consuming", "processes", "during", "the", "interval", ".", "num_processes", "=", "return", "the", "top", "N", "CPU", "consuming", "processes", "interval", "=", "the", "number", "of", "seconds", "to", "sample", "CPU...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L119-L178
[ "def", "top", "(", "num_processes", "=", "5", ",", "interval", "=", "3", ")", ":", "result", "=", "[", "]", "start_usage", "=", "{", "}", "for", "pid", "in", "psutil", ".", "pids", "(", ")", ":", "try", ":", "process", "=", "psutil", ".", "Proces...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
proc_info
Return a dictionary of information for a process id (PID). CLI Example: .. code-block:: bash salt '*' ps.proc_info 2322 salt '*' ps.proc_info 2322 attrs='["pid", "name"]' pid PID of process to query. attrs Optional list of desired process attributes. The list of pos...
salt/modules/ps.py
def proc_info(pid, attrs=None): ''' Return a dictionary of information for a process id (PID). CLI Example: .. code-block:: bash salt '*' ps.proc_info 2322 salt '*' ps.proc_info 2322 attrs='["pid", "name"]' pid PID of process to query. attrs Optional list of ...
def proc_info(pid, attrs=None): ''' Return a dictionary of information for a process id (PID). CLI Example: .. code-block:: bash salt '*' ps.proc_info 2322 salt '*' ps.proc_info 2322 attrs='["pid", "name"]' pid PID of process to query. attrs Optional list of ...
[ "Return", "a", "dictionary", "of", "information", "for", "a", "process", "id", "(", "PID", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L194-L217
[ "def", "proc_info", "(", "pid", ",", "attrs", "=", "None", ")", ":", "try", ":", "proc", "=", "psutil", ".", "Process", "(", "pid", ")", "return", "proc", ".", "as_dict", "(", "attrs", ")", "except", "(", "psutil", ".", "NoSuchProcess", ",", "psutil"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
kill_pid
Kill a process by PID. .. code-block:: bash salt 'minion' ps.kill_pid pid [signal=signal_number] pid PID of process to kill. signal Signal to send to the process. See manpage entry for kill for possible values. Default: 15 (SIGTERM). **Example:** Send SIGKILL to...
salt/modules/ps.py
def kill_pid(pid, signal=15): ''' Kill a process by PID. .. code-block:: bash salt 'minion' ps.kill_pid pid [signal=signal_number] pid PID of process to kill. signal Signal to send to the process. See manpage entry for kill for possible values. Default: 15 (SIGTER...
def kill_pid(pid, signal=15): ''' Kill a process by PID. .. code-block:: bash salt 'minion' ps.kill_pid pid [signal=signal_number] pid PID of process to kill. signal Signal to send to the process. See manpage entry for kill for possible values. Default: 15 (SIGTER...
[ "Kill", "a", "process", "by", "PID", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L220-L247
[ "def", "kill_pid", "(", "pid", ",", "signal", "=", "15", ")", ":", "try", ":", "psutil", ".", "Process", "(", "pid", ")", ".", "send_signal", "(", "signal", ")", "return", "True", "except", "psutil", ".", "NoSuchProcess", ":", "return", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pkill
Kill processes matching a pattern. .. code-block:: bash salt '*' ps.pkill pattern [user=username] [signal=signal_number] \\ [full=(true|false)] pattern Pattern to search for in the process list. user Limit matches to the given username. Default: All users. si...
salt/modules/ps.py
def pkill(pattern, user=None, signal=15, full=False): ''' Kill processes matching a pattern. .. code-block:: bash salt '*' ps.pkill pattern [user=username] [signal=signal_number] \\ [full=(true|false)] pattern Pattern to search for in the process list. user ...
def pkill(pattern, user=None, signal=15, full=False): ''' Kill processes matching a pattern. .. code-block:: bash salt '*' ps.pkill pattern [user=username] [signal=signal_number] \\ [full=(true|false)] pattern Pattern to search for in the process list. user ...
[ "Kill", "processes", "matching", "a", "pattern", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L250-L302
[ "def", "pkill", "(", "pattern", ",", "user", "=", "None", ",", "signal", "=", "15", ",", "full", "=", "False", ")", ":", "killed", "=", "[", "]", "for", "proc", "in", "psutil", ".", "process_iter", "(", ")", ":", "name_match", "=", "pattern", "in",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pgrep
Return the pids for processes matching a pattern. If full is true, the full command line is searched for a match, otherwise only the name of the command is searched. .. code-block:: bash salt '*' ps.pgrep pattern [user=username] [full=(true|false)] pattern Pattern to search for in th...
salt/modules/ps.py
def pgrep(pattern, user=None, full=False, pattern_is_regex=False): ''' Return the pids for processes matching a pattern. If full is true, the full command line is searched for a match, otherwise only the name of the command is searched. .. code-block:: bash salt '*' ps.pgrep pattern [user...
def pgrep(pattern, user=None, full=False, pattern_is_regex=False): ''' Return the pids for processes matching a pattern. If full is true, the full command line is searched for a match, otherwise only the name of the command is searched. .. code-block:: bash salt '*' ps.pgrep pattern [user...
[ "Return", "the", "pids", "for", "processes", "matching", "a", "pattern", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L305-L368
[ "def", "pgrep", "(", "pattern", ",", "user", "=", "None", ",", "full", "=", "False", ",", "pattern_is_regex", "=", "False", ")", ":", "procs", "=", "[", "]", "if", "pattern_is_regex", ":", "pattern", "=", "re", ".", "compile", "(", "str", "(", "patte...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cpu_percent
Return the percent of time the CPU is busy. interval the number of seconds to sample CPU usage over per_cpu if True return an array of CPU percent busy for each CPU, otherwise aggregate all percents into one number CLI Example: .. code-block:: bash salt '*' ps.cpu_per...
salt/modules/ps.py
def cpu_percent(interval=0.1, per_cpu=False): ''' Return the percent of time the CPU is busy. interval the number of seconds to sample CPU usage over per_cpu if True return an array of CPU percent busy for each CPU, otherwise aggregate all percents into one number CLI Examp...
def cpu_percent(interval=0.1, per_cpu=False): ''' Return the percent of time the CPU is busy. interval the number of seconds to sample CPU usage over per_cpu if True return an array of CPU percent busy for each CPU, otherwise aggregate all percents into one number CLI Examp...
[ "Return", "the", "percent", "of", "time", "the", "CPU", "is", "busy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L371-L391
[ "def", "cpu_percent", "(", "interval", "=", "0.1", ",", "per_cpu", "=", "False", ")", ":", "if", "per_cpu", ":", "result", "=", "list", "(", "psutil", ".", "cpu_percent", "(", "interval", ",", "True", ")", ")", "else", ":", "result", "=", "psutil", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cpu_times
Return the percent of time the CPU spends in each state, e.g. user, system, idle, nice, iowait, irq, softirq. per_cpu if True return an array of percents for each CPU, otherwise aggregate all percents into one number CLI Example: .. code-block:: bash salt '*' ps.cpu_times
salt/modules/ps.py
def cpu_times(per_cpu=False): ''' Return the percent of time the CPU spends in each state, e.g. user, system, idle, nice, iowait, irq, softirq. per_cpu if True return an array of percents for each CPU, otherwise aggregate all percents into one number CLI Example: .. code-block...
def cpu_times(per_cpu=False): ''' Return the percent of time the CPU spends in each state, e.g. user, system, idle, nice, iowait, irq, softirq. per_cpu if True return an array of percents for each CPU, otherwise aggregate all percents into one number CLI Example: .. code-block...
[ "Return", "the", "percent", "of", "time", "the", "CPU", "spends", "in", "each", "state", "e", ".", "g", ".", "user", "system", "idle", "nice", "iowait", "irq", "softirq", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L394-L413
[ "def", "cpu_times", "(", "per_cpu", "=", "False", ")", ":", "if", "per_cpu", ":", "result", "=", "[", "dict", "(", "times", ".", "_asdict", "(", ")", ")", "for", "times", "in", "psutil", ".", "cpu_times", "(", "True", ")", "]", "else", ":", "result...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
virtual_memory
.. versionadded:: 2014.7.0 Return a dict that describes statistics about system memory usage. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.virtual_memory
salt/modules/ps.py
def virtual_memory(): ''' .. versionadded:: 2014.7.0 Return a dict that describes statistics about system memory usage. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.virtual_memory ''' if p...
def virtual_memory(): ''' .. versionadded:: 2014.7.0 Return a dict that describes statistics about system memory usage. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.virtual_memory ''' if p...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L416-L435
[ "def", "virtual_memory", "(", ")", ":", "if", "psutil", ".", "version_info", "<", "(", "0", ",", "6", ",", "0", ")", ":", "msg", "=", "'virtual_memory is only available in psutil 0.6.0 or greater'", "raise", "CommandExecutionError", "(", "msg", ")", "return", "d...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
swap_memory
.. versionadded:: 2014.7.0 Return a dict that describes swap memory statistics. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.swap_memory
salt/modules/ps.py
def swap_memory(): ''' .. versionadded:: 2014.7.0 Return a dict that describes swap memory statistics. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.swap_memory ''' if psutil.version_info <...
def swap_memory(): ''' .. versionadded:: 2014.7.0 Return a dict that describes swap memory statistics. .. note:: This function is only available in psutil version 0.6.0 and above. CLI Example: .. code-block:: bash salt '*' ps.swap_memory ''' if psutil.version_info <...
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L438-L457
[ "def", "swap_memory", "(", ")", ":", "if", "psutil", ".", "version_info", "<", "(", "0", ",", "6", ",", "0", ")", ":", "msg", "=", "'swap_memory is only available in psutil 0.6.0 or greater'", "raise", "CommandExecutionError", "(", "msg", ")", "return", "dict", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disk_partitions
Return a list of disk partitions and their device, mount point, and filesystem type. all if set to False, only return local, physical partitions (hard disk, USB, CD/DVD partitions). If True, return all filesystems. CLI Example: .. code-block:: bash salt '*' ps.disk_partition...
salt/modules/ps.py
def disk_partitions(all=False): ''' Return a list of disk partitions and their device, mount point, and filesystem type. all if set to False, only return local, physical partitions (hard disk, USB, CD/DVD partitions). If True, return all filesystems. CLI Example: .. code-bloc...
def disk_partitions(all=False): ''' Return a list of disk partitions and their device, mount point, and filesystem type. all if set to False, only return local, physical partitions (hard disk, USB, CD/DVD partitions). If True, return all filesystems. CLI Example: .. code-bloc...
[ "Return", "a", "list", "of", "disk", "partitions", "and", "their", "device", "mount", "point", "and", "filesystem", "type", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L460-L477
[ "def", "disk_partitions", "(", "all", "=", "False", ")", ":", "result", "=", "[", "dict", "(", "partition", ".", "_asdict", "(", ")", ")", "for", "partition", "in", "psutil", ".", "disk_partitions", "(", "all", ")", "]", "return", "result" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disk_partition_usage
Return a list of disk partitions plus the mount point, filesystem and usage statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_partition_usage
salt/modules/ps.py
def disk_partition_usage(all=False): ''' Return a list of disk partitions plus the mount point, filesystem and usage statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_partition_usage ''' result = disk_partitions(all) for partition in result: partition.upda...
def disk_partition_usage(all=False): ''' Return a list of disk partitions plus the mount point, filesystem and usage statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_partition_usage ''' result = disk_partitions(all) for partition in result: partition.upda...
[ "Return", "a", "list", "of", "disk", "partitions", "plus", "the", "mount", "point", "filesystem", "and", "usage", "statistics", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L494-L508
[ "def", "disk_partition_usage", "(", "all", "=", "False", ")", ":", "result", "=", "disk_partitions", "(", "all", ")", "for", "partition", "in", "result", ":", "partition", ".", "update", "(", "disk_usage", "(", "partition", "[", "'mountpoint'", "]", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
total_physical_memory
Return the total number of bytes of physical memory. CLI Example: .. code-block:: bash salt '*' ps.total_physical_memory
salt/modules/ps.py
def total_physical_memory(): ''' Return the total number of bytes of physical memory. CLI Example: .. code-block:: bash salt '*' ps.total_physical_memory ''' if psutil.version_info < (0, 6, 0): msg = 'virtual_memory is only available in psutil 0.6.0 or greater' raise C...
def total_physical_memory(): ''' Return the total number of bytes of physical memory. CLI Example: .. code-block:: bash salt '*' ps.total_physical_memory ''' if psutil.version_info < (0, 6, 0): msg = 'virtual_memory is only available in psutil 0.6.0 or greater' raise C...
[ "Return", "the", "total", "number", "of", "bytes", "of", "physical", "memory", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L511-L529
[ "def", "total_physical_memory", "(", ")", ":", "if", "psutil", ".", "version_info", "<", "(", "0", ",", "6", ",", "0", ")", ":", "msg", "=", "'virtual_memory is only available in psutil 0.6.0 or greater'", "raise", "CommandExecutionError", "(", "msg", ")", "try", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
boot_time
Return the boot time in number of seconds since the epoch began. CLI Example: time_format Optionally specify a `strftime`_ format string. Use ``time_format='%c'`` to get a nicely-formatted locale specific date and time (i.e. ``Fri May 2 19:08:32 2014``). .. _strftime: https:/...
salt/modules/ps.py
def boot_time(time_format=None): ''' Return the boot time in number of seconds since the epoch began. CLI Example: time_format Optionally specify a `strftime`_ format string. Use ``time_format='%c'`` to get a nicely-formatted locale specific date and time (i.e. ``Fri May 2 19:...
def boot_time(time_format=None): ''' Return the boot time in number of seconds since the epoch began. CLI Example: time_format Optionally specify a `strftime`_ format string. Use ``time_format='%c'`` to get a nicely-formatted locale specific date and time (i.e. ``Fri May 2 19:...
[ "Return", "the", "boot", "time", "in", "number", "of", "seconds", "since", "the", "epoch", "began", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L550-L582
[ "def", "boot_time", "(", "time_format", "=", "None", ")", ":", "try", ":", "b_time", "=", "int", "(", "psutil", ".", "boot_time", "(", ")", ")", "except", "AttributeError", ":", "# get_boot_time() has been removed in newer psutil versions, and has", "# been replaced b...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
network_io_counters
Return network I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.network_io_counters salt '*' ps.network_io_counters interface=eth0
salt/modules/ps.py
def network_io_counters(interface=None): ''' Return network I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.network_io_counters salt '*' ps.network_io_counters interface=eth0 ''' if not interface: return dict(psutil.net_io_counters()._asdict()) else:...
def network_io_counters(interface=None): ''' Return network I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.network_io_counters salt '*' ps.network_io_counters interface=eth0 ''' if not interface: return dict(psutil.net_io_counters()._asdict()) else:...
[ "Return", "network", "I", "/", "O", "statistics", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L585-L604
[ "def", "network_io_counters", "(", "interface", "=", "None", ")", ":", "if", "not", "interface", ":", "return", "dict", "(", "psutil", ".", "net_io_counters", "(", ")", ".", "_asdict", "(", ")", ")", "else", ":", "stats", "=", "psutil", ".", "net_io_coun...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disk_io_counters
Return disk I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_io_counters salt '*' ps.disk_io_counters device=sda1
salt/modules/ps.py
def disk_io_counters(device=None): ''' Return disk I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_io_counters salt '*' ps.disk_io_counters device=sda1 ''' if not device: return dict(psutil.disk_io_counters()._asdict()) else: stats = psu...
def disk_io_counters(device=None): ''' Return disk I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_io_counters salt '*' ps.disk_io_counters device=sda1 ''' if not device: return dict(psutil.disk_io_counters()._asdict()) else: stats = psu...
[ "Return", "disk", "I", "/", "O", "statistics", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L607-L626
[ "def", "disk_io_counters", "(", "device", "=", "None", ")", ":", "if", "not", "device", ":", "return", "dict", "(", "psutil", ".", "disk_io_counters", "(", ")", ".", "_asdict", "(", ")", ")", "else", ":", "stats", "=", "psutil", ".", "disk_io_counters", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_users
Return logged-in users. CLI Example: .. code-block:: bash salt '*' ps.get_users
salt/modules/ps.py
def get_users(): ''' Return logged-in users. CLI Example: .. code-block:: bash salt '*' ps.get_users ''' try: recs = psutil.users() return [dict(x._asdict()) for x in recs] except AttributeError: # get_users is only present in psutil > v0.5.0 # try ...
def get_users(): ''' Return logged-in users. CLI Example: .. code-block:: bash salt '*' ps.get_users ''' try: recs = psutil.users() return [dict(x._asdict()) for x in recs] except AttributeError: # get_users is only present in psutil > v0.5.0 # try ...
[ "Return", "logged", "-", "in", "users", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L629-L660
[ "def", "get_users", "(", ")", ":", "try", ":", "recs", "=", "psutil", ".", "users", "(", ")", "return", "[", "dict", "(", "x", ".", "_asdict", "(", ")", ")", "for", "x", "in", "recs", "]", "except", "AttributeError", ":", "# get_users is only present i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lsof
Retrieve the lsof information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.lsof apache2
salt/modules/ps.py
def lsof(name): ''' Retrieve the lsof information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.lsof apache2 ''' sanitize_name = six.text_type(name) lsof_infos = __salt__['cmd.run']("lsof -c " + sanitize_name) ret = [] ret.extend([sanitize_name, ...
def lsof(name): ''' Retrieve the lsof information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.lsof apache2 ''' sanitize_name = six.text_type(name) lsof_infos = __salt__['cmd.run']("lsof -c " + sanitize_name) ret = [] ret.extend([sanitize_name, ...
[ "Retrieve", "the", "lsof", "information", "of", "the", "given", "process", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L663-L677
[ "def", "lsof", "(", "name", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "lsof_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"lsof -c \"", "+", "sanitize_name", ")", "ret", "=", "[", "]", "ret", ".", "extend", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netstat
Retrieve the netstat information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.netstat apache2
salt/modules/ps.py
def netstat(name): ''' Retrieve the netstat information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.netstat apache2 ''' sanitize_name = six.text_type(name) netstat_infos = __salt__['cmd.run']("netstat -nap") found_infos = [] ret = [] for in...
def netstat(name): ''' Retrieve the netstat information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.netstat apache2 ''' sanitize_name = six.text_type(name) netstat_infos = __salt__['cmd.run']("netstat -nap") found_infos = [] ret = [] for in...
[ "Retrieve", "the", "netstat", "information", "of", "the", "given", "process", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L681-L699
[ "def", "netstat", "(", "name", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "netstat_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"netstat -nap\"", ")", "found_infos", "=", "[", "]", "ret", "=", "[", "]", "for", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ss
Retrieve the ss information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.ss apache2 .. versionadded:: 2016.11.6
salt/modules/ps.py
def ss(name): ''' Retrieve the ss information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.ss apache2 .. versionadded:: 2016.11.6 ''' sanitize_name = six.text_type(name) ss_infos = __salt__['cmd.run']("ss -neap") found_infos = [] ret = [] ...
def ss(name): ''' Retrieve the ss information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.ss apache2 .. versionadded:: 2016.11.6 ''' sanitize_name = six.text_type(name) ss_infos = __salt__['cmd.run']("ss -neap") found_infos = [] ret = [] ...
[ "Retrieve", "the", "ss", "information", "of", "the", "given", "process", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L703-L724
[ "def", "ss", "(", "name", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "ss_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"ss -neap\"", ")", "found_infos", "=", "[", "]", "ret", "=", "[", "]", "for", "info", "in"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
psaux
Retrieve information corresponding to a "ps aux" filtered with the given pattern. It could be just a name or a regular expression (using python search from "re" module). CLI Example: .. code-block:: bash salt '*' ps.psaux www-data.+apache2
salt/modules/ps.py
def psaux(name): ''' Retrieve information corresponding to a "ps aux" filtered with the given pattern. It could be just a name or a regular expression (using python search from "re" module). CLI Example: .. code-block:: bash salt '*' ps.psaux www-data.+apache2 ''' sanitize_nam...
def psaux(name): ''' Retrieve information corresponding to a "ps aux" filtered with the given pattern. It could be just a name or a regular expression (using python search from "re" module). CLI Example: .. code-block:: bash salt '*' ps.psaux www-data.+apache2 ''' sanitize_nam...
[ "Retrieve", "information", "corresponding", "to", "a", "ps", "aux", "filtered", "with", "the", "given", "pattern", ".", "It", "could", "be", "just", "a", "name", "or", "a", "regular", "expression", "(", "using", "python", "search", "from", "re", "module", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L727-L756
[ "def", "psaux", "(", "name", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "pattern", "=", "re", ".", "compile", "(", "sanitize_name", ")", "salt_exception_pattern", "=", "re", ".", "compile", "(", "\"salt.+ps.psaux.+\"", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure pagerduty service exists. This method accepts as arguments everything defined in https://developer.pagerduty.com/documentation/rest/services/create Note that many arguments are mutually exclusive, depending on the "type" argument. Examples: .. code-block:: yaml # create a PagerDut...
salt/states/pagerduty_service.py
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty service exists. This method accepts as arguments everything defined in https://developer.pagerduty.com/documentation/rest/services/create Note that many arguments are mutually exclusive, depending on the ...
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty service exists. This method accepts as arguments everything defined in https://developer.pagerduty.com/documentation/rest/services/create Note that many arguments are mutually exclusive, depending on the ...
[ "Ensure", "pagerduty", "service", "exists", ".", "This", "method", "accepts", "as", "arguments", "everything", "defined", "in", "https", ":", "//", "developer", ".", "pagerduty", ".", "com", "/", "documentation", "/", "rest", "/", "services", "/", "create" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L30-L84
[ "def", "present", "(", "profile", "=", "'pagerduty'", ",", "subdomain", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO: aws_cloudwatch type should be integrated with boto_sns", "# for convenience, we accept id, name, or email for users"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure a pagerduty service does not exist. Name can be the service name or pagerduty service id.
salt/states/pagerduty_service.py
def absent(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure a pagerduty service does not exist. Name can be the service name or pagerduty service id. ''' r = __salt__['pagerduty_util.resource_absent']('services', ['name', 'id...
def absent(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure a pagerduty service does not exist. Name can be the service name or pagerduty service id. ''' r = __salt__['pagerduty_util.resource_absent']('services', ['name', 'id...
[ "Ensure", "a", "pagerduty", "service", "does", "not", "exist", ".", "Name", "can", "be", "the", "service", "name", "or", "pagerduty", "service", "id", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L87-L98
[ "def", "absent", "(", "profile", "=", "'pagerduty'", ",", "subdomain", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "r", "=", "__salt__", "[", "'pagerduty_util.resource_absent'", "]", "(", "'services'", ",", "[", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_diff
helper method to compare salt state info with the PagerDuty API json structure, and determine if we need to update. returns the dict to pass to the PD API to perform the update, or empty dict if no update.
salt/states/pagerduty_service.py
def _diff(state_data, resource_object): '''helper method to compare salt state info with the PagerDuty API json structure, and determine if we need to update. returns the dict to pass to the PD API to perform the update, or empty dict if no update. ''' objects_differ = None for k, v in state_d...
def _diff(state_data, resource_object): '''helper method to compare salt state info with the PagerDuty API json structure, and determine if we need to update. returns the dict to pass to the PD API to perform the update, or empty dict if no update. ''' objects_differ = None for k, v in state_d...
[ "helper", "method", "to", "compare", "salt", "state", "info", "with", "the", "PagerDuty", "API", "json", "structure", "and", "determine", "if", "we", "need", "to", "update", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L101-L126
[ "def", "_diff", "(", "state_data", ",", "resource_object", ")", ":", "objects_differ", "=", "None", "for", "k", ",", "v", "in", "state_data", "[", "'service'", "]", ".", "items", "(", ")", ":", "if", "k", "==", "'escalation_policy_id'", ":", "resource_valu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
modules_and_args
Walk the Salt install tree and return a dictionary or a list of the functions therein as well as their arguments. :param modules: Walk the modules directory if True :param states: Walk the states directory if True :param names_only: Return only a list of the callable functions instead of a dictionary w...
salt/modules/baredoc.py
def modules_and_args(modules=True, states=False, names_only=False): ''' Walk the Salt install tree and return a dictionary or a list of the functions therein as well as their arguments. :param modules: Walk the modules directory if True :param states: Walk the states directory if True :param na...
def modules_and_args(modules=True, states=False, names_only=False): ''' Walk the Salt install tree and return a dictionary or a list of the functions therein as well as their arguments. :param modules: Walk the modules directory if True :param states: Walk the states directory if True :param na...
[ "Walk", "the", "Salt", "install", "tree", "and", "return", "a", "dictionary", "or", "a", "list", "of", "the", "functions", "therein", "as", "well", "as", "their", "arguments", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/baredoc.py#L96-L151
[ "def", "modules_and_args", "(", "modules", "=", "True", ",", "states", "=", "False", ",", "names_only", "=", "False", ")", ":", "dirs", "=", "[", "]", "module_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
output
Mane function
salt/output/pony.py
def output(data, **kwargs): # pylint: disable=unused-argument ''' Mane function ''' high_out = __salt__['highstate'](data) return subprocess.check_output(['ponysay', salt.utils.data.decode(high_out)])
def output(data, **kwargs): # pylint: disable=unused-argument ''' Mane function ''' high_out = __salt__['highstate'](data) return subprocess.check_output(['ponysay', salt.utils.data.decode(high_out)])
[ "Mane", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/pony.py#L62-L67
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "high_out", "=", "__salt__", "[", "'highstate'", "]", "(", "data", ")", "return", "subprocess", ".", "check_output", "(", "[", "'ponysay'", ",", "salt", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run_config
r''' Compile a DSC Configuration in the form of a PowerShell script (.ps1) and apply it. The PowerShell script can be cached from the master using the ``source`` option. If there is more than one config within the PowerShell script, the desired configuration can be applied by passing the name in the ...
salt/modules/win_dsc.py
def run_config(path, source=None, config_name=None, config_data=None, config_data_source=None, script_parameters=None, salt_env='base'): r''' Compile a DSC Configuration in the form of a PowerShell script (.ps1) and ap...
def run_config(path, source=None, config_name=None, config_data=None, config_data_source=None, script_parameters=None, salt_env='base'): r''' Compile a DSC Configuration in the form of a PowerShell script (.ps1) and ap...
[ "r", "Compile", "a", "DSC", "Configuration", "in", "the", "form", "of", "a", "PowerShell", "script", "(", ".", "ps1", ")", "and", "apply", "it", ".", "The", "PowerShell", "script", "can", "be", "cached", "from", "the", "master", "using", "the", "source",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L95-L180
[ "def", "run_config", "(", "path", ",", "source", "=", "None", ",", "config_name", "=", "None", ",", "config_data", "=", "None", ",", "config_data_source", "=", "None", ",", "script_parameters", "=", "None", ",", "salt_env", "=", "'base'", ")", ":", "ret", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compile_config
r''' Compile a config from a PowerShell script (``.ps1``) Args: path (str): Path (local) to the script that will create the ``.mof`` configuration file. If no source is passed, the file must exist locally. Required. source (str): Path to the script on ``file_roots`` to...
salt/modules/win_dsc.py
def compile_config(path, source=None, config_name=None, config_data=None, config_data_source=None, script_parameters=None, salt_env='base'): r''' Compile a config from a PowerShell script (``.ps1``)...
def compile_config(path, source=None, config_name=None, config_data=None, config_data_source=None, script_parameters=None, salt_env='base'): r''' Compile a config from a PowerShell script (``.ps1``)...
[ "r", "Compile", "a", "config", "from", "a", "PowerShell", "script", "(", ".", "ps1", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L183-L329
[ "def", "compile_config", "(", "path", ",", "source", "=", "None", ",", "config_name", "=", "None", ",", "config_data", "=", "None", ",", "config_data_source", "=", "None", ",", "script_parameters", "=", "None", ",", "salt_env", "=", "'base'", ")", ":", "if...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
apply_config
r''' Run an compiled DSC configuration (a folder containing a .mof file). The folder can be cached from the salt master using the ``source`` option. Args: path (str): Local path to the directory that contains the .mof configuration file to apply. Required. source (str): Path t...
salt/modules/win_dsc.py
def apply_config(path, source=None, salt_env='base'): r''' Run an compiled DSC configuration (a folder containing a .mof file). The folder can be cached from the salt master using the ``source`` option. Args: path (str): Local path to the directory that contains the .mof configurat...
def apply_config(path, source=None, salt_env='base'): r''' Run an compiled DSC configuration (a folder containing a .mof file). The folder can be cached from the salt master using the ``source`` option. Args: path (str): Local path to the directory that contains the .mof configurat...
[ "r", "Run", "an", "compiled", "DSC", "configuration", "(", "a", "folder", "containing", "a", ".", "mof", "file", ")", ".", "The", "folder", "can", "be", "cached", "from", "the", "salt", "master", "using", "the", "source", "option", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L332-L408
[ "def", "apply_config", "(", "path", ",", "source", "=", "None", ",", "salt_env", "=", "'base'", ")", ":", "# If you're getting an error along the lines of \"The client cannot connect", "# to the destination specified in the request.\", try the following:", "# Enable-PSRemoting -SkipN...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config
Get the current DSC Configuration Returns: dict: A dictionary representing the DSC Configuration on the machine Raises: CommandExecutionError: On failure CLI Example: .. code-block:: bash salt '*' dsc.get_config
salt/modules/win_dsc.py
def get_config(): ''' Get the current DSC Configuration Returns: dict: A dictionary representing the DSC Configuration on the machine Raises: CommandExecutionError: On failure CLI Example: .. code-block:: bash salt '*' dsc.get_config ''' cmd = 'Get-DscConfigu...
def get_config(): ''' Get the current DSC Configuration Returns: dict: A dictionary representing the DSC Configuration on the machine Raises: CommandExecutionError: On failure CLI Example: .. code-block:: bash salt '*' dsc.get_config ''' cmd = 'Get-DscConfigu...
[ "Get", "the", "current", "DSC", "Configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L411-L448
[ "def", "get_config", "(", ")", ":", "cmd", "=", "'Get-DscConfiguration | Select-Object * -ExcludeProperty Cim*'", "try", ":", "raw_config", "=", "_pshell", "(", "cmd", ",", "ignore_retcode", "=", "True", ")", "except", "CommandExecutionError", "as", "exc", ":", "if"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove_config
Remove the current DSC Configuration. Removes current, pending, and previous dsc configurations. .. versionadded:: 2017.7.5 Args: reset (bool): Attempts to reset the DSC configuration by removing the following from ``C:\\Windows\\System32\\Configuration``: - Fi...
salt/modules/win_dsc.py
def remove_config(reset=False): ''' Remove the current DSC Configuration. Removes current, pending, and previous dsc configurations. .. versionadded:: 2017.7.5 Args: reset (bool): Attempts to reset the DSC configuration by removing the following from ``C:\\Windows\\...
def remove_config(reset=False): ''' Remove the current DSC Configuration. Removes current, pending, and previous dsc configurations. .. versionadded:: 2017.7.5 Args: reset (bool): Attempts to reset the DSC configuration by removing the following from ``C:\\Windows\\...
[ "Remove", "the", "current", "DSC", "Configuration", ".", "Removes", "current", "pending", "and", "previous", "dsc", "configurations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L451-L532
[ "def", "remove_config", "(", "reset", "=", "False", ")", ":", "# Stopping a running config (not likely to occur)", "cmd", "=", "'Stop-DscConfiguration'", "log", ".", "info", "(", "'DSC: Stopping Running Configuration'", ")", "try", ":", "_pshell", "(", "cmd", ")", "ex...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
restore_config
Reapplies the previous configuration. .. versionadded:: 2017.7.5 .. note:: The current configuration will be come the previous configuration. If run a second time back-to-back it is like toggling between two configs. Returns: bool: True if successfully restored Raises: ...
salt/modules/win_dsc.py
def restore_config(): ''' Reapplies the previous configuration. .. versionadded:: 2017.7.5 .. note:: The current configuration will be come the previous configuration. If run a second time back-to-back it is like toggling between two configs. Returns: bool: True if success...
def restore_config(): ''' Reapplies the previous configuration. .. versionadded:: 2017.7.5 .. note:: The current configuration will be come the previous configuration. If run a second time back-to-back it is like toggling between two configs. Returns: bool: True if success...
[ "Reapplies", "the", "previous", "configuration", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L535-L564
[ "def", "restore_config", "(", ")", ":", "cmd", "=", "'Restore-DscConfiguration'", "try", ":", "_pshell", "(", "cmd", ",", "ignore_retcode", "=", "True", ")", "except", "CommandExecutionError", "as", "exc", ":", "if", "'A previous configuration does not exist'", "in"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config_status
Get the status of the current DSC Configuration Returns: dict: A dictionary representing the status of the current DSC Configuration on the machine CLI Example: .. code-block:: bash salt '*' dsc.get_config_status
salt/modules/win_dsc.py
def get_config_status(): ''' Get the status of the current DSC Configuration Returns: dict: A dictionary representing the status of the current DSC Configuration on the machine CLI Example: .. code-block:: bash salt '*' dsc.get_config_status ''' cmd = 'Get-Dsc...
def get_config_status(): ''' Get the status of the current DSC Configuration Returns: dict: A dictionary representing the status of the current DSC Configuration on the machine CLI Example: .. code-block:: bash salt '*' dsc.get_config_status ''' cmd = 'Get-Dsc...
[ "Get", "the", "status", "of", "the", "current", "DSC", "Configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L589-L612
[ "def", "get_config_status", "(", ")", ":", "cmd", "=", "'Get-DscConfigurationStatus | '", "'Select-Object -Property HostName, Status, MetaData, '", "'@{Name=\"StartDate\";Expression={Get-Date ($_.StartDate) -Format g}}, '", "'Type, Mode, RebootRequested, NumberofResources'", "try", ":", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_lcm_config
For detailed descriptions of the parameters see: https://msdn.microsoft.com/en-us/PowerShell/DSC/metaConfig config_mode (str): How the LCM applies the configuration. Valid values are: - ApplyOnly - ApplyAndMonitor - ApplyAndAutoCorrect config_mode_freq (int): How often, in...
salt/modules/win_dsc.py
def set_lcm_config(config_mode=None, config_mode_freq=None, refresh_freq=None, reboot_if_needed=None, action_after_reboot=None, refresh_mode=None, certificate_id=None, configuration_id=No...
def set_lcm_config(config_mode=None, config_mode_freq=None, refresh_freq=None, reboot_if_needed=None, action_after_reboot=None, refresh_mode=None, certificate_id=None, configuration_id=No...
[ "For", "detailed", "descriptions", "of", "the", "parameters", "see", ":", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "PowerShell", "/", "DSC", "/", "metaConfig" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L637-L801
[ "def", "set_lcm_config", "(", "config_mode", "=", "None", ",", "config_mode_freq", "=", "None", ",", "refresh_freq", "=", "None", ",", "reboot_if_needed", "=", "None", ",", "action_after_reboot", "=", "None", ",", "refresh_mode", "=", "None", ",", "certificate_i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sense
Gather lm-sensors data from a given chip To determine the chip to query, use the 'sensors' command and see the leading line in the block. Example: /usr/bin/sensors coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +56.0°C (high = +87.0°C, crit = +105.0°C) Core 0: +52.0°...
salt/modules/sensors.py
def sense(chip, fahrenheit=False): ''' Gather lm-sensors data from a given chip To determine the chip to query, use the 'sensors' command and see the leading line in the block. Example: /usr/bin/sensors coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +56.0°C (high = +87.0...
def sense(chip, fahrenheit=False): ''' Gather lm-sensors data from a given chip To determine the chip to query, use the 'sensors' command and see the leading line in the block. Example: /usr/bin/sensors coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +56.0°C (high = +87.0...
[ "Gather", "lm", "-", "sensors", "data", "from", "a", "given", "chip" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sensors.py#L25-L55
[ "def", "sense", "(", "chip", ",", "fahrenheit", "=", "False", ")", ":", "extra_args", "=", "''", "if", "fahrenheit", "is", "True", ":", "extra_args", "=", "'-f'", "sensors", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'/usr/bin/sensors {0} {1}'", ".", "f...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
convert_duration
Convert the a duration string into XXhYYmZZs format duration Duration to convert Returns: duration_string String representation of duration in XXhYYmZZs format
salt/states/influxdb_retention_policy.py
def convert_duration(duration): ''' Convert the a duration string into XXhYYmZZs format duration Duration to convert Returns: duration_string String representation of duration in XXhYYmZZs format ''' # durations must be specified in days, weeks or hours if duration.endswi...
def convert_duration(duration): ''' Convert the a duration string into XXhYYmZZs format duration Duration to convert Returns: duration_string String representation of duration in XXhYYmZZs format ''' # durations must be specified in days, weeks or hours if duration.endswi...
[ "Convert", "the", "a", "duration", "string", "into", "XXhYYmZZs", "format" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_retention_policy.py#L24-L49
[ "def", "convert_duration", "(", "duration", ")", ":", "# durations must be specified in days, weeks or hours", "if", "duration", ".", "endswith", "(", "'h'", ")", ":", "hours", "=", "int", "(", "duration", ".", "split", "(", "'h'", ")", ")", "elif", "duration", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that given retention policy is present. name Name of the retention policy to create. database Database to create retention policy on.
salt/states/influxdb_retention_policy.py
def present(name, database, duration="7d", replication=1, default=False, **client_args): ''' Ensure that given retention policy is present. name Name of the retention policy to create. database Database to create retention policy on. ''' ret = {'name': n...
def present(name, database, duration="7d", replication=1, default=False, **client_args): ''' Ensure that given retention policy is present. name Name of the retention policy to create. database Database to create retention policy on. ''' ret = {'name': n...
[ "Ensure", "that", "given", "retention", "policy", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_retention_policy.py#L52-L126
[ "def", "present", "(", "name", ",", "database", ",", "duration", "=", "\"7d\"", ",", "replication", "=", "1", ",", "default", "=", "False", ",", "*", "*", "client_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_dict_subset
Return a dictionary of only the subset of keys/values specified in keys
salt/modules/event.py
def _dict_subset(keys, master_dict): ''' Return a dictionary of only the subset of keys/values specified in keys ''' return dict([(k, v) for k, v in six.iteritems(master_dict) if k in keys])
def _dict_subset(keys, master_dict): ''' Return a dictionary of only the subset of keys/values specified in keys ''' return dict([(k, v) for k, v in six.iteritems(master_dict) if k in keys])
[ "Return", "a", "dictionary", "of", "only", "the", "subset", "of", "keys", "/", "values", "specified", "in", "keys" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L27-L31
[ "def", "_dict_subset", "(", "keys", ",", "master_dict", ")", ":", "return", "dict", "(", "[", "(", "k", ",", "v", ")", "for", "k", ",", "v", "in", "six", ".", "iteritems", "(", "master_dict", ")", "if", "k", "in", "keys", "]", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fire_master
Fire an event off up to the master server CLI Example: .. code-block:: bash salt '*' event.fire_master '{"data":"my event data"}' 'tag'
salt/modules/event.py
def fire_master(data, tag, preload=None, timeout=60): ''' Fire an event off up to the master server CLI Example: .. code-block:: bash salt '*' event.fire_master '{"data":"my event data"}' 'tag' ''' if (__opts__.get('local', None) or __opts__.get('file_client', None) == 'local') and no...
def fire_master(data, tag, preload=None, timeout=60): ''' Fire an event off up to the master server CLI Example: .. code-block:: bash salt '*' event.fire_master '{"data":"my event data"}' 'tag' ''' if (__opts__.get('local', None) or __opts__.get('file_client', None) == 'local') and no...
[ "Fire", "an", "event", "off", "up", "to", "the", "master", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L34-L98
[ "def", "fire_master", "(", "data", ",", "tag", ",", "preload", "=", "None", ",", "timeout", "=", "60", ")", ":", "if", "(", "__opts__", ".", "get", "(", "'local'", ",", "None", ")", "or", "__opts__", ".", "get", "(", "'file_client'", ",", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fire
Fire an event on the local minion event bus. Data must be formed as a dict. CLI Example: .. code-block:: bash salt '*' event.fire '{"data":"my event data"}' 'tag'
salt/modules/event.py
def fire(data, tag, timeout=None): ''' Fire an event on the local minion event bus. Data must be formed as a dict. CLI Example: .. code-block:: bash salt '*' event.fire '{"data":"my event data"}' 'tag' ''' if timeout is None: timeout = 60000 else: timeout = timeout...
def fire(data, tag, timeout=None): ''' Fire an event on the local minion event bus. Data must be formed as a dict. CLI Example: .. code-block:: bash salt '*' event.fire '{"data":"my event data"}' 'tag' ''' if timeout is None: timeout = 60000 else: timeout = timeout...
[ "Fire", "an", "event", "on", "the", "local", "minion", "event", "bus", ".", "Data", "must", "be", "formed", "as", "a", "dict", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L101-L128
[ "def", "fire", "(", "data", ",", "tag", ",", "timeout", "=", "None", ")", ":", "if", "timeout", "is", "None", ":", "timeout", "=", "60000", "else", ":", "timeout", "=", "timeout", "*", "1000", "try", ":", "event", "=", "salt", ".", "utils", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
send
Send an event to the Salt Master .. versionadded:: 2014.7.0 :param tag: A tag to give the event. Use slashes to create a namespace for related events. E.g., ``myco/build/buildserver1/start``, ``myco/build/buildserver1/success``, ``myco/build/buildserver1/failure``. :param data: A ...
salt/modules/event.py
def send(tag, data=None, preload=None, with_env=False, with_grains=False, with_pillar=False, with_env_opts=False, timeout=60, **kwargs): ''' Send an event to the Salt Master .. versionadded:: 2014.7.0 :param tag: A tag to give the event. ...
def send(tag, data=None, preload=None, with_env=False, with_grains=False, with_pillar=False, with_env_opts=False, timeout=60, **kwargs): ''' Send an event to the Salt Master .. versionadded:: 2014.7.0 :param tag: A tag to give the event. ...
[ "Send", "an", "event", "to", "the", "Salt", "Master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L131-L247
[ "def", "send", "(", "tag", ",", "data", "=", "None", ",", "preload", "=", "None", ",", "with_env", "=", "False", ",", "with_grains", "=", "False", ",", "with_pillar", "=", "False", ",", "with_env_opts", "=", "False", ",", "timeout", "=", "60", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the named cluster is present with the specified properties. For more information about all of these options see man pg_createcluster(1) version Version of the postgresql cluster name The name of the cluster port Cluster port encoding The character enco...
salt/states/postgres_cluster.py
def present(version, name, port=None, encoding=None, locale=None, datadir=None, allow_group_access=None, data_checksums=None, wal_segsize=None ): ''' Ensure that the named cluster is present with the spec...
def present(version, name, port=None, encoding=None, locale=None, datadir=None, allow_group_access=None, data_checksums=None, wal_segsize=None ): ''' Ensure that the named cluster is present with the spec...
[ "Ensure", "that", "the", "named", "cluster", "is", "present", "with", "the", "specified", "properties", ".", "For", "more", "information", "about", "all", "of", "these", "options", "see", "man", "pg_createcluster", "(", "1", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_cluster.py#L28-L114
[ "def", "present", "(", "version", ",", "name", ",", "port", "=", "None", ",", "encoding", "=", "None", ",", "locale", "=", "None", ",", "datadir", "=", "None", ",", "allow_group_access", "=", "None", ",", "data_checksums", "=", "None", ",", "wal_segsize"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure that the named cluster is absent version Version of the postgresql server of the cluster to remove name The name of the cluster to remove .. versionadded:: 2015.XX
salt/states/postgres_cluster.py
def absent(version, name): ''' Ensure that the named cluster is absent version Version of the postgresql server of the cluster to remove name The name of the cluster to remove .. versionadded:: 2015.XX ''' ret = {'name': name, 'changes': {}, ...
def absent(version, name): ''' Ensure that the named cluster is absent version Version of the postgresql server of the cluster to remove name The name of the cluster to remove .. versionadded:: 2015.XX ''' ret = {'name': name, 'changes': {}, ...
[ "Ensure", "that", "the", "named", "cluster", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_cluster.py#L117-L151
[ "def", "absent", "(", "version", ",", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "#check if cluster exists and remove it", "if", "__salt__", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_send_splunk
Send the results to Splunk. Requires the Splunk HTTP Event Collector running on port 8088. This is available on Splunk Enterprise version 6.3 or higher.
salt/returners/splunk.py
def _send_splunk(event, index_override=None, sourcetype_override=None): ''' Send the results to Splunk. Requires the Splunk HTTP Event Collector running on port 8088. This is available on Splunk Enterprise version 6.3 or higher. ''' # Get Splunk Options opts = _get_options() log.info(st...
def _send_splunk(event, index_override=None, sourcetype_override=None): ''' Send the results to Splunk. Requires the Splunk HTTP Event Collector running on port 8088. This is available on Splunk Enterprise version 6.3 or higher. ''' # Get Splunk Options opts = _get_options() log.info(st...
[ "Send", "the", "results", "to", "Splunk", ".", "Requires", "the", "Splunk", "HTTP", "Event", "Collector", "running", "on", "port", "8088", ".", "This", "is", "available", "on", "Splunk", "Enterprise", "version", "6", ".", "3", "or", "higher", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/splunk.py#L70-L104
[ "def", "_send_splunk", "(", "event", ",", "index_override", "=", "None", ",", "sourcetype_override", "=", "None", ")", ":", "# Get Splunk Options", "opts", "=", "_get_options", "(", ")", "log", ".", "info", "(", "str", "(", "'Options: %s'", ")", ",", "# futu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
output
Print the output data in JSON
salt/output/dson.py
def output(data, **kwargs): # pylint: disable=unused-argument ''' Print the output data in JSON ''' try: dump_opts = {'indent': 4, 'default': repr} if 'output_indent' in __opts__: indent = __opts__.get('output_indent') sort_keys = False if indent =...
def output(data, **kwargs): # pylint: disable=unused-argument ''' Print the output data in JSON ''' try: dump_opts = {'indent': 4, 'default': repr} if 'output_indent' in __opts__: indent = __opts__.get('output_indent') sort_keys = False if indent =...
[ "Print", "the", "output", "data", "in", "JSON" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/dson.py#L37-L74
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "try", ":", "dump_opts", "=", "{", "'indent'", ":", "4", ",", "'default'", ":", "repr", "}", "if", "'output_indent'", "in", "__opts__", ":", "indent", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_salt_params
Try to get all sort of parameters for Server Density server info. NOTE: Missing publicDNS and publicIPs parameters. There might be way of getting them with salt-cloud.
salt/states/serverdensity_device.py
def _get_salt_params(): ''' Try to get all sort of parameters for Server Density server info. NOTE: Missing publicDNS and publicIPs parameters. There might be way of getting them with salt-cloud. ''' all_stats = __salt__['status.all_status']() all_grains = __salt__['grains.items']() par...
def _get_salt_params(): ''' Try to get all sort of parameters for Server Density server info. NOTE: Missing publicDNS and publicIPs parameters. There might be way of getting them with salt-cloud. ''' all_stats = __salt__['status.all_status']() all_grains = __salt__['grains.items']() par...
[ "Try", "to", "get", "all", "sort", "of", "parameters", "for", "Server", "Density", "server", "info", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/serverdensity_device.py#L69-L95
[ "def", "_get_salt_params", "(", ")", ":", "all_stats", "=", "__salt__", "[", "'status.all_status'", "]", "(", ")", "all_grains", "=", "__salt__", "[", "'grains.items'", "]", "(", ")", "params", "=", "{", "}", "try", ":", "params", "[", "'name'", "]", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
monitored
Device is monitored with Server Density. name Device name in Server Density. salt_name If ``True`` (default), takes the name from the ``id`` grain. If ``False``, the provided name is used. group Group name under with device will appear in Server Density dashboard. ...
salt/states/serverdensity_device.py
def monitored(name, group=None, salt_name=True, salt_params=True, agent_version=1, **params): ''' Device is monitored with Server Density. name Device name in Server Density. salt_name If ``True`` (default), takes the name from the ``id`` grain. If ``False``, the provided name ...
def monitored(name, group=None, salt_name=True, salt_params=True, agent_version=1, **params): ''' Device is monitored with Server Density. name Device name in Server Density. salt_name If ``True`` (default), takes the name from the ``id`` grain. If ``False``, the provided name ...
[ "Device", "is", "monitored", "with", "Server", "Density", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/serverdensity_device.py#L98-L215
[ "def", "monitored", "(", "name", ",", "group", "=", "None", ",", "salt_name", "=", "True", ",", "salt_params", "=", "True", ",", "agent_version", "=", "1", ",", "*", "*", "params", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_conn
Return an sqlite connection
salt/queues/sqlite_queue.py
def _conn(queue): ''' Return an sqlite connection ''' queue_dir = __opts__['sqlite_queue_dir'] db = os.path.join(queue_dir, '{0}.db'.format(queue)) log.debug('Connecting to: %s', db) con = sqlite3.connect(db) tables = _list_tables(con) if queue not in tables: _create_table(c...
def _conn(queue): ''' Return an sqlite connection ''' queue_dir = __opts__['sqlite_queue_dir'] db = os.path.join(queue_dir, '{0}.db'.format(queue)) log.debug('Connecting to: %s', db) con = sqlite3.connect(db) tables = _list_tables(con) if queue not in tables: _create_table(c...
[ "Return", "an", "sqlite", "connection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L40-L52
[ "def", "_conn", "(", "queue", ")", ":", "queue_dir", "=", "__opts__", "[", "'sqlite_queue_dir'", "]", "db", "=", "os", ".", "path", ".", "join", "(", "queue_dir", ",", "'{0}.db'", ".", "format", "(", "queue", ")", ")", "log", ".", "debug", "(", "'Con...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_items
Private function to list contents of a queue
salt/queues/sqlite_queue.py
def _list_items(queue): ''' Private function to list contents of a queue ''' con = _conn(queue) with con: cur = con.cursor() cmd = 'SELECT name FROM {0}'.format(queue) log.debug('SQL Query: %s', cmd) cur.execute(cmd) contents = cur.fetchall() return conten...
def _list_items(queue): ''' Private function to list contents of a queue ''' con = _conn(queue) with con: cur = con.cursor() cmd = 'SELECT name FROM {0}'.format(queue) log.debug('SQL Query: %s', cmd) cur.execute(cmd) contents = cur.fetchall() return conten...
[ "Private", "function", "to", "list", "contents", "of", "a", "queue" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L75-L86
[ "def", "_list_items", "(", "queue", ")", ":", "con", "=", "_conn", "(", "queue", ")", "with", "con", ":", "cur", "=", "con", ".", "cursor", "(", ")", "cmd", "=", "'SELECT name FROM {0}'", ".", "format", "(", "queue", ")", "log", ".", "debug", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_queues
Return a list of sqlite databases in the queue_dir
salt/queues/sqlite_queue.py
def _list_queues(): ''' Return a list of sqlite databases in the queue_dir ''' queue_dir = __opts__['sqlite_queue_dir'] files = os.path.join(queue_dir, '*.db') paths = glob.glob(files) queues = [os.path.splitext(os.path.basename(item))[0] for item in paths] return queues
def _list_queues(): ''' Return a list of sqlite databases in the queue_dir ''' queue_dir = __opts__['sqlite_queue_dir'] files = os.path.join(queue_dir, '*.db') paths = glob.glob(files) queues = [os.path.splitext(os.path.basename(item))[0] for item in paths] return queues
[ "Return", "a", "list", "of", "sqlite", "databases", "in", "the", "queue_dir" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L89-L98
[ "def", "_list_queues", "(", ")", ":", "queue_dir", "=", "__opts__", "[", "'sqlite_queue_dir'", "]", "files", "=", "os", ".", "path", ".", "join", "(", "queue_dir", ",", "'*.db'", ")", "paths", "=", "glob", ".", "glob", "(", "files", ")", "queues", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_items
List contents of a queue
salt/queues/sqlite_queue.py
def list_items(queue): ''' List contents of a queue ''' itemstuple = _list_items(queue) items = [item[0] for item in itemstuple] return items
def list_items(queue): ''' List contents of a queue ''' itemstuple = _list_items(queue) items = [item[0] for item in itemstuple] return items
[ "List", "contents", "of", "a", "queue" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L109-L115
[ "def", "list_items", "(", "queue", ")", ":", "itemstuple", "=", "_list_items", "(", "queue", ")", "items", "=", "[", "item", "[", "0", "]", "for", "item", "in", "itemstuple", "]", "return", "items" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_quote_escape
Make sure single quotes are escaped properly in sqlite3 fashion. e.g.: ' becomes ''
salt/queues/sqlite_queue.py
def _quote_escape(item): ''' Make sure single quotes are escaped properly in sqlite3 fashion. e.g.: ' becomes '' ''' rex_sqlquote = re.compile("'", re.M) return rex_sqlquote.sub("''", item)
def _quote_escape(item): ''' Make sure single quotes are escaped properly in sqlite3 fashion. e.g.: ' becomes '' ''' rex_sqlquote = re.compile("'", re.M) return rex_sqlquote.sub("''", item)
[ "Make", "sure", "single", "quotes", "are", "escaped", "properly", "in", "sqlite3", "fashion", ".", "e", ".", "g", ".", ":", "becomes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L126-L134
[ "def", "_quote_escape", "(", "item", ")", ":", "rex_sqlquote", "=", "re", ".", "compile", "(", "\"'\"", ",", "re", ".", "M", ")", "return", "rex_sqlquote", ".", "sub", "(", "\"''\"", ",", "item", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Delete an item or items from a queue
salt/queues/sqlite_queue.py
def delete(queue, items): ''' Delete an item or items from a queue ''' con = _conn(queue) with con: cur = con.cursor() if isinstance(items, six.string_types): items = _quote_escape(items) cmd = """DELETE FROM {0} WHERE name = '{1}'""".format(queue, items) ...
def delete(queue, items): ''' Delete an item or items from a queue ''' con = _conn(queue) with con: cur = con.cursor() if isinstance(items, six.string_types): items = _quote_escape(items) cmd = """DELETE FROM {0} WHERE name = '{1}'""".format(queue, items) ...
[ "Delete", "an", "item", "or", "items", "from", "a", "queue" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L179-L208
[ "def", "delete", "(", "queue", ",", "items", ")", ":", "con", "=", "_conn", "(", "queue", ")", "with", "con", ":", "cur", "=", "con", ".", "cursor", "(", ")", "if", "isinstance", "(", "items", ",", "six", ".", "string_types", ")", ":", "items", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pop
Pop one or more or all items from the queue return them.
salt/queues/sqlite_queue.py
def pop(queue, quantity=1, is_runner=False): ''' Pop one or more or all items from the queue return them. ''' cmd = 'SELECT name FROM {0}'.format(queue) if quantity != 'all': try: quantity = int(quantity) except ValueError as exc: error_txt = ('Quantity must b...
def pop(queue, quantity=1, is_runner=False): ''' Pop one or more or all items from the queue return them. ''' cmd = 'SELECT name FROM {0}'.format(queue) if quantity != 'all': try: quantity = int(quantity) except ValueError as exc: error_txt = ('Quantity must b...
[ "Pop", "one", "or", "more", "or", "all", "items", "from", "the", "queue", "return", "them", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L211-L244
[ "def", "pop", "(", "queue", ",", "quantity", "=", "1", ",", "is_runner", "=", "False", ")", ":", "cmd", "=", "'SELECT name FROM {0}'", ".", "format", "(", "queue", ")", "if", "quantity", "!=", "'all'", ":", "try", ":", "quantity", "=", "int", "(", "q...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_topics
Returns a list of the all topics.. CLI example:: salt myminion boto_sns.get_all_topics
salt/modules/boto_sns.py
def get_all_topics(region=None, key=None, keyid=None, profile=None): ''' Returns a list of the all topics.. CLI example:: salt myminion boto_sns.get_all_topics ''' cache_key = _cache_get_key() try: return __context__[cache_key] except KeyError: pass conn = _get...
def get_all_topics(region=None, key=None, keyid=None, profile=None): ''' Returns a list of the all topics.. CLI example:: salt myminion boto_sns.get_all_topics ''' cache_key = _cache_get_key() try: return __context__[cache_key] except KeyError: pass conn = _get...
[ "Returns", "a", "list", "of", "the", "all", "topics", ".." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L78-L99
[ "def", "get_all_topics", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "cache_key", "=", "_cache_get_key", "(", ")", "try", ":", "return", "__context__", "[", "cache_key", "]", "e...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check to see if an SNS topic exists. CLI example:: salt myminion boto_sns.exists mytopic region=us-east-1
salt/modules/boto_sns.py
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an SNS topic exists. CLI example:: salt myminion boto_sns.exists mytopic region=us-east-1 ''' topics = get_all_topics(region=region, key=key, keyid=keyid, profile=profile) ...
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an SNS topic exists. CLI example:: salt myminion boto_sns.exists mytopic region=us-east-1 ''' topics = get_all_topics(region=region, key=key, keyid=keyid, profile=profile) ...
[ "Check", "to", "see", "if", "an", "SNS", "topic", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L102-L115
[ "def", "exists", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "topics", "=", "get_all_topics", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create an SNS topic. CLI example to create a topic:: salt myminion boto_sns.create mytopic region=us-east-1
salt/modules/boto_sns.py
def create(name, region=None, key=None, keyid=None, profile=None): ''' Create an SNS topic. CLI example to create a topic:: salt myminion boto_sns.create mytopic region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.create_topic(name) log....
def create(name, region=None, key=None, keyid=None, profile=None): ''' Create an SNS topic. CLI example to create a topic:: salt myminion boto_sns.create mytopic region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.create_topic(name) log....
[ "Create", "an", "SNS", "topic", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L118-L130
[ "def", "create", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Delete an SNS topic. CLI example to delete a topic:: salt myminion boto_sns.delete mytopic region=us-east-1
salt/modules/boto_sns.py
def delete(name, region=None, key=None, keyid=None, profile=None): ''' Delete an SNS topic. CLI example to delete a topic:: salt myminion boto_sns.delete mytopic region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.delete_topic(get_arn(name, ...
def delete(name, region=None, key=None, keyid=None, profile=None): ''' Delete an SNS topic. CLI example to delete a topic:: salt myminion boto_sns.delete mytopic region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.delete_topic(get_arn(name, ...
[ "Delete", "an", "SNS", "topic", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L133-L145
[ "def", "delete", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_subscriptions_by_topic
Get list of all subscriptions to a specific topic. CLI example to delete a topic:: salt myminion boto_sns.get_all_subscriptions_by_topic mytopic region=us-east-1
salt/modules/boto_sns.py
def get_all_subscriptions_by_topic(name, region=None, key=None, keyid=None, profile=None): ''' Get list of all subscriptions to a specific topic. CLI example to delete a topic:: salt myminion boto_sns.get_all_subscriptions_by_topic mytopic region=us-east-1 ''' cache_key = _subscriptions_ca...
def get_all_subscriptions_by_topic(name, region=None, key=None, keyid=None, profile=None): ''' Get list of all subscriptions to a specific topic. CLI example to delete a topic:: salt myminion boto_sns.get_all_subscriptions_by_topic mytopic region=us-east-1 ''' cache_key = _subscriptions_ca...
[ "Get", "list", "of", "all", "subscriptions", "to", "a", "specific", "topic", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L148-L165
[ "def", "get_all_subscriptions_by_topic", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "cache_key", "=", "_subscriptions_cache_key", "(", "name", ")", "try", ":", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subscribe
Subscribe to a Topic. CLI example to delete a topic:: salt myminion boto_sns.subscribe mytopic https https://www.example.com/sns-endpoint region=us-east-1
salt/modules/boto_sns.py
def subscribe(topic, protocol, endpoint, region=None, key=None, keyid=None, profile=None): ''' Subscribe to a Topic. CLI example to delete a topic:: salt myminion boto_sns.subscribe mytopic https https://www.example.com/sns-endpoint region=us-east-1 ''' conn = _get_conn(region=region, key=...
def subscribe(topic, protocol, endpoint, region=None, key=None, keyid=None, profile=None): ''' Subscribe to a Topic. CLI example to delete a topic:: salt myminion boto_sns.subscribe mytopic https https://www.example.com/sns-endpoint region=us-east-1 ''' conn = _get_conn(region=region, key=...
[ "Subscribe", "to", "a", "Topic", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L168-L183
[ "def", "subscribe", "(", "topic", ",", "protocol", ",", "endpoint", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unsubscribe
Unsubscribe a specific SubscriptionArn of a topic. CLI Example: .. code-block:: bash salt myminion boto_sns.unsubscribe my_topic my_subscription_arn region=us-east-1 .. versionadded:: 2016.11.0
salt/modules/boto_sns.py
def unsubscribe(topic, subscription_arn, region=None, key=None, keyid=None, profile=None): ''' Unsubscribe a specific SubscriptionArn of a topic. CLI Example: .. code-block:: bash salt myminion boto_sns.unsubscribe my_topic my_subscription_arn region=us-east-1 .. versionadded:: 2016.11.0...
def unsubscribe(topic, subscription_arn, region=None, key=None, keyid=None, profile=None): ''' Unsubscribe a specific SubscriptionArn of a topic. CLI Example: .. code-block:: bash salt myminion boto_sns.unsubscribe my_topic my_subscription_arn region=us-east-1 .. versionadded:: 2016.11.0...
[ "Unsubscribe", "a", "specific", "SubscriptionArn", "of", "a", "topic", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L186-L211
[ "def", "unsubscribe", "(", "topic", ",", "subscription_arn", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_arn
Returns the full ARN for a given topic name. CLI example:: salt myminion boto_sns.get_arn mytopic
salt/modules/boto_sns.py
def get_arn(name, region=None, key=None, keyid=None, profile=None): ''' Returns the full ARN for a given topic name. CLI example:: salt myminion boto_sns.get_arn mytopic ''' if name.startswith('arn:aws:sns:'): return name account_id = __salt__['boto_iam.get_account_id']( ...
def get_arn(name, region=None, key=None, keyid=None, profile=None): ''' Returns the full ARN for a given topic name. CLI example:: salt myminion boto_sns.get_arn mytopic ''' if name.startswith('arn:aws:sns:'): return name account_id = __salt__['boto_iam.get_account_id']( ...
[ "Returns", "the", "full", "ARN", "for", "a", "given", "topic", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L214-L229
[ "def", "get_arn", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "name", ".", "startswith", "(", "'arn:aws:sns:'", ")", ":", "return", "name", "account_id", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
current_ioloop
A context manager that will set the current ioloop to io_loop for the context
salt/utils/asynchronous.py
def current_ioloop(io_loop): ''' A context manager that will set the current ioloop to io_loop for the context ''' orig_loop = tornado.ioloop.IOLoop.current() io_loop.make_current() try: yield finally: orig_loop.make_current()
def current_ioloop(io_loop): ''' A context manager that will set the current ioloop to io_loop for the context ''' orig_loop = tornado.ioloop.IOLoop.current() io_loop.make_current() try: yield finally: orig_loop.make_current()
[ "A", "context", "manager", "that", "will", "set", "the", "current", "ioloop", "to", "io_loop", "for", "the", "context" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/asynchronous.py#L15-L24
[ "def", "current_ioloop", "(", "io_loop", ")", ":", "orig_loop", "=", "tornado", ".", "ioloop", ".", "IOLoop", ".", "current", "(", ")", "io_loop", ".", "make_current", "(", ")", "try", ":", "yield", "finally", ":", "orig_loop", ".", "make_current", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_top_file_envs
Get all environments from the top file
salt/modules/saltutil.py
def _get_top_file_envs(): ''' Get all environments from the top file ''' try: return __context__['saltutil._top_file_envs'] except KeyError: try: st_ = salt.state.HighState(__opts__, initial_pillar=__pillar__) top = st_.g...
def _get_top_file_envs(): ''' Get all environments from the top file ''' try: return __context__['saltutil._top_file_envs'] except KeyError: try: st_ = salt.state.HighState(__opts__, initial_pillar=__pillar__) top = st_.g...
[ "Get", "all", "environments", "from", "the", "top", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L78-L98
[ "def", "_get_top_file_envs", "(", ")", ":", "try", ":", "return", "__context__", "[", "'saltutil._top_file_envs'", "]", "except", "KeyError", ":", "try", ":", "st_", "=", "salt", ".", "state", ".", "HighState", "(", "__opts__", ",", "initial_pillar", "=", "_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sync
Sync the given directory in the given environment
salt/modules/saltutil.py
def _sync(form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync the given directory in the given environment ''' if saltenv is None: saltenv = _get_top_file_envs() if isinstance(saltenv, six.string_types): saltenv = saltenv.split(',') ret, touched = salt.uti...
def _sync(form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync the given directory in the given environment ''' if saltenv is None: saltenv = _get_top_file_envs() if isinstance(saltenv, six.string_types): saltenv = saltenv.split(',') ret, touched = salt.uti...
[ "Sync", "the", "given", "directory", "in", "the", "given", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L101-L123
[ "def", "_sync", "(", "form", ",", "saltenv", "=", "None", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "if", "saltenv", "is", "None", ":", "saltenv", "=", "_get_top_file_envs", "(", ")", "if", "isinstance", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Update the salt minion from the URL defined in opts['update_url'] SaltStack, Inc provides the latest builds here: update_url: https://repo.saltstack.com/windows/ Be aware that as of 2014-8-11 there's a bug in esky such that only the latest version available in the update_url can be downloaded and insta...
salt/modules/saltutil.py
def update(version=None): ''' Update the salt minion from the URL defined in opts['update_url'] SaltStack, Inc provides the latest builds here: update_url: https://repo.saltstack.com/windows/ Be aware that as of 2014-8-11 there's a bug in esky such that only the latest version available in the ...
def update(version=None): ''' Update the salt minion from the URL defined in opts['update_url'] SaltStack, Inc provides the latest builds here: update_url: https://repo.saltstack.com/windows/ Be aware that as of 2014-8-11 there's a bug in esky such that only the latest version available in the ...
[ "Update", "the", "salt", "minion", "from", "the", "URL", "defined", "in", "opts", "[", "update_url", "]", "SaltStack", "Inc", "provides", "the", "latest", "builds", "here", ":", "update_url", ":", "https", ":", "//", "repo", ".", "saltstack", ".", "com", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L126-L189
[ "def", "update", "(", "version", "=", "None", ")", ":", "ret", "=", "{", "}", "if", "not", "HAS_ESKY", ":", "ret", "[", "'_error'", "]", "=", "'Esky not available as import'", "return", "ret", "if", "not", "getattr", "(", "sys", ",", "'frozen'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_beacons
.. versionadded:: 2015.5.1 Sync beacons from ``salt://_beacons`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. If not passed, then all environments configured in the :ref:`top files <st...
salt/modules/saltutil.py
def sync_beacons(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.5.1 Sync beacons from ``salt://_beacons`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-sep...
def sync_beacons(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.5.1 Sync beacons from ``salt://_beacons`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-sep...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "1" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L192-L228
[ "def", "sync_beacons", "(", "saltenv", "=", "None", ",", "refresh", "=", "True", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "ret", "=", "_sync", "(", "'beacons'", ",", "saltenv", ",", "extmod_whitelist", ",", "ext...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_sdb
.. versionadded:: 2015.5.8,2015.8.3 Sync sdb modules from ``salt://_sdb`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. If not passed, then all environments configured in the :ref:`top files ...
salt/modules/saltutil.py
def sync_sdb(saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.5.8,2015.8.3 Sync sdb modules from ``salt://_sdb`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated li...
def sync_sdb(saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.5.8,2015.8.3 Sync sdb modules from ``salt://_sdb`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated li...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "8", "2015", ".", "8", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L231-L264
[ "def", "sync_sdb", "(", "saltenv", "=", "None", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "ret", "=", "_sync", "(", "'sdb'", ",", "saltenv", ",", "extmod_whitelist", ",", "extmod_blacklist", ")", "return", "ret" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_modules
.. versionadded:: 0.10.0 Sync execution modules from ``salt://_modules`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. If not passed, then all environments configured in the :ref:`top files ...
salt/modules/saltutil.py
def sync_modules(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 0.10.0 Sync execution modules from ``salt://_modules`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a c...
def sync_modules(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 0.10.0 Sync execution modules from ``salt://_modules`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a c...
[ "..", "versionadded", "::", "0", ".", "10", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L267-L320
[ "def", "sync_modules", "(", "saltenv", "=", "None", ",", "refresh", "=", "True", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "ret", "=", "_sync", "(", "'modules'", ",", "saltenv", ",", "extmod_whitelist", ",", "ext...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
refresh_grains
.. versionadded:: 2016.3.6,2016.11.4,2017.7.0 Refresh the minion's grains without syncing custom grains modules from ``salt://_grains``. .. note:: The available execution modules will be reloaded as part of this proceess, as grains can affect which modules are available. refresh_pilla...
salt/modules/saltutil.py
def refresh_grains(**kwargs): ''' .. versionadded:: 2016.3.6,2016.11.4,2017.7.0 Refresh the minion's grains without syncing custom grains modules from ``salt://_grains``. .. note:: The available execution modules will be reloaded as part of this proceess, as grains can affect which...
def refresh_grains(**kwargs): ''' .. versionadded:: 2016.3.6,2016.11.4,2017.7.0 Refresh the minion's grains without syncing custom grains modules from ``salt://_grains``. .. note:: The available execution modules will be reloaded as part of this proceess, as grains can affect which...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "6", "2016", ".", "11", ".", "4", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L362-L392
[ "def", "refresh_grains", "(", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "_refresh_pillar", "=", "kwargs", ".", "pop", "(", "'refresh_pillar'", ",", "True", ")", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_grains
.. versionadded:: 0.10.0 Sync grains modules from ``salt://_grains`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. If not passed, then all environments configured in the :ref:`top files ...
salt/modules/saltutil.py
def sync_grains(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 0.10.0 Sync grains modules from ``salt://_grains`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-...
def sync_grains(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 0.10.0 Sync grains modules from ``salt://_grains`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-...
[ "..", "versionadded", "::", "0", ".", "10", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L395-L433
[ "def", "sync_grains", "(", "saltenv", "=", "None", ",", "refresh", "=", "True", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "ret", "=", "_sync", "(", "'grains'", ",", "saltenv", ",", "extmod_whitelist", ",", "extmo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_matchers
.. versionadded:: 2019.2.0 Sync engine modules from ``salt://_matchers`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list. If not passed, then all environments configured in the :ref:`top files ...
salt/modules/saltutil.py
def sync_matchers(saltenv=None, refresh=False, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2019.2.0 Sync engine modules from ``salt://_matchers`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a...
def sync_matchers(saltenv=None, refresh=False, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2019.2.0 Sync engine modules from ``salt://_matchers`` to the minion saltenv The fileserver environment from which to sync. To sync from more than one environment, pass a...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L553-L588
[ "def", "sync_matchers", "(", "saltenv", "=", "None", ",", "refresh", "=", "False", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "ret", "=", "_sync", "(", "'matchers'", ",", "saltenv", ",", "extmod_whitelist", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_extmods
.. versionadded:: 2017.7.0 List Salt modules which have been synced externally CLI Examples: .. code-block:: bash salt '*' saltutil.list_extmods
salt/modules/saltutil.py
def list_extmods(): ''' .. versionadded:: 2017.7.0 List Salt modules which have been synced externally CLI Examples: .. code-block:: bash salt '*' saltutil.list_extmods ''' ret = {} ext_dir = os.path.join(__opts__['cachedir'], 'extmods') mod_types = os.listdir(ext_dir) ...
def list_extmods(): ''' .. versionadded:: 2017.7.0 List Salt modules which have been synced externally CLI Examples: .. code-block:: bash salt '*' saltutil.list_extmods ''' ret = {} ext_dir = os.path.join(__opts__['cachedir'], 'extmods') mod_types = os.listdir(ext_dir) ...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L859-L880
[ "def", "list_extmods", "(", ")", ":", "ret", "=", "{", "}", "ext_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'extmods'", ")", "mod_types", "=", "os", ".", "listdir", "(", "ext_dir", ")", "for", "mod_type"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_pillar
.. versionadded:: 2015.8.11,2016.3.2 Sync pillar modules from the ``salt://_pillar`` directory on the Salt fileserver. This function is environment-aware, pass the desired environment to grab the contents of the ``_pillar`` directory from that environment. The default environment, if none is specified,...
salt/modules/saltutil.py
def sync_pillar(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.8.11,2016.3.2 Sync pillar modules from the ``salt://_pillar`` directory on the Salt fileserver. This function is environment-aware, pass the desired environment to grab the contents...
def sync_pillar(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionadded:: 2015.8.11,2016.3.2 Sync pillar modules from the ``salt://_pillar`` directory on the Salt fileserver. This function is environment-aware, pass the desired environment to grab the contents...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "11", "2016", ".", "3", ".", "2" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L922-L960
[ "def", "sync_pillar", "(", "saltenv", "=", "None", ",", "refresh", "=", "True", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "if", "__opts__", "[", "'file_client'", "]", "!=", "'local'", ":", "raise", "CommandExecutio...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync_all
.. versionchanged:: 2015.8.11,2016.3.2 On masterless minions, pillar modules are now synced, and refreshed when ``refresh`` is set to ``True``. Sync down all of the dynamic modules from the file server for a specific environment. This function synchronizes custom modules, states, beacons, g...
salt/modules/saltutil.py
def sync_all(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionchanged:: 2015.8.11,2016.3.2 On masterless minions, pillar modules are now synced, and refreshed when ``refresh`` is set to ``True``. Sync down all of the dynamic modules from the file serv...
def sync_all(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None): ''' .. versionchanged:: 2015.8.11,2016.3.2 On masterless minions, pillar modules are now synced, and refreshed when ``refresh`` is set to ``True``. Sync down all of the dynamic modules from the file serv...
[ "..", "versionchanged", "::", "2015", ".", "8", ".", "11", "2016", ".", "3", ".", "2", "On", "masterless", "minions", "pillar", "modules", "are", "now", "synced", "and", "refreshed", "when", "refresh", "is", "set", "to", "True", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L963-L1034
[ "def", "sync_all", "(", "saltenv", "=", "None", ",", "refresh", "=", "True", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "log", ".", "debug", "(", "'Syncing all'", ")", "ret", "=", "{", "}", "ret", "[", "'cloud...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
refresh_pillar
Signal the minion to refresh the pillar data. .. versionchanged:: Neon The ``async`` argument has been added. The default value is True. CLI Example: .. code-block:: bash salt '*' saltutil.refresh_pillar salt '*' saltutil.refresh_pillar async=False
salt/modules/saltutil.py
def refresh_pillar(**kwargs): ''' Signal the minion to refresh the pillar data. .. versionchanged:: Neon The ``async`` argument has been added. The default value is True. CLI Example: .. code-block:: bash salt '*' saltutil.refresh_pillar salt '*' saltutil.refresh_pillar a...
def refresh_pillar(**kwargs): ''' Signal the minion to refresh the pillar data. .. versionchanged:: Neon The ``async`` argument has been added. The default value is True. CLI Example: .. code-block:: bash salt '*' saltutil.refresh_pillar salt '*' saltutil.refresh_pillar a...
[ "Signal", "the", "minion", "to", "refresh", "the", "pillar", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1073-L1104
[ "def", "refresh_pillar", "(", "*", "*", "kwargs", ")", ":", "asynchronous", "=", "bool", "(", "kwargs", ".", "get", "(", "'async'", ",", "True", ")", ")", "try", ":", "if", "asynchronous", ":", "# If we're going to block, first setup a listener", "ret", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_running
If the named function is running return the data associated with it/them. The argument can be a glob CLI Example: .. code-block:: bash salt '*' saltutil.is_running state.highstate
salt/modules/saltutil.py
def is_running(fun): ''' If the named function is running return the data associated with it/them. The argument can be a glob CLI Example: .. code-block:: bash salt '*' saltutil.is_running state.highstate ''' run = running() ret = [] for data in run: if fnmatch.fnm...
def is_running(fun): ''' If the named function is running return the data associated with it/them. The argument can be a glob CLI Example: .. code-block:: bash salt '*' saltutil.is_running state.highstate ''' run = running() ret = [] for data in run: if fnmatch.fnm...
[ "If", "the", "named", "function", "is", "running", "return", "the", "data", "associated", "with", "it", "/", "them", ".", "The", "argument", "can", "be", "a", "glob" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1143-L1159
[ "def", "is_running", "(", "fun", ")", ":", "run", "=", "running", "(", ")", "ret", "=", "[", "]", "for", "data", "in", "run", ":", "if", "fnmatch", ".", "fnmatch", "(", "data", ".", "get", "(", "'fun'", ",", "''", ")", ",", "fun", ")", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear_cache
Forcibly removes all caches on a minion. .. versionadded:: 2014.7.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bash salt '*' saltutil.clear_cache days=7
salt/modules/saltutil.py
def clear_cache(days=-1): ''' Forcibly removes all caches on a minion. .. versionadded:: 2014.7.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bash salt '*' sa...
def clear_cache(days=-1): ''' Forcibly removes all caches on a minion. .. versionadded:: 2014.7.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bash salt '*' sa...
[ "Forcibly", "removes", "all", "caches", "on", "a", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1175-L1204
[ "def", "clear_cache", "(", "days", "=", "-", "1", ")", ":", "threshold", "=", "time", ".", "time", "(", ")", "-", "days", "*", "24", "*", "60", "*", "60", "for", "root", ",", "dirs", ",", "files", "in", "salt", ".", "utils", ".", "files", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear_job_cache
Forcibly removes job cache folders and files on a minion. .. versionadded:: 2018.3.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bash salt '*' saltutil.clear_job_cach...
salt/modules/saltutil.py
def clear_job_cache(hours=24): ''' Forcibly removes job cache folders and files on a minion. .. versionadded:: 2018.3.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bas...
def clear_job_cache(hours=24): ''' Forcibly removes job cache folders and files on a minion. .. versionadded:: 2018.3.0 WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it. CLI Example: .. code-block:: bas...
[ "Forcibly", "removes", "job", "cache", "folders", "and", "files", "on", "a", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1207-L1234
[ "def", "clear_job_cache", "(", "hours", "=", "24", ")", ":", "threshold", "=", "time", ".", "time", "(", ")", "-", "hours", "*", "60", "*", "60", "for", "root", ",", "dirs", ",", "files", "in", "salt", ".", "utils", ".", "files", ".", "safe_walk", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find_cached_job
Return the data for a specific cached job id. Note this only works if cache_jobs has previously been set to True on the minion. CLI Example: .. code-block:: bash salt '*' saltutil.find_cached_job <job id>
salt/modules/saltutil.py
def find_cached_job(jid): ''' Return the data for a specific cached job id. Note this only works if cache_jobs has previously been set to True on the minion. CLI Example: .. code-block:: bash salt '*' saltutil.find_cached_job <job id> ''' serial = salt.payload.Serial(__opts__) ...
def find_cached_job(jid): ''' Return the data for a specific cached job id. Note this only works if cache_jobs has previously been set to True on the minion. CLI Example: .. code-block:: bash salt '*' saltutil.find_cached_job <job id> ''' serial = salt.payload.Serial(__opts__) ...
[ "Return", "the", "data", "for", "a", "specific", "cached", "job", "id", ".", "Note", "this", "only", "works", "if", "cache_jobs", "has", "previously", "been", "set", "to", "True", "on", "the", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1289-L1322
[ "def", "find_cached_job", "(", "jid", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "proc_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'minion_jobs'", ")", "job_dir", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
signal_job
Sends a signal to the named salt job's process CLI Example: .. code-block:: bash salt '*' saltutil.signal_job <job id> 15
salt/modules/saltutil.py
def signal_job(jid, sig): ''' Sends a signal to the named salt job's process CLI Example: .. code-block:: bash salt '*' saltutil.signal_job <job id> 15 ''' if HAS_PSUTIL is False: log.warning('saltutil.signal job called, but psutil is not installed. ' 'Inst...
def signal_job(jid, sig): ''' Sends a signal to the named salt job's process CLI Example: .. code-block:: bash salt '*' saltutil.signal_job <job id> 15 ''' if HAS_PSUTIL is False: log.warning('saltutil.signal job called, but psutil is not installed. ' 'Inst...
[ "Sends", "a", "signal", "to", "the", "named", "salt", "job", "s", "process" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1325-L1360
[ "def", "signal_job", "(", "jid", ",", "sig", ")", ":", "if", "HAS_PSUTIL", "is", "False", ":", "log", ".", "warning", "(", "'saltutil.signal job called, but psutil is not installed. '", "'Install psutil to ensure more reliable and accurate PID '", "'management.'", ")", "for...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
term_all_jobs
Sends a termination signal (SIGTERM 15) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.term_all_jobs
salt/modules/saltutil.py
def term_all_jobs(): ''' Sends a termination signal (SIGTERM 15) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.term_all_jobs ''' ret = [] for data in running(): ret.append(signal_job(data['jid'], signal.SIGTERM)) return ret
def term_all_jobs(): ''' Sends a termination signal (SIGTERM 15) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.term_all_jobs ''' ret = [] for data in running(): ret.append(signal_job(data['jid'], signal.SIGTERM)) return ret
[ "Sends", "a", "termination", "signal", "(", "SIGTERM", "15", ")", "to", "all", "currently", "running", "jobs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1376-L1389
[ "def", "term_all_jobs", "(", ")", ":", "ret", "=", "[", "]", "for", "data", "in", "running", "(", ")", ":", "ret", ".", "append", "(", "signal_job", "(", "data", "[", "'jid'", "]", ",", "signal", ".", "SIGTERM", ")", ")", "return", "ret" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
kill_all_jobs
Sends a kill signal (SIGKILL 9) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.kill_all_jobs
salt/modules/saltutil.py
def kill_all_jobs(): ''' Sends a kill signal (SIGKILL 9) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.kill_all_jobs ''' # Some OS's (Win32) don't have SIGKILL, so use salt_SIGKILL which is set to # an appropriate value for the operating system ...
def kill_all_jobs(): ''' Sends a kill signal (SIGKILL 9) to all currently running jobs CLI Example: .. code-block:: bash salt '*' saltutil.kill_all_jobs ''' # Some OS's (Win32) don't have SIGKILL, so use salt_SIGKILL which is set to # an appropriate value for the operating system ...
[ "Sends", "a", "kill", "signal", "(", "SIGKILL", "9", ")", "to", "all", "currently", "running", "jobs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1407-L1422
[ "def", "kill_all_jobs", "(", ")", ":", "# Some OS's (Win32) don't have SIGKILL, so use salt_SIGKILL which is set to", "# an appropriate value for the operating system this is running on.", "ret", "=", "[", "]", "for", "data", "in", "running", "(", ")", ":", "ret", ".", "appen...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
regen_keys
Used to regenerate the minion keys. CLI Example: .. code-block:: bash salt '*' saltutil.regen_keys
salt/modules/saltutil.py
def regen_keys(): ''' Used to regenerate the minion keys. CLI Example: .. code-block:: bash salt '*' saltutil.regen_keys ''' for fn_ in os.listdir(__opts__['pki_dir']): path = os.path.join(__opts__['pki_dir'], fn_) try: os.remove(path) except os.err...
def regen_keys(): ''' Used to regenerate the minion keys. CLI Example: .. code-block:: bash salt '*' saltutil.regen_keys ''' for fn_ in os.listdir(__opts__['pki_dir']): path = os.path.join(__opts__['pki_dir'], fn_) try: os.remove(path) except os.err...
[ "Used", "to", "regenerate", "the", "minion", "keys", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1425-L1444
[ "def", "regen_keys", "(", ")", ":", "for", "fn_", "in", "os", ".", "listdir", "(", "__opts__", "[", "'pki_dir'", "]", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'pki_dir'", "]", ",", "fn_", ")", "try", ":", "os"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
revoke_auth
The minion sends a request to the master to revoke its own key. Note that the minion session will be revoked and the minion may not be able to return the result of this command back to the master. If the 'preserve_minion_cache' flag is set to True, the master cache for this minion will not be removed. ...
salt/modules/saltutil.py
def revoke_auth(preserve_minion_cache=False): ''' The minion sends a request to the master to revoke its own key. Note that the minion session will be revoked and the minion may not be able to return the result of this command back to the master. If the 'preserve_minion_cache' flag is set to True, ...
def revoke_auth(preserve_minion_cache=False): ''' The minion sends a request to the master to revoke its own key. Note that the minion session will be revoked and the minion may not be able to return the result of this command back to the master. If the 'preserve_minion_cache' flag is set to True, ...
[ "The", "minion", "sends", "a", "request", "to", "the", "master", "to", "revoke", "its", "own", "key", ".", "Note", "that", "the", "minion", "session", "will", "be", "revoked", "and", "the", "minion", "may", "not", "be", "able", "to", "return", "the", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1447-L1483
[ "def", "revoke_auth", "(", "preserve_minion_cache", "=", "False", ")", ":", "masters", "=", "list", "(", ")", "ret", "=", "True", "if", "'master_uri_list'", "in", "__opts__", ":", "for", "master_uri", "in", "__opts__", "[", "'master_uri_list'", "]", ":", "ma...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cmd
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Assuming this minion is a master, execute a salt command CLI Example: .. code-block:: bash salt '*' saltutil.cmd
salt/modules/saltutil.py
def cmd(tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, ssh=False, **kwargs): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``...
def cmd(tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, ssh=False, **kwargs): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1537-L1584
[ "def", "cmd", "(", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "kwarg", "=", "None", ",", "ssh", "=", "False", ",", "*", "*", "kwargs", ")", ":", "cfgf...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cmd_iter
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Assuming this minion is a master, execute a salt command CLI Example: .. code-block:: bash salt '*' saltutil.cmd_iter
salt/modules/saltutil.py
def cmd_iter(tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, ssh=False, **kwargs): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, ea...
def cmd_iter(tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, ssh=False, **kwargs): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, ea...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1587-L1622
[ "def", "cmd_iter", "(", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "kwarg", "=", "None", ",", "ssh", "=", "False", ",", "*", "*", "kwargs", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
runner
Execute a runner function. This function must be run on the master, either by targeting a minion running on a master or by using salt-call on a master. .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function ...
salt/modules/saltutil.py
def runner(name, arg=None, kwarg=None, full_return=False, saltenv='base', jid=None, asynchronous=False, **kwargs): ''' Execute a runner function. This function must be run on the master, either by targeting a minion running on a master or by using salt-call on a master. .. versionadded:: 2014.7.0 ...
def runner(name, arg=None, kwarg=None, full_return=False, saltenv='base', jid=None, asynchronous=False, **kwargs): ''' Execute a runner function. This function must be run on the master, either by targeting a minion running on a master or by using salt-call on a master. .. versionadded:: 2014.7.0 ...
[ "Execute", "a", "runner", "function", ".", "This", "function", "must", "be", "run", "on", "the", "master", "either", "by", "targeting", "a", "minion", "running", "on", "a", "master", "or", "by", "using", "salt", "-", "call", "on", "a", "master", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1625-L1697
[ "def", "runner", "(", "name", ",", "arg", "=", "None", ",", "kwarg", "=", "None", ",", "full_return", "=", "False", ",", "saltenv", "=", "'base'", ",", "jid", "=", "None", ",", "asynchronous", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wheel
Execute a wheel module and function. This function must be run against a minion that is local to the master. .. versionadded:: 2014.7.0 name The name of the function to run args Any positional arguments to pass to the wheel function. A common example of this would be the ``mat...
salt/modules/saltutil.py
def wheel(name, *args, **kwargs): ''' Execute a wheel module and function. This function must be run against a minion that is local to the master. .. versionadded:: 2014.7.0 name The name of the function to run args Any positional arguments to pass to the wheel function. A com...
def wheel(name, *args, **kwargs): ''' Execute a wheel module and function. This function must be run against a minion that is local to the master. .. versionadded:: 2014.7.0 name The name of the function to run args Any positional arguments to pass to the wheel function. A com...
[ "Execute", "a", "wheel", "module", "and", "function", ".", "This", "function", "must", "be", "run", "against", "a", "minion", "that", "is", "local", "to", "the", "master", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1700-L1794
[ "def", "wheel", "(", "name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "jid", "=", "kwargs", ".", "pop", "(", "'__orchestration_jid__'", ",", "None", ")", "saltenv", "=", "kwargs", ".", "pop", "(", "'__env__'", ",", "'base'", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mmodule
Loads minion modules from an environment so that they can be used in pillars for that environment CLI Example: .. code-block:: bash salt '*' saltutil.mmodule base test.ping
salt/modules/saltutil.py
def mmodule(saltenv, fun, *args, **kwargs): ''' Loads minion modules from an environment so that they can be used in pillars for that environment CLI Example: .. code-block:: bash salt '*' saltutil.mmodule base test.ping ''' mminion = _MMinion(saltenv) return mminion.functions...
def mmodule(saltenv, fun, *args, **kwargs): ''' Loads minion modules from an environment so that they can be used in pillars for that environment CLI Example: .. code-block:: bash salt '*' saltutil.mmodule base test.ping ''' mminion = _MMinion(saltenv) return mminion.functions...
[ "Loads", "minion", "modules", "from", "an", "environment", "so", "that", "they", "can", "be", "used", "in", "pillars", "for", "that", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L1830-L1842
[ "def", "mmodule", "(", "saltenv", ",", "fun", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "mminion", "=", "_MMinion", "(", "saltenv", ")", "return", "mminion", ".", "functions", "[", "fun", "]", "(", "*", "args", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_session
Create a session to be used when connecting to Zenoss.
salt/modules/zenoss.py
def _session(): ''' Create a session to be used when connecting to Zenoss. ''' config = __salt__['config.option']('zenoss') session = requests.session() session.auth = (config.get('username'), config.get('password')) session.verify = False session.headers.update({'Content-type': 'applic...
def _session(): ''' Create a session to be used when connecting to Zenoss. ''' config = __salt__['config.option']('zenoss') session = requests.session() session.auth = (config.get('username'), config.get('password')) session.verify = False session.headers.update({'Content-type': 'applic...
[ "Create", "a", "session", "to", "be", "used", "when", "connecting", "to", "Zenoss", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zenoss.py#L68-L78
[ "def", "_session", "(", ")", ":", "config", "=", "__salt__", "[", "'config.option'", "]", "(", "'zenoss'", ")", "session", "=", "requests", ".", "session", "(", ")", "session", ".", "auth", "=", "(", "config", ".", "get", "(", "'username'", ")", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_router_request
Make a request to the Zenoss API router
salt/modules/zenoss.py
def _router_request(router, method, data=None): ''' Make a request to the Zenoss API router ''' if router not in ROUTERS: return False req_data = salt.utils.json.dumps([dict( action=router, method=method, data=data, type='rpc', tid=1)]) config = ...
def _router_request(router, method, data=None): ''' Make a request to the Zenoss API router ''' if router not in ROUTERS: return False req_data = salt.utils.json.dumps([dict( action=router, method=method, data=data, type='rpc', tid=1)]) config = ...
[ "Make", "a", "request", "to", "the", "Zenoss", "API", "router" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zenoss.py#L81-L107
[ "def", "_router_request", "(", "router", ",", "method", ",", "data", "=", "None", ")", ":", "if", "router", "not", "in", "ROUTERS", ":", "return", "False", "req_data", "=", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "[", "dict", "(", "acti...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find_device
Find a device in Zenoss. If device not found, returns None. Parameters: device: (Optional) Will use the grain 'fqdn' by default CLI Example: salt '*' zenoss.find_device
salt/modules/zenoss.py
def find_device(device=None): ''' Find a device in Zenoss. If device not found, returns None. Parameters: device: (Optional) Will use the grain 'fqdn' by default CLI Example: salt '*' zenoss.find_device ''' data = [{'uid': '/zport/dmd/Devices', 'params': {}, 'limit': N...
def find_device(device=None): ''' Find a device in Zenoss. If device not found, returns None. Parameters: device: (Optional) Will use the grain 'fqdn' by default CLI Example: salt '*' zenoss.find_device ''' data = [{'uid': '/zport/dmd/Devices', 'params': {}, 'limit': N...
[ "Find", "a", "device", "in", "Zenoss", ".", "If", "device", "not", "found", "returns", "None", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zenoss.py#L118-L139
[ "def", "find_device", "(", "device", "=", "None", ")", ":", "data", "=", "[", "{", "'uid'", ":", "'/zport/dmd/Devices'", ",", "'params'", ":", "{", "}", ",", "'limit'", ":", "None", "}", "]", "all_devices", "=", "_router_request", "(", "'DeviceRouter'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_device
A function to connect to a zenoss server and add a new device entry. Parameters: device: (Optional) Will use the grain 'fqdn' by default. device_class: (Optional) The device class to use. If none, will determine based on kernel grain. collector: (Optional) The collector to us...
salt/modules/zenoss.py
def add_device(device=None, device_class=None, collector='localhost', prod_state=1000): ''' A function to connect to a zenoss server and add a new device entry. Parameters: device: (Optional) Will use the grain 'fqdn' by default. device_class: (Optional) The device class to use. I...
def add_device(device=None, device_class=None, collector='localhost', prod_state=1000): ''' A function to connect to a zenoss server and add a new device entry. Parameters: device: (Optional) Will use the grain 'fqdn' by default. device_class: (Optional) The device class to use. I...
[ "A", "function", "to", "connect", "to", "a", "zenoss", "server", "and", "add", "a", "new", "device", "entry", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zenoss.py#L161-L183
[ "def", "add_device", "(", "device", "=", "None", ",", "device_class", "=", "None", ",", "collector", "=", "'localhost'", ",", "prod_state", "=", "1000", ")", ":", "if", "not", "device", ":", "device", "=", "__salt__", "[", "'grains.get'", "]", "(", "'fqd...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_prod_state
A function to set the prod_state in zenoss. Parameters: prod_state: (Required) Integer value of the state device: (Optional) Will use the grain 'fqdn' by default. CLI Example: salt zenoss.set_prod_state 1000 hostname
salt/modules/zenoss.py
def set_prod_state(prod_state, device=None): ''' A function to set the prod_state in zenoss. Parameters: prod_state: (Required) Integer value of the state device: (Optional) Will use the grain 'fqdn' by default. CLI Example: salt zenoss.set_prod_state 1000 hostname ...
def set_prod_state(prod_state, device=None): ''' A function to set the prod_state in zenoss. Parameters: prod_state: (Required) Integer value of the state device: (Optional) Will use the grain 'fqdn' by default. CLI Example: salt zenoss.set_prod_state 1000 hostname ...
[ "A", "function", "to", "set", "the", "prod_state", "in", "zenoss", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zenoss.py#L186-L208
[ "def", "set_prod_state", "(", "prod_state", ",", "device", "=", "None", ")", ":", "if", "not", "device", ":", "device", "=", "__salt__", "[", "'grains.get'", "]", "(", "'fqdn'", ")", "device_object", "=", "find_device", "(", "device", ")", "if", "not", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_valid_deleted_file
Filters file path against unwanted directories and decides whether file is marked as deleted. Returns: True if file is desired deleted file, else False. Args: path: A string - path to file
salt/modules/restartcheck.py
def _valid_deleted_file(path): ''' Filters file path against unwanted directories and decides whether file is marked as deleted. Returns: True if file is desired deleted file, else False. Args: path: A string - path to file ''' ret = False if path.endswith(' (deleted)'): ...
def _valid_deleted_file(path): ''' Filters file path against unwanted directories and decides whether file is marked as deleted. Returns: True if file is desired deleted file, else False. Args: path: A string - path to file ''' ret = False if path.endswith(' (deleted)'): ...
[ "Filters", "file", "path", "against", "unwanted", "directories", "and", "decides", "whether", "file", "is", "marked", "as", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/restartcheck.py#L93-L112
[ "def", "_valid_deleted_file", "(", "path", ")", ":", "ret", "=", "False", "if", "path", ".", "endswith", "(", "' (deleted)'", ")", ":", "ret", "=", "True", "if", "re", ".", "compile", "(", "r\"\\(path inode=[0-9]+\\)$\"", ")", ".", "search", "(", "path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_deleted_files
Iterates over /proc/PID/maps and /proc/PID/fd links and returns list of desired deleted files. Returns: List of deleted files to analyze, False on failure.
salt/modules/restartcheck.py
def _deleted_files(): ''' Iterates over /proc/PID/maps and /proc/PID/fd links and returns list of desired deleted files. Returns: List of deleted files to analyze, False on failure. ''' deleted_files = [] for proc in psutil.process_iter(): # pylint: disable=too-many-nested-blocks ...
def _deleted_files(): ''' Iterates over /proc/PID/maps and /proc/PID/fd links and returns list of desired deleted files. Returns: List of deleted files to analyze, False on failure. ''' deleted_files = [] for proc in psutil.process_iter(): # pylint: disable=too-many-nested-blocks ...
[ "Iterates", "over", "/", "proc", "/", "PID", "/", "maps", "and", "/", "proc", "/", "PID", "/", "fd", "links", "and", "returns", "list", "of", "desired", "deleted", "files", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/restartcheck.py#L115-L182
[ "def", "_deleted_files", "(", ")", ":", "deleted_files", "=", "[", "]", "for", "proc", "in", "psutil", ".", "process_iter", "(", ")", ":", "# pylint: disable=too-many-nested-blocks", "try", ":", "pinfo", "=", "proc", ".", "as_dict", "(", "attrs", "=", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_output
Formats the output of the restartcheck module. Returns: String - formatted output. Args: kernel_restart: indicates that newer kernel is instaled packages: list of packages that should be restarted verbose: enables extensive output restartable: list of restartable packag...
salt/modules/restartcheck.py
def _format_output(kernel_restart, packages, verbose, restartable, nonrestartable, restartservicecommands, restartinitcommands): ''' Formats the output of the restartcheck module. Returns: String - formatted output. Args: kernel_restart: indicates that newer kernel i...
def _format_output(kernel_restart, packages, verbose, restartable, nonrestartable, restartservicecommands, restartinitcommands): ''' Formats the output of the restartcheck module. Returns: String - formatted output. Args: kernel_restart: indicates that newer kernel i...
[ "Formats", "the", "output", "of", "the", "restartcheck", "module", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/restartcheck.py#L185-L240
[ "def", "_format_output", "(", "kernel_restart", ",", "packages", ",", "verbose", ",", "restartable", ",", "nonrestartable", ",", "restartservicecommands", ",", "restartinitcommands", ")", ":", "if", "not", "verbose", ":", "packages", "=", "restartable", "+", "nonr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_kernel_versions_debian
Last installed kernel name, for Debian based systems. Returns: List with possible names of last installed kernel as they are probably interpreted in output of `uname -a` command.
salt/modules/restartcheck.py
def _kernel_versions_debian(): ''' Last installed kernel name, for Debian based systems. Returns: List with possible names of last installed kernel as they are probably interpreted in output of `uname -a` command. ''' kernel_get_selections = __salt__['cmd.run']('dpkg --get-s...
def _kernel_versions_debian(): ''' Last installed kernel name, for Debian based systems. Returns: List with possible names of last installed kernel as they are probably interpreted in output of `uname -a` command. ''' kernel_get_selections = __salt__['cmd.run']('dpkg --get-s...
[ "Last", "installed", "kernel", "name", "for", "Debian", "based", "systems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/restartcheck.py#L243-L278
[ "def", "_kernel_versions_debian", "(", ")", ":", "kernel_get_selections", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'dpkg --get-selections linux-image-*'", ")", "kernels", "=", "[", "]", "kernel_versions", "=", "[", "]", "for", "line", "in", "kernel_get_selectio...
e8541fd6e744ab0df786c0f76102e41631f45d46