repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
saltstack/salt
salt/cloud/clouds/openstack.py
list_nodes_min
def list_nodes_min(conn=None, call=None): ''' Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_min function must be called wi...
python
def list_nodes_min(conn=None, call=None): ''' Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_min function must be called wi...
[ "def", "list_nodes_min", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_min function must be called with -f or --function.'", ")", "if", "conn", "is", "None", ...
Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack
[ "Return", "a", "list", "of", "VMs", "with", "minimal", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L353-L373
train
Return a list of VMs with minimal information
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
list_nodes_full
def list_nodes_full(conn=None, call=None): ''' Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function mus...
python
def list_nodes_full(conn=None, call=None): ''' Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function mus...
[ "def", "list_nodes_full", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_full function must be called with -f or --function.'", ")", "if", "conn", "is", "None",...
Return a list of VMs with all the information about them CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack
[ "Return", "a", "list", "of", "VMs", "with", "all", "the", "information", "about", "them" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L389-L418
train
Return a list of VMs with all the information about them CLI Example
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
list_nodes_select
def list_nodes_select(conn=None, call=None): ''' Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select funct...
python
def list_nodes_select(conn=None, call=None): ''' Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_select funct...
[ "def", "list_nodes_select", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_select function must be called with -f or --function.'", ")", "return", "__utils__", "[...
Return a list of VMs with the fields from `query.selection` CLI Example .. code-block:: bash salt-cloud -f list_nodes_full myopenstack
[ "Return", "a", "list", "of", "VMs", "with", "the", "fields", "from", "query", ".", "selection" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L421-L438
train
Return a list of VMs with the fields from query. selection
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
show_instance
def show_instance(name, conn=None, call=None): ''' Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance...
python
def show_instance(name, conn=None, call=None): ''' Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance...
[ "def", "show_instance", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "if", "conn", "is", ...
Get VM on this OpenStack account name name of the instance CLI Example .. code-block:: bash salt-cloud -a show_instance myserver
[ "Get", "VM", "on", "this", "OpenStack", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L441-L477
train
Show the details of a VM on this OpenStack account
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
avail_images
def avail_images(conn=None, call=None): ''' List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_imag...
python
def avail_images(conn=None, call=None): ''' List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_imag...
[ "def", "avail_images", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", ...
List available images for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_images myopenstack salt-cloud --list-images myopenstack
[ "List", "available", "images", "for", "OpenStack" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L480-L499
train
Return a list of available images for OpenStack availables
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
avail_sizes
def avail_sizes(conn=None, call=None): ''' List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes fu...
python
def avail_sizes(conn=None, call=None): ''' List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes fu...
[ "def", "avail_sizes", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "...
List available sizes for OpenStack CLI Example .. code-block:: bash salt-cloud -f avail_sizes myopenstack salt-cloud --list-sizes myopenstack
[ "List", "available", "sizes", "for", "OpenStack" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L502-L521
train
Return a list of available sizes for OpenStack
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
list_networks
def list_networks(conn=None, call=None): ''' List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_networks function must be called with ' '-f ...
python
def list_networks(conn=None, call=None): ''' List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack ''' if call == 'action': raise SaltCloudSystemExit( 'The list_networks function must be called with ' '-f ...
[ "def", "list_networks", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_networks function must be called with '", "'-f or --function'", ")", "if", "conn", "is", "Non...
List networks for OpenStack CLI Example .. code-block:: bash salt-cloud -f list_networks myopenstack
[ "List", "networks", "for", "OpenStack" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L524-L542
train
List networks for OpenStack elastic network
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
list_subnets
def list_subnets(conn=None, call=None, kwargs=None): ''' List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net ''' if call == 'action': raise SaltCloudSystemExit( '...
python
def list_subnets(conn=None, call=None, kwargs=None): ''' List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net ''' if call == 'action': raise SaltCloudSystemExit( '...
[ "def", "list_subnets", "(", "conn", "=", "None", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_subnets function must be called with '", "'-f or --function.'", ")...
List subnets in a virtual network network network to list subnets of .. code-block:: bash salt-cloud -f list_subnets myopenstack network=salt-net
[ "List", "subnets", "in", "a", "virtual", "network" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L545-L568
train
List subnets in a virtual network
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
_clean_create_kwargs
def _clean_create_kwargs(**kwargs): ''' Sanatize kwargs to be sent to create_server ''' VALID_OPTS = { 'name': six.string_types, 'image': six.string_types, 'flavor': six.string_types, 'auto_ip': bool, 'ips': list, 'ip_pool': six.string_types, 'root...
python
def _clean_create_kwargs(**kwargs): ''' Sanatize kwargs to be sent to create_server ''' VALID_OPTS = { 'name': six.string_types, 'image': six.string_types, 'flavor': six.string_types, 'auto_ip': bool, 'ips': list, 'ip_pool': six.string_types, 'root...
[ "def", "_clean_create_kwargs", "(", "*", "*", "kwargs", ")", ":", "VALID_OPTS", "=", "{", "'name'", ":", "six", ".", "string_types", ",", "'image'", ":", "six", ".", "string_types", ",", "'flavor'", ":", "six", ".", "string_types", ",", "'auto_ip'", ":", ...
Sanatize kwargs to be sent to create_server
[ "Sanatize", "kwargs", "to", "be", "sent", "to", "create_server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L571-L616
train
Clean the kwargs to be sent to create_server
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
request_instance
def request_instance(vm_, conn=None, call=None): ''' Request an instance to be built ''' if call == 'function': # Technically this function may be called other ways too, but it # definitely cannot be called with --function. raise SaltCloudSystemExit( 'The request_inst...
python
def request_instance(vm_, conn=None, call=None): ''' Request an instance to be built ''' if call == 'function': # Technically this function may be called other ways too, but it # definitely cannot be called with --function. raise SaltCloudSystemExit( 'The request_inst...
[ "def", "request_instance", "(", "vm_", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "# Technically this function may be called other ways too, but it", "# definitely cannot be called with --function.", "raise", "Salt...
Request an instance to be built
[ "Request", "an", "instance", "to", "be", "built" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L619-L658
train
Request an instance from the specified VM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
create
def create(vm_): ''' Create a single VM from a data dict ''' deploy = config.get_cloud_config_value('deploy', vm_, __opts__) key_filename = config.get_cloud_config_value( 'ssh_key_file', vm_, __opts__, search_global=False, default=None ) if key_filename is not None and not os.path.is...
python
def create(vm_): ''' Create a single VM from a data dict ''' deploy = config.get_cloud_config_value('deploy', vm_, __opts__) key_filename = config.get_cloud_config_value( 'ssh_key_file', vm_, __opts__, search_global=False, default=None ) if key_filename is not None and not os.path.is...
[ "def", "create", "(", "vm_", ")", ":", "deploy", "=", "config", ".", "get_cloud_config_value", "(", "'deploy'", ",", "vm_", ",", "__opts__", ")", "key_filename", "=", "config", ".", "get_cloud_config_value", "(", "'ssh_key_file'", ",", "vm_", ",", "__opts__", ...
Create a single VM from a data dict
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L661-L770
train
Create a single VM from a data dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
destroy
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
python
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
[ "def", "destroy", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__"...
Delete a single VM
[ "Delete", "a", "single", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L773-L816
train
Delete a single VM
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/clouds/openstack.py
call
def call(conn=None, call=None, kwargs=None): ''' Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network na...
python
def call(conn=None, call=None, kwargs=None): ''' Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network na...
[ "def", "call", "(", "conn", "=", "None", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The call function must be called with '", "'-f or --function.'", ")", "if", "'f...
Call function from shade. func function to call from shade.openstackcloud library CLI Example .. code-block:: bash salt-cloud -f call myopenstack func=list_images t sujksalt-cloud -f call myopenstack func=create_network name=mysubnet
[ "Call", "function", "from", "shade", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/openstack.py#L819-L858
train
Return the base image for the current user
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
merge
def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False): ''' Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge ...
python
def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False): ''' Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge ...
[ "def", "merge", "(", "obj_a", ",", "obj_b", ",", "strategy", "=", "'smart'", ",", "renderer", "=", "'yaml'", ",", "merge_lists", "=", "False", ")", ":", "return", "salt", ".", "utils", ".", "dictupdate", ".", "merge", "(", "obj_a", ",", "obj_b", ",", ...
Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge '{foo: Foo}' '{bar: Bar}'
[ "Merge", "a", "data", "structure", "into", "another", "by", "choosing", "a", "merge", "strategy" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L37-L56
train
Merge two data structures into a single data structure
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
merge_all
def merge_all(lst, strategy='smart', renderer='yaml', merge_lists=False): ''' .. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupd...
python
def merge_all(lst, strategy='smart', renderer='yaml', merge_lists=False): ''' .. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupd...
[ "def", "merge_all", "(", "lst", ",", "strategy", "=", "'smart'", ",", "renderer", "=", "'yaml'", ",", "merge_lists", "=", "False", ")", ":", "ret", "=", "{", "}", "for", "obj", "in", "lst", ":", "ret", "=", "salt", ".", "utils", ".", "dictupdate", ...
.. versionadded:: 2019.2.0 Merge a list of objects into each other in order :type lst: Iterable :param lst: List of objects to be merged. :type strategy: String :param strategy: Merge strategy. See utils.dictupdate. :type renderer: String :param renderer: Renderer type. Used to d...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L59-L92
train
Merge a list of objects into each other in order.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
renderer
def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs): ''' Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of ...
python
def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs): ''' Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of ...
[ "def", "renderer", "(", "path", "=", "None", ",", "string", "=", "None", ",", "default_renderer", "=", "'jinja|yaml'", ",", "*", "*", "kwargs", ")", ":", "if", "not", "path", "and", "not", "string", ":", "raise", "salt", ".", "exceptions", ".", "SaltIn...
Parse a string or file through Salt's renderer system .. versionchanged:: 2018.3.0 Add support for Salt fileserver URIs. This is an open-ended function and can be used for a variety of tasks. It makes use of Salt's "renderer pipes" system to run a string or file through a pipe of any of the loa...
[ "Parse", "a", "string", "or", "file", "through", "Salt", "s", "renderer", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L95-L186
train
Parse a string or file through a renderer pipe and return a data structure that can be used to render the file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
serialize
def serialize(serializer, obj, **mod_kwargs): ''' Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja ...
python
def serialize(serializer, obj, **mod_kwargs): ''' Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja ...
[ "def", "serialize", "(", "serializer", ",", "obj", ",", "*", "*", "mod_kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "mod_kwargs", ")", "return", "_get_serialize_fn", "(", "serializer", ",", "'se...
Serialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' --no-parse=obj slsutil.serialize 'json' obj="{'foo': 'Foo!'} Jinja Example: .. code-block:: jinja {% set json_string = salt.slsutil.serialize('json', ...
[ "Serialize", "a", "Python", "object", "using", "a", ":", "py", ":", "mod", ":", "serializer", "module", "<salt", ".", "serializers", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L206-L225
train
Serialize a Python object using a serializer module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
deserialize
def deserialize(serializer, stream_or_string, **mod_kwargs): ''' Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil....
python
def deserialize(serializer, stream_or_string, **mod_kwargs): ''' Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil....
[ "def", "deserialize", "(", "serializer", ",", "stream_or_string", ",", "*", "*", "mod_kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "mod_kwargs", ")", "return", "_get_serialize_fn", "(", "serializer"...
Deserialize a Python object using a :py:mod:`serializer module <salt.serializers>` CLI Example: .. code-block:: bash salt '*' slsutil.deserialize 'json' '{"foo": "Foo!"}' salt '*' --no-parse=stream_or_string slsutil.deserialize 'json' \\ stream_or_string='{"foo": "Foo!"}' ...
[ "Deserialize", "a", "Python", "object", "using", "a", ":", "py", ":", "mod", ":", "serializer", "module", "<salt", ".", "serializers", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L228-L250
train
Deserialize a Python object using a serializer module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/slsutil.py
banner
def banner(width=72, commentchar='#', borderchar='#', blockstart=None, blockend=None, title=None, text=None, newline=False): ''' Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, ...
python
def banner(width=72, commentchar='#', borderchar='#', blockstart=None, blockend=None, title=None, text=None, newline=False): ''' Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, ...
[ "def", "banner", "(", "width", "=", "72", ",", "commentchar", "=", "'#'", ",", "borderchar", "=", "'#'", ",", "blockstart", "=", "None", ",", "blockend", "=", "None", ",", "title", "=", "None", ",", "text", "=", "None", ",", "newline", "=", "False", ...
Create a standardized comment block to include in a templated file. A common technique in configuration management is to include a comment block in managed files, warning users not to modify the file. This function simplifies and standardizes those comment blocks. :param width: The width, in character...
[ "Create", "a", "standardized", "comment", "block", "to", "include", "in", "a", "templated", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slsutil.py#L253-L339
train
Return a standardized comment block that can be used to include in a templated file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/msazure.py
get_storage_conn
def get_storage_conn(storage_account=None, storage_key=None, opts=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if opts is None: opts = {} if not storage_account: storage_account = opts.get('storage_account', None) if not sto...
python
def get_storage_conn(storage_account=None, storage_key=None, opts=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if opts is None: opts = {} if not storage_account: storage_account = opts.get('storage_account', None) if not sto...
[ "def", "get_storage_conn", "(", "storage_account", "=", "None", ",", "storage_key", "=", "None", ",", "opts", "=", "None", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "if", "not", "storage_account", ":", "storage_account", "=", "opt...
.. versionadded:: 2015.8.0 Return a storage_conn object for the storage account
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L26-L40
train
Returns a storage_conn object for the storage account and storage key
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/msazure.py
list_blobs
def list_blobs(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 List blobs associated with the container ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit( code=42, msg='A...
python
def list_blobs(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 List blobs associated with the container ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit( code=42, msg='A...
[ "def", "list_blobs", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
.. versionadded:: 2015.8.0 List blobs associated with the container
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L43-L70
train
List the blobs associated with the container
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/msazure.py
put_blob
def put_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Upload a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "container...
python
def put_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Upload a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "container...
[ "def", "put_blob", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
.. versionadded:: 2015.8.0 Upload a blob
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L73-L120
train
Uploads a blob to the specified container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/msazure.py
get_blob
def get_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Download a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "contain...
python
def get_blob(storage_conn=None, **kwargs): ''' .. versionadded:: 2015.8.0 Download a blob ''' if not storage_conn: storage_conn = get_storage_conn(opts=kwargs) if 'container' not in kwargs: raise SaltSystemExit(code=42, msg='The blob container name must be specified as "contain...
[ "def", "get_blob", "(", "storage_conn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "storage_conn", ":", "storage_conn", "=", "get_storage_conn", "(", "opts", "=", "kwargs", ")", "if", "'container'", "not", "in", "kwargs", ":", "raise", ...
.. versionadded:: 2015.8.0 Download a blob
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L123-L167
train
Download a blob from the specified container
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/msazure.py
object_to_dict
def object_to_dict(obj): ''' .. versionadded:: 2015.8.0 Convert an object to a dictionary ''' if isinstance(obj, list) or isinstance(obj, tuple): ret = [] for item in obj: ret.append(object_to_dict(item)) elif hasattr(obj, '__dict__'): ret = {} for it...
python
def object_to_dict(obj): ''' .. versionadded:: 2015.8.0 Convert an object to a dictionary ''' if isinstance(obj, list) or isinstance(obj, tuple): ret = [] for item in obj: ret.append(object_to_dict(item)) elif hasattr(obj, '__dict__'): ret = {} for it...
[ "def", "object_to_dict", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "list", ")", "or", "isinstance", "(", "obj", ",", "tuple", ")", ":", "ret", "=", "[", "]", "for", "item", "in", "obj", ":", "ret", ".", "append", "(", "object_to_di...
.. versionadded:: 2015.8.0 Convert an object to a dictionary
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msazure.py#L170-L188
train
Converts an object to a dictionary
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cloud/cli.py
SaltCloud.run
def run(self): ''' Execute the salt-cloud command line ''' # Parse shell arguments self.parse_args() salt_master_user = self.config.get('user') if salt_master_user is None: salt_master_user = salt.utils.user.get_user() if not check_user(salt_...
python
def run(self): ''' Execute the salt-cloud command line ''' # Parse shell arguments self.parse_args() salt_master_user = self.config.get('user') if salt_master_user is None: salt_master_user = salt.utils.user.get_user() if not check_user(salt_...
[ "def", "run", "(", "self", ")", ":", "# Parse shell arguments", "self", ".", "parse_args", "(", ")", "salt_master_user", "=", "self", ".", "config", ".", "get", "(", "'user'", ")", "if", "salt_master_user", "is", "None", ":", "salt_master_user", "=", "salt",...
Execute the salt-cloud command line
[ "Execute", "the", "salt", "-", "cloud", "command", "line" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/cli.py#L41-L397
train
Execute the salt - cloud command line
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/webutil.py
user_exists
def user_exists(name, password=None, htpasswd_file=None, options='', force=False, runas=None, update=False): ''' Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file opti...
python
def user_exists(name, password=None, htpasswd_file=None, options='', force=False, runas=None, update=False): ''' Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file opti...
[ "def", "user_exists", "(", "name", ",", "password", "=", "None", ",", "htpasswd_file", "=", "None", ",", "options", "=", "''", ",", "force", "=", "False", ",", "runas", "=", "None", ",", "update", "=", "False", ")", ":", "ret", "=", "{", "'name'", ...
Make sure the user is inside the specified htpasswd file name User name password User password htpasswd_file Path to the htpasswd file options See :mod:`salt.modules.htpasswd.useradd` force Touch the file even if user already created runas Th...
[ "Make", "sure", "the", "user", "is", "inside", "the", "specified", "htpasswd", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/webutil.py#L36-L104
train
Ensures that a user exists in the specified htpasswd file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/webutil.py
user_absent
def user_absent(name, htpasswd_file=None, runas=None): ''' Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with ''' ret = {'name': name, 'chang...
python
def user_absent(name, htpasswd_file=None, runas=None): ''' Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with ''' ret = {'name': name, 'chang...
[ "def", "user_absent", "(", "name", ",", "htpasswd_file", "=", "None", ",", "runas", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "None", "}", "exi...
Make sure the user is not in the specified htpasswd file name User name htpasswd_file Path to the htpasswd file runas The system user to run htpasswd command with
[ "Make", "sure", "the", "user", "is", "not", "in", "the", "specified", "htpasswd", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/webutil.py#L107-L150
train
Ensure the user is absent from the specified htpasswd file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/celery.py
run_task
def run_task(task_name, args=None, kwargs=None, broker=None, backend=None, wait_for_result=False, timeout=None, propagate=True, interval=0.5, no_ack=True, raise_timeout=True, config=None): ''' Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. ...
python
def run_task(task_name, args=None, kwargs=None, broker=None, backend=None, wait_for_result=False, timeout=None, propagate=True, interval=0.5, no_ack=True, raise_timeout=True, config=None): ''' Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. ...
[ "def", "run_task", "(", "task_name", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "broker", "=", "None", ",", "backend", "=", "None", ",", "wait_for_result", "=", "False", ",", "timeout", "=", "None", ",", "propagate", "=", "True", ",", ...
Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. code-block:: bash salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \\ backend=redis://localhost wait_for_result=true task_name The task name, e.g. tasks.sleep ...
[ "Execute", "celery", "tasks", ".", "For", "celery", "specific", "parameters", "see", "celery", "documentation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/celery.py#L40-L110
train
Execute celery tasks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.run
def run(self, cmd): ''' Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', ...
python
def run(self, cmd): ''' Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', ...
[ "def", "run", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "dict", "(", "cmd", ")", "# make copy", "client", "=", "'minion'", "# default to local minion client", "mode", "=", "cmd", ".", "get", "(", "'mode'", ",", "'async'", ")", "# check for wheel or runn...
Execute the salt command given by cmd dict. cmd is a dictionary of the following form: { 'mode': 'modestring', 'fun' : 'modulefunctionstring', 'kwarg': functionkeywordargdictionary, 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatternty...
[ "Execute", "the", "salt", "command", "given", "by", "cmd", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L70-L137
train
Execute the salt command given by cmd dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.signature
def signature(self, cmd): ''' Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token':...
python
def signature(self, cmd): ''' Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token':...
[ "def", "signature", "(", "self", ",", "cmd", ")", ":", "cmd", "[", "'client'", "]", "=", "'minion'", "if", "len", "(", "cmd", "[", "'module'", "]", ".", "split", "(", "'.'", ")", ")", ">", "2", "and", "cmd", "[", "'module'", "]", ".", "split", ...
Convenience function that returns dict of function signature(s) specified by cmd. cmd is dict of the form: { 'module' : 'modulestring', 'tgt' : 'targetpatternstring', 'tgt_type' : 'targetpatterntype', 'token': 'salttokenstring', 'username': 'u...
[ "Convenience", "function", "that", "returns", "dict", "of", "function", "signature", "(", "s", ")", "specified", "by", "cmd", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L177-L211
train
Returns dict of function signature for the specified command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient._signature
def _signature(self, cmd): ''' Expects everything that signature does and also a client type string. client can either be master or minion. ''' result = {} client = cmd.get('client', 'minion') if client == 'minion': cmd['fun'] = 'sys.argspec' ...
python
def _signature(self, cmd): ''' Expects everything that signature does and also a client type string. client can either be master or minion. ''' result = {} client = cmd.get('client', 'minion') if client == 'minion': cmd['fun'] = 'sys.argspec' ...
[ "def", "_signature", "(", "self", ",", "cmd", ")", ":", "result", "=", "{", "}", "client", "=", "cmd", ".", "get", "(", "'client'", ",", "'minion'", ")", "if", "client", "==", "'minion'", ":", "cmd", "[", "'fun'", "]", "=", "'sys.argspec'", "cmd", ...
Expects everything that signature does and also a client type string. client can either be master or minion.
[ "Expects", "everything", "that", "signature", "does", "and", "also", "a", "client", "type", "string", ".", "client", "can", "either", "be", "master", "or", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L213-L234
train
Returns the signature of the command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.create_token
def create_token(self, creds): ''' Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', ...
python
def create_token(self, creds): ''' Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', ...
[ "def", "create_token", "(", "self", ",", "creds", ")", ":", "try", ":", "tokenage", "=", "self", ".", "resolver", ".", "mk_token", "(", "creds", ")", "except", "Exception", "as", "ex", ":", "raise", "EauthAuthenticationError", "(", "\"Authentication failed wit...
Create token with creds. Token authorizes salt access if successful authentication with the credentials in creds. creds format is as follows: { 'username': 'namestring', 'password': 'passwordstring', 'eauth': 'eauthtypestring', } exam...
[ "Create", "token", "with", "creds", ".", "Token", "authorizes", "salt", "access", "if", "successful", "authentication", "with", "the", "credentials", "in", "creds", ".", "creds", "format", "is", "as", "follows", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L236-L293
train
Create a token with the provided credentials.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.verify_token
def verify_token(self, token): ''' If token is valid Then returns user name associated with token Else False. ''' try: result = self.resolver.get_token(token) except Exception as ex: raise EauthAuthenticationError( "Token validation...
python
def verify_token(self, token): ''' If token is valid Then returns user name associated with token Else False. ''' try: result = self.resolver.get_token(token) except Exception as ex: raise EauthAuthenticationError( "Token validation...
[ "def", "verify_token", "(", "self", ",", "token", ")", ":", "try", ":", "result", "=", "self", ".", "resolver", ".", "get_token", "(", "token", ")", "except", "Exception", "as", "ex", ":", "raise", "EauthAuthenticationError", "(", "\"Token validation failed wi...
If token is valid Then returns user name associated with token Else False.
[ "If", "token", "is", "valid", "Then", "returns", "user", "name", "associated", "with", "token", "Else", "False", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L295-L306
train
Verify that the token is valid and returns user name associated with token Else raises EauthAuthenticationError
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.get_event
def get_event(self, wait=0.25, tag='', full=False): ''' Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until...
python
def get_event(self, wait=0.25, tag='', full=False): ''' Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until...
[ "def", "get_event", "(", "self", ",", "wait", "=", "0.25", ",", "tag", "=", "''", ",", "full", "=", "False", ")", ":", "return", "self", ".", "event", ".", "get_event", "(", "wait", "=", "wait", ",", "tag", "=", "tag", ",", "full", "=", "full", ...
Get a single salt event. If no events are available, then block for up to ``wait`` seconds. Return the event if it matches the tag (or ``tag`` is empty) Otherwise return None If wait is 0 then block forever or until next event becomes available.
[ "Get", "a", "single", "salt", "event", ".", "If", "no", "events", "are", "available", "then", "block", "for", "up", "to", "wait", "seconds", ".", "Return", "the", "event", "if", "it", "matches", "the", "tag", "(", "or", "tag", "is", "empty", ")", "Ot...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L308-L317
train
Get a single salt event.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/client/api.py
APIClient.fire_event
def fire_event(self, data, tag): ''' fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication ''' return self.event.fire_event(data, salt.utils.event.tagify(...
python
def fire_event(self, data, tag): ''' fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication ''' return self.event.fire_event(data, salt.utils.event.tagify(...
[ "def", "fire_event", "(", "self", ",", "data", ",", "tag", ")", ":", "return", "self", ".", "event", ".", "fire_event", "(", "data", ",", "salt", ".", "utils", ".", "event", ".", "tagify", "(", "tag", ",", "'wui'", ")", ")" ]
fires event with data and tag This only works if api is running with same user permissions as master Need to convert this to a master call with appropriate authentication
[ "fires", "event", "with", "data", "and", "tag", "This", "only", "works", "if", "api", "is", "running", "with", "same", "user", "permissions", "as", "master", "Need", "to", "convert", "this", "to", "a", "master", "call", "with", "appropriate", "authentication...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/api.py#L319-L326
train
Fires an event with data and tag
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_timezone.py
get_zone
def get_zone(): ''' Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone ''' cmd = ['tzutil', '/g'] r...
python
def get_zone(): ''' Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone ''' cmd = ['tzutil', '/g'] r...
[ "def", "get_zone", "(", ")", ":", "cmd", "=", "[", "'tzutil'", ",", "'/g'", "]", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "res", "[", "'retcode'", "]", "or", "not", "res", "[", "'s...
Get current timezone (i.e. America/Denver) Returns: str: Timezone in unix format Raises: CommandExecutionError: If timezone could not be gathered CLI Example: .. code-block:: bash salt '*' timezone.get_zone
[ "Get", "current", "timezone", "(", "i", ".", "e", ".", "America", "/", "Denver", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L201-L223
train
Return the current timezone in unix format
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_timezone.py
get_offset
def get_offset(): ''' Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset ''' # http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and...
python
def get_offset(): ''' Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset ''' # http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and...
[ "def", "get_offset", "(", ")", ":", "# http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and-pytz-localize-vs-normalize/", "tz_object", "=", "pytz", ".", "timezone", "(", "get_zone", "(", ")", ")", "utc_time", "=", "pytz", ".", "utc", ...
Get current numeric timezone offset from UTC (i.e. -0700) Returns: str: Offset from UTC CLI Example: .. code-block:: bash salt '*' timezone.get_offset
[ "Get", "current", "numeric", "timezone", "offset", "from", "UTC", "(", "i", ".", "e", ".", "-", "0700", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L226-L244
train
Get current offset from UTC
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_timezone.py
get_zonecode
def get_zonecode(): ''' Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode ''' tz_object = pytz.timezone(get_zone()) loc_time = tz_object.localize(datetime.utcnow()) ...
python
def get_zonecode(): ''' Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode ''' tz_object = pytz.timezone(get_zone()) loc_time = tz_object.localize(datetime.utcnow()) ...
[ "def", "get_zonecode", "(", ")", ":", "tz_object", "=", "pytz", ".", "timezone", "(", "get_zone", "(", ")", ")", "loc_time", "=", "tz_object", ".", "localize", "(", "datetime", ".", "utcnow", "(", ")", ")", "return", "loc_time", ".", "tzname", "(", ")"...
Get current timezone (i.e. PST, MDT, etc) Returns: str: An abbreviated timezone code CLI Example: .. code-block:: bash salt '*' timezone.get_zonecode
[ "Get", "current", "timezone", "(", "i", ".", "e", ".", "PST", "MDT", "etc", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L247-L262
train
Get current timezone code
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_timezone.py
set_zone
def set_zone(timezone): ''' Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash ...
python
def set_zone(timezone): ''' Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash ...
[ "def", "set_zone", "(", "timezone", ")", ":", "# if it's one of the key's just use it", "if", "timezone", ".", "lower", "(", ")", "in", "mapper", ".", "win_to_unix", ":", "win_zone", "=", "timezone", "elif", "timezone", ".", "lower", "(", ")", "in", "mapper", ...
Sets the timezone using the tzutil. Args: timezone (str): A valid timezone Returns: bool: ``True`` if successful, otherwise ``False`` Raises: CommandExecutionError: If invalid timezone is passed CLI Example: .. code-block:: bash salt '*' timezone.set_zone 'Ameri...
[ "Sets", "the", "timezone", "using", "the", "tzutil", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L265-L303
train
Sets the timezone using the tzutil module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_timezone.py
zone_compare
def zone_compare(timezone): ''' Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list``...
python
def zone_compare(timezone): ''' Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list``...
[ "def", "zone_compare", "(", "timezone", ")", ":", "# if it's one of the key's just use it", "if", "timezone", ".", "lower", "(", ")", "in", "mapper", ".", "win_to_unix", ":", "check_zone", "=", "timezone", "elif", "timezone", ".", "lower", "(", ")", "in", "map...
Compares the given timezone with the machine timezone. Mostly useful for running state checks. Args: timezone (str): The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the ``timezone.list`` function Returns: bool: ``...
[ "Compares", "the", "given", "timezone", "with", "the", "machine", "timezone", ".", "Mostly", "useful", "for", "running", "state", "checks", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_timezone.py#L306-L338
train
Compares the given timezone with the machine timezone.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/win_license.py
activate
def activate(name): ''' Install and activate the given product key name The 5x5 product key given to you by Microsoft ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} product_key = name license_info = __salt__['license.info']...
python
def activate(name): ''' Install and activate the given product key name The 5x5 product key given to you by Microsoft ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} product_key = name license_info = __salt__['license.info']...
[ "def", "activate", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "product_key", "=", "name", "license_info", "=", "__salt__", "[", "'lic...
Install and activate the given product key name The 5x5 product key given to you by Microsoft
[ "Install", "and", "activate", "the", "given", "product", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_license.py#L33-L71
train
Install and activate a given 5x5 product key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/quota.py
mode
def mode(name, mode, quotatype): ''' Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group`` ''' ret = {'name': name, 'changes': {}, 'result':...
python
def mode(name, mode, quotatype): ''' Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group`` ''' ret = {'name': name, 'changes': {}, 'result':...
[ "def", "mode", "(", "name", ",", "mode", ",", "quotatype", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "fun", "=", "'off'", "if", "mode", "is",...
Set the quota for the system name The filesystem to set the quota mode on mode Whether the quota system is on or off quotatype Must be ``user`` or ``group``
[ "Set", "the", "quota", "for", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/quota.py#L26-L62
train
Set the quota for the system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
report
def report(mount): ''' Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data ''' ret = {mount: {}} ret[mount]['User Quotas'] = _parse_quota(mount, '-u') ret[mount]['Group Quotas'] = _parse_quota(mount, '-g') return ret
python
def report(mount): ''' Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data ''' ret = {mount: {}} ret[mount]['User Quotas'] = _parse_quota(mount, '-u') ret[mount]['Group Quotas'] = _parse_quota(mount, '-g') return ret
[ "def", "report", "(", "mount", ")", ":", "ret", "=", "{", "mount", ":", "{", "}", "}", "ret", "[", "mount", "]", "[", "'User Quotas'", "]", "=", "_parse_quota", "(", "mount", ",", "'-u'", ")", "ret", "[", "mount", "]", "[", "'Group Quotas'", "]", ...
Report on quotas for a specific volume CLI Example: .. code-block:: bash salt '*' quota.report /media/data
[ "Report", "on", "quotas", "for", "a", "specific", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L38-L51
train
Report on quotas for a specific volume CLI Example
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
_parse_quota
def _parse_quota(mount, opts): ''' Parse the output from repquota. Requires that -u -g are passed in ''' cmd = 'repquota -vp {0} {1}'.format(opts, mount) out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() mode = 'header' if '-u' in opts: quotatype = 'Users' elif '-g...
python
def _parse_quota(mount, opts): ''' Parse the output from repquota. Requires that -u -g are passed in ''' cmd = 'repquota -vp {0} {1}'.format(opts, mount) out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() mode = 'header' if '-u' in opts: quotatype = 'Users' elif '-g...
[ "def", "_parse_quota", "(", "mount", ",", "opts", ")", ":", "cmd", "=", "'repquota -vp {0} {1}'", ".", "format", "(", "opts", ",", "mount", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", ".", "sp...
Parse the output from repquota. Requires that -u -g are passed in
[ "Parse", "the", "output", "from", "repquota", ".", "Requires", "that", "-", "u", "-", "g", "are", "passed", "in" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L54-L94
train
Parse the output from repquota - vp mount and return a dict of the quotas and users
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
set_
def set_(device, **kwargs): ''' Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000 ''' empty = {'block-soft-...
python
def set_(device, **kwargs): ''' Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000 ''' empty = {'block-soft-...
[ "def", "set_", "(", "device", ",", "*", "*", "kwargs", ")", ":", "empty", "=", "{", "'block-soft-limit'", ":", "0", ",", "'block-hard-limit'", ":", "0", ",", "'file-soft-limit'", ":", "0", ",", "'file-hard-limit'", ":", "0", "}", "current", "=", "None", ...
Calls out to setquota, for a specific user or group CLI Example: .. code-block:: bash salt '*' quota.set /media/data user=larry block-soft-limit=1048576 salt '*' quota.set /media/data group=painters file-hard-limit=1000
[ "Calls", "out", "to", "setquota", "for", "a", "specific", "user", "or", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L97-L155
train
Sets the quota for a specific user or group
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
stats
def stats(): ''' Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats ''' ret = {} out = __salt__['cmd.run']('quotastats').splitlines() for line in out: if not line: continue comps = line....
python
def stats(): ''' Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats ''' ret = {} out = __salt__['cmd.run']('quotastats').splitlines() for line in out: if not line: continue comps = line....
[ "def", "stats", "(", ")", ":", "ret", "=", "{", "}", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'quotastats'", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "if", "not", "line", ":", "continue", "comps", "=", "line", ...
Runs the quotastats command, and returns the parsed output CLI Example: .. code-block:: bash salt '*' quota.stats
[ "Runs", "the", "quotastats", "command", "and", "returns", "the", "parsed", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L172-L190
train
Returns the parsed output of the quotastats command
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
off
def off(device): ''' Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off ''' cmd = 'quotaoff {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
python
def off(device): ''' Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off ''' cmd = 'quotaoff {0}'.format(device) __salt__['cmd.run'](cmd, python_shell=False) return True
[ "def", "off", "(", "device", ")", ":", "cmd", "=", "'quotaoff {0}'", ".", "format", "(", "device", ")", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "True" ]
Turns off the quota system CLI Example: .. code-block:: bash salt '*' quota.off
[ "Turns", "off", "the", "quota", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L208-L220
train
Turn off the quota system CLI Example : bash salt '*' quota. off CLI Example : bash quota. off CLI Example : bash quota. off CLI Example : bash quota. off CLI Example : bash quota. off quota. off quota. off quota. off quota. off quota. off quota. off ...
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/quota.py
get_mode
def get_mode(device): ''' Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode ''' ret = {} cmd = 'quotaon -p {0}'.format(device) out = __salt__['cmd.run'](cmd, python_shell=False) for line in out.splitlines...
python
def get_mode(device): ''' Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode ''' ret = {} cmd = 'quotaon -p {0}'.format(device) out = __salt__['cmd.run'](cmd, python_shell=False) for line in out.splitlines...
[ "def", "get_mode", "(", "device", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'quotaon -p {0}'", ".", "format", "(", "device", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "for", "line", "in...
Report whether the quota system for this device is on or off CLI Example: .. code-block:: bash salt '*' quota.get_mode
[ "Report", "whether", "the", "quota", "system", "for", "this", "device", "is", "on", "or", "off" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/quota.py#L223-L251
train
Return the quota system mode for this device
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/pagerduty_user.py
present
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create. ''' return __salt__['pagerduty_util.resource_present']('users', ...
python
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs): ''' Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create. ''' return __salt__['pagerduty_util.resource_present']('users', ...
[ "def", "present", "(", "profile", "=", "'pagerduty'", ",", "subdomain", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "__salt__", "[", "'pagerduty_util.resource_present'", "]", "(", "'users'", ",", "[", "'email'", "...
Ensure pagerduty user exists. Arguments match those supported by https://developer.pagerduty.com/documentation/rest/users/create.
[ "Ensure", "pagerduty", "user", "exists", ".", "Arguments", "match", "those", "supported", "by", "https", ":", "//", "developer", ".", "pagerduty", ".", "com", "/", "documentation", "/", "rest", "/", "users", "/", "create", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_user.py#L28-L40
train
Ensure pagerduty user exists.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/rsync.py
_check
def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh): ''' Generate rsync options ''' options = ['-avz'] if delete: options.append('--delete') if force: options.append('--force') if update: options.append('--update') if rsh: o...
python
def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh): ''' Generate rsync options ''' options = ['-avz'] if delete: options.append('--delete') if force: options.append('--force') if update: options.append('--update') if rsh: o...
[ "def", "_check", "(", "delete", ",", "force", ",", "update", ",", "passwordfile", ",", "exclude", ",", "excludefrom", ",", "dryrun", ",", "rsh", ")", ":", "options", "=", "[", "'-avz'", "]", "if", "delete", ":", "options", ".", "append", "(", "'--delet...
Generate rsync options
[ "Generate", "rsync", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L38-L66
train
Generate rsync options for a single object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/rsync.py
rsync
def rsync(src, dst, delete=False, force=False, update=False, passwordfile=None, exclude=None, excludefrom=None, dryrun=False, rsh=None, additional_opts=None, saltenv='base'): ''' .. versionchanged:: 201...
python
def rsync(src, dst, delete=False, force=False, update=False, passwordfile=None, exclude=None, excludefrom=None, dryrun=False, rsh=None, additional_opts=None, saltenv='base'): ''' .. versionchanged:: 201...
[ "def", "rsync", "(", "src", ",", "dst", ",", "delete", "=", "False", ",", "force", "=", "False", ",", "update", "=", "False", ",", "passwordfile", "=", "None", ",", "exclude", "=", "None", ",", "excludefrom", "=", "None", ",", "dryrun", "=", "False",...
.. versionchanged:: 2016.3.0 Return data now contains just the output of the rsync command, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Rsync files from src to dst src The source location where files will be rsynced from. ...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "output", "of", "the", "rsync", "command", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ":", "func", ":", "cmd", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L69-L219
train
Rsync a file or directory from one location to another.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/rsync.py
version
def version(): ''' .. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash sal...
python
def version(): ''' .. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash sal...
[ "def", "version", "(", ")", ":", "try", ":", "out", "=", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "[", "'rsync'", ",", "'--version'", "]", ",", "python_shell", "=", "False", ")", "except", "(", "IOError", ",", "OSError", ")", "as", "exc", ":", ...
.. versionchanged:: 2016.3.0 Return data now contains just the version number as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns rsync version CLI Example: .. code-block:: bash salt '*' rsync.version
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "version", "number", "as", "a", "string", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ":", "func", ":", "cmd", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L222-L246
train
Return the rsync version of the current version of the rsync system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/rsync.py
config
def config(conf_path='/etc/rsyncd.conf'): ''' .. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync conf...
python
def config(conf_path='/etc/rsyncd.conf'): ''' .. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync conf...
[ "def", "config", "(", "conf_path", "=", "'/etc/rsyncd.conf'", ")", ":", "ret", "=", "''", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "conf_path", ",", "'r'", ")", "as", "fp_", ":", "for", "line", "in", "fp_", ":", "r...
.. versionchanged:: 2016.3.0 Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from :py:func:`cmd.run_all <salt.modules.cmdmod.run_all>`. Returns the contents of the rsync config file conf_path : /etc/rsyncd.conf Path...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "0", "Return", "data", "now", "contains", "just", "the", "contents", "of", "the", "rsyncd", ".", "conf", "as", "a", "string", "instead", "of", "a", "dictionary", "as", "returned", "from", ":", "py", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rsync.py#L249-L288
train
Return the contents of the rsyncd. conf file as a string instead of a dictionary as returned from cmd. run_all.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/keystone_role.py
present
def present(name, auth=None, **kwargs): ''' Ensure an role exists name Name of the role description An arbitrary description of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_k...
python
def present(name, auth=None, **kwargs): ''' Ensure an role exists name Name of the role description An arbitrary description of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_k...
[ "def", "present", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "kwargs", "=", ...
Ensure an role exists name Name of the role description An arbitrary description of the role
[ "Ensure", "an", "role", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_role.py#L40-L75
train
Ensure a keystone role exists and is up - to - date
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/keystone_role.py
absent
def absent(name, auth=None, **kwargs): ''' Ensure role does not exist name Name of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) kwargs['name'] = name role = __salt__['...
python
def absent(name, auth=None, **kwargs): ''' Ensure role does not exist name Name of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) kwargs['name'] = name role = __salt__['...
[ "def", "absent", "(", "name", ",", "auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "__salt__", "[", ...
Ensure role does not exist name Name of the role
[ "Ensure", "role", "does", "not", "exist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_role.py#L78-L106
train
Ensure a role does not exist
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_assistive.py
install
def install(app_id, enable=True): ''' Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash ...
python
def install(app_id, enable=True): ''' Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash ...
[ "def", "install", "(", "app_id", ",", "enable", "=", "True", ")", ":", "ge_el_capitan", "=", "True", "if", "_LooseVersion", "(", "__grains__", "[", "'osrelease'", "]", ")", ">=", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "'10.11'", ")...
Install a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to install for assistive access. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' assistive.install /usr/bin/o...
[ "Install", "a", "bundle", "ID", "or", "command", "as", "being", "allowed", "to", "use", "assistive", "access", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L39-L78
train
Installs an application ID or command as being allowed to use assistive access.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_assistive.py
enable
def enable(app_id, enabled=True): ''' Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' ...
python
def enable(app_id, enabled=True): ''' Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' ...
[ "def", "enable", "(", "app_id", ",", "enabled", "=", "True", ")", ":", "enable_str", "=", "'1'", "if", "enabled", "else", "'0'", "for", "a", "in", "_get_assistive_access", "(", ")", ":", "if", "app_id", "==", "a", "[", "0", "]", ":", "cmd", "=", "'...
Enable or disable an existing assistive access application. app_id The bundle ID or command to set assistive access status. enabled Sets enabled or disabled status. Default is ``True``. CLI Example: .. code-block:: bash salt '*' assistive.enable /usr/bin/osascript sa...
[ "Enable", "or", "disable", "an", "existing", "assistive", "access", "application", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L103-L143
train
Enable or disable an existing assistive access application.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_assistive.py
remove
def remove(app_id): ''' Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove c...
python
def remove(app_id): ''' Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove c...
[ "def", "remove", "(", "app_id", ")", ":", "cmd", "=", "'sqlite3 \"/Library/Application Support/com.apple.TCC/TCC.db\" '", "'\"DELETE from access where client=\\'{0}\\'\"'", ".", "format", "(", "app_id", ")", "call", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ...
Remove a bundle ID or command as being allowed to use assistive access. app_id The bundle ID or command to remove from assistive access list. CLI Example: .. code-block:: bash salt '*' assistive.remove /usr/bin/osascript salt '*' assistive.remove com.smileonmymac.textexpander
[ "Remove", "a", "bundle", "ID", "or", "command", "as", "being", "allowed", "to", "use", "assistive", "access", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L168-L199
train
Remove an application from assistive access list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_assistive.py
_get_assistive_access
def _get_assistive_access(): ''' Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not. ''' cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT * FROM access"' call = __salt__['cmd.run_all']( ...
python
def _get_assistive_access(): ''' Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not. ''' cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT * FROM access"' call = __salt__['cmd.run_all']( ...
[ "def", "_get_assistive_access", "(", ")", ":", "cmd", "=", "'sqlite3 \"/Library/Application Support/com.apple.TCC/TCC.db\" \"SELECT * FROM access\"'", "call", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'debug'", ",", "python_shell"...
Get a list of all of the assistive access applications installed, returns as a ternary showing whether each app is enabled or not.
[ "Get", "a", "list", "of", "all", "of", "the", "assistive", "access", "applications", "installed", "returns", "as", "a", "ternary", "showing", "whether", "each", "app", "is", "enabled", "or", "not", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_assistive.py#L210-L232
train
Get a list of all of the assistive access applications installed
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/serializers/yaml.py
deserialize
def deserialize(stream_or_string, **options): ''' Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module. ''' options.setdefault('Loader', Loader) try: r...
python
def deserialize(stream_or_string, **options): ''' Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module. ''' options.setdefault('Loader', Loader) try: r...
[ "def", "deserialize", "(", "stream_or_string", ",", "*", "*", "options", ")", ":", "options", ".", "setdefault", "(", "'Loader'", ",", "Loader", ")", "try", ":", "return", "yaml", ".", "load", "(", "stream_or_string", ",", "*", "*", "options", ")", "exce...
Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower yaml module.
[ "Deserialize", "any", "string", "of", "stream", "like", "object", "into", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yaml.py#L41-L64
train
Deserialize any string of stream like object into a Python data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/serializers/yaml.py
serialize
def serialize(obj, **options): ''' Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module. ''' options.setdefault('Dumper', Dumper) try: response = yaml.dump(obj, **options) if response.endswith('\n...\n...
python
def serialize(obj, **options): ''' Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module. ''' options.setdefault('Dumper', Dumper) try: response = yaml.dump(obj, **options) if response.endswith('\n...\n...
[ "def", "serialize", "(", "obj", ",", "*", "*", "options", ")", ":", "options", ".", "setdefault", "(", "'Dumper'", ",", "Dumper", ")", "try", ":", "response", "=", "yaml", ".", "dump", "(", "obj", ",", "*", "*", "options", ")", "if", "response", "....
Serialize Python data to YAML. :param obj: the data structure to serialize :param options: options given to lower yaml module.
[ "Serialize", "Python", "data", "to", "YAML", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yaml.py#L67-L85
train
Serialize Python data to YAML.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_certutil.py
get_cert_serial
def get_cert_serial(cert_file): ''' Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name> ''' cmd = "certutil.exe -silent -verify {0}".format...
python
def get_cert_serial(cert_file): ''' Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name> ''' cmd = "certutil.exe -silent -verify {0}".format...
[ "def", "get_cert_serial", "(", "cert_file", ")", ":", "cmd", "=", "\"certutil.exe -silent -verify {0}\"", ".", "format", "(", "cert_file", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "# match serial number by paragraph to work with multiple lang...
Get the serial number of a certificate file cert_file The certificate file to find the serial for CLI Example: .. code-block:: bash salt '*' certutil.get_cert_serial <certificate name>
[ "Get", "the", "serial", "number", "of", "a", "certificate", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L32-L52
train
Get the serial number of a certificate file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_certutil.py
get_stored_cert_serials
def get_stored_cert_serials(store): ''' Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store> ''' cmd = "certutil.exe -store {0}...
python
def get_stored_cert_serials(store): ''' Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store> ''' cmd = "certutil.exe -store {0}...
[ "def", "get_stored_cert_serials", "(", "store", ")", ":", "cmd", "=", "\"certutil.exe -store {0}\"", ".", "format", "(", "store", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "# match serial numbers by header position to work with multiple langua...
Get all of the certificate serials in the specified store store The store to get all the certificate serials from CLI Example: .. code-block:: bash salt '*' certutil.get_stored_cert_serials <store>
[ "Get", "all", "of", "the", "certificate", "serials", "in", "the", "specified", "store" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L55-L72
train
Get all of the certificate serials in the specified store
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_certutil.py
add_store
def add_store(source, store, saltenv='base'): ''' Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment t...
python
def add_store(source, store, saltenv='base'): ''' Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment t...
[ "def", "add_store", "(", "source", ",", "store", ",", "saltenv", "=", "'base'", ")", ":", "cert_file", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", "saltenv", ")", "cmd", "=", "\"certutil.exe -addstore {0} {1}\"", ".", "format", "(", "st...
Add the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to add the certificate to saltenv The salt environment to use this is ignored if the path is local CL...
[ "Add", "the", "given", "cert", "into", "the", "given", "Certificate", "Store" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L75-L98
train
Add a certificate into a certificate store
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_certutil.py
del_store
def del_store(source, store, saltenv='base'): ''' Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt envir...
python
def del_store(source, store, saltenv='base'): ''' Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt envir...
[ "def", "del_store", "(", "source", ",", "store", ",", "saltenv", "=", "'base'", ")", ":", "cert_file", "=", "__salt__", "[", "'cp.cache_file'", "]", "(", "source", ",", "saltenv", ")", "serial", "=", "get_cert_serial", "(", "cert_file", ")", "cmd", "=", ...
Delete the given cert into the given Certificate Store source The source certificate file this can be in the form salt://path/to/file store The certificate store to delete the certificate from saltenv The salt environment to use this is ignored if the path is local...
[ "Delete", "the", "given", "cert", "into", "the", "given", "Certificate", "Store" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_certutil.py#L101-L125
train
Delete the given certificate into the given Certificate Store
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ddns.py
present
def present(name, zone, ttl, data, rdtype='A', **kwargs): ''' Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so...
python
def present(name, zone, ttl, data, rdtype='A', **kwargs): ''' Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so...
[ "def", "present", "(", "name", ",", "zone", ",", "ttl", ",", "data", ",", "rdtype", "=", "'A'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'co...
Ensures that the named DNS record is present with the given ttl. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so make sure that information is not duplicated in these two arg...
[ "Ensures", "that", "the", "named", "DNS", "record", "is", "present", "with", "the", "given", "ttl", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ddns.py#L35-L91
train
Ensure that the named DNS record is present with the given ttl.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ddns.py
absent
def absent(name, zone, data=None, rdtype=None, **kwargs): ''' Ensures that the named DNS record is absent. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so make sure that info...
python
def absent(name, zone, data=None, rdtype=None, **kwargs): ''' Ensures that the named DNS record is absent. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so make sure that info...
[ "def", "absent", "(", "name", ",", "zone", ",", "data", "=", "None", ",", "rdtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'c...
Ensures that the named DNS record is absent. name The host portion of the DNS record, e.g., 'webserver'. Name and zone are concatenated when the entry is created unless name includes a trailing dot, so make sure that information is not duplicated in these two arguments. zone ...
[ "Ensures", "that", "the", "named", "DNS", "record", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ddns.py#L94-L145
train
Ensures that the named DNS record is absent.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/renderers/json.py
render
def render(json_data, saltenv='base', sls='', **kws): ''' Accepts JSON as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure ''' if not isinstance(json_data, six.string_types): json_data = json_data.read() if json_data.startswith('#!')...
python
def render(json_data, saltenv='base', sls='', **kws): ''' Accepts JSON as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure ''' if not isinstance(json_data, six.string_types): json_data = json_data.read() if json_data.startswith('#!')...
[ "def", "render", "(", "json_data", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "*", "*", "kws", ")", ":", "if", "not", "isinstance", "(", "json_data", ",", "six", ".", "string_types", ")", ":", "json_data", "=", "json_data", ".", "read...
Accepts JSON as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure
[ "Accepts", "JSON", "as", "a", "string", "or", "as", "a", "file", "object", "and", "runs", "it", "through", "the", "JSON", "parser", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/json.py#L16-L30
train
Takes a JSON string or as a file object and runs it through the JSON parser.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
_cmd
def _cmd(binary, *args): ''' Wrapper to run at(1) or return None. ''' binary = salt.utils.path.which(binary) if not binary: raise CommandNotFoundError('{0}: command not found'.format(binary)) cmd = [binary] + list(args) return __salt__['cmd.run_stdout']([binary] + list(args), ...
python
def _cmd(binary, *args): ''' Wrapper to run at(1) or return None. ''' binary = salt.utils.path.which(binary) if not binary: raise CommandNotFoundError('{0}: command not found'.format(binary)) cmd = [binary] + list(args) return __salt__['cmd.run_stdout']([binary] + list(args), ...
[ "def", "_cmd", "(", "binary", ",", "*", "args", ")", ":", "binary", "=", "salt", ".", "utils", ".", "path", ".", "which", "(", "binary", ")", "if", "not", "binary", ":", "raise", "CommandNotFoundError", "(", "'{0}: command not found'", ".", "format", "("...
Wrapper to run at(1) or return None.
[ "Wrapper", "to", "run", "at", "(", "1", ")", "or", "return", "None", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L51-L60
train
Wrapper to run at 1 or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run at ( 1 ) or return None. Wrapper to run a...
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
atq
def atq(tag=None): ''' List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ''' jobs = [] # Shim to produce output similar to what __virtual_...
python
def atq(tag=None): ''' List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ''' jobs = [] # Shim to produce output similar to what __virtual_...
[ "def", "atq", "(", "tag", "=", "None", ")", ":", "jobs", "=", "[", "]", "# Shim to produce output similar to what __virtual__() should do", "# but __salt__ isn't available in __virtual__()", "# Tested on CentOS 5.8", "if", "__grains__", "[", "'os_family'", "]", "==", "'RedH...
List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number]
[ "List", "all", "queued", "and", "running", "jobs", "or", "only", "those", "with", "an", "optional", "tag", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L63-L163
train
Return all queued and running jobs or only those with AttributeNames tag.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
atrm
def atrm(*args): ''' Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag] ''' # Need to do this here also since we use atq() if not salt.utils.path.which('at'): ...
python
def atrm(*args): ''' Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag] ''' # Need to do this here also since we use atq() if not salt.utils.path.which('at'): ...
[ "def", "atrm", "(", "*", "args", ")", ":", "# Need to do this here also since we use atq()", "if", "not", "salt", ".", "utils", ".", "path", ".", "which", "(", "'at'", ")", ":", "return", "'\\'at.atrm\\' is not available.'", "if", "not", "args", ":", "return", ...
Remove jobs from the queue. CLI Example: .. code-block:: bash salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag]
[ "Remove", "jobs", "from", "the", "queue", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L166-L207
train
Remove jobs from the queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
at
def at(*args, **kwargs): # pylint: disable=C0103 ''' Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' ...
python
def at(*args, **kwargs): # pylint: disable=C0103 ''' Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' ...
[ "def", "at", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0103", "if", "len", "(", "args", ")", "<", "2", ":", "return", "{", "'jobs'", ":", "[", "]", "}", "# Shim to produce output similar to what __virtual__() should do", "# but _...
Add a job to the queue. The 'timespec' follows the format documented in the at(1) manpage. CLI Example: .. code-block:: bash salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' tag=reboot salt '*' at.at '3:05am +3 days' 'bin/myscri...
[ "Add", "a", "job", "to", "the", "queue", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L210-L263
train
Add a job to the queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
atc
def atc(jobid): ''' Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid> ''' # Shim to produce output similar to what __virtual__() should do # bu...
python
def atc(jobid): ''' Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid> ''' # Shim to produce output similar to what __virtual__() should do # bu...
[ "def", "atc", "(", "jobid", ")", ":", "# Shim to produce output similar to what __virtual__() should do", "# but __salt__ isn't available in __virtual__()", "output", "=", "_cmd", "(", "'at'", ",", "'-c'", ",", "six", ".", "text_type", "(", "jobid", ")", ")", "if", "o...
Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text. CLI Example: .. code-block:: bash salt '*' at.atc <jobid>
[ "Print", "the", "at", "(", "1", ")", "script", "that", "will", "run", "for", "the", "passed", "job", "id", ".", "This", "is", "mostly", "for", "debugging", "so", "the", "output", "will", "just", "be", "text", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L266-L287
train
Print the at. atc script that will run for the passed jobid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/at.py
_atq
def _atq(**kwargs): ''' Return match jobs list ''' jobs = [] runas = kwargs.get('runas', None) tag = kwargs.get('tag', None) hour = kwargs.get('hour', None) minute = kwargs.get('minute', None) day = kwargs.get('day', None) month = kwargs.get('month', None) year = kwargs.get...
python
def _atq(**kwargs): ''' Return match jobs list ''' jobs = [] runas = kwargs.get('runas', None) tag = kwargs.get('tag', None) hour = kwargs.get('hour', None) minute = kwargs.get('minute', None) day = kwargs.get('day', None) month = kwargs.get('month', None) year = kwargs.get...
[ "def", "_atq", "(", "*", "*", "kwargs", ")", ":", "jobs", "=", "[", "]", "runas", "=", "kwargs", ".", "get", "(", "'runas'", ",", "None", ")", "tag", "=", "kwargs", ".", "get", "(", "'tag'", ",", "None", ")", "hour", "=", "kwargs", ".", "get", ...
Return match jobs list
[ "Return", "match", "jobs", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/at.py#L290-L368
train
Return a list of match jobs in a single language.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cli/support/__init__.py
_render_profile
def _render_profile(path, caller, runner): ''' Render profile as Jinja2. :param path: :return: ''' env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(path)), trim_blocks=False) return env.get_template(os.path.basename(path)).render(salt=caller, runners=runner).strip()
python
def _render_profile(path, caller, runner): ''' Render profile as Jinja2. :param path: :return: ''' env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(path)), trim_blocks=False) return env.get_template(os.path.basename(path)).render(salt=caller, runners=runner).strip()
[ "def", "_render_profile", "(", "path", ",", "caller", ",", "runner", ")", ":", "env", "=", "jinja2", ".", "Environment", "(", "loader", "=", "jinja2", ".", "FileSystemLoader", "(", "os", ".", "path", ".", "dirname", "(", "path", ")", ")", ",", "trim_bl...
Render profile as Jinja2. :param path: :return:
[ "Render", "profile", "as", "Jinja2", ".", ":", "param", "path", ":", ":", "return", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/support/__init__.py#L15-L22
train
Render profile as Jinja2.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cli/support/__init__.py
get_profile
def get_profile(profile, caller, runner): ''' Get profile. :param profile: :return: ''' profiles = profile.split(',') data = {} for profile in profiles: if os.path.basename(profile) == profile: profile = profile.split('.')[0] # Trim extension if someone added it ...
python
def get_profile(profile, caller, runner): ''' Get profile. :param profile: :return: ''' profiles = profile.split(',') data = {} for profile in profiles: if os.path.basename(profile) == profile: profile = profile.split('.')[0] # Trim extension if someone added it ...
[ "def", "get_profile", "(", "profile", ",", "caller", ",", "runner", ")", ":", "profiles", "=", "profile", ".", "split", "(", "','", ")", "data", "=", "{", "}", "for", "profile", "in", "profiles", ":", "if", "os", ".", "path", ".", "basename", "(", ...
Get profile. :param profile: :return:
[ "Get", "profile", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/support/__init__.py#L25-L52
train
Get the data from a profile.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/cli/support/__init__.py
get_profiles
def get_profiles(config): ''' Get available profiles. :return: ''' profiles = [] for profile_name in os.listdir(os.path.join(os.path.dirname(__file__), 'profiles')): if profile_name.endswith('.yml'): profiles.append(profile_name.split('.')[0]) return sorted(profiles)
python
def get_profiles(config): ''' Get available profiles. :return: ''' profiles = [] for profile_name in os.listdir(os.path.join(os.path.dirname(__file__), 'profiles')): if profile_name.endswith('.yml'): profiles.append(profile_name.split('.')[0]) return sorted(profiles)
[ "def", "get_profiles", "(", "config", ")", ":", "profiles", "=", "[", "]", "for", "profile_name", "in", "os", ".", "listdir", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'profiles'", ")", ...
Get available profiles. :return:
[ "Get", "available", "profiles", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/support/__init__.py#L55-L66
train
Get available profiles.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_user
def get_user(): ''' Get the current user ''' if HAS_PWD: ret = pwd.getpwuid(os.geteuid()).pw_name elif HAS_WIN_FUNCTIONS and salt.utils.win_functions.HAS_WIN32: ret = salt.utils.win_functions.get_current_user() else: raise CommandExecutionError( 'Required exte...
python
def get_user(): ''' Get the current user ''' if HAS_PWD: ret = pwd.getpwuid(os.geteuid()).pw_name elif HAS_WIN_FUNCTIONS and salt.utils.win_functions.HAS_WIN32: ret = salt.utils.win_functions.get_current_user() else: raise CommandExecutionError( 'Required exte...
[ "def", "get_user", "(", ")", ":", "if", "HAS_PWD", ":", "ret", "=", "pwd", ".", "getpwuid", "(", "os", ".", "geteuid", "(", ")", ")", ".", "pw_name", "elif", "HAS_WIN_FUNCTIONS", "and", "salt", ".", "utils", ".", "win_functions", ".", "HAS_WIN32", ":",...
Get the current user
[ "Get", "the", "current", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L54-L65
train
Get the current user s name
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_uid
def get_uid(user=None): ''' Get the uid for a given user name. If no user given, the current euid will be returned. If the user does not exist, None will be returned. On systems which do not support pwd or os.geteuid, None will be returned. ''' if not HAS_PWD: return None elif user i...
python
def get_uid(user=None): ''' Get the uid for a given user name. If no user given, the current euid will be returned. If the user does not exist, None will be returned. On systems which do not support pwd or os.geteuid, None will be returned. ''' if not HAS_PWD: return None elif user i...
[ "def", "get_uid", "(", "user", "=", "None", ")", ":", "if", "not", "HAS_PWD", ":", "return", "None", "elif", "user", "is", "None", ":", "try", ":", "return", "os", ".", "geteuid", "(", ")", "except", "AttributeError", ":", "return", "None", "else", "...
Get the uid for a given user name. If no user given, the current euid will be returned. If the user does not exist, None will be returned. On systems which do not support pwd or os.geteuid, None will be returned.
[ "Get", "the", "uid", "for", "a", "given", "user", "name", ".", "If", "no", "user", "given", "the", "current", "euid", "will", "be", "returned", ".", "If", "the", "user", "does", "not", "exist", "None", "will", "be", "returned", ".", "On", "systems", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L69-L86
train
Get the uid for a given user name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
_win_user_token_is_admin
def _win_user_token_is_admin(user_token): ''' Using the win32 api, determine if the user with token 'user_token' has administrator rights. See MSDN entry here: http://msdn.microsoft.com/en-us/library/aa376389(VS.85).aspx ''' class SID_IDENTIFIER_AUTHORITY(ctypes.Structure): _fie...
python
def _win_user_token_is_admin(user_token): ''' Using the win32 api, determine if the user with token 'user_token' has administrator rights. See MSDN entry here: http://msdn.microsoft.com/en-us/library/aa376389(VS.85).aspx ''' class SID_IDENTIFIER_AUTHORITY(ctypes.Structure): _fie...
[ "def", "_win_user_token_is_admin", "(", "user_token", ")", ":", "class", "SID_IDENTIFIER_AUTHORITY", "(", "ctypes", ".", "Structure", ")", ":", "_fields_", "=", "[", "(", "\"byte0\"", ",", "ctypes", ".", "c_byte", ")", ",", "(", "\"byte1\"", ",", "ctypes", "...
Using the win32 api, determine if the user with token 'user_token' has administrator rights. See MSDN entry here: http://msdn.microsoft.com/en-us/library/aa376389(VS.85).aspx
[ "Using", "the", "win32", "api", "determine", "if", "the", "user", "with", "token", "user_token", "has", "administrator", "rights", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L89-L131
train
Returns a new win32 user token that is an admin of the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_specific_user
def get_specific_user(): ''' Get a user name for publishing. If you find the user is "root" attempt to be more specific ''' user = get_user() if salt.utils.platform.is_windows(): if _win_current_user_is_admin(): return 'sudo_{0}'.format(user) else: env_vars = ('SU...
python
def get_specific_user(): ''' Get a user name for publishing. If you find the user is "root" attempt to be more specific ''' user = get_user() if salt.utils.platform.is_windows(): if _win_current_user_is_admin(): return 'sudo_{0}'.format(user) else: env_vars = ('SU...
[ "def", "get_specific_user", "(", ")", ":", "user", "=", "get_user", "(", ")", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "if", "_win_current_user_is_admin", "(", ")", ":", "return", "'sudo_{0}'", ".", "format", "(", "u...
Get a user name for publishing. If you find the user is "root" attempt to be more specific
[ "Get", "a", "user", "name", "for", "publishing", ".", "If", "you", "find", "the", "user", "is", "root", "attempt", "to", "be", "more", "specific" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L142-L157
train
Get a user name for publishing. If you find the user is root attempt to be more specific . If you find the user is admin attempt to be more specific .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
chugid
def chugid(runas, group=None): ''' Change the current process to belong to the specified user (and the groups to which it belongs) ''' uinfo = pwd.getpwnam(runas) supgroups = [] supgroups_seen = set() if group: try: target_pw_gid = grp.getgrnam(group).gr_gid ...
python
def chugid(runas, group=None): ''' Change the current process to belong to the specified user (and the groups to which it belongs) ''' uinfo = pwd.getpwnam(runas) supgroups = [] supgroups_seen = set() if group: try: target_pw_gid = grp.getgrnam(group).gr_gid ...
[ "def", "chugid", "(", "runas", ",", "group", "=", "None", ")", ":", "uinfo", "=", "pwd", ".", "getpwnam", "(", "runas", ")", "supgroups", "=", "[", "]", "supgroups_seen", "=", "set", "(", ")", "if", "group", ":", "try", ":", "target_pw_gid", "=", "...
Change the current process to belong to the specified user (and the groups to which it belongs)
[ "Change", "the", "current", "process", "to", "belong", "to", "the", "specified", "user", "(", "and", "the", "groups", "to", "which", "it", "belongs", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L160-L229
train
Change the current process to belong to the specified user and the groups to which it belongs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
chugid_and_umask
def chugid_and_umask(runas, umask, group=None): ''' Helper method for for subprocess.Popen to initialise uid/gid and umask for the new process. ''' set_runas = False set_grp = False current_user = getpass.getuser() if runas and runas != current_user: set_runas = True run...
python
def chugid_and_umask(runas, umask, group=None): ''' Helper method for for subprocess.Popen to initialise uid/gid and umask for the new process. ''' set_runas = False set_grp = False current_user = getpass.getuser() if runas and runas != current_user: set_runas = True run...
[ "def", "chugid_and_umask", "(", "runas", ",", "umask", ",", "group", "=", "None", ")", ":", "set_runas", "=", "False", "set_grp", "=", "False", "current_user", "=", "getpass", ".", "getuser", "(", ")", "if", "runas", "and", "runas", "!=", "current_user", ...
Helper method for for subprocess.Popen to initialise uid/gid and umask for the new process.
[ "Helper", "method", "for", "for", "subprocess", ".", "Popen", "to", "initialise", "uid", "/", "gid", "and", "umask", "for", "the", "new", "process", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L232-L257
train
Helper method for subprocess. Popen to initialise uid gid and umask for the new process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_default_group
def get_default_group(user): ''' Returns the specified user's default group. If the user doesn't exist, a KeyError will be raised. ''' return grp.getgrgid(pwd.getpwnam(user).pw_gid).gr_name \ if HAS_GRP and HAS_PWD \ else None
python
def get_default_group(user): ''' Returns the specified user's default group. If the user doesn't exist, a KeyError will be raised. ''' return grp.getgrgid(pwd.getpwnam(user).pw_gid).gr_name \ if HAS_GRP and HAS_PWD \ else None
[ "def", "get_default_group", "(", "user", ")", ":", "return", "grp", ".", "getgrgid", "(", "pwd", ".", "getpwnam", "(", "user", ")", ".", "pw_gid", ")", ".", "gr_name", "if", "HAS_GRP", "and", "HAS_PWD", "else", "None" ]
Returns the specified user's default group. If the user doesn't exist, a KeyError will be raised.
[ "Returns", "the", "specified", "user", "s", "default", "group", ".", "If", "the", "user", "doesn", "t", "exist", "a", "KeyError", "will", "be", "raised", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L260-L267
train
Returns the specified user s default group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_group_list
def get_group_list(user, include_default=True): ''' Returns a list of all of the system group names of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] group_names = None ugroups = set() if hasattr(os, 'getgrouplist'): # Try os.getgroupli...
python
def get_group_list(user, include_default=True): ''' Returns a list of all of the system group names of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] group_names = None ugroups = set() if hasattr(os, 'getgrouplist'): # Try os.getgroupli...
[ "def", "get_group_list", "(", "user", ",", "include_default", "=", "True", ")", ":", "if", "HAS_GRP", "is", "False", "or", "HAS_PWD", "is", "False", ":", "return", "[", "]", "group_names", "=", "None", "ugroups", "=", "set", "(", ")", "if", "hasattr", ...
Returns a list of all of the system group names of which the user is a member.
[ "Returns", "a", "list", "of", "all", "of", "the", "system", "group", "names", "of", "which", "the", "user", "is", "a", "member", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L270-L326
train
Returns a list of all of the system group names of which the user is a member.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_group_dict
def get_group_dict(user=None, include_default=True): ''' Returns a dict of all of the system groups as keys, and group ids as values, of which the user is a member. E.g.: {'staff': 501, 'sudo': 27} ''' if HAS_GRP is False or HAS_PWD is False: return {} group_dict = {} group_names...
python
def get_group_dict(user=None, include_default=True): ''' Returns a dict of all of the system groups as keys, and group ids as values, of which the user is a member. E.g.: {'staff': 501, 'sudo': 27} ''' if HAS_GRP is False or HAS_PWD is False: return {} group_dict = {} group_names...
[ "def", "get_group_dict", "(", "user", "=", "None", ",", "include_default", "=", "True", ")", ":", "if", "HAS_GRP", "is", "False", "or", "HAS_PWD", "is", "False", ":", "return", "{", "}", "group_dict", "=", "{", "}", "group_names", "=", "get_group_list", ...
Returns a dict of all of the system groups as keys, and group ids as values, of which the user is a member. E.g.: {'staff': 501, 'sudo': 27}
[ "Returns", "a", "dict", "of", "all", "of", "the", "system", "groups", "as", "keys", "and", "group", "ids", "as", "values", "of", "which", "the", "user", "is", "a", "member", ".", "E", ".", "g", ".", ":", "{", "staff", ":", "501", "sudo", ":", "27...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L329-L341
train
Returns a dict of all of the system groups and group ids of the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_gid_list
def get_gid_list(user, include_default=True): ''' Returns a list of all of the system group IDs of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] gid_list = list( six.itervalues( get_group_dict(user, include_default=include_default)...
python
def get_gid_list(user, include_default=True): ''' Returns a list of all of the system group IDs of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] gid_list = list( six.itervalues( get_group_dict(user, include_default=include_default)...
[ "def", "get_gid_list", "(", "user", ",", "include_default", "=", "True", ")", ":", "if", "HAS_GRP", "is", "False", "or", "HAS_PWD", "is", "False", ":", "return", "[", "]", "gid_list", "=", "list", "(", "six", ".", "itervalues", "(", "get_group_dict", "("...
Returns a list of all of the system group IDs of which the user is a member.
[ "Returns", "a", "list", "of", "all", "of", "the", "system", "group", "IDs", "of", "which", "the", "user", "is", "a", "member", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L344-L356
train
Returns a list of all of the system group IDs of which the user is a member.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/user.py
get_gid
def get_gid(group=None): ''' Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None. ''' if not HAS_GRP: return None if group i...
python
def get_gid(group=None): ''' Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None. ''' if not HAS_GRP: return None if group i...
[ "def", "get_gid", "(", "group", "=", "None", ")", ":", "if", "not", "HAS_GRP", ":", "return", "None", "if", "group", "is", "None", ":", "try", ":", "return", "os", ".", "getegid", "(", ")", "except", "AttributeError", ":", "return", "None", "else", "...
Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None.
[ "Get", "the", "gid", "for", "a", "given", "group", "name", ".", "If", "no", "group", "given", "the", "current", "egid", "will", "be", "returned", ".", "If", "the", "group", "does", "not", "exist", "None", "will", "be", "returned", ".", "On", "systems",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L359-L376
train
Get the gid for a given group name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
html_override_tool
def html_override_tool(): ''' Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header. ''' apiopts = cherrypy.config['apiopts'] request = cherrypy.request url_blacklist = ( ...
python
def html_override_tool(): ''' Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header. ''' apiopts = cherrypy.config['apiopts'] request = cherrypy.request url_blacklist = ( ...
[ "def", "html_override_tool", "(", ")", ":", "apiopts", "=", "cherrypy", ".", "config", "[", "'apiopts'", "]", "request", "=", "cherrypy", ".", "request", "url_blacklist", "=", "(", "apiopts", ".", "get", "(", "'app_path'", ",", "'/app'", ")", ",", "apiopts...
Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header.
[ "Bypass", "the", "normal", "handler", "and", "serve", "HTML", "for", "all", "URLs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L649-L681
train
Override the normal handler and serve HTML for all URLs
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
salt_token_tool
def salt_token_tool(): ''' If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended ''' x_auth = cherrypy.request.headers.get('X-Auth-Token', None) # X-Auth-Token header trumps session cookie if x_auth: cherry...
python
def salt_token_tool(): ''' If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended ''' x_auth = cherrypy.request.headers.get('X-Auth-Token', None) # X-Auth-Token header trumps session cookie if x_auth: cherry...
[ "def", "salt_token_tool", "(", ")", ":", "x_auth", "=", "cherrypy", ".", "request", ".", "headers", ".", "get", "(", "'X-Auth-Token'", ",", "None", ")", "# X-Auth-Token header trumps session cookie", "if", "x_auth", ":", "cherrypy", ".", "request", ".", "cookie"...
If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended
[ "If", "the", "custom", "authentication", "header", "is", "supplied", "put", "it", "in", "the", "cookie", "dict", "so", "the", "rest", "of", "the", "session", "-", "based", "auth", "works", "as", "intended" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L684-L693
train
This function is used to set the session_id in the cookie dict based on the request headers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
salt_api_acl_tool
def salt_api_acl_tool(username, request): ''' ..versionadded:: 2016.3.0 Verifies user requests against the API whitelist. (User/IP pair) in order to provide whitelisting for the API similar to the master, but over the API. ..code-block:: yaml rest_cherrypy: api_acl: ...
python
def salt_api_acl_tool(username, request): ''' ..versionadded:: 2016.3.0 Verifies user requests against the API whitelist. (User/IP pair) in order to provide whitelisting for the API similar to the master, but over the API. ..code-block:: yaml rest_cherrypy: api_acl: ...
[ "def", "salt_api_acl_tool", "(", "username", ",", "request", ")", ":", "failure_str", "=", "(", "\"[api_acl] Authentication failed for \"", "\"user %s from IP %s\"", ")", "success_str", "=", "(", "\"[api_acl] Authentication sucessful for \"", "\"user %s from IP %s\"", ")", "p...
..versionadded:: 2016.3.0 Verifies user requests against the API whitelist. (User/IP pair) in order to provide whitelisting for the API similar to the master, but over the API. ..code-block:: yaml rest_cherrypy: api_acl: users: '*': ...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L696-L762
train
Checks if a user request is allowed to access the API.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
salt_ip_verify_tool
def salt_ip_verify_tool(): ''' If there is a list of restricted IPs, verify current client is coming from one of those IPs. ''' # This is overly cumbersome and crude, # But, it's also safe... ish... salt_config = cherrypy.config.get('saltopts', None) if salt_config: cherrypy_conf...
python
def salt_ip_verify_tool(): ''' If there is a list of restricted IPs, verify current client is coming from one of those IPs. ''' # This is overly cumbersome and crude, # But, it's also safe... ish... salt_config = cherrypy.config.get('saltopts', None) if salt_config: cherrypy_conf...
[ "def", "salt_ip_verify_tool", "(", ")", ":", "# This is overly cumbersome and crude,", "# But, it's also safe... ish...", "salt_config", "=", "cherrypy", ".", "config", ".", "get", "(", "'saltopts'", ",", "None", ")", "if", "salt_config", ":", "cherrypy_conf", "=", "s...
If there is a list of restricted IPs, verify current client is coming from one of those IPs.
[ "If", "there", "is", "a", "list", "of", "restricted", "IPs", "verify", "current", "client", "is", "coming", "from", "one", "of", "those", "IPs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L765-L783
train
Verify that the current client is coming from one of the restricted IPs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
cors_tool
def cors_tool(): ''' Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response. ''' req_head = che...
python
def cors_tool(): ''' Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response. ''' req_head = che...
[ "def", "cors_tool", "(", ")", ":", "req_head", "=", "cherrypy", ".", "request", ".", "headers", "resp_head", "=", "cherrypy", ".", "response", ".", "headers", "# Always set response headers necessary for 'simple' CORS.", "resp_head", "[", "'Access-Control-Allow-Origin'", ...
Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response.
[ "Handle", "both", "simple", "and", "complex", "CORS", "requests" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L798-L840
train
This function handles both simple and complex CORS requests and returns a single - purpose handler with a simple and complex CORS preflight request.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
hypermedia_handler
def hypermedia_handler(*args, **kwargs): ''' Determine the best output format based on the Accept header, execute the regular handler, and transform the output to the request content type (even if it's an error). :param args: Pass args through to the main handler :param kwargs: Pass kwargs thro...
python
def hypermedia_handler(*args, **kwargs): ''' Determine the best output format based on the Accept header, execute the regular handler, and transform the output to the request content type (even if it's an error). :param args: Pass args through to the main handler :param kwargs: Pass kwargs thro...
[ "def", "hypermedia_handler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Execute the real handler. Handle or pass-through any errors we know how", "# to handle (auth & HTTP errors). Reformat any errors we don't know how to", "# handle as a data structure.", "try", ":", "c...
Determine the best output format based on the Accept header, execute the regular handler, and transform the output to the request content type (even if it's an error). :param args: Pass args through to the main handler :param kwargs: Pass kwargs through to the main handler
[ "Determine", "the", "best", "output", "format", "based", "on", "the", "Accept", "header", "execute", "the", "regular", "handler", "and", "transform", "the", "output", "to", "the", "request", "content", "type", "(", "even", "if", "it", "s", "an", "error", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L853-L918
train
Execute the main handler and transform the output to the request content type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
hypermedia_out
def hypermedia_out(): ''' Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type ''' request = cherrypy.serving.request request._hypermedia_inner_handler = request.handler # If handler...
python
def hypermedia_out(): ''' Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type ''' request = cherrypy.serving.request request._hypermedia_inner_handler = request.handler # If handler...
[ "def", "hypermedia_out", "(", ")", ":", "request", "=", "cherrypy", ".", "serving", ".", "request", "request", ".", "_hypermedia_inner_handler", "=", "request", ".", "handler", "# If handler has been explicitly set to None, don't override.", "if", "request", ".", "handl...
Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type
[ "Determine", "the", "best", "handler", "for", "the", "requested", "content", "type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L921-L933
train
This function is used to set the handler for the request object and the output of that handler into the requested content type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
process_request_body
def process_request_body(fn): ''' A decorator to skip a processor function if process_request_body is False ''' @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) return wrappe...
python
def process_request_body(fn): ''' A decorator to skip a processor function if process_request_body is False ''' @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) return wrappe...
[ "def", "process_request_body", "(", "fn", ")", ":", "@", "functools", ".", "wraps", "(", "fn", ")", "def", "wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0111", "if", "cherrypy", ".", "request", ".", "process_request_bo...
A decorator to skip a processor function if process_request_body is False
[ "A", "decorator", "to", "skip", "a", "processor", "function", "if", "process_request_body", "is", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L936-L944
train
A decorator to skip a processor function if process_request_body is False
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
urlencoded_processor
def urlencoded_processor(entity): ''' Accept x-www-form-urlencoded data (run through CherryPy's formatter) and reformat it into a Low State data structure. Since we can't easily represent complicated data structures with key-value pairs, any more complicated requirements (e.g. compound commands...
python
def urlencoded_processor(entity): ''' Accept x-www-form-urlencoded data (run through CherryPy's formatter) and reformat it into a Low State data structure. Since we can't easily represent complicated data structures with key-value pairs, any more complicated requirements (e.g. compound commands...
[ "def", "urlencoded_processor", "(", "entity", ")", ":", "# First call out to CherryPy's default processor", "cherrypy", ".", "_cpreqbody", ".", "process_urlencoded", "(", "entity", ")", "cherrypy", ".", "_cpreqbody", ".", "process_urlencoded", "(", "entity", ")", "cherr...
Accept x-www-form-urlencoded data (run through CherryPy's formatter) and reformat it into a Low State data structure. Since we can't easily represent complicated data structures with key-value pairs, any more complicated requirements (e.g. compound commands) must instead be delivered via JSON or YAML. ...
[ "Accept", "x", "-", "www", "-", "form", "-", "urlencoded", "data", "(", "run", "through", "CherryPy", "s", "formatter", ")", "and", "reformat", "it", "into", "a", "Low", "State", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L947-L969
train
This is the main method for the urlencoded data processor. It is used to process the POST data and return a Low State data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
json_processor
def json_processor(entity): ''' Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
python
def json_processor(entity): ''' Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
[ "def", "json_processor", "(", "entity", ")", ":", "if", "six", ".", "PY2", ":", "body", "=", "entity", ".", "fp", ".", "read", "(", ")", "else", ":", "# https://github.com/cherrypy/cherrypy/pull/1572", "contents", "=", "BytesIO", "(", ")", "body", "=", "en...
Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data
[ "Unserialize", "raw", "POST", "data", "in", "JSON", "format", "to", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L973-L993
train
Unserialize raw POST data in JSON format to a Python data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
yaml_processor
def yaml_processor(entity): ''' Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
python
def yaml_processor(entity): ''' Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
[ "def", "yaml_processor", "(", "entity", ")", ":", "if", "six", ".", "PY2", ":", "body", "=", "entity", ".", "fp", ".", "read", "(", ")", "else", ":", "# https://github.com/cherrypy/cherrypy/pull/1572", "contents", "=", "BytesIO", "(", ")", "body", "=", "en...
Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data
[ "Unserialize", "raw", "POST", "data", "in", "YAML", "format", "to", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L997-L1016
train
Unserialize raw POST data in YAML format to a Python data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/netapi/rest_cherrypy/app.py
hypermedia_in
def hypermedia_in(): ''' Unserialize POST/PUT data of a specified Content-Type. The following custom processors all are intended to format Low State data and will place that data structure into the request object. :raises HTTPError: if the request contains a Content-Type that we do not hav...
python
def hypermedia_in(): ''' Unserialize POST/PUT data of a specified Content-Type. The following custom processors all are intended to format Low State data and will place that data structure into the request object. :raises HTTPError: if the request contains a Content-Type that we do not hav...
[ "def", "hypermedia_in", "(", ")", ":", "# Be liberal in what you accept", "ct_in_map", "=", "{", "'application/x-www-form-urlencoded'", ":", "urlencoded_processor", ",", "'application/json'", ":", "json_processor", ",", "'application/x-yaml'", ":", "yaml_processor", ",", "'...
Unserialize POST/PUT data of a specified Content-Type. The following custom processors all are intended to format Low State data and will place that data structure into the request object. :raises HTTPError: if the request contains a Content-Type that we do not have a processor for
[ "Unserialize", "POST", "/", "PUT", "data", "of", "a", "specified", "Content", "-", "Type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1045-L1074
train
Unserialize POST or PUT data of a specified Content - Type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...