repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/states/esxi.py
ntp_configured
def ntp_configured(name, service_running, ntp_servers=None, service_policy=None, service_restart=False, update_datetime=False): ''' Ensures a host's NTP server configuration such as setting NTP servers, ensuring the ...
python
def ntp_configured(name, service_running, ntp_servers=None, service_policy=None, service_restart=False, update_datetime=False): ''' Ensures a host's NTP server configuration such as setting NTP servers, ensuring the ...
[ "def", "ntp_configured", "(", "name", ",", "service_running", ",", "ntp_servers", "=", "None", ",", "service_policy", "=", "None", ",", "service_restart", "=", "False", ",", "update_datetime", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ...
Ensures a host's NTP server configuration such as setting NTP servers, ensuring the NTP daemon is running or stopped, or restarting the NTP daemon for the ESXi host. name Name of the state. service_running Ensures the running state of the ntp daemon for the host. Boolean value where ...
[ "Ensures", "a", "host", "s", "NTP", "server", "configuration", "such", "as", "setting", "NTP", "servers", "ensuring", "the", "NTP", "daemon", "is", "running", "or", "stopped", "or", "restarting", "the", "NTP", "daemon", "for", "the", "ESXi", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L326-L497
train
saltstack/salt
salt/states/esxi.py
vmotion_configured
def vmotion_configured(name, enabled, device='vmk0'): ''' Configures a host's VMotion properties such as enabling VMotion and setting the device VirtualNic that VMotion will use. name Name of the state. enabled Ensures whether or not VMotion should be enabled on a host as a boolean...
python
def vmotion_configured(name, enabled, device='vmk0'): ''' Configures a host's VMotion properties such as enabling VMotion and setting the device VirtualNic that VMotion will use. name Name of the state. enabled Ensures whether or not VMotion should be enabled on a host as a boolean...
[ "def", "vmotion_configured", "(", "name", ",", "enabled", ",", "device", "=", "'vmk0'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "esxi_cmd", "=...
Configures a host's VMotion properties such as enabling VMotion and setting the device VirtualNic that VMotion will use. name Name of the state. enabled Ensures whether or not VMotion should be enabled on a host as a boolean value where ``True`` indicates that VMotion should be ena...
[ "Configures", "a", "host", "s", "VMotion", "properties", "such", "as", "enabling", "VMotion", "and", "setting", "the", "device", "VirtualNic", "that", "VMotion", "will", "use", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L500-L569
train
saltstack/salt
salt/states/esxi.py
vsan_configured
def vsan_configured(name, enabled, add_disks_to_vsan=False): ''' Configures a host's VSAN properties such as enabling or disabling VSAN, or adding VSAN-eligible disks to the VSAN system for the host. name Name of the state. enabled Ensures whether or not VSAN should be enabled on a...
python
def vsan_configured(name, enabled, add_disks_to_vsan=False): ''' Configures a host's VSAN properties such as enabling or disabling VSAN, or adding VSAN-eligible disks to the VSAN system for the host. name Name of the state. enabled Ensures whether or not VSAN should be enabled on a...
[ "def", "vsan_configured", "(", "name", ",", "enabled", ",", "add_disks_to_vsan", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "esxi_cmd...
Configures a host's VSAN properties such as enabling or disabling VSAN, or adding VSAN-eligible disks to the VSAN system for the host. name Name of the state. enabled Ensures whether or not VSAN should be enabled on a host as a boolean value where ``True`` indicates that VSAN shoul...
[ "Configures", "a", "host", "s", "VSAN", "properties", "such", "as", "enabling", "or", "disabling", "VSAN", "or", "adding", "VSAN", "-", "eligible", "disks", "to", "the", "VSAN", "system", "for", "the", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L572-L666
train
saltstack/salt
salt/states/esxi.py
ssh_configured
def ssh_configured(name, service_running, ssh_key=None, ssh_key_file=None, service_policy=None, service_restart=False, certificate_verify=False): ''' Manage the SSH configuration for a host includin...
python
def ssh_configured(name, service_running, ssh_key=None, ssh_key_file=None, service_policy=None, service_restart=False, certificate_verify=False): ''' Manage the SSH configuration for a host includin...
[ "def", "ssh_configured", "(", "name", ",", "service_running", ",", "ssh_key", "=", "None", ",", "ssh_key_file", "=", "None", ",", "service_policy", "=", "None", ",", "service_restart", "=", "False", ",", "certificate_verify", "=", "False", ")", ":", "ret", "...
Manage the SSH configuration for a host including whether or not SSH is running or the presence of a given SSH key. Note: Only one ssh key can be uploaded for root. Uploading a second key will replace any existing key. name Name of the state. service_running Ensures whether or not the ...
[ "Manage", "the", "SSH", "configuration", "for", "a", "host", "including", "whether", "or", "not", "SSH", "is", "running", "or", "the", "presence", "of", "a", "given", "SSH", "key", ".", "Note", ":", "Only", "one", "ssh", "key", "can", "be", "uploaded", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L669-L866
train
saltstack/salt
salt/states/esxi.py
syslog_configured
def syslog_configured(name, syslog_configs, firewall=True, reset_service=True, reset_syslog_config=False, reset_configs=None): ''' Ensures the specified syslog configuration parameters. By default, ...
python
def syslog_configured(name, syslog_configs, firewall=True, reset_service=True, reset_syslog_config=False, reset_configs=None): ''' Ensures the specified syslog configuration parameters. By default, ...
[ "def", "syslog_configured", "(", "name", ",", "syslog_configs", ",", "firewall", "=", "True", ",", "reset_service", "=", "True", ",", "reset_syslog_config", "=", "False", ",", "reset_configs", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ...
Ensures the specified syslog configuration parameters. By default, this state will reset the syslog service after any new or changed parameters are set successfully. name Name of the state. syslog_configs Name of parameter to set (corresponds to the command line switch for esxc...
[ "Ensures", "the", "specified", "syslog", "configuration", "parameters", ".", "By", "default", "this", "state", "will", "reset", "the", "syslog", "service", "after", "any", "new", "or", "changed", "parameters", "are", "set", "successfully", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L869-L1025
train
saltstack/salt
salt/states/esxi.py
diskgroups_configured
def diskgroups_configured(name, diskgroups, erase_disks=False): ''' Configures the disk groups to use for vsan. This function will do the following: 1. Check whether or not all disks in the diskgroup spec exist, and raises and errors if they do not. 2. Create diskgroups with the correct di...
python
def diskgroups_configured(name, diskgroups, erase_disks=False): ''' Configures the disk groups to use for vsan. This function will do the following: 1. Check whether or not all disks in the diskgroup spec exist, and raises and errors if they do not. 2. Create diskgroups with the correct di...
[ "def", "diskgroups_configured", "(", "name", ",", "diskgroups", ",", "erase_disks", "=", "False", ")", ":", "proxy_details", "=", "__salt__", "[", "'esxi.get_details'", "]", "(", ")", "hostname", "=", "proxy_details", "[", "'host'", "]", "if", "not", "proxy_de...
Configures the disk groups to use for vsan. This function will do the following: 1. Check whether or not all disks in the diskgroup spec exist, and raises and errors if they do not. 2. Create diskgroups with the correct disk configurations if diskgroup (identified by the cache disk canonica...
[ "Configures", "the", "disk", "groups", "to", "use", "for", "vsan", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L1030-L1300
train
saltstack/salt
salt/states/esxi.py
host_cache_configured
def host_cache_configured(name, enabled, datastore, swap_size='100%', dedicated_backing_disk=False, erase_backing_disk=False): ''' Configures the host cache used for swapping. It will do the following: 1. Checks if backing disk exists 2. Creates...
python
def host_cache_configured(name, enabled, datastore, swap_size='100%', dedicated_backing_disk=False, erase_backing_disk=False): ''' Configures the host cache used for swapping. It will do the following: 1. Checks if backing disk exists 2. Creates...
[ "def", "host_cache_configured", "(", "name", ",", "enabled", ",", "datastore", ",", "swap_size", "=", "'100%'", ",", "dedicated_backing_disk", "=", "False", ",", "erase_backing_disk", "=", "False", ")", ":", "log", ".", "trace", "(", "'enabled = %s'", ",", "en...
Configures the host cache used for swapping. It will do the following: 1. Checks if backing disk exists 2. Creates the VMFS datastore if doesn't exist (datastore partition will be created and use the entire disk) 3. Raises an error if ``dedicated_backing_disk`` is ``True`` and partitions ...
[ "Configures", "the", "host", "cache", "used", "for", "swapping", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxi.py#L1305-L1594
train
saltstack/salt
salt/states/cimc.py
hostname
def hostname(name, hostname=None): ''' Ensures that the hostname is set to the specified value. .. versionadded:: 2019.2.0 name: The name of the module function to execute. hostname(str): The hostname of the server. SLS Example: .. code-block:: yaml set_name: cimc.hos...
python
def hostname(name, hostname=None): ''' Ensures that the hostname is set to the specified value. .. versionadded:: 2019.2.0 name: The name of the module function to execute. hostname(str): The hostname of the server. SLS Example: .. code-block:: yaml set_name: cimc.hos...
[ "def", "hostname", "(", "name", ",", "hostname", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "current_name", "=", "__salt__", "[", "'cimc.get_hostname'", "]", "(", ")", "req_change", "=", "False", "try", ":", "if", "current_name", ...
Ensures that the hostname is set to the specified value. .. versionadded:: 2019.2.0 name: The name of the module function to execute. hostname(str): The hostname of the server. SLS Example: .. code-block:: yaml set_name: cimc.hostname: - hostname: foobar
[ "Ensures", "that", "the", "hostname", "is", "set", "to", "the", "specified", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L46-L100
train
saltstack/salt
salt/states/cimc.py
logging_levels
def logging_levels(name, remote=None, local=None): ''' Ensures that the logging levels are set on the device. The logging levels must match the following options: emergency, alert, critical, error, warning, notice, informational, debug. .. versionadded:: 2019.2.0 name: The name of the module f...
python
def logging_levels(name, remote=None, local=None): ''' Ensures that the logging levels are set on the device. The logging levels must match the following options: emergency, alert, critical, error, warning, notice, informational, debug. .. versionadded:: 2019.2.0 name: The name of the module f...
[ "def", "logging_levels", "(", "name", ",", "remote", "=", "None", ",", "local", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "syslog_conf", "=", "__salt__", "[", "'cimc.get_syslog_settings'", "]", "(", ")", "req_change", "=", "False...
Ensures that the logging levels are set on the device. The logging levels must match the following options: emergency, alert, critical, error, warning, notice, informational, debug. .. versionadded:: 2019.2.0 name: The name of the module function to execute. remote(str): The logging level for SYS...
[ "Ensures", "that", "the", "logging", "levels", "are", "set", "on", "the", "device", ".", "The", "logging", "levels", "must", "match", "the", "following", "options", ":", "emergency", "alert", "critical", "error", "warning", "notice", "informational", "debug", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L103-L165
train
saltstack/salt
salt/states/cimc.py
ntp
def ntp(name, servers): ''' Ensures that the NTP servers are configured. Servers are provided as an individual string or list format. Only four NTP servers will be reviewed. Any entries past four will be ignored. name: The name of the module function to execute. servers(str, list): The IP address ...
python
def ntp(name, servers): ''' Ensures that the NTP servers are configured. Servers are provided as an individual string or list format. Only four NTP servers will be reviewed. Any entries past four will be ignored. name: The name of the module function to execute. servers(str, list): The IP address ...
[ "def", "ntp", "(", "name", ",", "servers", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ntp_servers", "=", "[", "''", ",", "''", ",", "''", ",", "''", "]", "# Parse our server arguments", "if", "isinstance", "(", "servers", ",", "list", ")"...
Ensures that the NTP servers are configured. Servers are provided as an individual string or list format. Only four NTP servers will be reviewed. Any entries past four will be ignored. name: The name of the module function to execute. servers(str, list): The IP address or FQDN of the NTP servers. SLS...
[ "Ensures", "that", "the", "NTP", "servers", "are", "configured", ".", "Servers", "are", "provided", "as", "an", "individual", "string", "or", "list", "format", ".", "Only", "four", "NTP", "servers", "will", "be", "reviewed", ".", "Any", "entries", "past", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L168-L247
train
saltstack/salt
salt/states/cimc.py
power_configuration
def power_configuration(name, policy=None, delayType=None, delayValue=None): ''' Ensures that the power configuration is configured on the system. This is only available on some C-Series servers. .. versionadded:: 2019.2.0 name: The name of the module function to execute. policy(str): The act...
python
def power_configuration(name, policy=None, delayType=None, delayValue=None): ''' Ensures that the power configuration is configured on the system. This is only available on some C-Series servers. .. versionadded:: 2019.2.0 name: The name of the module function to execute. policy(str): The act...
[ "def", "power_configuration", "(", "name", ",", "policy", "=", "None", ",", "delayType", "=", "None", ",", "delayValue", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "power_conf", "=", "__salt__", "[", "'cimc.get_power_configuration'", ...
Ensures that the power configuration is configured on the system. This is only available on some C-Series servers. .. versionadded:: 2019.2.0 name: The name of the module function to execute. policy(str): The action to be taken when chassis power is restored after an unexpected power loss. This c...
[ "Ensures", "that", "the", "power", "configuration", "is", "configured", "on", "the", "system", ".", "This", "is", "only", "available", "on", "some", "C", "-", "Series", "servers", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L250-L348
train
saltstack/salt
salt/states/cimc.py
syslog
def syslog(name, primary=None, secondary=None): ''' Ensures that the syslog servers are set to the specified values. A value of None will be ignored. name: The name of the module function to execute. primary(str): The IP address or FQDN of the primary syslog server. secondary(str): The IP address...
python
def syslog(name, primary=None, secondary=None): ''' Ensures that the syslog servers are set to the specified values. A value of None will be ignored. name: The name of the module function to execute. primary(str): The IP address or FQDN of the primary syslog server. secondary(str): The IP address...
[ "def", "syslog", "(", "name", ",", "primary", "=", "None", ",", "secondary", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "conf", "=", "__salt__", "[", "'cimc.get_syslog'", "]", "(", ")", "req_change", "=", "False", "if", "prima...
Ensures that the syslog servers are set to the specified values. A value of None will be ignored. name: The name of the module function to execute. primary(str): The IP address or FQDN of the primary syslog server. secondary(str): The IP address or FQDN of the secondary syslog server. SLS Example: ...
[ "Ensures", "that", "the", "syslog", "servers", "are", "set", "to", "the", "specified", "values", ".", "A", "value", "of", "None", "will", "be", "ignored", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L351-L434
train
saltstack/salt
salt/states/cimc.py
user
def user(name, id='', user='', priv='', password='', status='active'): ''' Ensures that a user is configured on the device. Due to being unable to verify the user password. This is a forced operation. .. versionadded:: 2019.2.0 name: The name of the module function to execute. id(int): The us...
python
def user(name, id='', user='', priv='', password='', status='active'): ''' Ensures that a user is configured on the device. Due to being unable to verify the user password. This is a forced operation. .. versionadded:: 2019.2.0 name: The name of the module function to execute. id(int): The us...
[ "def", "user", "(", "name", ",", "id", "=", "''", ",", "user", "=", "''", ",", "priv", "=", "''", ",", "password", "=", "''", ",", "status", "=", "'active'", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "user_conf", "=", "__salt__", "[...
Ensures that a user is configured on the device. Due to being unable to verify the user password. This is a forced operation. .. versionadded:: 2019.2.0 name: The name of the module function to execute. id(int): The user ID slot on the device. user(str): The username of the user. priv(str):...
[ "Ensures", "that", "a", "user", "is", "configured", "on", "the", "device", ".", "Due", "to", "being", "unable", "to", "verify", "the", "user", "password", ".", "This", "is", "a", "forced", "operation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cimc.py#L437-L503
train
saltstack/salt
salt/proxy/esxcluster.py
init
def init(opts): ''' This function gets called when the proxy starts up. For login the protocol and port are cached. ''' log.debug('Initting esxcluster proxy module in process %s', os.getpid()) log.debug('Validating esxcluster proxy input') schema = EsxclusterProxySchema.serialize() l...
python
def init(opts): ''' This function gets called when the proxy starts up. For login the protocol and port are cached. ''' log.debug('Initting esxcluster proxy module in process %s', os.getpid()) log.debug('Validating esxcluster proxy input') schema = EsxclusterProxySchema.serialize() l...
[ "def", "init", "(", "opts", ")", ":", "log", ".", "debug", "(", "'Initting esxcluster proxy module in process %s'", ",", "os", ".", "getpid", "(", ")", ")", "log", ".", "debug", "(", "'Validating esxcluster proxy input'", ")", "schema", "=", "EsxclusterProxySchema...
This function gets called when the proxy starts up. For login the protocol and port are cached.
[ "This", "function", "gets", "called", "when", "the", "proxy", "starts", "up", ".", "For", "login", "the", "protocol", "and", "port", "are", "cached", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxcluster.py#L197-L257
train
saltstack/salt
salt/proxy/esxcluster.py
find_credentials
def find_credentials(): ''' Cycle through all the possible credentials and return the first one that works. ''' # if the username and password were already found don't fo though the # connection process again if 'username' in DETAILS and 'password' in DETAILS: return DETAILS['userna...
python
def find_credentials(): ''' Cycle through all the possible credentials and return the first one that works. ''' # if the username and password were already found don't fo though the # connection process again if 'username' in DETAILS and 'password' in DETAILS: return DETAILS['userna...
[ "def", "find_credentials", "(", ")", ":", "# if the username and password were already found don't fo though the", "# connection process again", "if", "'username'", "in", "DETAILS", "and", "'password'", "in", "DETAILS", ":", "return", "DETAILS", "[", "'username'", "]", ",",...
Cycle through all the possible credentials and return the first one that works.
[ "Cycle", "through", "all", "the", "possible", "credentials", "and", "return", "the", "first", "one", "that", "works", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxcluster.py#L281-L302
train
saltstack/salt
salt/roster/flat.py
targets
def targets(tgt, tgt_type='glob', **kwargs): ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' template = get_roster_file(__opts__) rend = salt.loader.render(__opts__, {}) raw = compile_template(template, ...
python
def targets(tgt, tgt_type='glob', **kwargs): ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' template = get_roster_file(__opts__) rend = salt.loader.render(__opts__, {}) raw = compile_template(template, ...
[ "def", "targets", "(", "tgt", ",", "tgt_type", "=", "'glob'", ",", "*", "*", "kwargs", ")", ":", "template", "=", "get_roster_file", "(", "__opts__", ")", "rend", "=", "salt", ".", "loader", ".", "render", "(", "__opts__", ",", "{", "}", ")", "raw", ...
Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster
[ "Return", "the", "targets", "from", "the", "flat", "yaml", "file", "checks", "opts", "for", "location", "but", "defaults", "to", "/", "etc", "/", "salt", "/", "roster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/flat.py#L18-L36
train
saltstack/salt
salt/cli/key.py
SaltKey.run
def run(self): ''' Execute salt-key ''' import salt.key self.parse_args() self.setup_logfile_logger() verify_log(self.config) key = salt.key.KeyCLI(self.config) if check_user(self.config['user']): key.run()
python
def run(self): ''' Execute salt-key ''' import salt.key self.parse_args() self.setup_logfile_logger() verify_log(self.config) key = salt.key.KeyCLI(self.config) if check_user(self.config['user']): key.run()
[ "def", "run", "(", "self", ")", ":", "import", "salt", ".", "key", "self", ".", "parse_args", "(", ")", "self", ".", "setup_logfile_logger", "(", ")", "verify_log", "(", "self", ".", "config", ")", "key", "=", "salt", ".", "key", ".", "KeyCLI", "(", ...
Execute salt-key
[ "Execute", "salt", "-", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/key.py#L14-L26
train
saltstack/salt
salt/sdb/tism.py
get
def get(key, service=None, profile=None): # pylint: disable=W0613 ''' Get a decrypted secret from the tISMd API ''' if not profile.get('url') or not profile.get('token'): raise SaltConfigurationError("url and/or token missing from the tism sdb profile") request = {"token": profile['token'...
python
def get(key, service=None, profile=None): # pylint: disable=W0613 ''' Get a decrypted secret from the tISMd API ''' if not profile.get('url') or not profile.get('token'): raise SaltConfigurationError("url and/or token missing from the tism sdb profile") request = {"token": profile['token'...
[ "def", "get", "(", "key", ",", "service", "=", "None", ",", "profile", "=", "None", ")", ":", "# pylint: disable=W0613", "if", "not", "profile", ".", "get", "(", "'url'", ")", "or", "not", "profile", ".", "get", "(", "'token'", ")", ":", "raise", "Sa...
Get a decrypted secret from the tISMd API
[ "Get", "a", "decrypted", "secret", "from", "the", "tISMd", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/tism.py#L53-L78
train
saltstack/salt
salt/pillar/postgres.py
ext_pillar
def ext_pillar(minion_id, pillar, *args, **kwargs): ''' Execute queries against POSTGRES, merge and return as a dict ''' return POSTGRESExtPillar().fetch(minion_id, pillar, *args, **kwargs)
python
def ext_pillar(minion_id, pillar, *args, **kwargs): ''' Execute queries against POSTGRES, merge and return as a dict ''' return POSTGRESExtPillar().fetch(minion_id, pillar, *args, **kwargs)
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "POSTGRESExtPillar", "(", ")", ".", "fetch", "(", "minion_id", ",", "pillar", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Execute queries against POSTGRES, merge and return as a dict
[ "Execute", "queries", "against", "POSTGRES", "merge", "and", "return", "as", "a", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/postgres.py#L112-L119
train
saltstack/salt
salt/pillar/postgres.py
POSTGRESExtPillar._get_cursor
def _get_cursor(self): ''' Yield a POSTGRES cursor ''' _options = self._get_options() conn = psycopg2.connect(host=_options['host'], user=_options['user'], password=_options['pass'], d...
python
def _get_cursor(self): ''' Yield a POSTGRES cursor ''' _options = self._get_options() conn = psycopg2.connect(host=_options['host'], user=_options['user'], password=_options['pass'], d...
[ "def", "_get_cursor", "(", "self", ")", ":", "_options", "=", "self", ".", "_get_options", "(", ")", "conn", "=", "psycopg2", ".", "connect", "(", "host", "=", "_options", "[", "'host'", "]", ",", "user", "=", "_options", "[", "'user'", "]", ",", "pa...
Yield a POSTGRES cursor
[ "Yield", "a", "POSTGRES", "cursor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/postgres.py#L85-L102
train
saltstack/salt
salt/pillar/postgres.py
POSTGRESExtPillar.extract_queries
def extract_queries(self, args, kwargs): ''' This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts. ''' return super(POSTGRESExtPillar, self).extract_queries(args, kwargs)
python
def extract_queries(self, args, kwargs): ''' This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts. ''' return super(POSTGRESExtPillar, self).extract_queries(args, kwargs)
[ "def", "extract_queries", "(", "self", ",", "args", ",", "kwargs", ")", ":", "return", "super", "(", "POSTGRESExtPillar", ",", "self", ")", ".", "extract_queries", "(", "args", ",", "kwargs", ")" ]
This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts.
[ "This", "function", "normalizes", "the", "config", "block", "into", "a", "set", "of", "queries", "we", "can", "use", ".", "The", "return", "is", "a", "list", "of", "consistently", "laid", "out", "dicts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/postgres.py#L104-L109
train
saltstack/salt
salt/modules/ps.py
_get_proc_cmdline
def _get_proc_cmdline(proc): ''' Returns the cmdline of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.cmdline() if PSUTIL2 else proc.cmdline) except (psutil.NoSuchProcess, psutil.AccessDenied): return []
python
def _get_proc_cmdline(proc): ''' Returns the cmdline of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.cmdline() if PSUTIL2 else proc.cmdline) except (psutil.NoSuchProcess, psutil.AccessDenied): return []
[ "def", "_get_proc_cmdline", "(", "proc", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "cmdline", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "cmdline", ")", "except", "(", "psutil", ".", "NoS...
Returns the cmdline of a Process instance. It's backward compatible with < 2.0 versions of psutil.
[ "Returns", "the", "cmdline", "of", "a", "Process", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L50-L59
train
saltstack/salt
salt/modules/ps.py
_get_proc_create_time
def _get_proc_create_time(proc): ''' Returns the create_time of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.create_time() if PSUTIL2 else proc.create_time) except (psutil.NoSuchProcess, psutil.AccessDenied): ...
python
def _get_proc_create_time(proc): ''' Returns the create_time of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.create_time() if PSUTIL2 else proc.create_time) except (psutil.NoSuchProcess, psutil.AccessDenied): ...
[ "def", "_get_proc_create_time", "(", "proc", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "create_time", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "create_time", ")", "except", "(", "psutil", ...
Returns the create_time of a Process instance. It's backward compatible with < 2.0 versions of psutil.
[ "Returns", "the", "create_time", "of", "a", "Process", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L62-L71
train
saltstack/salt
salt/modules/ps.py
_get_proc_name
def _get_proc_name(proc): ''' Returns the name of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.name() if PSUTIL2 else proc.name) except (psutil.NoSuchProcess, psutil.AccessDenied): return []
python
def _get_proc_name(proc): ''' Returns the name of a Process instance. It's backward compatible with < 2.0 versions of psutil. ''' try: return salt.utils.data.decode(proc.name() if PSUTIL2 else proc.name) except (psutil.NoSuchProcess, psutil.AccessDenied): return []
[ "def", "_get_proc_name", "(", "proc", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "name", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "name", ")", "except", "(", "psutil", ".", "NoSuchProces...
Returns the name of a Process instance. It's backward compatible with < 2.0 versions of psutil.
[ "Returns", "the", "name", "of", "a", "Process", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L74-L83
train
saltstack/salt
salt/modules/ps.py
_get_proc_status
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
python
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", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "status", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "status", ")", "except", "(", "psutil", ".", "NoSuch...
Returns the status of a Process instance. It's backward compatible with < 2.0 versions of psutil.
[ "Returns", "the", "status", "of", "a", "Process", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L86-L95
train
saltstack/salt
salt/modules/ps.py
_get_proc_username
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): ...
python
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", ")", ":", "try", ":", "return", "salt", ".", "utils", ".", "data", ".", "decode", "(", "proc", ".", "username", "(", ")", "if", "PSUTIL2", "else", "proc", ".", "username", ")", "except", "(", "psutil", ".", "...
Returns the username of a Process instance. It's backward compatible with < 2.0 versions of psutil.
[ "Returns", "the", "username", "of", "a", "Process", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L98-L107
train
saltstack/salt
salt/modules/ps.py
top
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...
python
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", ")", ":", "result", "=", "[", "]", "start_usage", "=", "{", "}", "for", "pid", "in", "psutil", ".", "pids", "(", ")", ":", "try", ":", "process", "=", "psutil", ".", "Proces...
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
[ "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...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L119-L178
train
saltstack/salt
salt/modules/ps.py
proc_info
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 ...
python
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", ")", ":", "try", ":", "proc", "=", "psutil", ".", "Process", "(", "pid", ")", "return", "proc", ".", "as_dict", "(", "attrs", ")", "except", "(", "psutil", ".", "NoSuchProcess", ",", "psutil"...
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...
[ "Return", "a", "dictionary", "of", "information", "for", "a", "process", "id", "(", "PID", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L194-L217
train
saltstack/salt
salt/modules/ps.py
kill_pid
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...
python
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", ")", ":", "try", ":", "psutil", ".", "Process", "(", "pid", ")", ".", "send_signal", "(", "signal", ")", "return", "True", "except", "psutil", ".", "NoSuchProcess", ":", "return", "False" ]
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...
[ "Kill", "a", "process", "by", "PID", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L220-L247
train
saltstack/salt
salt/modules/ps.py
pkill
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 ...
python
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", ")", ":", "killed", "=", "[", "]", "for", "proc", "in", "psutil", ".", "process_iter", "(", ")", ":", "name_match", "=", "pattern", "in",...
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...
[ "Kill", "processes", "matching", "a", "pattern", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L250-L302
train
saltstack/salt
salt/modules/ps.py
pgrep
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...
python
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", ")", ":", "procs", "=", "[", "]", "if", "pattern_is_regex", ":", "pattern", "=", "re", ".", "compile", "(", "str", "(", "patte...
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...
[ "Return", "the", "pids", "for", "processes", "matching", "a", "pattern", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L305-L368
train
saltstack/salt
salt/modules/ps.py
cpu_percent
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...
python
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", ")", ":", "if", "per_cpu", ":", "result", "=", "list", "(", "psutil", ".", "cpu_percent", "(", "interval", ",", "True", ")", ")", "else", ":", "result", "=", "psutil", "...
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...
[ "Return", "the", "percent", "of", "time", "the", "CPU", "is", "busy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L371-L391
train
saltstack/salt
salt/modules/ps.py
cpu_times
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...
python
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", ")", ":", "if", "per_cpu", ":", "result", "=", "[", "dict", "(", "times", ".", "_asdict", "(", ")", ")", "for", "times", "in", "psutil", ".", "cpu_times", "(", "True", ")", "]", "else", ":", "result...
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
[ "Return", "the", "percent", "of", "time", "the", "CPU", "spends", "in", "each", "state", "e", ".", "g", ".", "user", "system", "idle", "nice", "iowait", "irq", "softirq", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L394-L413
train
saltstack/salt
salt/modules/ps.py
virtual_memory
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...
python
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", "(", ")", ":", "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...
.. 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
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L416-L435
train
saltstack/salt
salt/modules/ps.py
swap_memory
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 <...
python
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", "(", ")", ":", "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", ...
.. 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
[ "..", "versionadded", "::", "2014", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L438-L457
train
saltstack/salt
salt/modules/ps.py
disk_partitions
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...
python
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", ")", ":", "result", "=", "[", "dict", "(", "partition", ".", "_asdict", "(", ")", ")", "for", "partition", "in", "psutil", ".", "disk_partitions", "(", "all", ")", "]", "return", "result" ]
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...
[ "Return", "a", "list", "of", "disk", "partitions", "and", "their", "device", "mount", "point", "and", "filesystem", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L460-L477
train
saltstack/salt
salt/modules/ps.py
disk_partition_usage
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...
python
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", ")", ":", "result", "=", "disk_partitions", "(", "all", ")", "for", "partition", "in", "result", ":", "partition", ".", "update", "(", "disk_usage", "(", "partition", "[", "'mountpoint'", "]", ")", "...
Return a list of disk partitions plus the mount point, filesystem and usage statistics. CLI Example: .. code-block:: bash salt '*' ps.disk_partition_usage
[ "Return", "a", "list", "of", "disk", "partitions", "plus", "the", "mount", "point", "filesystem", "and", "usage", "statistics", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L494-L508
train
saltstack/salt
salt/modules/ps.py
total_physical_memory
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...
python
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", "(", ")", ":", "if", "psutil", ".", "version_info", "<", "(", "0", ",", "6", ",", "0", ")", ":", "msg", "=", "'virtual_memory is only available in psutil 0.6.0 or greater'", "raise", "CommandExecutionError", "(", "msg", ")", "try", ...
Return the total number of bytes of physical memory. CLI Example: .. code-block:: bash salt '*' ps.total_physical_memory
[ "Return", "the", "total", "number", "of", "bytes", "of", "physical", "memory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L511-L529
train
saltstack/salt
salt/modules/ps.py
boot_time
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:...
python
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", ")", ":", "try", ":", "b_time", "=", "int", "(", "psutil", ".", "boot_time", "(", ")", ")", "except", "AttributeError", ":", "# get_boot_time() has been removed in newer psutil versions, and has", "# been replaced b...
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:/...
[ "Return", "the", "boot", "time", "in", "number", "of", "seconds", "since", "the", "epoch", "began", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L550-L582
train
saltstack/salt
salt/modules/ps.py
network_io_counters
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:...
python
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", ")", ":", "if", "not", "interface", ":", "return", "dict", "(", "psutil", ".", "net_io_counters", "(", ")", ".", "_asdict", "(", ")", ")", "else", ":", "stats", "=", "psutil", ".", "net_io_coun...
Return network I/O statistics. CLI Example: .. code-block:: bash salt '*' ps.network_io_counters salt '*' ps.network_io_counters interface=eth0
[ "Return", "network", "I", "/", "O", "statistics", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L585-L604
train
saltstack/salt
salt/modules/ps.py
disk_io_counters
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...
python
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", ")", ":", "if", "not", "device", ":", "return", "dict", "(", "psutil", ".", "disk_io_counters", "(", ")", ".", "_asdict", "(", ")", ")", "else", ":", "stats", "=", "psutil", ".", "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
[ "Return", "disk", "I", "/", "O", "statistics", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L607-L626
train
saltstack/salt
salt/modules/ps.py
get_users
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 ...
python
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", "(", ")", ":", "try", ":", "recs", "=", "psutil", ".", "users", "(", ")", "return", "[", "dict", "(", "x", ".", "_asdict", "(", ")", ")", "for", "x", "in", "recs", "]", "except", "AttributeError", ":", "# get_users is only present i...
Return logged-in users. CLI Example: .. code-block:: bash salt '*' ps.get_users
[ "Return", "logged", "-", "in", "users", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L629-L660
train
saltstack/salt
salt/modules/ps.py
lsof
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, ...
python
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", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "lsof_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"lsof -c \"", "+", "sanitize_name", ")", "ret", "=", "[", "]", "ret", ".", "extend", "("...
Retrieve the lsof information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.lsof apache2
[ "Retrieve", "the", "lsof", "information", "of", "the", "given", "process", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L663-L677
train
saltstack/salt
salt/modules/ps.py
netstat
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...
python
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", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "netstat_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"netstat -nap\"", ")", "found_infos", "=", "[", "]", "ret", "=", "[", "]", "for", ...
Retrieve the netstat information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.netstat apache2
[ "Retrieve", "the", "netstat", "information", "of", "the", "given", "process", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L681-L699
train
saltstack/salt
salt/modules/ps.py
ss
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 = [] ...
python
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", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "ss_infos", "=", "__salt__", "[", "'cmd.run'", "]", "(", "\"ss -neap\"", ")", "found_infos", "=", "[", "]", "ret", "=", "[", "]", "for", "info", "in"...
Retrieve the ss information of the given process name. CLI Example: .. code-block:: bash salt '*' ps.ss apache2 .. versionadded:: 2016.11.6
[ "Retrieve", "the", "ss", "information", "of", "the", "given", "process", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L703-L724
train
saltstack/salt
salt/modules/ps.py
psaux
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...
python
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", ")", ":", "sanitize_name", "=", "six", ".", "text_type", "(", "name", ")", "pattern", "=", "re", ".", "compile", "(", "sanitize_name", ")", "salt_exception_pattern", "=", "re", ".", "compile", "(", "\"salt.+ps.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
[ "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", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ps.py#L727-L756
train
saltstack/salt
salt/states/pagerduty_service.py
present
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 ...
python
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", ")", ":", "# TODO: aws_cloudwatch type should be integrated with boto_sns", "# for convenience, we accept id, name, or email for users"...
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...
[ "Ensure", "pagerduty", "service", "exists", ".", "This", "method", "accepts", "as", "arguments", "everything", "defined", "in", "https", ":", "//", "developer", ".", "pagerduty", ".", "com", "/", "documentation", "/", "rest", "/", "services", "/", "create" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L30-L84
train
saltstack/salt
salt/states/pagerduty_service.py
absent
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...
python
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", ")", ":", "r", "=", "__salt__", "[", "'pagerduty_util.resource_absent'", "]", "(", "'services'", ",", "[", "'name'", ...
Ensure a pagerduty service does not exist. Name can be the service name or pagerduty service id.
[ "Ensure", "a", "pagerduty", "service", "does", "not", "exist", ".", "Name", "can", "be", "the", "service", "name", "or", "pagerduty", "service", "id", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L87-L98
train
saltstack/salt
salt/states/pagerduty_service.py
_diff
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...
python
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", ")", ":", "objects_differ", "=", "None", "for", "k", ",", "v", "in", "state_data", "[", "'service'", "]", ".", "items", "(", ")", ":", "if", "k", "==", "'escalation_policy_id'", ":", "resource_valu...
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.
[ "helper", "method", "to", "compare", "salt", "state", "info", "with", "the", "PagerDuty", "API", "json", "structure", "and", "determine", "if", "we", "need", "to", "update", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_service.py#L101-L126
train
saltstack/salt
salt/modules/baredoc.py
modules_and_args
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...
python
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", ")", ":", "dirs", "=", "[", "]", "module_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(",...
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...
[ "Walk", "the", "Salt", "install", "tree", "and", "return", "a", "dictionary", "or", "a", "list", "of", "the", "functions", "therein", "as", "well", "as", "their", "arguments", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/baredoc.py#L96-L151
train
saltstack/salt
salt/output/pony.py
output
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)])
python
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", "high_out", "=", "__salt__", "[", "'highstate'", "]", "(", "data", ")", "return", "subprocess", ".", "check_output", "(", "[", "'ponysay'", ",", "salt", "."...
Mane function
[ "Mane", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/pony.py#L62-L67
train
saltstack/salt
salt/modules/win_dsc.py
run_config
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...
python
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'", ")", ":", "ret", ...
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 ...
[ "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",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L95-L180
train
saltstack/salt
salt/modules/win_dsc.py
compile_config
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``)...
python
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'", ")", ":", "if...
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...
[ "r", "Compile", "a", "config", "from", "a", "PowerShell", "script", "(", ".", "ps1", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L183-L329
train
saltstack/salt
salt/modules/win_dsc.py
apply_config
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...
python
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'", ")", ":", "# 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...
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...
[ "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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L332-L408
train
saltstack/salt
salt/modules/win_dsc.py
get_config
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...
python
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", "(", ")", ":", "cmd", "=", "'Get-DscConfiguration | Select-Object * -ExcludeProperty Cim*'", "try", ":", "raw_config", "=", "_pshell", "(", "cmd", ",", "ignore_retcode", "=", "True", ")", "except", "CommandExecutionError", "as", "exc", ":", "if"...
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
[ "Get", "the", "current", "DSC", "Configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L411-L448
train
saltstack/salt
salt/modules/win_dsc.py
remove_config
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\\...
python
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", ")", ":", "# Stopping a running config (not likely to occur)", "cmd", "=", "'Stop-DscConfiguration'", "log", ".", "info", "(", "'DSC: Stopping Running Configuration'", ")", "try", ":", "_pshell", "(", "cmd", ")", "ex...
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...
[ "Remove", "the", "current", "DSC", "Configuration", ".", "Removes", "current", "pending", "and", "previous", "dsc", "configurations", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L451-L532
train
saltstack/salt
salt/modules/win_dsc.py
restore_config
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...
python
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", "(", ")", ":", "cmd", "=", "'Restore-DscConfiguration'", "try", ":", "_pshell", "(", "cmd", ",", "ignore_retcode", "=", "True", ")", "except", "CommandExecutionError", "as", "exc", ":", "if", "'A previous configuration does not exist'", "in"...
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: ...
[ "Reapplies", "the", "previous", "configuration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L535-L564
train
saltstack/salt
salt/modules/win_dsc.py
get_config_status
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...
python
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", "(", ")", ":", "cmd", "=", "'Get-DscConfigurationStatus | '", "'Select-Object -Property HostName, Status, MetaData, '", "'@{Name=\"StartDate\";Expression={Get-Date ($_.StartDate) -Format g}}, '", "'Type, Mode, RebootRequested, NumberofResources'", "try", ":", "r...
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
[ "Get", "the", "status", "of", "the", "current", "DSC", "Configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L589-L612
train
saltstack/salt
salt/modules/win_dsc.py
set_lcm_config
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...
python
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_i...
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...
[ "For", "detailed", "descriptions", "of", "the", "parameters", "see", ":", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "PowerShell", "/", "DSC", "/", "metaConfig" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dsc.py#L637-L801
train
saltstack/salt
salt/modules/sensors.py
sense
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...
python
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", ")", ":", "extra_args", "=", "''", "if", "fahrenheit", "is", "True", ":", "extra_args", "=", "'-f'", "sensors", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'/usr/bin/sensors {0} {1}'", ".", "f...
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°...
[ "Gather", "lm", "-", "sensors", "data", "from", "a", "given", "chip" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sensors.py#L25-L55
train
saltstack/salt
salt/states/influxdb_retention_policy.py
convert_duration
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...
python
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", ")", ":", "# durations must be specified in days, weeks or hours", "if", "duration", ".", "endswith", "(", "'h'", ")", ":", "hours", "=", "int", "(", "duration", ".", "split", "(", "'h'", ")", ")", "elif", "duration", ...
Convert the a duration string into XXhYYmZZs format duration Duration to convert Returns: duration_string String representation of duration in XXhYYmZZs format
[ "Convert", "the", "a", "duration", "string", "into", "XXhYYmZZs", "format" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_retention_policy.py#L24-L49
train
saltstack/salt
salt/states/influxdb_retention_policy.py
present
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...
python
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", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", ...
Ensure that given retention policy is present. name Name of the retention policy to create. database Database to create retention policy on.
[ "Ensure", "that", "given", "retention", "policy", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_retention_policy.py#L52-L126
train
saltstack/salt
salt/modules/event.py
_dict_subset
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])
python
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", "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
[ "Return", "a", "dictionary", "of", "only", "the", "subset", "of", "keys", "/", "values", "specified", "in", "keys" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L27-L31
train
saltstack/salt
salt/modules/event.py
fire_master
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...
python
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", ")", ":", "if", "(", "__opts__", ".", "get", "(", "'local'", ",", "None", ")", "or", "__opts__", ".", "get", "(", "'file_client'", ",", "None", "...
Fire an event off up to the master server CLI Example: .. code-block:: bash salt '*' event.fire_master '{"data":"my event data"}' 'tag'
[ "Fire", "an", "event", "off", "up", "to", "the", "master", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L34-L98
train
saltstack/salt
salt/modules/event.py
fire
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...
python
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", ")", ":", "if", "timeout", "is", "None", ":", "timeout", "=", "60000", "else", ":", "timeout", "=", "timeout", "*", "1000", "try", ":", "event", "=", "salt", ".", "utils", ".", ...
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'
[ "Fire", "an", "event", "on", "the", "local", "minion", "event", "bus", ".", "Data", "must", "be", "formed", "as", "a", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L101-L128
train
saltstack/salt
salt/modules/event.py
send
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. ...
python
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", ",", "...
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 ...
[ "Send", "an", "event", "to", "the", "Salt", "Master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/event.py#L131-L247
train
saltstack/salt
salt/states/postgres_cluster.py
present
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...
python
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"...
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...
[ "Ensure", "that", "the", "named", "cluster", "is", "present", "with", "the", "specified", "properties", ".", "For", "more", "information", "about", "all", "of", "these", "options", "see", "man", "pg_createcluster", "(", "1", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_cluster.py#L28-L114
train
saltstack/salt
salt/states/postgres_cluster.py
absent
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': {}, ...
python
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", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "#check if cluster exists and remove it", "if", "__salt__", "...
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
[ "Ensure", "that", "the", "named", "cluster", "is", "absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_cluster.py#L117-L151
train
saltstack/salt
salt/returners/splunk.py
_send_splunk
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...
python
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", ")", ":", "# Get Splunk Options", "opts", "=", "_get_options", "(", ")", "log", ".", "info", "(", "str", "(", "'Options: %s'", ")", ",", "# futu...
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.
[ "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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/splunk.py#L70-L104
train
saltstack/salt
salt/output/dson.py
output
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 =...
python
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", "try", ":", "dump_opts", "=", "{", "'indent'", ":", "4", ",", "'default'", ":", "repr", "}", "if", "'output_indent'", "in", "__opts__", ":", "indent", "="...
Print the output data in JSON
[ "Print", "the", "output", "data", "in", "JSON" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/dson.py#L37-L74
train
saltstack/salt
salt/states/serverdensity_device.py
_get_salt_params
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...
python
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", "(", ")", ":", "all_stats", "=", "__salt__", "[", "'status.all_status'", "]", "(", ")", "all_grains", "=", "__salt__", "[", "'grains.items'", "]", "(", ")", "params", "=", "{", "}", "try", ":", "params", "[", "'name'", "]", "="...
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.
[ "Try", "to", "get", "all", "sort", "of", "parameters", "for", "Server", "Density", "server", "info", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/serverdensity_device.py#L69-L95
train
saltstack/salt
salt/states/serverdensity_device.py
monitored
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 ...
python
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", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ...
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. ...
[ "Device", "is", "monitored", "with", "Server", "Density", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/serverdensity_device.py#L98-L215
train
saltstack/salt
salt/queues/sqlite_queue.py
_conn
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...
python
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", ")", ":", "queue_dir", "=", "__opts__", "[", "'sqlite_queue_dir'", "]", "db", "=", "os", ".", "path", ".", "join", "(", "queue_dir", ",", "'{0}.db'", ".", "format", "(", "queue", ")", ")", "log", ".", "debug", "(", "'Con...
Return an sqlite connection
[ "Return", "an", "sqlite", "connection" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L40-L52
train
saltstack/salt
salt/queues/sqlite_queue.py
_list_items
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...
python
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", ")", ":", "con", "=", "_conn", "(", "queue", ")", "with", "con", ":", "cur", "=", "con", ".", "cursor", "(", ")", "cmd", "=", "'SELECT name FROM {0}'", ".", "format", "(", "queue", ")", "log", ".", "debug", "(", ...
Private function to list contents of a queue
[ "Private", "function", "to", "list", "contents", "of", "a", "queue" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L75-L86
train
saltstack/salt
salt/queues/sqlite_queue.py
_list_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
python
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", "(", ")", ":", "queue_dir", "=", "__opts__", "[", "'sqlite_queue_dir'", "]", "files", "=", "os", ".", "path", ".", "join", "(", "queue_dir", ",", "'*.db'", ")", "paths", "=", "glob", ".", "glob", "(", "files", ")", "queues", "=",...
Return a list of sqlite databases in the queue_dir
[ "Return", "a", "list", "of", "sqlite", "databases", "in", "the", "queue_dir" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L89-L98
train
saltstack/salt
salt/queues/sqlite_queue.py
list_items
def list_items(queue): ''' List contents of a queue ''' itemstuple = _list_items(queue) items = [item[0] for item in itemstuple] return items
python
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", ")", ":", "itemstuple", "=", "_list_items", "(", "queue", ")", "items", "=", "[", "item", "[", "0", "]", "for", "item", "in", "itemstuple", "]", "return", "items" ]
List contents of a queue
[ "List", "contents", "of", "a", "queue" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L109-L115
train
saltstack/salt
salt/queues/sqlite_queue.py
_quote_escape
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)
python
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", ")", ":", "rex_sqlquote", "=", "re", ".", "compile", "(", "\"'\"", ",", "re", ".", "M", ")", "return", "rex_sqlquote", ".", "sub", "(", "\"''\"", ",", "item", ")" ]
Make sure single quotes are escaped properly in sqlite3 fashion. e.g.: ' becomes ''
[ "Make", "sure", "single", "quotes", "are", "escaped", "properly", "in", "sqlite3", "fashion", ".", "e", ".", "g", ".", ":", "becomes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L126-L134
train
saltstack/salt
salt/queues/sqlite_queue.py
delete
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) ...
python
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", ")", ":", "con", "=", "_conn", "(", "queue", ")", "with", "con", ":", "cur", "=", "con", ".", "cursor", "(", ")", "if", "isinstance", "(", "items", ",", "six", ".", "string_types", ")", ":", "items", "...
Delete an item or items from a queue
[ "Delete", "an", "item", "or", "items", "from", "a", "queue" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L179-L208
train
saltstack/salt
salt/queues/sqlite_queue.py
pop
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...
python
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", ")", ":", "cmd", "=", "'SELECT name FROM {0}'", ".", "format", "(", "queue", ")", "if", "quantity", "!=", "'all'", ":", "try", ":", "quantity", "=", "int", "(", "q...
Pop one or more or all items from the queue return them.
[ "Pop", "one", "or", "more", "or", "all", "items", "from", "the", "queue", "return", "them", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/queues/sqlite_queue.py#L211-L244
train
saltstack/salt
salt/modules/boto_sns.py
get_all_topics
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...
python
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", ")", ":", "cache_key", "=", "_cache_get_key", "(", ")", "try", ":", "return", "__context__", "[", "cache_key", "]", "e...
Returns a list of the all topics.. CLI example:: salt myminion boto_sns.get_all_topics
[ "Returns", "a", "list", "of", "the", "all", "topics", ".." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L78-L99
train
saltstack/salt
salt/modules/boto_sns.py
exists
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) ...
python
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", ")", ":", "topics", "=", "get_all_topics", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid"...
Check to see if an SNS topic exists. CLI example:: salt myminion boto_sns.exists mytopic region=us-east-1
[ "Check", "to", "see", "if", "an", "SNS", "topic", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L102-L115
train
saltstack/salt
salt/modules/boto_sns.py
create
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....
python
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", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
Create an SNS topic. CLI example to create a topic:: salt myminion boto_sns.create mytopic region=us-east-1
[ "Create", "an", "SNS", "topic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L118-L130
train
saltstack/salt
salt/modules/boto_sns.py
delete
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, ...
python
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", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
Delete an SNS topic. CLI example to delete a topic:: salt myminion boto_sns.delete mytopic region=us-east-1
[ "Delete", "an", "SNS", "topic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L133-L145
train
saltstack/salt
salt/modules/boto_sns.py
get_all_subscriptions_by_topic
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...
python
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", ")", ":", "cache_key", "=", "_subscriptions_cache_key", "(", "name", ")", "try", ":", "return...
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
[ "Get", "list", "of", "all", "subscriptions", "to", "a", "specific", "topic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L148-L165
train
saltstack/salt
salt/modules/boto_sns.py
subscribe
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=...
python
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", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", ...
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
[ "Subscribe", "to", "a", "Topic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L168-L183
train
saltstack/salt
salt/modules/boto_sns.py
unsubscribe
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...
python
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", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=...
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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L186-L211
train
saltstack/salt
salt/modules/boto_sns.py
get_arn
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']( ...
python
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", ")", ":", "if", "name", ".", "startswith", "(", "'arn:aws:sns:'", ")", ":", "return", "name", "account_id", "=...
Returns the full ARN for a given topic name. CLI example:: salt myminion boto_sns.get_arn mytopic
[ "Returns", "the", "full", "ARN", "for", "a", "given", "topic", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_sns.py#L214-L229
train
saltstack/salt
salt/utils/asynchronous.py
current_ioloop
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()
python
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", ")", ":", "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
[ "A", "context", "manager", "that", "will", "set", "the", "current", "ioloop", "to", "io_loop", "for", "the", "context" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/asynchronous.py#L15-L24
train
saltstack/salt
salt/modules/saltutil.py
_get_top_file_envs
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...
python
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", "(", ")", ":", "try", ":", "return", "__context__", "[", "'saltutil._top_file_envs'", "]", "except", "KeyError", ":", "try", ":", "st_", "=", "salt", ".", "state", ".", "HighState", "(", "__opts__", ",", "initial_pillar", "=", "_...
Get all environments from the top file
[ "Get", "all", "environments", "from", "the", "top", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L78-L98
train
saltstack/salt
salt/modules/saltutil.py
_sync
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...
python
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", ")", ":", "if", "saltenv", "is", "None", ":", "saltenv", "=", "_get_top_file_envs", "(", ")", "if", "isinstance", "(", "...
Sync the given directory in the given environment
[ "Sync", "the", "given", "directory", "in", "the", "given", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L101-L123
train
saltstack/salt
salt/modules/saltutil.py
update
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 ...
python
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", ")", ":", "ret", "=", "{", "}", "if", "not", "HAS_ESKY", ":", "ret", "[", "'_error'", "]", "=", "'Esky not available as import'", "return", "ret", "if", "not", "getattr", "(", "sys", ",", "'frozen'", ",", "...
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...
[ "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", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L126-L189
train
saltstack/salt
salt/modules/saltutil.py
sync_beacons
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...
python
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", ")", ":", "ret", "=", "_sync", "(", "'beacons'", ",", "saltenv", ",", "extmod_whitelist", ",", "ext...
.. 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...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "1" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L192-L228
train
saltstack/salt
salt/modules/saltutil.py
sync_sdb
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...
python
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", ")", ":", "ret", "=", "_sync", "(", "'sdb'", ",", "saltenv", ",", "extmod_whitelist", ",", "extmod_blacklist", ")", "return", "ret" ]
.. 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 ...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "8", "2015", ".", "8", ".", "3" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L231-L264
train
saltstack/salt
salt/modules/saltutil.py
sync_modules
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...
python
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", ")", ":", "ret", "=", "_sync", "(", "'modules'", ",", "saltenv", ",", "extmod_whitelist", ",", "ext...
.. 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 ...
[ "..", "versionadded", "::", "0", ".", "10", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L267-L320
train
saltstack/salt
salt/modules/saltutil.py
refresh_grains
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...
python
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", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "_refresh_pillar", "=", "kwargs", ".", "pop", "(", "'refresh_pillar'", ",", "True", ")", "i...
.. 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...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "6", "2016", ".", "11", ".", "4", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L362-L392
train
saltstack/salt
salt/modules/saltutil.py
sync_grains
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-...
python
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", ")", ":", "ret", "=", "_sync", "(", "'grains'", ",", "saltenv", ",", "extmod_whitelist", ",", "extmo...
.. 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 ...
[ "..", "versionadded", "::", "0", ".", "10", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L395-L433
train
saltstack/salt
salt/modules/saltutil.py
sync_matchers
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...
python
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", ")", ":", "ret", "=", "_sync", "(", "'matchers'", ",", "saltenv", ",", "extmod_whitelist", ",", "...
.. 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 ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L553-L588
train
saltstack/salt
salt/modules/saltutil.py
list_extmods
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) ...
python
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", "(", ")", ":", "ret", "=", "{", "}", "ext_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'extmods'", ")", "mod_types", "=", "os", ".", "listdir", "(", "ext_dir", ")", "for", "mod_type"...
.. versionadded:: 2017.7.0 List Salt modules which have been synced externally CLI Examples: .. code-block:: bash salt '*' saltutil.list_extmods
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L859-L880
train
saltstack/salt
salt/modules/saltutil.py
sync_pillar
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...
python
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", ")", ":", "if", "__opts__", "[", "'file_client'", "]", "!=", "'local'", ":", "raise", "CommandExecutio...
.. 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,...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "11", "2016", ".", "3", ".", "2" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L922-L960
train
saltstack/salt
salt/modules/saltutil.py
sync_all
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...
python
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", ")", ":", "log", ".", "debug", "(", "'Syncing all'", ")", "ret", "=", "{", "}", "ret", "[", "'cloud...
.. 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...
[ "..", "versionchanged", "::", "2015", ".", "8", ".", "11", "2016", ".", "3", ".", "2", "On", "masterless", "minions", "pillar", "modules", "are", "now", "synced", "and", "refreshed", "when", "refresh", "is", "set", "to", "True", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltutil.py#L963-L1034
train