id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
32,900
saltstack/salt
salt/modules/redismod.py
time
def time(host=None, port=None, db=None, password=None): ''' Return the current server UNIX time in seconds CLI Example: .. code-block:: bash salt '*' redis.time ''' server = _connect(host, port, db, password) return server.time()[0]
python
def time(host=None, port=None, db=None, password=None): ''' Return the current server UNIX time in seconds CLI Example: .. code-block:: bash salt '*' redis.time ''' server = _connect(host, port, db, password) return server.time()[0]
[ "def", "time", "(", "host", "=", "None", ",", "port", "=", "None", ",", "db", "=", "None", ",", "password", "=", "None", ")", ":", "server", "=", "_connect", "(", "host", ",", "port", ",", "db", ",", "password", ")", "return", "server", ".", "tim...
Return the current server UNIX time in seconds CLI Example: .. code-block:: bash salt '*' redis.time
[ "Return", "the", "current", "server", "UNIX", "time", "in", "seconds" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/redismod.py#L663-L674
32,901
saltstack/salt
salt/modules/redismod.py
zcard
def zcard(key, host=None, port=None, db=None, password=None): ''' Get the length of a sorted set in Redis CLI Example: .. code-block:: bash salt '*' redis.zcard foo_sorted ''' server = _connect(host, port, db, password) return server.zcard(key)
python
def zcard(key, host=None, port=None, db=None, password=None): ''' Get the length of a sorted set in Redis CLI Example: .. code-block:: bash salt '*' redis.zcard foo_sorted ''' server = _connect(host, port, db, password) return server.zcard(key)
[ "def", "zcard", "(", "key", ",", "host", "=", "None", ",", "port", "=", "None", ",", "db", "=", "None", ",", "password", "=", "None", ")", ":", "server", "=", "_connect", "(", "host", ",", "port", ",", "db", ",", "password", ")", "return", "serve...
Get the length of a sorted set in Redis CLI Example: .. code-block:: bash salt '*' redis.zcard foo_sorted
[ "Get", "the", "length", "of", "a", "sorted", "set", "in", "Redis" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/redismod.py#L677-L688
32,902
saltstack/salt
salt/modules/redismod.py
zrange
def zrange(key, start, stop, host=None, port=None, db=None, password=None): ''' Get a range of values from a sorted set in Redis by index CLI Example: .. code-block:: bash salt '*' redis.zrange foo_sorted 0 10 ''' server = _connect(host, port, db, password) return server.zrange(ke...
python
def zrange(key, start, stop, host=None, port=None, db=None, password=None): ''' Get a range of values from a sorted set in Redis by index CLI Example: .. code-block:: bash salt '*' redis.zrange foo_sorted 0 10 ''' server = _connect(host, port, db, password) return server.zrange(ke...
[ "def", "zrange", "(", "key", ",", "start", ",", "stop", ",", "host", "=", "None", ",", "port", "=", "None", ",", "db", "=", "None", ",", "password", "=", "None", ")", ":", "server", "=", "_connect", "(", "host", ",", "port", ",", "db", ",", "pa...
Get a range of values from a sorted set in Redis by index CLI Example: .. code-block:: bash salt '*' redis.zrange foo_sorted 0 10
[ "Get", "a", "range", "of", "values", "from", "a", "sorted", "set", "in", "Redis", "by", "index" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/redismod.py#L691-L702
32,903
saltstack/salt
salt/modules/redismod.py
sentinel_get_master_ip
def sentinel_get_master_ip(master, host=None, port=None, password=None): ''' Get ip for sentinel master .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.sentinel_get_master_ip 'mymaster' ''' server = _sconnect(host, port, password) ret = server.senti...
python
def sentinel_get_master_ip(master, host=None, port=None, password=None): ''' Get ip for sentinel master .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.sentinel_get_master_ip 'mymaster' ''' server = _sconnect(host, port, password) ret = server.senti...
[ "def", "sentinel_get_master_ip", "(", "master", ",", "host", "=", "None", ",", "port", "=", "None", ",", "password", "=", "None", ")", ":", "server", "=", "_sconnect", "(", "host", ",", "port", ",", "password", ")", "ret", "=", "server", ".", "sentinel...
Get ip for sentinel master .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.sentinel_get_master_ip 'mymaster'
[ "Get", "ip", "for", "sentinel", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/redismod.py#L705-L719
32,904
saltstack/salt
salt/modules/redismod.py
get_master_ip
def get_master_ip(host=None, port=None, password=None): ''' Get host information about slave .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.get_master_ip ''' server = _connect(host, port, password) srv_info = server.info() ret = (srv_info.get('...
python
def get_master_ip(host=None, port=None, password=None): ''' Get host information about slave .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.get_master_ip ''' server = _connect(host, port, password) srv_info = server.info() ret = (srv_info.get('...
[ "def", "get_master_ip", "(", "host", "=", "None", ",", "port", "=", "None", ",", "password", "=", "None", ")", ":", "server", "=", "_connect", "(", "host", ",", "port", ",", "password", ")", "srv_info", "=", "server", ".", "info", "(", ")", "ret", ...
Get host information about slave .. versionadded: 2016.3.0 CLI Example: .. code-block:: bash salt '*' redis.get_master_ip
[ "Get", "host", "information", "about", "slave" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/redismod.py#L722-L737
32,905
saltstack/salt
salt/modules/boto_efs.py
_get_conn
def _get_conn(key=None, keyid=None, profile=None, region=None, **kwargs): ''' Create a boto3 client connection to EFS ''' client = None if profile: if isinstance(profile, six.string_types): if profile in __pillar__: ...
python
def _get_conn(key=None, keyid=None, profile=None, region=None, **kwargs): ''' Create a boto3 client connection to EFS ''' client = None if profile: if isinstance(profile, six.string_types): if profile in __pillar__: ...
[ "def", "_get_conn", "(", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "None", "if", "profile", ":", "if", "isinstance", "(", "profile", ","...
Create a boto3 client connection to EFS
[ "Create", "a", "boto3", "client", "connection", "to", "EFS" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L82-L121
32,906
saltstack/salt
salt/modules/boto_efs.py
create_file_system
def create_file_system(name, performance_mode='generalPurpose', keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs): ''' Cr...
python
def create_file_system(name, performance_mode='generalPurpose', keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs): ''' Cr...
[ "def", "create_file_system", "(", "name", ",", "performance_mode", "=", "'generalPurpose'", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "creation_token", "=", "None", ",", "*", "*", "k...
Creates a new, empty file system. name (string) - The name for the new file system performance_mode (string) - The PerformanceMode of the file system. Can be either generalPurpose or maxIO creation_token (string) - A unique name to be used as reference when creating an EFS...
[ "Creates", "a", "new", "empty", "file", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L124-L172
32,907
saltstack/salt
salt/modules/boto_efs.py
create_mount_target
def create_mount_target(filesystemid, subnetid, ipaddress=None, securitygroups=None, keyid=None, key=None, profile=None, region=None, ...
python
def create_mount_target(filesystemid, subnetid, ipaddress=None, securitygroups=None, keyid=None, key=None, profile=None, region=None, ...
[ "def", "create_mount_target", "(", "filesystemid", ",", "subnetid", ",", "ipaddress", "=", "None", ",", "securitygroups", "=", "None", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", ...
Creates a mount target for a file system. You can then mount the file system on EC2 instances via the mount target. You can create one mount target in each Availability Zone in your VPC. All EC2 instances in a VPC within a given Availability Zone share a single mount target for a given file system. ...
[ "Creates", "a", "mount", "target", "for", "a", "file", "system", ".", "You", "can", "then", "mount", "the", "file", "system", "on", "EC2", "instances", "via", "the", "mount", "target", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L175-L240
32,908
saltstack/salt
salt/modules/boto_efs.py
create_tags
def create_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified i...
python
def create_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified i...
[ "def", "create_tags", "(", "filesystemid", ",", "tags", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "key", "=", "ke...
Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified in the request already exists on the file system, this operation overwrites its value with the value provided in the request. filesystemid (string) - ID of the file system for whose ta...
[ "Creates", "or", "overwrites", "tags", "associated", "with", "a", "file", "system", ".", "Each", "tag", "is", "a", "key", "-", "value", "pair", ".", "If", "a", "tag", "key", "specified", "in", "the", "request", "already", "exists", "on", "the", "file", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L243-L275
32,909
saltstack/salt
salt/modules/boto_efs.py
delete_file_system
def delete_file_system(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes a file system, permanently severing access to its contents. Upon return, the file sy...
python
def delete_file_system(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes a file system, permanently severing access to its contents. Upon return, the file sy...
[ "def", "delete_file_system", "(", "filesystemid", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "key", "=", "key", ",",...
Deletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system. You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them. ...
[ "Deletes", "a", "file", "system", "permanently", "severing", "access", "to", "its", "contents", ".", "Upon", "return", "the", "file", "system", "no", "longer", "exists", "and", "you", "can", "t", "access", "any", "contents", "of", "the", "deleted", "file", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L278-L303
32,910
saltstack/salt
salt/modules/boto_efs.py
delete_mount_target
def delete_mount_target(mounttargetid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes the specified mount target. This operation forcibly breaks any mounts of the file...
python
def delete_mount_target(mounttargetid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes the specified mount target. This operation forcibly breaks any mounts of the file...
[ "def", "delete_mount_target", "(", "mounttargetid", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "key", "=", "key", ",...
Deletes the specified mount target. This operation forcibly breaks any mounts of the file system via the mount target that is being deleted, which might disrupt instances or applications using those mounts. To avoid applications getting cut off abruptly, you might consider unmounting any mounts of the ...
[ "Deletes", "the", "specified", "mount", "target", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L306-L337
32,911
saltstack/salt
salt/modules/boto_efs.py
delete_tags
def delete_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes the specified tags from a file system. filesystemid (string) - ID of the file system for whose ...
python
def delete_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Deletes the specified tags from a file system. filesystemid (string) - ID of the file system for whose ...
[ "def", "delete_tags", "(", "filesystemid", ",", "tags", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "key", "=", "ke...
Deletes the specified tags from a file system. filesystemid (string) - ID of the file system for whose tags will be removed. tags (list[string]) - The tag keys to delete to the file system CLI Example: .. code-block:: bash salt 'my-minion' boto_efs.delete_tags
[ "Deletes", "the", "specified", "tags", "from", "a", "file", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L340-L365
32,912
saltstack/salt
salt/modules/boto_efs.py
get_file_systems
def get_file_systems(filesystemid=None, keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs): ''' Get all EFS properties or a specific instance property if...
python
def get_file_systems(filesystemid=None, keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs): ''' Get all EFS properties or a specific instance property if...
[ "def", "get_file_systems", "(", "filesystemid", "=", "None", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "creation_token", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", ...
Get all EFS properties or a specific instance property if filesystemid is specified filesystemid (string) - ID of the file system to retrieve properties creation_token (string) - A unique token that identifies an EFS. If fileysystem created via create_file_system this would ...
[ "Get", "all", "EFS", "properties", "or", "a", "specific", "instance", "property", "if", "filesystemid", "is", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L368-L421
32,913
saltstack/salt
salt/modules/boto_efs.py
get_mount_targets
def get_mount_targets(filesystemid=None, mounttargetid=None, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Get all the EFS mount point properties for a specific f...
python
def get_mount_targets(filesystemid=None, mounttargetid=None, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Get all the EFS mount point properties for a specific f...
[ "def", "get_mount_targets", "(", "filesystemid", "=", "None", ",", "mounttargetid", "=", "None", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", ...
Get all the EFS mount point properties for a specific filesystemid or the properties for a specific mounttargetid. One or the other must be specified filesystemid (string) - ID of the file system whose mount targets to list Must be specified if mounttargetid is not mounttarg...
[ "Get", "all", "the", "EFS", "mount", "point", "properties", "for", "a", "specific", "filesystemid", "or", "the", "properties", "for", "a", "specific", "mounttargetid", ".", "One", "or", "the", "other", "must", "be", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L424-L468
32,914
saltstack/salt
salt/modules/boto_efs.py
get_tags
def get_tags(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Return the tags associated with an EFS instance. filesystemid (string) - ID of the file system whose tags to list returns (list) -...
python
def get_tags(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Return the tags associated with an EFS instance. filesystemid (string) - ID of the file system whose tags to list returns (list) -...
[ "def", "get_tags", "(", "filesystemid", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "key", "=", "key", ",", "keyid"...
Return the tags associated with an EFS instance. filesystemid (string) - ID of the file system whose tags to list returns (list) - list of tags as key/value pairs CLI Example: .. code-block:: bash salt 'my-minion' boto_efs.get_tags efs-id
[ "Return", "the", "tags", "associated", "with", "an", "EFS", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L471-L501
32,915
saltstack/salt
salt/modules/boto_efs.py
set_security_groups
def set_security_groups(mounttargetid, securitygroup, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Modifies the set of security groups in effect for ...
python
def set_security_groups(mounttargetid, securitygroup, keyid=None, key=None, profile=None, region=None, **kwargs): ''' Modifies the set of security groups in effect for ...
[ "def", "set_security_groups", "(", "mounttargetid", ",", "securitygroup", ",", "keyid", "=", "None", ",", "key", "=", "None", ",", "profile", "=", "None", ",", "region", "=", "None", ",", "*", "*", "kwargs", ")", ":", "client", "=", "_get_conn", "(", "...
Modifies the set of security groups in effect for a mount target mounttargetid (string) - ID of the mount target whose security groups will be modified securitygroups (list[string]) - list of no more than 5 VPC security group IDs. CLI Example: .. code-block:: bash salt 'my-m...
[ "Modifies", "the", "set", "of", "security", "groups", "in", "effect", "for", "a", "mount", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_efs.py#L504-L529
32,916
saltstack/salt
salt/states/win_wusa.py
installed
def installed(name, source): ''' Ensure an update is installed on the minion Args: name(str): Name of the Windows KB ("KB123456") source (str): Source of .msu file corresponding to the KB Example: .. code-block:: yaml KB123456: wusa.ins...
python
def installed(name, source): ''' Ensure an update is installed on the minion Args: name(str): Name of the Windows KB ("KB123456") source (str): Source of .msu file corresponding to the KB Example: .. code-block:: yaml KB123456: wusa.ins...
[ "def", "installed", "(", "name", ",", "source", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "# Input validation", "if", "not", "name", ":", "raise...
Ensure an update is installed on the minion Args: name(str): Name of the Windows KB ("KB123456") source (str): Source of .msu file corresponding to the KB Example: .. code-block:: yaml KB123456: wusa.installed: - source: salt://kb12...
[ "Ensure", "an", "update", "is", "installed", "on", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_wusa.py#L37-L100
32,917
saltstack/salt
salt/states/win_wusa.py
uninstalled
def uninstalled(name): ''' Ensure an update is uninstalled from the minion Args: name(str): Name of the Windows KB ("KB123456") Example: .. code-block:: yaml KB123456: wusa.uninstalled ''' ret = {'name': name, 'changes': {}, 'r...
python
def uninstalled(name): ''' Ensure an update is uninstalled from the minion Args: name(str): Name of the Windows KB ("KB123456") Example: .. code-block:: yaml KB123456: wusa.uninstalled ''' ret = {'name': name, 'changes': {}, 'r...
[ "def", "uninstalled", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "# Is the KB already uninstalled", "if", "not", "__salt__", "[", "'wusa...
Ensure an update is uninstalled from the minion Args: name(str): Name of the Windows KB ("KB123456") Example: .. code-block:: yaml KB123456: wusa.uninstalled
[ "Ensure", "an", "update", "is", "uninstalled", "from", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_wusa.py#L103-L148
32,918
saltstack/salt
salt/modules/netaddress.py
list_cidr_ips
def list_cidr_ips(cidr): ''' Get a list of IP addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return [six.text_type(ip) for ip in list(ips)]
python
def list_cidr_ips(cidr): ''' Get a list of IP addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return [six.text_type(ip) for ip in list(ips)]
[ "def", "list_cidr_ips", "(", "cidr", ")", ":", "ips", "=", "netaddr", ".", "IPNetwork", "(", "cidr", ")", "return", "[", "six", ".", "text_type", "(", "ip", ")", "for", "ip", "in", "list", "(", "ips", ")", "]" ]
Get a list of IP addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips 192.168.0.0/20
[ "Get", "a", "list", "of", "IP", "addresses", "from", "a", "CIDR", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netaddress.py#L35-L44
32,919
saltstack/salt
salt/modules/netaddress.py
list_cidr_ips_ipv6
def list_cidr_ips_ipv6(cidr): ''' Get a list of IPv6 addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips_ipv6 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return [six.text_type(ip.ipv6()) for ip in list(ips)]
python
def list_cidr_ips_ipv6(cidr): ''' Get a list of IPv6 addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips_ipv6 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return [six.text_type(ip.ipv6()) for ip in list(ips)]
[ "def", "list_cidr_ips_ipv6", "(", "cidr", ")", ":", "ips", "=", "netaddr", ".", "IPNetwork", "(", "cidr", ")", "return", "[", "six", ".", "text_type", "(", "ip", ".", "ipv6", "(", ")", ")", "for", "ip", "in", "list", "(", "ips", ")", "]" ]
Get a list of IPv6 addresses from a CIDR. CLI example:: salt myminion netaddress.list_cidr_ips_ipv6 192.168.0.0/20
[ "Get", "a", "list", "of", "IPv6", "addresses", "from", "a", "CIDR", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netaddress.py#L47-L56
32,920
saltstack/salt
salt/modules/netaddress.py
cidr_netmask
def cidr_netmask(cidr): ''' Get the netmask address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return six.text_type(ips.netmask)
python
def cidr_netmask(cidr): ''' Get the netmask address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return six.text_type(ips.netmask)
[ "def", "cidr_netmask", "(", "cidr", ")", ":", "ips", "=", "netaddr", ".", "IPNetwork", "(", "cidr", ")", "return", "six", ".", "text_type", "(", "ips", ".", "netmask", ")" ]
Get the netmask address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20
[ "Get", "the", "netmask", "address", "associated", "with", "a", "CIDR", "address", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netaddress.py#L59-L68
32,921
saltstack/salt
salt/modules/netaddress.py
cidr_broadcast
def cidr_broadcast(cidr): ''' Get the broadcast address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return six.text_type(ips.broadcast)
python
def cidr_broadcast(cidr): ''' Get the broadcast address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20 ''' ips = netaddr.IPNetwork(cidr) return six.text_type(ips.broadcast)
[ "def", "cidr_broadcast", "(", "cidr", ")", ":", "ips", "=", "netaddr", ".", "IPNetwork", "(", "cidr", ")", "return", "six", ".", "text_type", "(", "ips", ".", "broadcast", ")" ]
Get the broadcast address associated with a CIDR address. CLI example:: salt myminion netaddress.cidr_netmask 192.168.0.0/20
[ "Get", "the", "broadcast", "address", "associated", "with", "a", "CIDR", "address", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netaddress.py#L71-L80
32,922
saltstack/salt
salt/modules/openstack_mng.py
restart_service
def restart_service(service_name, minimum_running_time=None): ''' Restart OpenStack service immediately, or only if it's running longer than specified value CLI Example: .. code-block:: bash salt '*' openstack_mng.restart_service neutron salt '*' openstack_mng.restart_service neut...
python
def restart_service(service_name, minimum_running_time=None): ''' Restart OpenStack service immediately, or only if it's running longer than specified value CLI Example: .. code-block:: bash salt '*' openstack_mng.restart_service neutron salt '*' openstack_mng.restart_service neut...
[ "def", "restart_service", "(", "service_name", ",", "minimum_running_time", "=", "None", ")", ":", "if", "minimum_running_time", ":", "ret_code", "=", "False", "# get system services list for interesting openstack service", "services", "=", "__salt__", "[", "'cmd.run'", "...
Restart OpenStack service immediately, or only if it's running longer than specified value CLI Example: .. code-block:: bash salt '*' openstack_mng.restart_service neutron salt '*' openstack_mng.restart_service neutron minimum_running_time=600
[ "Restart", "OpenStack", "service", "immediately", "or", "only", "if", "it", "s", "running", "longer", "than", "specified", "value" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openstack_mng.py#L65-L104
32,923
saltstack/salt
salt/returners/mysql.py
_get_serv
def _get_serv(ret=None, commit=False): ''' Return a mysql cursor ''' _options = _get_options(ret) connect = True if __context__ and 'mysql_returner_conn' in __context__: try: log.debug('Trying to reuse MySQL connection pool') conn = __context__['mysql_returner_co...
python
def _get_serv(ret=None, commit=False): ''' Return a mysql cursor ''' _options = _get_options(ret) connect = True if __context__ and 'mysql_returner_conn' in __context__: try: log.debug('Trying to reuse MySQL connection pool') conn = __context__['mysql_returner_co...
[ "def", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "False", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "connect", "=", "True", "if", "__context__", "and", "'mysql_returner_conn'", "in", "__context__", ":", "try", ":", "log", ...
Return a mysql cursor
[ "Return", "a", "mysql", "cursor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L231-L286
32,924
saltstack/salt
salt/returners/mysql.py
returner
def returner(ret): ''' Return data to a mysql server ''' # if a minion is returning a standalone job, get a jobid if ret['jid'] == 'req': ret['jid'] = prep_jid(nocache=ret.get('nocache', False)) save_load(ret['jid'], ret) try: with _get_serv(ret, commit=True) as cur: ...
python
def returner(ret): ''' Return data to a mysql server ''' # if a minion is returning a standalone job, get a jobid if ret['jid'] == 'req': ret['jid'] = prep_jid(nocache=ret.get('nocache', False)) save_load(ret['jid'], ret) try: with _get_serv(ret, commit=True) as cur: ...
[ "def", "returner", "(", "ret", ")", ":", "# if a minion is returning a standalone job, get a jobid", "if", "ret", "[", "'jid'", "]", "==", "'req'", ":", "ret", "[", "'jid'", "]", "=", "prep_jid", "(", "nocache", "=", "ret", ".", "get", "(", "'nocache'", ",",...
Return data to a mysql server
[ "Return", "data", "to", "a", "mysql", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L289-L311
32,925
saltstack/salt
salt/returners/mysql.py
event_return
def event_return(events): ''' Return event to mysql server Requires that configuration be enabled via 'event_return' option in master config. ''' with _get_serv(events, commit=True) as cur: for event in events: tag = event.get('tag', '') data = event.get('data', ...
python
def event_return(events): ''' Return event to mysql server Requires that configuration be enabled via 'event_return' option in master config. ''' with _get_serv(events, commit=True) as cur: for event in events: tag = event.get('tag', '') data = event.get('data', ...
[ "def", "event_return", "(", "events", ")", ":", "with", "_get_serv", "(", "events", ",", "commit", "=", "True", ")", "as", "cur", ":", "for", "event", "in", "events", ":", "tag", "=", "event", ".", "get", "(", "'tag'", ",", "''", ")", "data", "=", ...
Return event to mysql server Requires that configuration be enabled via 'event_return' option in master config.
[ "Return", "event", "to", "mysql", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L314-L327
32,926
saltstack/salt
salt/returners/syslog_return.py
_verify_options
def _verify_options(options): ''' Verify options and log warnings Returns True if all options can be verified, otherwise False ''' # sanity check all vals used for bitwise operations later bitwise_args = [('level', options['level']), ('facility', options['facility']) ...
python
def _verify_options(options): ''' Verify options and log warnings Returns True if all options can be verified, otherwise False ''' # sanity check all vals used for bitwise operations later bitwise_args = [('level', options['level']), ('facility', options['facility']) ...
[ "def", "_verify_options", "(", "options", ")", ":", "# sanity check all vals used for bitwise operations later", "bitwise_args", "=", "[", "(", "'level'", ",", "options", "[", "'level'", "]", ")", ",", "(", "'facility'", ",", "options", "[", "'facility'", "]", ")"...
Verify options and log warnings Returns True if all options can be verified, otherwise False
[ "Verify", "options", "and", "log", "warnings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/syslog_return.py#L135-L166
32,927
saltstack/salt
salt/returners/syslog_return.py
returner
def returner(ret): ''' Return data to the local syslog ''' _options = _get_options(ret) if not _verify_options(_options): return # Get values from syslog module level = getattr(syslog, _options['level']) facility = getattr(syslog, _options['facility']) # parse for syslog ...
python
def returner(ret): ''' Return data to the local syslog ''' _options = _get_options(ret) if not _verify_options(_options): return # Get values from syslog module level = getattr(syslog, _options['level']) facility = getattr(syslog, _options['facility']) # parse for syslog ...
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "if", "not", "_verify_options", "(", "_options", ")", ":", "return", "# Get values from syslog module", "level", "=", "getattr", "(", "syslog", ",", "_options", "[", "...
Return data to the local syslog
[ "Return", "data", "to", "the", "local", "syslog" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/syslog_return.py#L175-L204
32,928
saltstack/salt
salt/utils/parsers.py
DaemonMixIn.check_running
def check_running(self): ''' Check if a pid file exists and if it is associated with a running process. ''' if self.check_pidfile(): pid = self.get_pidfile() if not salt.utils.platform.is_windows(): if self.check_pidfile() and self.is_daem...
python
def check_running(self): ''' Check if a pid file exists and if it is associated with a running process. ''' if self.check_pidfile(): pid = self.get_pidfile() if not salt.utils.platform.is_windows(): if self.check_pidfile() and self.is_daem...
[ "def", "check_running", "(", "self", ")", ":", "if", "self", ".", "check_pidfile", "(", ")", ":", "pid", "=", "self", ".", "get_pidfile", "(", ")", "if", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "if", "self", ...
Check if a pid file exists and if it is associated with a running process.
[ "Check", "if", "a", "pid", "file", "exists", "and", "if", "it", "is", "associated", "with", "a", "running", "process", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/parsers.py#L1045-L1060
32,929
saltstack/salt
salt/states/ethtool.py
coalesce
def coalesce(name, **kwargs): ''' Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_...
python
def coalesce(name, **kwargs): ''' Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_...
[ "def", "coalesce", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Network device {0} coalescing settings are up to date.'", ".", ...
Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_usecs: 24 - rx_frame: 0 ...
[ "Manage", "coalescing", "settings", "of", "network", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ethtool.py#L51-L144
32,930
saltstack/salt
salt/states/esxdatacenter.py
datacenter_configured
def datacenter_configured(name): ''' Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: ...
python
def datacenter_configured(name): ''' Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: ...
[ "def", "datacenter_configured", "(", "name", ")", ":", "proxy_type", "=", "__salt__", "[", "'vsphere.get_proxy_type'", "]", "(", ")", "if", "proxy_type", "==", "'esxdatacenter'", ":", "dc_name", "=", "__salt__", "[", "'esxdatacenter.get_details'", "]", "(", ")", ...
Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: Datacenter name. Ignored if the proxytype is ...
[ "Makes", "sure", "a", "datacenter", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxdatacenter.py#L72-L126
32,931
saltstack/salt
salt/modules/napalm_formula.py
_container_path
def _container_path(model, key=None, container=None, delim=DEFAULT_TARGET_DELIM): ''' Generate all the possible paths within an OpenConfig-like object. This function returns a generator. ''' if not key: key = '' if not container...
python
def _container_path(model, key=None, container=None, delim=DEFAULT_TARGET_DELIM): ''' Generate all the possible paths within an OpenConfig-like object. This function returns a generator. ''' if not key: key = '' if not container...
[ "def", "_container_path", "(", "model", ",", "key", "=", "None", ",", "container", "=", "None", ",", "delim", "=", "DEFAULT_TARGET_DELIM", ")", ":", "if", "not", "key", ":", "key", "=", "''", "if", "not", "container", ":", "container", "=", "'config'", ...
Generate all the possible paths within an OpenConfig-like object. This function returns a generator.
[ "Generate", "all", "the", "possible", "paths", "within", "an", "OpenConfig", "-", "like", "object", ".", "This", "function", "returns", "a", "generator", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L42-L68
32,932
saltstack/salt
salt/modules/napalm_formula.py
defaults
def defaults(model, defaults_, delim='//', flipped_merge=False): ''' Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dic...
python
def defaults(model, defaults_, delim='//', flipped_merge=False): ''' Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dic...
[ "def", "defaults", "(", "model", ",", "defaults_", ",", "delim", "=", "'//'", ",", "flipped_merge", "=", "False", ")", ":", "merged", "=", "{", "}", "log", ".", "debug", "(", "'Applying the defaults:'", ")", "log", ".", "debug", "(", "defaults_", ")", ...
Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dictionary of defaults. This argument must equally be structured with respect to the OpenConfig standards. ...
[ "Apply", "the", "defaults", "to", "a", "Python", "dictionary", "having", "the", "structure", "as", "described", "in", "the", "OpenConfig", "standards", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L173-L234
32,933
saltstack/salt
salt/states/win_servermanager.py
installed
def installed(name, features=None, recurse=False, restart=False, source=None, exclude=None): ''' Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` para...
python
def installed(name, features=None, recurse=False, restart=False, source=None, exclude=None): ''' Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` para...
[ "def", "installed", "(", "name", ",", "features", "=", "None", ",", "recurse", "=", "False", ",", "restart", "=", "False", ",", "source", "=", "None", ",", "exclude", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", "...
Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` parameter. .. note:: Some features require reboot after un/installation. If so, until the server is restarted other features can not be installed! Args: ...
[ "Install", "the", "windows", "feature", ".", "To", "install", "a", "single", "feature", "use", "the", "name", "parameter", ".", "To", "install", "multiple", "features", "use", "the", "features", "parameter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_servermanager.py#L25-L189
32,934
saltstack/salt
salt/states/win_servermanager.py
removed
def removed(name, features=None, remove_payload=False, restart=False): ''' Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in...
python
def removed(name, features=None, remove_payload=False, restart=False): ''' Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in...
[ "def", "removed", "(", "name", ",", "features", "=", "None", ",", "remove_payload", "=", "False", ",", "restart", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'...
Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in win_servermanager.list_available). This can be a single feature or a ...
[ "Remove", "the", "windows", "feature", "To", "remove", "a", "single", "feature", "use", "the", "name", "parameter", ".", "To", "remove", "multiple", "features", "use", "the", "features", "parameter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_servermanager.py#L192-L320
32,935
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
_check_cors_origin
def _check_cors_origin(origin, allowed_origins): ''' Check if an origin match cors allowed origins ''' if isinstance(allowed_origins, list): if origin in allowed_origins: return origin elif allowed_origins == '*': return allowed_origins elif allowed_origins == origin:...
python
def _check_cors_origin(origin, allowed_origins): ''' Check if an origin match cors allowed origins ''' if isinstance(allowed_origins, list): if origin in allowed_origins: return origin elif allowed_origins == '*': return allowed_origins elif allowed_origins == origin:...
[ "def", "_check_cors_origin", "(", "origin", ",", "allowed_origins", ")", ":", "if", "isinstance", "(", "allowed_origins", ",", "list", ")", ":", "if", "origin", "in", "allowed_origins", ":", "return", "origin", "elif", "allowed_origins", "==", "'*'", ":", "ret...
Check if an origin match cors allowed origins
[ "Check", "if", "an", "origin", "match", "cors", "allowed", "origins" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1750-L1761
32,936
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
EventListener.clean_by_request
def clean_by_request(self, request): ''' Remove all futures that were waiting for request `request` since it is done waiting ''' if request not in self.request_map: return for tag, matcher, future in self.request_map[request]: # timeout the future ...
python
def clean_by_request(self, request): ''' Remove all futures that were waiting for request `request` since it is done waiting ''' if request not in self.request_map: return for tag, matcher, future in self.request_map[request]: # timeout the future ...
[ "def", "clean_by_request", "(", "self", ",", "request", ")", ":", "if", "request", "not", "in", "self", ".", "request_map", ":", "return", "for", "tag", ",", "matcher", ",", "future", "in", "self", ".", "request_map", "[", "request", "]", ":", "# timeout...
Remove all futures that were waiting for request `request` since it is done waiting
[ "Remove", "all", "futures", "that", "were", "waiting", "for", "request", "request", "since", "it", "is", "done", "waiting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L302-L316
32,937
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
EventListener._timeout_future
def _timeout_future(self, tag, matcher, future): ''' Timeout a specific future ''' if (tag, matcher) not in self.tag_map: return if not future.done(): future.set_exception(TimeoutException()) self.tag_map[(tag, matcher)].remove(future) ...
python
def _timeout_future(self, tag, matcher, future): ''' Timeout a specific future ''' if (tag, matcher) not in self.tag_map: return if not future.done(): future.set_exception(TimeoutException()) self.tag_map[(tag, matcher)].remove(future) ...
[ "def", "_timeout_future", "(", "self", ",", "tag", ",", "matcher", ",", "future", ")", ":", "if", "(", "tag", ",", "matcher", ")", "not", "in", "self", ".", "tag_map", ":", "return", "if", "not", "future", ".", "done", "(", ")", ":", "future", ".",...
Timeout a specific future
[ "Timeout", "a", "specific", "future" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L362-L372
32,938
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
EventListener._handle_event_socket_recv
def _handle_event_socket_recv(self, raw): ''' Callback for events on the event sub socket ''' mtag, data = self.event.unpack(raw, self.event.serial) # see if we have any futures that need this info: for (tag, matcher), futures in six.iteritems(self.tag_map): ...
python
def _handle_event_socket_recv(self, raw): ''' Callback for events on the event sub socket ''' mtag, data = self.event.unpack(raw, self.event.serial) # see if we have any futures that need this info: for (tag, matcher), futures in six.iteritems(self.tag_map): ...
[ "def", "_handle_event_socket_recv", "(", "self", ",", "raw", ")", ":", "mtag", ",", "data", "=", "self", ".", "event", ".", "unpack", "(", "raw", ",", "self", ".", "event", ".", "serial", ")", "# see if we have any futures that need this info:", "for", "(", ...
Callback for events on the event sub socket
[ "Callback", "for", "events", "on", "the", "event", "sub", "socket" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L374-L398
32,939
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler._verify_client
def _verify_client(self, low): ''' Verify that the client is in fact one we have ''' if 'client' not in low or low.get('client') not in self.saltclients: self.set_status(400) self.write("400 Invalid Client: Client not found in salt clients") self.finis...
python
def _verify_client(self, low): ''' Verify that the client is in fact one we have ''' if 'client' not in low or low.get('client') not in self.saltclients: self.set_status(400) self.write("400 Invalid Client: Client not found in salt clients") self.finis...
[ "def", "_verify_client", "(", "self", ",", "low", ")", ":", "if", "'client'", "not", "in", "low", "or", "low", ".", "get", "(", "'client'", ")", "not", "in", "self", ".", "saltclients", ":", "self", ".", "set_status", "(", "400", ")", "self", ".", ...
Verify that the client is in fact one we have
[ "Verify", "that", "the", "client", "is", "in", "fact", "one", "we", "have" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L407-L416
32,940
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.initialize
def initialize(self): ''' Initialize the handler before requests are called ''' if not hasattr(self.application, 'event_listener'): log.debug('init a listener') self.application.event_listener = EventListener( self.application.mod_opts, ...
python
def initialize(self): ''' Initialize the handler before requests are called ''' if not hasattr(self.application, 'event_listener'): log.debug('init a listener') self.application.event_listener = EventListener( self.application.mod_opts, ...
[ "def", "initialize", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ".", "application", ",", "'event_listener'", ")", ":", "log", ".", "debug", "(", "'init a listener'", ")", "self", ".", "application", ".", "event_listener", "=", "EventListener...
Initialize the handler before requests are called
[ "Initialize", "the", "handler", "before", "requests", "are", "called" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L418-L440
32,941
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.token
def token(self): ''' The token used for the request ''' # find the token (cookie or headers) if AUTH_TOKEN_HEADER in self.request.headers: return self.request.headers[AUTH_TOKEN_HEADER] else: return self.get_cookie(AUTH_COOKIE_NAME)
python
def token(self): ''' The token used for the request ''' # find the token (cookie or headers) if AUTH_TOKEN_HEADER in self.request.headers: return self.request.headers[AUTH_TOKEN_HEADER] else: return self.get_cookie(AUTH_COOKIE_NAME)
[ "def", "token", "(", "self", ")", ":", "# find the token (cookie or headers)", "if", "AUTH_TOKEN_HEADER", "in", "self", ".", "request", ".", "headers", ":", "return", "self", ".", "request", ".", "headers", "[", "AUTH_TOKEN_HEADER", "]", "else", ":", "return", ...
The token used for the request
[ "The", "token", "used", "for", "the", "request" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L443-L451
32,942
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler._verify_auth
def _verify_auth(self): ''' Boolean whether the request is auth'd ''' return self.token and bool(self.application.auth.get_tok(self.token))
python
def _verify_auth(self): ''' Boolean whether the request is auth'd ''' return self.token and bool(self.application.auth.get_tok(self.token))
[ "def", "_verify_auth", "(", "self", ")", ":", "return", "self", ".", "token", "and", "bool", "(", "self", ".", "application", ".", "auth", ".", "get_tok", "(", "self", ".", "token", ")", ")" ]
Boolean whether the request is auth'd
[ "Boolean", "whether", "the", "request", "is", "auth", "d" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L453-L458
32,943
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.serialize
def serialize(self, data): ''' Serlialize the output based on the Accept header ''' self.set_header('Content-Type', self.content_type) return self.dumper(data)
python
def serialize(self, data): ''' Serlialize the output based on the Accept header ''' self.set_header('Content-Type', self.content_type) return self.dumper(data)
[ "def", "serialize", "(", "self", ",", "data", ")", ":", "self", ".", "set_header", "(", "'Content-Type'", ",", "self", ".", "content_type", ")", "return", "self", ".", "dumper", "(", "data", ")" ]
Serlialize the output based on the Accept header
[ "Serlialize", "the", "output", "based", "on", "the", "Accept", "header" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L514-L520
32,944
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler._form_loader
def _form_loader(self, _): ''' function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are ''' data = {} for key in self.request.arguments: val = self.get_arguments(key) if len(val) == 1...
python
def _form_loader(self, _): ''' function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are ''' data = {} for key in self.request.arguments: val = self.get_arguments(key) if len(val) == 1...
[ "def", "_form_loader", "(", "self", ",", "_", ")", ":", "data", "=", "{", "}", "for", "key", "in", "self", ".", "request", ".", "arguments", ":", "val", "=", "self", ".", "get_arguments", "(", "key", ")", "if", "len", "(", "val", ")", "==", "1", ...
function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are
[ "function", "to", "get", "the", "data", "from", "the", "urlencoded", "forms", "ignore", "the", "data", "passed", "in", "and", "just", "get", "the", "args", "from", "wherever", "they", "are" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L522-L534
32,945
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.deserialize
def deserialize(self, data): ''' Deserialize the data based on request content type headers ''' ct_in_map = { 'application/x-www-form-urlencoded': self._form_loader, 'application/json': salt.utils.json.loads, 'application/x-yaml': salt.utils.yaml.safe_...
python
def deserialize(self, data): ''' Deserialize the data based on request content type headers ''' ct_in_map = { 'application/x-www-form-urlencoded': self._form_loader, 'application/json': salt.utils.json.loads, 'application/x-yaml': salt.utils.yaml.safe_...
[ "def", "deserialize", "(", "self", ",", "data", ")", ":", "ct_in_map", "=", "{", "'application/x-www-form-urlencoded'", ":", "self", ".", "_form_loader", ",", "'application/json'", ":", "salt", ".", "utils", ".", "json", ".", "loads", ",", "'application/x-yaml'"...
Deserialize the data based on request content type headers
[ "Deserialize", "the", "data", "based", "on", "request", "content", "type", "headers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L536-L556
32,946
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler._get_lowstate
def _get_lowstate(self): ''' Format the incoming data into a lowstate object ''' if not self.request.body: return data = self.deserialize(self.request.body) self.request_payload = copy(data) if data and 'arg' in data and not isinstance(data['arg'], li...
python
def _get_lowstate(self): ''' Format the incoming data into a lowstate object ''' if not self.request.body: return data = self.deserialize(self.request.body) self.request_payload = copy(data) if data and 'arg' in data and not isinstance(data['arg'], li...
[ "def", "_get_lowstate", "(", "self", ")", ":", "if", "not", "self", ".", "request", ".", "body", ":", "return", "data", "=", "self", ".", "deserialize", "(", "self", ".", "request", ".", "body", ")", "self", ".", "request_payload", "=", "copy", "(", ...
Format the incoming data into a lowstate object
[ "Format", "the", "incoming", "data", "into", "a", "lowstate", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L558-L575
32,947
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.set_default_headers
def set_default_headers(self): ''' Set default CORS headers ''' mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): origin = self.request.headers.get('Origin') allowed_origin = _check_cors_origin(origin, mod_opts['cors_origin']) ...
python
def set_default_headers(self): ''' Set default CORS headers ''' mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): origin = self.request.headers.get('Origin') allowed_origin = _check_cors_origin(origin, mod_opts['cors_origin']) ...
[ "def", "set_default_headers", "(", "self", ")", ":", "mod_opts", "=", "self", ".", "application", ".", "mod_opts", "if", "mod_opts", ".", "get", "(", "'cors_origin'", ")", ":", "origin", "=", "self", ".", "request", ".", "headers", ".", "get", "(", "'Ori...
Set default CORS headers
[ "Set", "default", "CORS", "headers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L577-L589
32,948
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
BaseSaltAPIHandler.options
def options(self, *args, **kwargs): ''' Return CORS headers for preflight requests ''' # Allow X-Auth-Token in requests request_headers = self.request.headers.get('Access-Control-Request-Headers') allowed_headers = request_headers.split(',') # Filter allowed head...
python
def options(self, *args, **kwargs): ''' Return CORS headers for preflight requests ''' # Allow X-Auth-Token in requests request_headers = self.request.headers.get('Access-Control-Request-Headers') allowed_headers = request_headers.split(',') # Filter allowed head...
[ "def", "options", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Allow X-Auth-Token in requests", "request_headers", "=", "self", ".", "request", ".", "headers", ".", "get", "(", "'Access-Control-Request-Headers'", ")", "allowed_headers", "...
Return CORS headers for preflight requests
[ "Return", "CORS", "headers", "for", "preflight", "requests" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L591-L611
32,949
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAuthHandler.get
def get(self): ''' All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text ...
python
def get(self): ''' All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text ...
[ "def", "get", "(", "self", ")", ":", "self", ".", "set_status", "(", "401", ")", "self", ".", "set_header", "(", "'WWW-Authenticate'", ",", "'Session'", ")", "ret", "=", "{", "'status'", ":", "'401 Unauthorized'", ",", "'return'", ":", "'Please log in'", "...
All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text GET /login HTTP/1.1 ...
[ "All", "logins", "are", "done", "over", "post", "this", "is", "a", "parked", "endpoint" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L618-L655
32,950
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAPIHandler.get
def get(self): ''' An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash c...
python
def get(self): ''' An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash c...
[ "def", "get", "(", "self", ")", ":", "ret", "=", "{", "\"clients\"", ":", "list", "(", "self", ".", "saltclients", ".", "keys", "(", ")", ")", ",", "\"return\"", ":", "\"Welcome\"", "}", "self", ".", "write", "(", "self", ".", "serialize", "(", "re...
An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000 .. c...
[ "An", "endpoint", "to", "determine", "salt", "-", "api", "capabilities" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L795-L831
32,951
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAPIHandler.disbatch
def disbatch(self): ''' Disbatch all lowstates to the appropriate clients ''' ret = [] # check clients before going, we want to throw 400 if one is bad for low in self.lowstate: if not self._verify_client(low): return # Make sure ...
python
def disbatch(self): ''' Disbatch all lowstates to the appropriate clients ''' ret = [] # check clients before going, we want to throw 400 if one is bad for low in self.lowstate: if not self._verify_client(low): return # Make sure ...
[ "def", "disbatch", "(", "self", ")", ":", "ret", "=", "[", "]", "# check clients before going, we want to throw 400 if one is bad", "for", "low", "in", "self", ".", "lowstate", ":", "if", "not", "self", ".", "_verify_client", "(", "low", ")", ":", "return", "#...
Disbatch all lowstates to the appropriate clients
[ "Disbatch", "all", "lowstates", "to", "the", "appropriate", "clients" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L912-L946
32,952
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAPIHandler._disbatch_local_async
def _disbatch_local_async(self, chunk): ''' Disbatch local client_async commands ''' f_call = self._format_call_run_job_async(chunk) # fire a job off pub_data = yield self.saltclients['local_async'](*f_call.get('args', ()), **f_call.get('kwargs', {})) raise torna...
python
def _disbatch_local_async(self, chunk): ''' Disbatch local client_async commands ''' f_call = self._format_call_run_job_async(chunk) # fire a job off pub_data = yield self.saltclients['local_async'](*f_call.get('args', ()), **f_call.get('kwargs', {})) raise torna...
[ "def", "_disbatch_local_async", "(", "self", ",", "chunk", ")", ":", "f_call", "=", "self", ".", "_format_call_run_job_async", "(", "chunk", ")", "# fire a job off", "pub_data", "=", "yield", "self", ".", "saltclients", "[", "'local_async'", "]", "(", "*", "f_...
Disbatch local client_async commands
[ "Disbatch", "local", "client_async", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1114-L1122
32,953
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAPIHandler._disbatch_runner
def _disbatch_runner(self, chunk): ''' Disbatch runner client commands ''' full_return = chunk.pop('full_return', False) pub_data = self.saltclients['runner'](chunk) tag = pub_data['tag'] + '/ret' try: event = yield self.application.event_listener.get_...
python
def _disbatch_runner(self, chunk): ''' Disbatch runner client commands ''' full_return = chunk.pop('full_return', False) pub_data = self.saltclients['runner'](chunk) tag = pub_data['tag'] + '/ret' try: event = yield self.application.event_listener.get_...
[ "def", "_disbatch_runner", "(", "self", ",", "chunk", ")", ":", "full_return", "=", "chunk", ".", "pop", "(", "'full_return'", ",", "False", ")", "pub_data", "=", "self", ".", "saltclients", "[", "'runner'", "]", "(", "chunk", ")", "tag", "=", "pub_data"...
Disbatch runner client commands
[ "Disbatch", "runner", "client", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1125-L1139
32,954
saltstack/salt
salt/netapi/rest_tornado/saltnado.py
SaltAPIHandler._disbatch_runner_async
def _disbatch_runner_async(self, chunk): ''' Disbatch runner client_async commands ''' pub_data = self.saltclients['runner'](chunk) raise tornado.gen.Return(pub_data)
python
def _disbatch_runner_async(self, chunk): ''' Disbatch runner client_async commands ''' pub_data = self.saltclients['runner'](chunk) raise tornado.gen.Return(pub_data)
[ "def", "_disbatch_runner_async", "(", "self", ",", "chunk", ")", ":", "pub_data", "=", "self", ".", "saltclients", "[", "'runner'", "]", "(", "chunk", ")", "raise", "tornado", ".", "gen", ".", "Return", "(", "pub_data", ")" ]
Disbatch runner client_async commands
[ "Disbatch", "runner", "client_async", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1142-L1147
32,955
saltstack/salt
salt/states/pdbedit.py
absent
def absent(name): ''' Ensure user account is absent name : string username ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} # remove if needed if name in __salt__['pdbedit.list'](False): res = __salt__['pdbedit.delete']...
python
def absent(name): ''' Ensure user account is absent name : string username ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} # remove if needed if name in __salt__['pdbedit.list'](False): res = __salt__['pdbedit.delete']...
[ "def", "absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "# remove if needed", "if", "name", "in", "__salt__", "[", "'pdbedit.list'"...
Ensure user account is absent name : string username
[ "Ensure", "user", "account", "is", "absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pdbedit.py#L53-L75
32,956
saltstack/salt
salt/states/pdbedit.py
managed
def managed(name, **kwargs): ''' Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path scrip...
python
def managed(name, **kwargs): ''' Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path scrip...
[ "def", "managed", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "# save state", "saved", "=", "__salt__", "["...
Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path script : string logon script drive...
[ "Manage", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pdbedit.py#L78-L146
32,957
saltstack/salt
salt/modules/salt_proxy.py
_write_proxy_conf
def _write_proxy_conf(proxyfile): ''' write to file ''' msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \ .format(proxyfile) log.trace('Salt Proxy Module: write proxy conf') if proxyfile: log.debug('Writing proxy conf file') with salt.utils.files.fo...
python
def _write_proxy_conf(proxyfile): ''' write to file ''' msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \ .format(proxyfile) log.trace('Salt Proxy Module: write proxy conf') if proxyfile: log.debug('Writing proxy conf file') with salt.utils.files.fo...
[ "def", "_write_proxy_conf", "(", "proxyfile", ")", ":", "msg", "=", "'Invalid value for proxy file provided!, Supplied value = {0}'", ".", "format", "(", "proxyfile", ")", "log", ".", "trace", "(", "'Salt Proxy Module: write proxy conf'", ")", "if", "proxyfile", ":", "l...
write to file
[ "write", "to", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L24-L41
32,958
saltstack/salt
salt/modules/salt_proxy.py
_proxy_conf_file
def _proxy_conf_file(proxyfile, test): ''' Check if proxy conf exists and update ''' changes_old = [] changes_new = [] success = True if not os.path.exists(proxyfile): try: if not test: changes_new.append(_write_proxy_conf(proxyfile)) msg =...
python
def _proxy_conf_file(proxyfile, test): ''' Check if proxy conf exists and update ''' changes_old = [] changes_new = [] success = True if not os.path.exists(proxyfile): try: if not test: changes_new.append(_write_proxy_conf(proxyfile)) msg =...
[ "def", "_proxy_conf_file", "(", "proxyfile", ",", "test", ")", ":", "changes_old", "=", "[", "]", "changes_new", "=", "[", "]", "success", "=", "True", "if", "not", "os", ".", "path", ".", "exists", "(", "proxyfile", ")", ":", "try", ":", "if", "not"...
Check if proxy conf exists and update
[ "Check", "if", "proxy", "conf", "exists", "and", "update" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L44-L70
32,959
saltstack/salt
salt/modules/salt_proxy.py
_is_proxy_running
def _is_proxy_running(proxyname): ''' Check if proxy for this name is running ''' cmd = ('ps ax | grep "salt-proxy --proxyid={0}" | grep -v grep' .format(salt.ext.six.moves.shlex_quote(proxyname))) cmdout = __salt__['cmd.run_all']( cmd, timeout=5, python_shell=True...
python
def _is_proxy_running(proxyname): ''' Check if proxy for this name is running ''' cmd = ('ps ax | grep "salt-proxy --proxyid={0}" | grep -v grep' .format(salt.ext.six.moves.shlex_quote(proxyname))) cmdout = __salt__['cmd.run_all']( cmd, timeout=5, python_shell=True...
[ "def", "_is_proxy_running", "(", "proxyname", ")", ":", "cmd", "=", "(", "'ps ax | grep \"salt-proxy --proxyid={0}\" | grep -v grep'", ".", "format", "(", "salt", ".", "ext", ".", "six", ".", "moves", ".", "shlex_quote", "(", "proxyname", ")", ")", ")", "cmdout"...
Check if proxy for this name is running
[ "Check", "if", "proxy", "for", "this", "name", "is", "running" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L73-L86
32,960
saltstack/salt
salt/modules/salt_proxy.py
_proxy_process
def _proxy_process(proxyname, test): ''' Check and execute proxy process ''' changes_old = [] changes_new = [] if not _is_proxy_running(proxyname): if not test: __salt__['cmd.run_all']( 'salt-proxy --proxyid={0} -l info -d'.format(salt.ext.six.moves.shlex_quot...
python
def _proxy_process(proxyname, test): ''' Check and execute proxy process ''' changes_old = [] changes_new = [] if not _is_proxy_running(proxyname): if not test: __salt__['cmd.run_all']( 'salt-proxy --proxyid={0} -l info -d'.format(salt.ext.six.moves.shlex_quot...
[ "def", "_proxy_process", "(", "proxyname", ",", "test", ")", ":", "changes_old", "=", "[", "]", "changes_new", "=", "[", "]", "if", "not", "_is_proxy_running", "(", "proxyname", ")", ":", "if", "not", "test", ":", "__salt__", "[", "'cmd.run_all'", "]", "...
Check and execute proxy process
[ "Check", "and", "execute", "proxy", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L89-L108
32,961
saltstack/salt
salt/netapi/rest_tornado/event_processor.py
SaltInfo.process_minion_update
def process_minion_update(self, event_data): ''' Associate grains data with a minion and publish minion update ''' tag = event_data['tag'] event_info = event_data['data'] mid = tag.split('/')[-1] if not self.minions.get(mid, None): self.minions[mid] ...
python
def process_minion_update(self, event_data): ''' Associate grains data with a minion and publish minion update ''' tag = event_data['tag'] event_info = event_data['data'] mid = tag.split('/')[-1] if not self.minions.get(mid, None): self.minions[mid] ...
[ "def", "process_minion_update", "(", "self", ",", "event_data", ")", ":", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "mid", "=", "tag", ".", "split", "(", "'/'", ")", "[", "-", "1", "]", "if", "n...
Associate grains data with a minion and publish minion update
[ "Associate", "grains", "data", "with", "a", "minion", "and", "publish", "minion", "update" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L60-L76
32,962
saltstack/salt
salt/netapi/rest_tornado/event_processor.py
SaltInfo.process_new_job_event
def process_new_job_event(self, event_data): ''' Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted. ''' job = None ...
python
def process_new_job_event(self, event_data): ''' Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted. ''' job = None ...
[ "def", "process_new_job_event", "(", "self", ",", "event_data", ")", ":", "job", "=", "None", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "minions", "=", "{", "}", "for", "mid", "in", "event_info", "[...
Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted.
[ "Creates", "a", "new", "job", "with", "properties", "from", "the", "event", "data", "like", "jid", "function", "args", "timestamp", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L102-L129
32,963
saltstack/salt
salt/utils/timeout.py
wait_for
def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None): ''' Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeo...
python
def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None): ''' Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeo...
[ "def", "wait_for", "(", "func", ",", "timeout", "=", "10", ",", "step", "=", "1", ",", "default", "=", "None", ",", "func_args", "=", "(", ")", ",", "func_kwargs", "=", "None", ")", ":", "if", "func_kwargs", "is", "None", ":", "func_kwargs", "=", "...
Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeout: int | float @param step: Interval at which we should check for the value @type step: i...
[ "Call", "func", "at", "regular", "intervals", "and", "Waits", "until", "the", "given", "function", "returns", "a", "truthy", "value", "within", "the", "given", "timeout", "and", "returns", "that", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeout.py#L12-L50
32,964
saltstack/salt
salt/modules/debian_service.py
get_enabled
def get_enabled(): ''' Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel()) ret = set() lines = glob.glob('{0}*'.format(prefix)) for line in lines: ...
python
def get_enabled(): ''' Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel()) ret = set() lines = glob.glob('{0}*'.format(prefix)) for line in lines: ...
[ "def", "get_enabled", "(", ")", ":", "prefix", "=", "'/etc/rc[S{0}].d/S'", ".", "format", "(", "_get_runlevel", "(", ")", ")", "ret", "=", "set", "(", ")", "lines", "=", "glob", ".", "glob", "(", "'{0}*'", ".", "format", "(", "prefix", ")", ")", "for...
Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled
[ "Return", "a", "list", "of", "service", "that", "are", "enabled", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L76-L91
32,965
saltstack/salt
salt/modules/keystone.py
_get_kwargs
def _get_kwargs(profile=None, **connection_args): ''' get connection args ''' if profile: prefix = profile + ":keystone." else: prefix = "keystone." def get(key, default=None): ''' look in connection_args first, then default to config file ''' ret...
python
def _get_kwargs(profile=None, **connection_args): ''' get connection args ''' if profile: prefix = profile + ":keystone." else: prefix = "keystone." def get(key, default=None): ''' look in connection_args first, then default to config file ''' ret...
[ "def", "_get_kwargs", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "if", "profile", ":", "prefix", "=", "profile", "+", "\":keystone.\"", "else", ":", "prefix", "=", "\"keystone.\"", "def", "get", "(", "key", ",", "default", "...
get connection args
[ "get", "connection", "args" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L94-L135
32,966
saltstack/salt
salt/modules/keystone.py
api_version
def api_version(profile=None, **connection_args): ''' Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version ''' kwargs = _get_kwargs(profile=profile, **connection_args) auth_url = kwargs.get('auth_url', kwargs.get...
python
def api_version(profile=None, **connection_args): ''' Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version ''' kwargs = _get_kwargs(profile=profile, **connection_args) auth_url = kwargs.get('auth_url', kwargs.get...
[ "def", "api_version", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kwargs", "=", "_get_kwargs", "(", "profile", "=", "profile", ",", "*", "*", "connection_args", ")", "auth_url", "=", "kwargs", ".", "get", "(", "'auth_url'", ...
Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version
[ "Returns", "the", "API", "version", "derived", "from", "endpoint", "s", "response", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L138-L154
32,967
saltstack/salt
salt/modules/keystone.py
auth
def auth(profile=None, **connection_args): ''' Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth ''' __utils__['versions.warn_until']( 'Neon', ( 'The keystone modu...
python
def auth(profile=None, **connection_args): ''' Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth ''' __utils__['versions.warn_until']( 'Neon', ( 'The keystone modu...
[ "def", "auth", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "__utils__", "[", "'versions.warn_until'", "]", "(", "'Neon'", ",", "(", "'The keystone module has been deprecated and will be removed in {version}. '", "'Please update to using the key...
Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth
[ "Set", "up", "keystone", "credentials", ".", "Only", "intended", "to", "be", "used", "within", "Keystone", "-", "enabled", "modules", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L157-L192
32,968
saltstack/salt
salt/modules/keystone.py
ec2_credentials_create
def ec2_credentials_create(user_id=None, name=None, tenant_id=None, tenant=None, profile=None, **connection_args): ''' Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentia...
python
def ec2_credentials_create(user_id=None, name=None, tenant_id=None, tenant=None, profile=None, **connection_args): ''' Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentia...
[ "def", "ec2_credentials_create", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "tenant_id", "=", "None", ",", "tenant", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "pro...
Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_create name=admin tenant=admin salt '*' keystone.ec2_credentials_create \ user_id=c965f79c4f864eaaa9c3b41904e67082 \ tenant_id=722787eb540849158668370dc6...
[ "Create", "EC2", "-", "compatible", "credentials", "for", "user", "per", "tenant" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L195-L229
32,969
saltstack/salt
salt/modules/keystone.py
ec2_credentials_delete
def ec2_credentials_delete(user_id=None, name=None, access_key=None, profile=None, **connection_args): ''' Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access...
python
def ec2_credentials_delete(user_id=None, name=None, access_key=None, profile=None, **connection_args): ''' Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access...
[ "def", "ec2_credentials_delete", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "access_key", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "conn...
Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access_key=5f66d2f24f604b8bb9cd28886106f442 salt '*' keystone.ec2_credentials_delete name=admin \ access_key=5f66d2f24f604b8bb9cd28...
[ "Delete", "EC2", "-", "compatible", "credentials" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L232-L255
32,970
saltstack/salt
salt/modules/keystone.py
endpoint_create
def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova...
python
def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova...
[ "def", "endpoint_create", "(", "service", ",", "publicurl", "=", "None", ",", "internalurl", "=", "None", ",", "adminurl", "=", "None", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "url", "=", "None", ",", "interface", "=", "None", ","...
Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne'
[ "Create", "an", "endpoint", "for", "an", "Openstack", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L372-L402
32,971
saltstack/salt
salt/modules/keystone.py
endpoint_delete
def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args): ''' Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=adm...
python
def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args): ''' Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=adm...
[ "def", "endpoint_delete", "(", "service", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "interface", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", ...
Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=admin [region=RegionOne]
[ "Delete", "endpoints", "of", "an", "Openstack", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L405-L424
32,972
saltstack/salt
salt/modules/keystone.py
role_create
def role_create(name, profile=None, **connection_args): ''' Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin ''' kstone = auth(profile, **connection_args) if 'Error' not in role_get(name=name, profile=profile, **connection_args): ...
python
def role_create(name, profile=None, **connection_args): ''' Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin ''' kstone = auth(profile, **connection_args) if 'Error' not in role_get(name=name, profile=profile, **connection_args): ...
[ "def", "role_create", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "'Error'", "not", "in", "role_get", "(", "name", "=", "name"...
Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin
[ "Create", "a", "named", "role", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L427-L442
32,973
saltstack/salt
salt/modules/keystone.py
service_create
def service_create(name, service_type, description=None, profile=None, **connection_args): ''' Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service' ''' kstone = auth(pr...
python
def service_create(name, service_type, description=None, profile=None, **connection_args): ''' Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service' ''' kstone = auth(pr...
[ "def", "service_create", "(", "name", ",", "service_type", ",", "description", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "service", ...
Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service'
[ "Add", "service", "to", "Keystone", "service", "catalog" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L525-L539
32,974
saltstack/salt
salt/modules/keystone.py
service_delete
def service_delete(service_id=None, name=None, profile=None, **connection_args): ''' Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova ''' ...
python
def service_delete(service_id=None, name=None, profile=None, **connection_args): ''' Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova ''' ...
[ "def", "service_delete", "(", "service_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "name", ":",...
Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova
[ "Delete", "a", "service", "from", "Keystone", "service", "catalog" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L542-L558
32,975
saltstack/salt
salt/modules/keystone.py
tenant_create
def tenant_create(name, description=None, enabled=True, profile=None, **connection_args): ''' Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False...
python
def tenant_create(name, description=None, enabled=True, profile=None, **connection_args): ''' Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False...
[ "def", "tenant_create", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "n...
Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False
[ "Create", "a", "keystone", "tenant" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L608-L622
32,976
saltstack/salt
salt/modules/keystone.py
user_verify_password
def user_verify_password(user_id=None, name=None, password=None, profile=None, **connection_args): ''' Verify a user's password CLI Examples: .. code-block:: bash salt '*' keystone.user_verify_password name=test password=foobar salt '*' keystone.user_verify_pa...
python
def user_verify_password(user_id=None, name=None, password=None, profile=None, **connection_args): ''' Verify a user's password CLI Examples: .. code-block:: bash salt '*' keystone.user_verify_password name=test password=foobar salt '*' keystone.user_verify_pa...
[ "def", "user_verify_password", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "password", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connecti...
Verify a user's password CLI Examples: .. code-block:: bash salt '*' keystone.user_verify_password name=test password=foobar salt '*' keystone.user_verify_password user_id=c965f79c4f864eaaa9c3b41904e67082 password=foobar
[ "Verify", "a", "user", "s", "password" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1112-L1157
32,977
saltstack/salt
salt/roster/sshconfig.py
parse_ssh_config
def parse_ssh_config(lines): ''' Parses lines from the SSH config to create roster targets. :param lines: Individual lines from the ssh config file :return: Dictionary of targets in similar style to the flat roster ''' # transform the list of individual lines into a list of sublists where each ...
python
def parse_ssh_config(lines): ''' Parses lines from the SSH config to create roster targets. :param lines: Individual lines from the ssh config file :return: Dictionary of targets in similar style to the flat roster ''' # transform the list of individual lines into a list of sublists where each ...
[ "def", "parse_ssh_config", "(", "lines", ")", ":", "# transform the list of individual lines into a list of sublists where each", "# sublist represents a single Host definition", "hosts", "=", "[", "]", "for", "line", "in", "lines", ":", "line", "=", "salt", ".", "utils", ...
Parses lines from the SSH config to create roster targets. :param lines: Individual lines from the ssh config file :return: Dictionary of targets in similar style to the flat roster
[ "Parses", "lines", "from", "the", "SSH", "config", "to", "create", "roster", "targets", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L45-L94
32,978
saltstack/salt
salt/exceptions.py
SaltException.pack
def pack(self): ''' Pack this exception into a serializable dictionary that is safe for transport via msgpack ''' if six.PY3: return {'message': six.text_type(self), 'args': self.args} return dict(message=self.__unicode__(), args=self.args)
python
def pack(self): ''' Pack this exception into a serializable dictionary that is safe for transport via msgpack ''' if six.PY3: return {'message': six.text_type(self), 'args': self.args} return dict(message=self.__unicode__(), args=self.args)
[ "def", "pack", "(", "self", ")", ":", "if", "six", ".", "PY3", ":", "return", "{", "'message'", ":", "six", ".", "text_type", "(", "self", ")", ",", "'args'", ":", "self", ".", "args", "}", "return", "dict", "(", "message", "=", "self", ".", "__u...
Pack this exception into a serializable dictionary that is safe for transport via msgpack
[ "Pack", "this", "exception", "into", "a", "serializable", "dictionary", "that", "is", "safe", "for", "transport", "via", "msgpack" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/exceptions.py#L65-L72
32,979
saltstack/salt
salt/modules/namecheap_domains.py
reactivate
def reactivate(domain_name): ''' Try to reactivate the expired domain name Returns the following information: - Whether or not the domain was reactivated successfully - The amount charged for reactivation - The order ID - The transaction ID CLI Example: .. code-block:: bash ...
python
def reactivate(domain_name): ''' Try to reactivate the expired domain name Returns the following information: - Whether or not the domain was reactivated successfully - The amount charged for reactivation - The order ID - The transaction ID CLI Example: .. code-block:: bash ...
[ "def", "reactivate", "(", "domain_name", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.reactivate'", ")", "opts", "[", "'DomainName'", "]", "=", "domain_name", "response_xml", "=", "salt", ".", "utils"...
Try to reactivate the expired domain name Returns the following information: - Whether or not the domain was reactivated successfully - The amount charged for reactivation - The order ID - The transaction ID CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.re...
[ "Try", "to", "reactivate", "the", "expired", "domain", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L54-L80
32,980
saltstack/salt
salt/modules/namecheap_domains.py
renew
def renew(domain_name, years, promotion_code=None): ''' Try to renew the specified expiring domain name for a specified number of years domain_name The domain name to be renewed years Number of years to renew Returns the following information: - Whether or not the domain was ...
python
def renew(domain_name, years, promotion_code=None): ''' Try to renew the specified expiring domain name for a specified number of years domain_name The domain name to be renewed years Number of years to renew Returns the following information: - Whether or not the domain was ...
[ "def", "renew", "(", "domain_name", ",", "years", ",", "promotion_code", "=", "None", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.renew'", ")", "opts", "[", "'DomainName'", "]", "=", "domain_name",...
Try to renew the specified expiring domain name for a specified number of years domain_name The domain name to be renewed years Number of years to renew Returns the following information: - Whether or not the domain was renewed successfully - The domain ID - The order ID ...
[ "Try", "to", "renew", "the", "specified", "expiring", "domain", "name", "for", "a", "specified", "number", "of", "years" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L83-L120
32,981
saltstack/salt
salt/modules/namecheap_domains.py
check
def check(*domains_to_check): ''' Checks the availability of domains domains_to_check array of strings List of domains to check Returns a dictionary mapping the each domain name to a boolean denoting whether or not it is available. CLI Example: .. code-block:: bash salt...
python
def check(*domains_to_check): ''' Checks the availability of domains domains_to_check array of strings List of domains to check Returns a dictionary mapping the each domain name to a boolean denoting whether or not it is available. CLI Example: .. code-block:: bash salt...
[ "def", "check", "(", "*", "domains_to_check", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.check'", ")", "opts", "[", "'DomainList'", "]", "=", "','", ".", "join", "(", "domains_to_check", ")", "r...
Checks the availability of domains domains_to_check array of strings List of domains to check Returns a dictionary mapping the each domain name to a boolean denoting whether or not it is available. CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.check domai...
[ "Checks", "the", "availability", "of", "domains" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L212-L241
32,982
saltstack/salt
salt/modules/namecheap_domains.py
get_info
def get_info(domain_name): ''' Returns information about the requested domain returns a dictionary of information about the domain_name domain_name string Domain name to get information about CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_info my-d...
python
def get_info(domain_name): ''' Returns information about the requested domain returns a dictionary of information about the domain_name domain_name string Domain name to get information about CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_info my-d...
[ "def", "get_info", "(", "domain_name", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.getinfo'", ")", "opts", "[", "'DomainName'", "]", "=", "domain_name", "response_xml", "=", "salt", ".", "utils", "...
Returns information about the requested domain returns a dictionary of information about the domain_name domain_name string Domain name to get information about CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_info my-domain-name
[ "Returns", "information", "about", "the", "requested", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L244-L269
32,983
saltstack/salt
salt/modules/namecheap_domains.py
get_tld_list
def get_tld_list(): ''' Returns a list of TLDs as objects CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_tld_list ''' response_xml = salt.utils.namecheap.get_request(salt.utils.namecheap.get_opts('namecheap.domains.gettldlist')) if response_xml is None:...
python
def get_tld_list(): ''' Returns a list of TLDs as objects CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_tld_list ''' response_xml = salt.utils.namecheap.get_request(salt.utils.namecheap.get_opts('namecheap.domains.gettldlist')) if response_xml is None:...
[ "def", "get_tld_list", "(", ")", ":", "response_xml", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_request", "(", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.gettldlist'", ")", ")", "if", "response_xml", "is", ...
Returns a list of TLDs as objects CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains.get_tld_list
[ "Returns", "a", "list", "of", "TLDs", "as", "objects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L272-L301
32,984
saltstack/salt
salt/modules/namecheap_domains.py
get_list
def get_list(list_type=None, search_term=None, page=None, page_size=None, sort_by=None): ''' Returns a list of domains for the particular user as a list of objects offset by ``page`` length of ``page_size`` list_type : ALL One of ``ALL``, ``EX...
python
def get_list(list_type=None, search_term=None, page=None, page_size=None, sort_by=None): ''' Returns a list of domains for the particular user as a list of objects offset by ``page`` length of ``page_size`` list_type : ALL One of ``ALL``, ``EX...
[ "def", "get_list", "(", "list_type", "=", "None", ",", "search_term", "=", "None", ",", "page", "=", "None", ",", "page_size", "=", "None", ",", "sort_by", "=", "None", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "...
Returns a list of domains for the particular user as a list of objects offset by ``page`` length of ``page_size`` list_type : ALL One of ``ALL``, ``EXPIRING``, ``EXPIRED`` search_term Keyword to look for on the domain list page : 1 Number of result page to return page_siz...
[ "Returns", "a", "list", "of", "domains", "for", "the", "particular", "user", "as", "a", "list", "of", "objects", "offset", "by", "page", "length", "of", "page_size" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L304-L376
32,985
saltstack/salt
salt/modules/zcbuildout.py
_set_status
def _set_status(m, comment=INVALID_RESPONSE, status=False, out=None): ''' Assign status data to a dict. ''' m['out'] = out m['status'] = status m['logs'] = LOG.messages[:] m['logs_by_level'] = LOG.by_level.copy() outlog, outlog_by_level = '...
python
def _set_status(m, comment=INVALID_RESPONSE, status=False, out=None): ''' Assign status data to a dict. ''' m['out'] = out m['status'] = status m['logs'] = LOG.messages[:] m['logs_by_level'] = LOG.by_level.copy() outlog, outlog_by_level = '...
[ "def", "_set_status", "(", "m", ",", "comment", "=", "INVALID_RESPONSE", ",", "status", "=", "False", ",", "out", "=", "None", ")", ":", "m", "[", "'out'", "]", "=", "out", "m", "[", "'status'", "]", "=", "status", "m", "[", "'logs'", "]", "=", "...
Assign status data to a dict.
[ "Assign", "status", "data", "to", "a", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L209-L248
32,986
saltstack/salt
salt/modules/zcbuildout.py
_invalid
def _invalid(m, comment=INVALID_RESPONSE, out=None): ''' Return invalid status. ''' return _set_status(m, status=False, comment=comment, out=out)
python
def _invalid(m, comment=INVALID_RESPONSE, out=None): ''' Return invalid status. ''' return _set_status(m, status=False, comment=comment, out=out)
[ "def", "_invalid", "(", "m", ",", "comment", "=", "INVALID_RESPONSE", ",", "out", "=", "None", ")", ":", "return", "_set_status", "(", "m", ",", "status", "=", "False", ",", "comment", "=", "comment", ",", "out", "=", "out", ")" ]
Return invalid status.
[ "Return", "invalid", "status", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L251-L255
32,987
saltstack/salt
salt/modules/zcbuildout.py
_valid
def _valid(m, comment=VALID_RESPONSE, out=None): ''' Return valid status. ''' return _set_status(m, status=True, comment=comment, out=out)
python
def _valid(m, comment=VALID_RESPONSE, out=None): ''' Return valid status. ''' return _set_status(m, status=True, comment=comment, out=out)
[ "def", "_valid", "(", "m", ",", "comment", "=", "VALID_RESPONSE", ",", "out", "=", "None", ")", ":", "return", "_set_status", "(", "m", ",", "status", "=", "True", ",", "comment", "=", "comment", ",", "out", "=", "out", ")" ]
Return valid status.
[ "Return", "valid", "status", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L258-L262
32,988
saltstack/salt
salt/modules/zcbuildout.py
_get_bootstrap_content
def _get_bootstrap_content(directory='.'): ''' Get the current bootstrap.py script content ''' try: with salt.utils.files.fopen(os.path.join( os.path.abspath(directory), 'bootstrap.py')) as fic: oldcontent = salt.utils.s...
python
def _get_bootstrap_content(directory='.'): ''' Get the current bootstrap.py script content ''' try: with salt.utils.files.fopen(os.path.join( os.path.abspath(directory), 'bootstrap.py')) as fic: oldcontent = salt.utils.s...
[ "def", "_get_bootstrap_content", "(", "directory", "=", "'.'", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "abspath", "(", "directory", ")", ",", ...
Get the current bootstrap.py script content
[ "Get", "the", "current", "bootstrap", ".", "py", "script", "content" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L391-L404
32,989
saltstack/salt
salt/modules/zcbuildout.py
_get_buildout_ver
def _get_buildout_ver(directory='.'): '''Check for buildout versions. In any cases, check for a version pinning Also check for buildout.dumppickedversions which is buildout1 specific Also check for the version targeted by the local bootstrap file Take as default buildout2 directory dir...
python
def _get_buildout_ver(directory='.'): '''Check for buildout versions. In any cases, check for a version pinning Also check for buildout.dumppickedversions which is buildout1 specific Also check for the version targeted by the local bootstrap file Take as default buildout2 directory dir...
[ "def", "_get_buildout_ver", "(", "directory", "=", "'.'", ")", ":", "directory", "=", "os", ".", "path", ".", "abspath", "(", "directory", ")", "buildoutver", "=", "2", "try", ":", "files", "=", "_find_cfgs", "(", "directory", ")", "for", "f", "in", "f...
Check for buildout versions. In any cases, check for a version pinning Also check for buildout.dumppickedversions which is buildout1 specific Also check for the version targeted by the local bootstrap file Take as default buildout2 directory directory to execute in
[ "Check", "for", "buildout", "versions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L407-L441
32,990
saltstack/salt
salt/modules/zcbuildout.py
_get_bootstrap_url
def _get_bootstrap_url(directory): ''' Get the most appropriate download URL for the bootstrap script. directory directory to execute in ''' v = _get_buildout_ver(directory) return _URL_VERSIONS.get(v, _URL_VERSIONS[DEFAULT_VER])
python
def _get_bootstrap_url(directory): ''' Get the most appropriate download URL for the bootstrap script. directory directory to execute in ''' v = _get_buildout_ver(directory) return _URL_VERSIONS.get(v, _URL_VERSIONS[DEFAULT_VER])
[ "def", "_get_bootstrap_url", "(", "directory", ")", ":", "v", "=", "_get_buildout_ver", "(", "directory", ")", "return", "_URL_VERSIONS", ".", "get", "(", "v", ",", "_URL_VERSIONS", "[", "DEFAULT_VER", "]", ")" ]
Get the most appropriate download URL for the bootstrap script. directory directory to execute in
[ "Get", "the", "most", "appropriate", "download", "URL", "for", "the", "bootstrap", "script", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L444-L453
32,991
saltstack/salt
salt/modules/zcbuildout.py
upgrade_bootstrap
def upgrade_bootstrap(directory='.', onlyif=None, unless=None, runas=None, env=(), offline=False, buildout_ver=None): ''' Upgrade current bootstrap.py with the last released one. ...
python
def upgrade_bootstrap(directory='.', onlyif=None, unless=None, runas=None, env=(), offline=False, buildout_ver=None): ''' Upgrade current bootstrap.py with the last released one. ...
[ "def", "upgrade_bootstrap", "(", "directory", "=", "'.'", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "runas", "=", "None", ",", "env", "=", "(", ")", ",", "offline", "=", "False", ",", "buildout_ver", "=", "None", ")", ":", "if", ...
Upgrade current bootstrap.py with the last released one. Indeed, when we first run a buildout, a common source of problem is to have a locally stale bootstrap, we just try to grab a new copy directory directory to execute in offline are we executing buildout in offline mode build...
[ "Upgrade", "current", "bootstrap", ".", "py", "with", "the", "last", "released", "one", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L468-L553
32,992
saltstack/salt
salt/modules/zcbuildout.py
run_buildout
def run_buildout(directory='.', config='buildout.cfg', parts=None, onlyif=None, unless=None, offline=False, newest=True, runas=None, env=(), verbose=False, ...
python
def run_buildout(directory='.', config='buildout.cfg', parts=None, onlyif=None, unless=None, offline=False, newest=True, runas=None, env=(), verbose=False, ...
[ "def", "run_buildout", "(", "directory", "=", "'.'", ",", "config", "=", "'buildout.cfg'", ",", "parts", "=", "None", ",", "onlyif", "=", "None", ",", "unless", "=", "None", ",", "offline", "=", "False", ",", "newest", "=", "True", ",", "runas", "=", ...
Run a buildout in a directory. directory directory to execute in config alternative buildout configuration file to use offline are we executing buildout in offline mode runas user used to run buildout as env environment variables to set when running ...
[ "Run", "a", "buildout", "in", "a", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L768-L870
32,993
saltstack/salt
salt/modules/zcbuildout.py
buildout
def buildout(directory='.', config='buildout.cfg', parts=None, runas=None, env=(), buildout_ver=None, test_release=False, distribute=None, new_st=None, offline=False, newest=False, ...
python
def buildout(directory='.', config='buildout.cfg', parts=None, runas=None, env=(), buildout_ver=None, test_release=False, distribute=None, new_st=None, offline=False, newest=False, ...
[ "def", "buildout", "(", "directory", "=", "'.'", ",", "config", "=", "'buildout.cfg'", ",", "parts", "=", "None", ",", "runas", "=", "None", ",", "env", "=", "(", ")", ",", "buildout_ver", "=", "None", ",", "test_release", "=", "False", ",", "distribut...
Run buildout in a directory. directory directory to execute in config buildout config to use parts specific buildout parts to run runas user used to run buildout as env environment variables to set when running buildout_ver force a specific b...
[ "Run", "buildout", "in", "a", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L922-L1024
32,994
saltstack/salt
salt/pillar/sqlite3.py
ext_pillar
def ext_pillar(minion_id, pillar, *args, **kwargs): ''' Execute queries against SQLite3, merge and return as a dict ''' return SQLite3ExtPillar().fetch(minion_id, pillar, *args, **kwargs)
python
def ext_pillar(minion_id, pillar, *args, **kwargs): ''' Execute queries against SQLite3, merge and return as a dict ''' return SQLite3ExtPillar().fetch(minion_id, pillar, *args, **kwargs)
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "SQLite3ExtPillar", "(", ")", ".", "fetch", "(", "minion_id", ",", "pillar", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Execute queries against SQLite3, merge and return as a dict
[ "Execute", "queries", "against", "SQLite3", "merge", "and", "return", "as", "a", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlite3.py#L110-L117
32,995
saltstack/salt
salt/pillar/http_json.py
ext_pillar
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 url, with_grains=False): ''' Read pillar data from HTTP response. :param str url: Url to request. :param bool with_grains: Whether to substitute strings in the url with their grain values. :retu...
python
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 url, with_grains=False): ''' Read pillar data from HTTP response. :param str url: Url to request. :param bool with_grains: Whether to substitute strings in the url with their grain values. :retu...
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "url", ",", "with_grains", "=", "False", ")", ":", "url", "=", "url", ".", "replace", "(", "'%s'", ",", "_quote", "(", "minion_id", ")", ")", "grain_pattern", "=", "r'<(?...
Read pillar data from HTTP response. :param str url: Url to request. :param bool with_grains: Whether to substitute strings in the url with their grain values. :return: A dictionary of the pillar data to add. :rtype: dict
[ "Read", "pillar", "data", "from", "HTTP", "response", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/http_json.py#L66-L109
32,996
saltstack/salt
salt/modules/nxos.py
check_password
def check_password(username, password, encrypted=False, **kwargs): ''' Verify user password. username Username on which to perform password check password Password to check encrypted Whether or not the password is encrypted Default: False .. code-block: bash ...
python
def check_password(username, password, encrypted=False, **kwargs): ''' Verify user password. username Username on which to perform password check password Password to check encrypted Whether or not the password is encrypted Default: False .. code-block: bash ...
[ "def", "check_password", "(", "username", ",", "password", ",", "encrypted", "=", "False", ",", "*", "*", "kwargs", ")", ":", "hash_algorithms", "=", "{", "'1'", ":", "'md5'", ",", "'2a'", ":", "'blowfish'", ",", "'5'", ":", "'sha256'", ",", "'6'", ":"...
Verify user password. username Username on which to perform password check password Password to check encrypted Whether or not the password is encrypted Default: False .. code-block: bash salt '*' nxos.cmd check_password username=admin password=admin ...
[ "Verify", "user", "password", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L143-L181
32,997
saltstack/salt
salt/modules/nxos.py
get_roles
def get_roles(username, **kwargs): ''' Get roles assigned to a username. .. code-block: bash salt '*' nxos.cmd get_roles username=admin ''' user = get_user(username) if not user: return [] command = 'show user-account {0}'.format(username) info = '' info = show(comm...
python
def get_roles(username, **kwargs): ''' Get roles assigned to a username. .. code-block: bash salt '*' nxos.cmd get_roles username=admin ''' user = get_user(username) if not user: return [] command = 'show user-account {0}'.format(username) info = '' info = show(comm...
[ "def", "get_roles", "(", "username", ",", "*", "*", "kwargs", ")", ":", "user", "=", "get_user", "(", "username", ")", "if", "not", "user", ":", "return", "[", "]", "command", "=", "'show user-account {0}'", ".", "format", "(", "username", ")", "info", ...
Get roles assigned to a username. .. code-block: bash salt '*' nxos.cmd get_roles username=admin
[ "Get", "roles", "assigned", "to", "a", "username", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L247-L268
32,998
saltstack/salt
salt/modules/nxos.py
get_user
def get_user(username, **kwargs): ''' Get username line from switch. .. code-block: bash salt '*' nxos.cmd get_user username=admin ''' command = 'show run | include "^username {0} password 5 "'.format(username) info = '' info = show(command, **kwargs) if isinstance(info, list):...
python
def get_user(username, **kwargs): ''' Get username line from switch. .. code-block: bash salt '*' nxos.cmd get_user username=admin ''' command = 'show run | include "^username {0} password 5 "'.format(username) info = '' info = show(command, **kwargs) if isinstance(info, list):...
[ "def", "get_user", "(", "username", ",", "*", "*", "kwargs", ")", ":", "command", "=", "'show run | include \"^username {0} password 5 \"'", ".", "format", "(", "username", ")", "info", "=", "''", "info", "=", "show", "(", "command", ",", "*", "*", "kwargs",...
Get username line from switch. .. code-block: bash salt '*' nxos.cmd get_user username=admin
[ "Get", "username", "line", "from", "switch", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L271-L284
32,999
saltstack/salt
salt/modules/nxos.py
show_ver
def show_ver(**kwargs): ''' Shortcut to run `show version` on the NX-OS device. .. code-block:: bash salt '*' nxos.cmd show_ver ''' command = 'show version' info = '' info = show(command, **kwargs) if isinstance(info, list): info = info[0] return info
python
def show_ver(**kwargs): ''' Shortcut to run `show version` on the NX-OS device. .. code-block:: bash salt '*' nxos.cmd show_ver ''' command = 'show version' info = '' info = show(command, **kwargs) if isinstance(info, list): info = info[0] return info
[ "def", "show_ver", "(", "*", "*", "kwargs", ")", ":", "command", "=", "'show version'", "info", "=", "''", "info", "=", "show", "(", "command", ",", "*", "*", "kwargs", ")", "if", "isinstance", "(", "info", ",", "list", ")", ":", "info", "=", "info...
Shortcut to run `show version` on the NX-OS device. .. code-block:: bash salt '*' nxos.cmd show_ver
[ "Shortcut", "to", "run", "show", "version", "on", "the", "NX", "-", "OS", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L391-L404