repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/modules/azurearm_resource.py
policy_assignments_list_for_resource_group
def policy_assignments_list_for_resource_group(resource_group, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-bl...
python
def policy_assignments_list_for_resource_group(resource_group, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-bl...
[ "def", "policy_assignments_list_for_resource_group", "(", "resource_group", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", ...
.. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L978-L1009
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_assignments_list
def policy_assignments_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list ''' result = {} polconn = __utils__['azurearm.get_client']('policy', **...
python
def policy_assignments_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list ''' result = {} polconn = __utils__['azurearm.get_client']('policy', **...
[ "def", "policy_assignments_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy_assign", "=", "__utils__", "[",...
.. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1012-L1036
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_definition_create_or_update
def policy_definition_create_or_update(name, policy_rule, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `poli...
python
def policy_definition_create_or_update(name, policy_rule, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `poli...
[ "def", "policy_definition_create_or_update", "(", "name", ",", "policy_rule", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "if", "not", "isinstance", "(", "policy_rule", ",", "dict", ")", ":", "result", "=", "{", "'error'", ":", "'The pol...
.. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `policy rule <https://docs.microsoft.com/en-us/azure/azure-policy/policy-definition#policy-rule>`_. CLI Example: ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1039-L1091
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_definition_delete
def policy_definition_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy ''' result = ...
python
def policy_definition_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy ''' result = ...
[ "def", "policy_definition_delete", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "# pylint: disable=unused-vari...
.. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1094-L1120
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_definition_get
def policy_definition_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy ''' ...
python
def policy_definition_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy ''' ...
[ "def", "policy_definition_get", "(", "name", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy_def", "=", "polconn", ".", "policy_definitions"...
.. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1123-L1148
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_definitions_list
def policy_definitions_list(hide_builtin=False, **kwargs): ''' .. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurea...
python
def policy_definitions_list(hide_builtin=False, **kwargs): ''' .. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurea...
[ "def", "policy_definitions_list", "(", "hide_builtin", "=", "False", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "p...
.. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definitions_list
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1151-L1178
train
saltstack/salt
salt/cloud/clouds/joyent.py
query_instance
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
python
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
[ "def", "query_instance", "(", "vm_", "=", "None", ",", "call", "=", "None", ")", ":", "if", "isinstance", "(", "vm_", ",", "six", ".", "string_types", ")", "and", "call", "==", "'action'", ":", "vm_", "=", "{", "'name'", ":", "vm_", ",", "'provider'"...
Query an instance upon creation from the Joyent API
[ "Query", "an", "instance", "upon", "creation", "from", "the", "Joyent", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L172-L235
train
saltstack/salt
salt/cloud/clouds/joyent.py
create
def create(vm_): ''' Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, ...
python
def create(vm_): ''' Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, ...
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'joyen...
Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L238-L322
train
saltstack/salt
salt/cloud/clouds/joyent.py
create_node
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
python
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
[ "def", "create_node", "(", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", "[", "'name'", "]", "size", "=", "kwargs", "[", "'size'", "]", "image", "=", "kwargs", "[", "'image'", "]", "location", "=", "kwargs", "[", "'location'", "]", "networks", ...
convenience function to make the rest api call for node creation.
[ "convenience", "function", "to", "make", "the", "rest", "api", "call", "for", "node", "creation", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L325-L370
train
saltstack/salt
salt/cloud/clouds/joyent.py
destroy
def destroy(name, call=None): ''' destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash ...
python
def destroy(name, call=None): ''' destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash ...
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash salt-cloud -d vm_name
[ "destroy", "a", "machine", "by", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L373-L420
train
saltstack/salt
salt/cloud/clouds/joyent.py
reboot
def reboot(name, call=None): ''' reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' node = get_node(name) ret = ...
python
def reboot(name, call=None): ''' reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' node = get_node(name) ret = ...
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ")", ":", "node", "=", "get_node", "(", "name", ")", "ret", "=", "take_action", "(", "name", "=", "name", ",", "call", "=", "call", ",", "method", "=", "'POST'", ",", "command", "=", "'my/mach...
reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name
[ "reboot", "a", "machine", "by", "name", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "return", ":", "true", "if", "successful" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L423-L440
train
saltstack/salt
salt/cloud/clouds/joyent.py
take_action
def take_action(name=None, call=None, command=None, data=None, method='GET', location=DEFAULT_LOCATION): ''' take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to ...
python
def take_action(name=None, call=None, command=None, data=None, method='GET', location=DEFAULT_LOCATION): ''' take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to ...
[ "def", "take_action", "(", "name", "=", "None", ",", "call", "=", "None", ",", "command", "=", "None", ",", "data", "=", "None", ",", "method", "=", "'GET'", ",", "location", "=", "DEFAULT_LOCATION", ")", ":", "caller", "=", "inspect", ".", "stack", ...
take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to be passed to the api, must be in json format :method: GET,POST,or DELETE :location: data center to execute the command on ...
[ "take", "action", "call", "used", "by", "start", "stop", "reboot", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "command", ":", "api", "path",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L484-L524
train
saltstack/salt
salt/cloud/clouds/joyent.py
get_location
def get_location(vm_=None): ''' Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting ''' return __opts__.get( 'location', config.get_cloud_config_value( 'location', vm_ or get_configure...
python
def get_location(vm_=None): ''' Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting ''' return __opts__.get( 'location', config.get_cloud_config_value( 'location', vm_ or get_configure...
[ "def", "get_location", "(", "vm_", "=", "None", ")", ":", "return", "__opts__", ".", "get", "(", "'location'", ",", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", "or", "get_configured_provider", "(", ")", ",", "__opts__", ",", "defa...
Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting
[ "Return", "the", "joyent", "data", "center", "to", "use", "in", "this", "order", ":", "-", "CLI", "parameter", "-", "VM", "parameter", "-", "Cloud", "profile", "setting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L538-L554
train
saltstack/salt
salt/cloud/clouds/joyent.py
avail_locations
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} for key in JOYENT_L...
python
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} for key in JOYENT_L...
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'", ")", "ret", "=", "{", ...
List all available locations
[ "List", "all", "available", "locations" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L557-L587
train
saltstack/salt
salt/cloud/clouds/joyent.py
has_method
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
python
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
[ "def", "has_method", "(", "obj", ",", "method_name", ")", ":", "if", "method_name", "in", "dir", "(", "obj", ")", ":", "return", "True", "log", ".", "error", "(", "'Method \\'%s\\' not yet supported!'", ",", "method_name", ")", "return", "False" ]
Find if the provided object has a specific method
[ "Find", "if", "the", "provided", "object", "has", "a", "specific", "method" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L590-L598
train
saltstack/salt
salt/cloud/clouds/joyent.py
key_list
def key_list(items=None): ''' convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary ''' if items is None: items = [] ret = {} if items and isinstance(items, list): for item in items: if 'name' in it...
python
def key_list(items=None): ''' convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary ''' if items is None: items = [] ret = {} if items and isinstance(items, list): for item in items: if 'name' in it...
[ "def", "key_list", "(", "items", "=", "None", ")", ":", "if", "items", "is", "None", ":", "items", "=", "[", "]", "ret", "=", "{", "}", "if", "items", "and", "isinstance", "(", "items", ",", "list", ")", ":", "for", "item", "in", "items", ":", ...
convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary
[ "convert", "list", "to", "dictionary", "using", "the", "key", "as", "the", "identifier", ":", "param", "items", ":", "array", "to", "iterate", "over", ":", "return", ":", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L601-L618
train
saltstack/salt
salt/cloud/clouds/joyent.py
show_instance
def show_instance(name, call=None): ''' get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name ''' node = get_nod...
python
def show_instance(name, call=None): ''' get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name ''' node = get_nod...
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "node", "=", "get_node", "(", "name", ")", "ret", "=", "query", "(", "command", "=", "'my/machines/{0}'", ".", "format", "(", "node", "[", "'id'", "]", ")", ",", "location", "="...
get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name
[ "get", "details", "about", "a", "machine", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "return", ":", "machine", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L633-L650
train
saltstack/salt
salt/cloud/clouds/joyent.py
reformat_node
def reformat_node(item=None, full=False): ''' Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict ''' desired_keys = [...
python
def reformat_node(item=None, full=False): ''' Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict ''' desired_keys = [...
[ "def", "reformat_node", "(", "item", "=", "None", ",", "full", "=", "False", ")", ":", "desired_keys", "=", "[", "'id'", ",", "'name'", ",", "'state'", ",", "'public_ips'", ",", "'private_ips'", ",", "'size'", ",", "'image'", ",", "'location'", "]", "ite...
Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict
[ "Reformat", "the", "returned", "data", "from", "joyent", "determine", "public", "/", "private", "IPs", "and", "strip", "out", "fields", "if", "necessary", "to", "provide", "either", "full", "or", "brief", "content", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L674-L714
train
saltstack/salt
salt/cloud/clouds/joyent.py
list_nodes
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
python
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
[ "def", "list_nodes", "(", "full", "=", "False", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "if", "POL...
list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q
[ "list", "of", "nodes", "keeping", "only", "a", "brief", "listing" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L717-L755
train
saltstack/salt
salt/cloud/clouds/joyent.py
_get_proto
def _get_proto(): ''' Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True ''' use_ssl = config.get_cloud_config_value( 'use_ssl', get_configured_provider(), __opts__, search_global=False, def...
python
def _get_proto(): ''' Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True ''' use_ssl = config.get_cloud_config_value( 'use_ssl', get_configured_provider(), __opts__, search_global=False, def...
[ "def", "_get_proto", "(", ")", ":", "use_ssl", "=", "config", ".", "get_cloud_config_value", "(", "'use_ssl'", ",", "get_configured_provider", "(", ")", ",", "__opts__", ",", "search_global", "=", "False", ",", "default", "=", "True", ")", "if", "use_ssl", "...
Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True
[ "Checks", "configuration", "to", "see", "whether", "the", "user", "has", "SSL", "turned", "on", ".", "Default", "is", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L785-L802
train
saltstack/salt
salt/cloud/clouds/joyent.py
avail_images
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
python
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "user", "=", "config", "."...
Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images
[ "Get", "list", "of", "available", "images" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L805-L848
train
saltstack/salt
salt/cloud/clouds/joyent.py
avail_sizes
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
python
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "rcode", ",", "items", "=", ...
get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes
[ "get", "list", "of", "available", "packages" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L851-L870
train
saltstack/salt
salt/cloud/clouds/joyent.py
list_keys
def list_keys(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} ret = {} rcode, data = query(command...
python
def list_keys(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} ret = {} rcode, data = query(command...
[ "def", "list_keys", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The list_keys function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwargs", ...
List the keys available
[ "List", "the", "keys", "available" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L873-L890
train
saltstack/salt
salt/cloud/clouds/joyent.py
show_key
def show_key(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwargs: log.e...
python
def show_key(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwargs: log.e...
[ "def", "show_key", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The list_keys function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwargs", ...
List the keys available
[ "List", "the", "keys", "available" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L893-L914
train
saltstack/salt
salt/cloud/clouds/joyent.py
import_key
def import_key(kwargs=None, call=None): ''' List the keys available CLI Example: .. code-block:: bash salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub ''' if call != 'function': log.error( 'The import_key function must be called with -f or --fun...
python
def import_key(kwargs=None, call=None): ''' List the keys available CLI Example: .. code-block:: bash salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub ''' if call != 'function': log.error( 'The import_key function must be called with -f or --fun...
[ "def", "import_key", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The import_key function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwargs"...
List the keys available CLI Example: .. code-block:: bash salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub
[ "List", "the", "keys", "available" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L917-L960
train
saltstack/salt
salt/cloud/clouds/joyent.py
query
def query(action=None, command=None, args=None, method='GET', location=None, data=None): ''' Make a web call to Joyent ''' user = config.get_cloud_config_value( 'user', get_configured_provider(), __opts__, search_global=False ) if not us...
python
def query(action=None, command=None, args=None, method='GET', location=None, data=None): ''' Make a web call to Joyent ''' user = config.get_cloud_config_value( 'user', get_configured_provider(), __opts__, search_global=False ) if not us...
[ "def", "query", "(", "action", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "location", "=", "None", ",", "data", "=", "None", ")", ":", "user", "=", "config", ".", "get_cloud_config_value", "(...
Make a web call to Joyent
[ "Make", "a", "web", "call", "to", "Joyent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L1002-L1127
train
saltstack/salt
salt/modules/upstart_service.py
_find_utmp
def _find_utmp(): ''' Figure out which utmp file to use when determining runlevel. Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness. ''' result = {} # These are the likely locations for the file on Ubuntu for utmp in '/var/run/utmp', '/run/utmp': try: r...
python
def _find_utmp(): ''' Figure out which utmp file to use when determining runlevel. Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness. ''' result = {} # These are the likely locations for the file on Ubuntu for utmp in '/var/run/utmp', '/run/utmp': try: r...
[ "def", "_find_utmp", "(", ")", ":", "result", "=", "{", "}", "# These are the likely locations for the file on Ubuntu", "for", "utmp", "in", "'/var/run/utmp'", ",", "'/run/utmp'", ":", "try", ":", "result", "[", "os", ".", "stat", "(", "utmp", ")", ".", "st_mt...
Figure out which utmp file to use when determining runlevel. Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.
[ "Figure", "out", "which", "utmp", "file", "to", "use", "when", "determining", "runlevel", ".", "Sometimes", "/", "var", "/", "run", "/", "utmp", "doesn", "t", "exist", "/", "run", "/", "utmp", "is", "the", "new", "hotness", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L89-L104
train
saltstack/salt
salt/modules/upstart_service.py
_runlevel
def _runlevel(): ''' Return the current runlevel ''' if 'upstart._runlevel' in __context__: return __context__['upstart._runlevel'] ret = _default_runlevel() utmp = _find_utmp() if utmp: out = __salt__['cmd.run'](['runlevel', '{0}'.format(utmp)], python_shell=False) t...
python
def _runlevel(): ''' Return the current runlevel ''' if 'upstart._runlevel' in __context__: return __context__['upstart._runlevel'] ret = _default_runlevel() utmp = _find_utmp() if utmp: out = __salt__['cmd.run'](['runlevel', '{0}'.format(utmp)], python_shell=False) t...
[ "def", "_runlevel", "(", ")", ":", "if", "'upstart._runlevel'", "in", "__context__", ":", "return", "__context__", "[", "'upstart._runlevel'", "]", "ret", "=", "_default_runlevel", "(", ")", "utmp", "=", "_find_utmp", "(", ")", "if", "utmp", ":", "out", "=",...
Return the current runlevel
[ "Return", "the", "current", "runlevel" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L152-L167
train
saltstack/salt
salt/modules/upstart_service.py
_upstart_is_disabled
def _upstart_is_disabled(name): ''' An Upstart service is assumed disabled if a manual stanza is placed in /etc/init/[name].override. NOTE: An Upstart service can also be disabled by placing "manual" in /etc/init/[name].conf. ''' files = ['/etc/init/{0}.conf'.format(name), '/etc/init/{0}.ove...
python
def _upstart_is_disabled(name): ''' An Upstart service is assumed disabled if a manual stanza is placed in /etc/init/[name].override. NOTE: An Upstart service can also be disabled by placing "manual" in /etc/init/[name].conf. ''' files = ['/etc/init/{0}.conf'.format(name), '/etc/init/{0}.ove...
[ "def", "_upstart_is_disabled", "(", "name", ")", ":", "files", "=", "[", "'/etc/init/{0}.conf'", ".", "format", "(", "name", ")", ",", "'/etc/init/{0}.override'", ".", "format", "(", "name", ")", "]", "for", "file_name", "in", "filter", "(", "os", ".", "pa...
An Upstart service is assumed disabled if a manual stanza is placed in /etc/init/[name].override. NOTE: An Upstart service can also be disabled by placing "manual" in /etc/init/[name].conf.
[ "An", "Upstart", "service", "is", "assumed", "disabled", "if", "a", "manual", "stanza", "is", "placed", "in", "/", "etc", "/", "init", "/", "[", "name", "]", ".", "override", ".", "NOTE", ":", "An", "Upstart", "service", "can", "also", "be", "disabled"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L185-L199
train
saltstack/salt
salt/modules/upstart_service.py
_service_is_sysv
def _service_is_sysv(name): ''' A System-V style service will have a control script in /etc/init.d. We make sure to skip over symbolic links that point to Upstart's /lib/init/upstart-job, and anything that isn't an executable, like README or skeleton. ''' script = '/etc/init.d/{0}'.format(na...
python
def _service_is_sysv(name): ''' A System-V style service will have a control script in /etc/init.d. We make sure to skip over symbolic links that point to Upstart's /lib/init/upstart-job, and anything that isn't an executable, like README or skeleton. ''' script = '/etc/init.d/{0}'.format(na...
[ "def", "_service_is_sysv", "(", "name", ")", ":", "script", "=", "'/etc/init.d/{0}'", ".", "format", "(", "name", ")", "return", "not", "_service_is_upstart", "(", "name", ")", "and", "os", ".", "access", "(", "script", ",", "os", ".", "X_OK", ")" ]
A System-V style service will have a control script in /etc/init.d. We make sure to skip over symbolic links that point to Upstart's /lib/init/upstart-job, and anything that isn't an executable, like README or skeleton.
[ "A", "System", "-", "V", "style", "service", "will", "have", "a", "control", "script", "in", "/", "etc", "/", "init", ".", "d", ".", "We", "make", "sure", "to", "skip", "over", "symbolic", "links", "that", "point", "to", "Upstart", "s", "/", "lib", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L210-L218
train
saltstack/salt
salt/modules/upstart_service.py
_iter_service_names
def _iter_service_names(): ''' Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts ''' found = set() for line in glob.glob('/etc/init.d/*'): name = os.path.basename(line) found.add(name) yield name # Thi...
python
def _iter_service_names(): ''' Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts ''' found = set() for line in glob.glob('/etc/init.d/*'): name = os.path.basename(line) found.add(name) yield name # Thi...
[ "def", "_iter_service_names", "(", ")", ":", "found", "=", "set", "(", ")", "for", "line", "in", "glob", ".", "glob", "(", "'/etc/init.d/*'", ")", ":", "name", "=", "os", ".", "path", ".", "basename", "(", "line", ")", "found", ".", "add", "(", "na...
Detect all of the service names available to upstart via init configuration files and via classic sysv init scripts
[ "Detect", "all", "of", "the", "service", "names", "available", "to", "upstart", "via", "init", "configuration", "files", "and", "via", "classic", "sysv", "init", "scripts" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L238-L265
train
saltstack/salt
salt/modules/upstart_service.py
get_enabled
def get_enabled(): ''' Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_enabled(name): ret.add(name) ...
python
def get_enabled(): ''' Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_enabled(name): ret.add(name) ...
[ "def", "get_enabled", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "name", "in", "_iter_service_names", "(", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "if", "_upstart_is_enabled", "(", "name", ")", ":", "ret", ".", "add", "(",...
Return the enabled services CLI Example: .. code-block:: bash salt '*' service.get_enabled
[ "Return", "the", "enabled", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L268-L287
train
saltstack/salt
salt/modules/upstart_service.py
get_disabled
def get_disabled(): ''' Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_disabled(name): ret.add(name) ...
python
def get_disabled(): ''' Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' ret = set() for name in _iter_service_names(): if _service_is_upstart(name): if _upstart_is_disabled(name): ret.add(name) ...
[ "def", "get_disabled", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "name", "in", "_iter_service_names", "(", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "if", "_upstart_is_disabled", "(", "name", ")", ":", "ret", ".", "add", "(...
Return the disabled services CLI Example: .. code-block:: bash salt '*' service.get_disabled
[ "Return", "the", "disabled", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L290-L309
train
saltstack/salt
salt/modules/upstart_service.py
_upstart_disable
def _upstart_disable(name): ''' Disable an Upstart service. ''' if _upstart_is_disabled(name): return _upstart_is_disabled(name) override = '/etc/init/{0}.override'.format(name) with salt.utils.files.fopen(override, 'a') as ofile: ofile.write(salt.utils.stringutils.to_str('manual...
python
def _upstart_disable(name): ''' Disable an Upstart service. ''' if _upstart_is_disabled(name): return _upstart_is_disabled(name) override = '/etc/init/{0}.override'.format(name) with salt.utils.files.fopen(override, 'a') as ofile: ofile.write(salt.utils.stringutils.to_str('manual...
[ "def", "_upstart_disable", "(", "name", ")", ":", "if", "_upstart_is_disabled", "(", "name", ")", ":", "return", "_upstart_is_disabled", "(", "name", ")", "override", "=", "'/etc/init/{0}.override'", ".", "format", "(", "name", ")", "with", "salt", ".", "utils...
Disable an Upstart service.
[ "Disable", "an", "Upstart", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L499-L508
train
saltstack/salt
salt/modules/upstart_service.py
_upstart_enable
def _upstart_enable(name): ''' Enable an Upstart service. ''' if _upstart_is_enabled(name): return _upstart_is_enabled(name) override = '/etc/init/{0}.override'.format(name) files = ['/etc/init/{0}.conf'.format(name), override] for file_name in filter(os.path.isfile, files): ...
python
def _upstart_enable(name): ''' Enable an Upstart service. ''' if _upstart_is_enabled(name): return _upstart_is_enabled(name) override = '/etc/init/{0}.override'.format(name) files = ['/etc/init/{0}.conf'.format(name), override] for file_name in filter(os.path.isfile, files): ...
[ "def", "_upstart_enable", "(", "name", ")", ":", "if", "_upstart_is_enabled", "(", "name", ")", ":", "return", "_upstart_is_enabled", "(", "name", ")", "override", "=", "'/etc/init/{0}.override'", ".", "format", "(", "name", ")", "files", "=", "[", "'/etc/init...
Enable an Upstart service.
[ "Enable", "an", "Upstart", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L511-L535
train
saltstack/salt
salt/modules/upstart_service.py
enable
def enable(name, **kwargs): ''' Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name> ''' if _service_is_upstart(name): return _upstart_enable(name) executable = _get_service_exec() cmd = '{0} -f {1} defaults...
python
def enable(name, **kwargs): ''' Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name> ''' if _service_is_upstart(name): return _upstart_enable(name) executable = _get_service_exec() cmd = '{0} -f {1} defaults...
[ "def", "enable", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_enable", "(", "name", ")", "executable", "=", "_get_service_exec", "(", ")", "cmd", "=", "'{0} -f {1} defaults'", ".", ...
Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name>
[ "Enable", "the", "named", "service", "to", "start", "at", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L538-L552
train
saltstack/salt
salt/modules/upstart_service.py
disable
def disable(name, **kwargs): ''' Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' if _service_is_upstart(name): return _upstart_disable(name) executable = _get_service_exec() cmd = [executable...
python
def disable(name, **kwargs): ''' Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' if _service_is_upstart(name): return _upstart_disable(name) executable = _get_service_exec() cmd = [executable...
[ "def", "disable", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_disable", "(", "name", ")", "executable", "=", "_get_service_exec", "(", ")", "cmd", "=", "[", "executable", ",", "'...
Disable the named service from starting on boot CLI Example: .. code-block:: bash salt '*' service.disable <service name>
[ "Disable", "the", "named", "service", "from", "starting", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L555-L569
train
saltstack/salt
salt/modules/upstart_service.py
enabled
def enabled(name, **kwargs): ''' Check to see if the named service is enabled to start on boot CLI Example: .. code-block:: bash salt '*' service.enabled <service name> ''' if _service_is_upstart(name): return _upstart_is_enabled(name) else: if _service_is_sysv(nam...
python
def enabled(name, **kwargs): ''' Check to see if the named service is enabled to start on boot CLI Example: .. code-block:: bash salt '*' service.enabled <service name> ''' if _service_is_upstart(name): return _upstart_is_enabled(name) else: if _service_is_sysv(nam...
[ "def", "enabled", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_is_enabled", "(", "name", ")", "else", ":", "if", "_service_is_sysv", "(", "name", ")", ":", "return", "_sysv_is_enabl...
Check to see if the named service is enabled to start on boot CLI Example: .. code-block:: bash salt '*' service.enabled <service name>
[ "Check", "to", "see", "if", "the", "named", "service", "is", "enabled", "to", "start", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L572-L587
train
saltstack/salt
salt/modules/upstart_service.py
disabled
def disabled(name): ''' Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name> ''' if _service_is_upstart(name): return _upstart_is_disabled(name) else: if _service_is_sysv(name): ...
python
def disabled(name): ''' Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name> ''' if _service_is_upstart(name): return _upstart_is_disabled(name) else: if _service_is_sysv(name): ...
[ "def", "disabled", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "return", "_upstart_is_disabled", "(", "name", ")", "else", ":", "if", "_service_is_sysv", "(", "name", ")", ":", "return", "_sysv_is_disabled", "(", "name", ")", ...
Check to see if the named service is disabled to start on boot CLI Example: .. code-block:: bash salt '*' service.disabled <service name>
[ "Check", "to", "see", "if", "the", "named", "service", "is", "disabled", "to", "start", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/upstart_service.py#L590-L605
train
saltstack/salt
salt/auth/yubico.py
__get_yubico_users
def __get_yubico_users(username): ''' Grab the YubiKey Client ID & Secret Key ''' user = {} try: if __opts__['yubico_users'].get(username, None): (user['id'], user['key']) = list(__opts__['yubico_users'][username].values()) else: return None except KeyErr...
python
def __get_yubico_users(username): ''' Grab the YubiKey Client ID & Secret Key ''' user = {} try: if __opts__['yubico_users'].get(username, None): (user['id'], user['key']) = list(__opts__['yubico_users'][username].values()) else: return None except KeyErr...
[ "def", "__get_yubico_users", "(", "username", ")", ":", "user", "=", "{", "}", "try", ":", "if", "__opts__", "[", "'yubico_users'", "]", ".", "get", "(", "username", ",", "None", ")", ":", "(", "user", "[", "'id'", "]", ",", "user", "[", "'key'", "...
Grab the YubiKey Client ID & Secret Key
[ "Grab", "the", "YubiKey", "Client", "ID", "&", "Secret", "Key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/yubico.py#L55-L69
train
saltstack/salt
salt/auth/yubico.py
auth
def auth(username, password): ''' Authenticate against yubico server ''' _cred = __get_yubico_users(username) client = Yubico(_cred['id'], _cred['key']) try: return client.verify(password) except yubico_exceptions.StatusCodeError as e: log.info('Unable to verify YubiKey `%s...
python
def auth(username, password): ''' Authenticate against yubico server ''' _cred = __get_yubico_users(username) client = Yubico(_cred['id'], _cred['key']) try: return client.verify(password) except yubico_exceptions.StatusCodeError as e: log.info('Unable to verify YubiKey `%s...
[ "def", "auth", "(", "username", ",", "password", ")", ":", "_cred", "=", "__get_yubico_users", "(", "username", ")", "client", "=", "Yubico", "(", "_cred", "[", "'id'", "]", ",", "_cred", "[", "'key'", "]", ")", "try", ":", "return", "client", ".", "...
Authenticate against yubico server
[ "Authenticate", "against", "yubico", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/yubico.py#L72-L84
train
saltstack/salt
salt/log/mixins.py
ExcInfoOnLogLevelFormatMixIn.format
def format(self, record): ''' Format the log record to include exc_info if the handler is enabled for a specific log level ''' formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format(record) exc_info_on_loglevel = getattr(record, 'exc_info_on_loglevel', None) ...
python
def format(self, record): ''' Format the log record to include exc_info if the handler is enabled for a specific log level ''' formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format(record) exc_info_on_loglevel = getattr(record, 'exc_info_on_loglevel', None) ...
[ "def", "format", "(", "self", ",", "record", ")", ":", "formatted_record", "=", "super", "(", "ExcInfoOnLogLevelFormatMixIn", ",", "self", ")", ".", "format", "(", "record", ")", "exc_info_on_loglevel", "=", "getattr", "(", "record", ",", "'exc_info_on_loglevel'...
Format the log record to include exc_info if the handler is enabled for a specific log level
[ "Format", "the", "log", "record", "to", "include", "exc_info", "if", "the", "handler", "is", "enabled", "for", "a", "specific", "log", "level" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/mixins.py#L90-L141
train
saltstack/salt
salt/modules/s3.py
delete
def delete(bucket, path=None, action=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt...
python
def delete(bucket, path=None, action=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt...
[ "def", "delete", "(", "bucket", ",", "path", "=", "None", ",", "action", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl", "=", "None", ",", "kms_keyid", "=", "None", ",", "location",...
Delete a bucket, or delete an object from a bucket. CLI Example to delete a bucket:: salt myminion s3.delete mybucket CLI Example to delete an object from a bucket:: salt myminion s3.delete mybucket remoteobject
[ "Delete", "a", "bucket", "or", "delete", "an", "object", "from", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L82-L120
train
saltstack/salt
salt/modules/s3.py
get
def get(bucket='', path='', return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' List the contents of a bucket, or return an object from a bucket. Se...
python
def get(bucket='', path='', return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' List the contents of a bucket, or return an object from a bucket. Se...
[ "def", "get", "(", "bucket", "=", "''", ",", "path", "=", "''", ",", "return_bin", "=", "False", ",", "action", "=", "None", ",", "local_file", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", ...
List the contents of a bucket, or return an object from a bucket. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response. CLI Example to list buckets: .. code-block:: bash salt myminion s3.get CLI Example to list the content...
[ "List", "the", "contents", "of", "a", "bucket", "or", "return", "an", "object", "from", "a", "bucket", ".", "Set", "return_bin", "to", "True", "in", "order", "to", "retrieve", "an", "object", "wholesale", ".", "Otherwise", "Salt", "will", "attempt", "to", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L123-L204
train
saltstack/salt
salt/modules/s3.py
head
def head(bucket, path='', key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt mymin...
python
def head(bucket, path='', key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None): ''' Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt mymin...
[ "def", "head", "(", "bucket", ",", "path", "=", "''", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl", "=", "None", ",", "kms_keyid", "=", "None", ",", "location", "=", "None", ",", "role_arn", ...
Return the metadata for a bucket, or an object in a bucket. CLI Examples: .. code-block:: bash salt myminion s3.head mybucket salt myminion s3.head mybucket myfile.png
[ "Return", "the", "metadata", "for", "a", "bucket", "or", "an", "object", "in", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L207-L244
train
saltstack/salt
salt/modules/s3.py
put
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): ''' Create a new bucket, or upload an o...
python
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): ''' Create a new bucket, or upload an o...
[ "def", "put", "(", "bucket", ",", "path", "=", "None", ",", "return_bin", "=", "False", ",", "action", "=", "None", ",", "local_file", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "service_url", "=", "None", ",", "verify_ssl"...
Create a new bucket, or upload an object to a bucket. CLI Example to create a bucket: .. code-block:: bash salt myminion s3.put mybucket CLI Example to upload an object to a bucket: .. code-block:: bash salt myminion s3.put mybucket remotepath local_file=/path/to/file
[ "Create", "a", "new", "bucket", "or", "upload", "an", "object", "to", "a", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L247-L300
train
saltstack/salt
salt/modules/s3.py
_get_key
def _get_key(key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable): ''' Examine the keys, and populate as necessary ''' if not key and __salt__['config.option']('s3.key'): key = __salt__['config.option']('s3.key') if not keyid and __salt__['config.opt...
python
def _get_key(key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable): ''' Examine the keys, and populate as necessary ''' if not key and __salt__['config.option']('s3.key'): key = __salt__['config.option']('s3.key') if not keyid and __salt__['config.opt...
[ "def", "_get_key", "(", "key", ",", "keyid", ",", "service_url", ",", "verify_ssl", ",", "kms_keyid", ",", "location", ",", "role_arn", ",", "path_style", ",", "https_enable", ")", ":", "if", "not", "key", "and", "__salt__", "[", "'config.option'", "]", "(...
Examine the keys, and populate as necessary
[ "Examine", "the", "keys", "and", "populate", "as", "necessary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/s3.py#L303-L346
train
saltstack/salt
salt/modules/pdbedit.py
generate_nt_hash
def generate_nt_hash(password): ''' Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd ''' return binascii.hexlify( hashlib.new( 'md4', password.encode('utf-16le') ).digest() ).upper()
python
def generate_nt_hash(password): ''' Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd ''' return binascii.hexlify( hashlib.new( 'md4', password.encode('utf-16le') ).digest() ).upper()
[ "def", "generate_nt_hash", "(", "password", ")", ":", "return", "binascii", ".", "hexlify", "(", "hashlib", ".", "new", "(", "'md4'", ",", "password", ".", "encode", "(", "'utf-16le'", ")", ")", ".", "digest", "(", ")", ")", ".", "upper", "(", ")" ]
Generate a NT HASH CLI Example: .. code-block:: bash salt '*' pdbedit.generate_nt_hash my_passwd
[ "Generate", "a", "NT", "HASH" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L52-L67
train
saltstack/salt
salt/modules/pdbedit.py
list_users
def list_users(verbose=True, hashes=False): ''' List user accounts verbose : boolean return all information hashes : boolean include NT HASH and LM HASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.list ''' users = {} if verbose else []...
python
def list_users(verbose=True, hashes=False): ''' List user accounts verbose : boolean return all information hashes : boolean include NT HASH and LM HASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.list ''' users = {} if verbose else []...
[ "def", "list_users", "(", "verbose", "=", "True", ",", "hashes", "=", "False", ")", ":", "users", "=", "{", "}", "if", "verbose", "else", "[", "]", "if", "verbose", ":", "# parse detailed user data", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "("...
List user accounts verbose : boolean return all information hashes : boolean include NT HASH and LM HASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.list
[ "List", "user", "accounts" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L70-L124
train
saltstack/salt
salt/modules/pdbedit.py
get_user
def get_user(login, hashes=False): ''' Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee ''' users = list_users(verbose=True, hashes=has...
python
def get_user(login, hashes=False): ''' Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee ''' users = list_users(verbose=True, hashes=has...
[ "def", "get_user", "(", "login", ",", "hashes", "=", "False", ")", ":", "users", "=", "list_users", "(", "verbose", "=", "True", ",", "hashes", "=", "hashes", ")", "return", "users", "[", "login", "]", "if", "login", "in", "users", "else", "{", "}" ]
Get user account details login : string login name hashes : boolean include NTHASH and LMHASH in verbose output CLI Example: .. code-block:: bash salt '*' pdbedit.get kaylee
[ "Get", "user", "account", "details" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L127-L143
train
saltstack/salt
salt/modules/pdbedit.py
delete
def delete(login): ''' Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash ''' if login in list_users(False): res = __salt__['cmd.run_all']( 'pdbedit --delete {login}'.format(login=_quote_args(lo...
python
def delete(login): ''' Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash ''' if login in list_users(False): res = __salt__['cmd.run_all']( 'pdbedit --delete {login}'.format(login=_quote_args(lo...
[ "def", "delete", "(", "login", ")", ":", "if", "login", "in", "list_users", "(", "False", ")", ":", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'pdbedit --delete {login}'", ".", "format", "(", "login", "=", "_quote_args", "(", "login", ")", ...
Delete user account login : string login name CLI Example: .. code-block:: bash salt '*' pdbedit.delete wash
[ "Delete", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L146-L169
train
saltstack/salt
salt/modules/pdbedit.py
create
def create(login, password, password_hashed=False, machine_account=False): ''' Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to c...
python
def create(login, password, password_hashed=False, machine_account=False): ''' Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to c...
[ "def", "create", "(", "login", ",", "password", ",", "password_hashed", "=", "False", ",", "machine_account", "=", "False", ")", ":", "ret", "=", "'unchanged'", "# generate nt hash if needed", "if", "password_hashed", ":", "password_hash", "=", "password", ".", ...
Create user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text machine_account : boolean set to create a machine trust account instead CLI Example: .. code-block:: bash ...
[ "Create", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L172-L233
train
saltstack/salt
salt/modules/pdbedit.py
modify
def modify( login, password=None, password_hashed=False, domain=None, profile=None, script=None, drive=None, homedir=None, fullname=None, account_desc=None, account_control=None, machine_sid=None, user_sid=None, reset_login_hours=False, reset_bad_password_count=False, ): ''' Modify user ...
python
def modify( login, password=None, password_hashed=False, domain=None, profile=None, script=None, drive=None, homedir=None, fullname=None, account_desc=None, account_control=None, machine_sid=None, user_sid=None, reset_login_hours=False, reset_bad_password_count=False, ): ''' Modify user ...
[ "def", "modify", "(", "login", ",", "password", "=", "None", ",", "password_hashed", "=", "False", ",", "domain", "=", "None", ",", "profile", "=", "None", ",", "script", "=", "None", ",", "drive", "=", "None", ",", "homedir", "=", "None", ",", "full...
Modify user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path script : string logon script drive...
[ "Modify", "user", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pdbedit.py#L236-L385
train
saltstack/salt
salt/beacons/wtmp.py
_validate_time_range
def _validate_time_range(trange, status, msg): ''' Check time range ''' # If trange is empty, just return the current status & msg if not trange: return status, msg if not isinstance(trange, dict): status = False msg = ('The time_range parameter for ' 'wtm...
python
def _validate_time_range(trange, status, msg): ''' Check time range ''' # If trange is empty, just return the current status & msg if not trange: return status, msg if not isinstance(trange, dict): status = False msg = ('The time_range parameter for ' 'wtm...
[ "def", "_validate_time_range", "(", "trange", ",", "status", ",", "msg", ")", ":", "# If trange is empty, just return the current status & msg", "if", "not", "trange", ":", "return", "status", ",", "msg", "if", "not", "isinstance", "(", "trange", ",", "dict", ")",...
Check time range
[ "Check", "time", "range" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/wtmp.py#L174-L194
train
saltstack/salt
salt/beacons/wtmp.py
validate
def validate(config): ''' Validate the beacon configuration ''' vstatus = True vmsg = 'Valid beacon configuration' # Configuration for wtmp beacon should be a list of dicts if not isinstance(config, list): vstatus = False vmsg = ('Configuration for wtmp beacon must be a list...
python
def validate(config): ''' Validate the beacon configuration ''' vstatus = True vmsg = 'Valid beacon configuration' # Configuration for wtmp beacon should be a list of dicts if not isinstance(config, list): vstatus = False vmsg = ('Configuration for wtmp beacon must be a list...
[ "def", "validate", "(", "config", ")", ":", "vstatus", "=", "True", "vmsg", "=", "'Valid beacon configuration'", "# Configuration for wtmp beacon should be a list of dicts", "if", "not", "isinstance", "(", "config", ",", "list", ")", ":", "vstatus", "=", "False", "v...
Validate the beacon configuration
[ "Validate", "the", "beacon", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/wtmp.py#L234-L291
train
saltstack/salt
salt/states/supervisord.py
running
def running(name, restart=False, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' Ensure the named service is running. name Service name as defined in the supervisor configuration file restart ...
python
def running(name, restart=False, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' Ensure the named service is running. name Service name as defined in the supervisor configuration file restart ...
[ "def", "running", "(", "name", ",", "restart", "=", "False", ",", "update", "=", "False", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "name", ".", "endswith", "(", ...
Ensure the named service is running. name Service name as defined in the supervisor configuration file restart Whether to force a restart update Whether to update the supervisor configuration. user Name of the user to run the supervisorctl command .. versiona...
[ "Ensure", "the", "named", "service", "is", "running", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/supervisord.py#L52-L272
train
saltstack/salt
salt/states/supervisord.py
dead
def dead(name, user=None, conf_file=None, bin_env=None, **kwargs): ''' Ensure the named service is dead (not running). name Service name as defined in the supervisor configuration file user Name of the user to run the supervisorctl command ....
python
def dead(name, user=None, conf_file=None, bin_env=None, **kwargs): ''' Ensure the named service is dead (not running). name Service name as defined in the supervisor configuration file user Name of the user to run the supervisorctl command ....
[ "def", "dead", "(", "name", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''"...
Ensure the named service is dead (not running). name Service name as defined in the supervisor configuration file user Name of the user to run the supervisorctl command .. versionadded:: 0.17.0 conf_file path to supervisorctl config file bin_env path to super...
[ "Ensure", "the", "named", "service", "is", "dead", "(", "not", "running", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/supervisord.py#L275-L355
train
saltstack/salt
salt/states/supervisord.py
mod_watch
def mod_watch(name, restart=True, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state e...
python
def mod_watch(name, restart=True, update=False, user=None, conf_file=None, bin_env=None, **kwargs): ''' The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state e...
[ "def", "mod_watch", "(", "name", ",", "restart", "=", "True", ",", "update", "=", "False", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "running", "(", "name", ",...
The supervisord watcher, called to invoke the watch command. Always restart on watch .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function should be set by the state being t...
[ "The", "supervisord", "watcher", "called", "to", "invoke", "the", "watch", "command", ".", "Always", "restart", "on", "watch" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/supervisord.py#L358-L382
train
saltstack/salt
salt/renderers/cheetah.py
render
def render(cheetah_data, saltenv='base', sls='', method='xml', **kws): ''' Render a Cheetah template. :rtype: A Python data structure ''' if not HAS_LIBS: return {} if not isinstance(cheetah_data, six.string_types): cheetah_data = cheetah_data.read() if cheetah_data.starts...
python
def render(cheetah_data, saltenv='base', sls='', method='xml', **kws): ''' Render a Cheetah template. :rtype: A Python data structure ''' if not HAS_LIBS: return {} if not isinstance(cheetah_data, six.string_types): cheetah_data = cheetah_data.read() if cheetah_data.starts...
[ "def", "render", "(", "cheetah_data", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "method", "=", "'xml'", ",", "*", "*", "kws", ")", ":", "if", "not", "HAS_LIBS", ":", "return", "{", "}", "if", "not", "isinstance", "(", "cheetah_data",...
Render a Cheetah template. :rtype: A Python data structure
[ "Render", "a", "Cheetah", "template", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/cheetah.py#L19-L36
train
saltstack/salt
salt/modules/nagios_rpc.py
_config
def _config(): ''' Get configuration items for URL, Username and Password ''' status_url = __salt__['config.get']('nagios.status_url') or \ __salt__['config.get']('nagios:status_url') if not status_url: raise CommandExecutionError('Missing Nagios URL in the configuration.') user...
python
def _config(): ''' Get configuration items for URL, Username and Password ''' status_url = __salt__['config.get']('nagios.status_url') or \ __salt__['config.get']('nagios:status_url') if not status_url: raise CommandExecutionError('Missing Nagios URL in the configuration.') user...
[ "def", "_config", "(", ")", ":", "status_url", "=", "__salt__", "[", "'config.get'", "]", "(", "'nagios.status_url'", ")", "or", "__salt__", "[", "'config.get'", "]", "(", "'nagios:status_url'", ")", "if", "not", "status_url", ":", "raise", "CommandExecutionErro...
Get configuration items for URL, Username and Password
[ "Get", "configuration", "items", "for", "URL", "Username", "and", "Password" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L32-L49
train
saltstack/salt
salt/modules/nagios_rpc.py
_status_query
def _status_query(query, hostname, enumerate=None, service=None): ''' Send query along to Nagios. ''' config = _config() data = None params = { 'hostname': hostname, 'query': query, } ret = { 'result': False } if enumerate: params['formatoptions...
python
def _status_query(query, hostname, enumerate=None, service=None): ''' Send query along to Nagios. ''' config = _config() data = None params = { 'hostname': hostname, 'query': query, } ret = { 'result': False } if enumerate: params['formatoptions...
[ "def", "_status_query", "(", "query", ",", "hostname", ",", "enumerate", "=", "None", ",", "service", "=", "None", ")", ":", "config", "=", "_config", "(", ")", "data", "=", "None", "params", "=", "{", "'hostname'", ":", "hostname", ",", "'query'", ":"...
Send query along to Nagios.
[ "Send", "query", "along", "to", "Nagios", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L52-L110
train
saltstack/salt
salt/modules/nagios_rpc.py
host_status
def host_status(hostname=None, **kwargs): ''' Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ...
python
def host_status(hostname=None, **kwargs): ''' Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ...
[ "def", "host_status", "(", "hostname", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "hostname", ":", "raise", "CommandExecutionError", "(", "'Missing hostname parameter'", ")", "target", "=", "'host'", "numeric", "=", "kwargs", ".", "get", "(...
Check status of a particular host By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. numeric Turn to false in order to return status in text format ('OK' instead of 0, 'Warning' instead of 1 etc...
[ "Check", "status", "of", "a", "particular", "host", "By", "default", "statuses", "are", "returned", "in", "a", "numeric", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L113-L150
train
saltstack/salt
salt/modules/nagios_rpc.py
service_status
def service_status(hostname=None, service=None, **kwargs): ''' Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The serv...
python
def service_status(hostname=None, service=None, **kwargs): ''' Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The serv...
[ "def", "service_status", "(", "hostname", "=", "None", ",", "service", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "hostname", ":", "raise", "CommandExecutionError", "(", "'Missing hostname parameter'", ")", "if", "not", "service", ":", "rai...
Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format. Parameters: hostname The hostname to check the status of the service in Nagios. service The service to check the status of in Nagios. numeric Turn to fals...
[ "Check", "status", "of", "a", "particular", "service", "on", "a", "host", "on", "it", "in", "Nagios", ".", "By", "default", "statuses", "are", "returned", "in", "a", "numeric", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios_rpc.py#L153-L196
train
saltstack/salt
salt/sdb/keyring_db.py
set_
def set_(key, value, service=None, profile=None): ''' Set a key/value pair in a keyring service ''' service = _get_service(service, profile) keyring.set_password(service, key, value)
python
def set_(key, value, service=None, profile=None): ''' Set a key/value pair in a keyring service ''' service = _get_service(service, profile) keyring.set_password(service, key, value)
[ "def", "set_", "(", "key", ",", "value", ",", "service", "=", "None", ",", "profile", "=", "None", ")", ":", "service", "=", "_get_service", "(", "service", ",", "profile", ")", "keyring", ".", "set_password", "(", "service", ",", "key", ",", "value", ...
Set a key/value pair in a keyring service
[ "Set", "a", "key", "/", "value", "pair", "in", "a", "keyring", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/keyring_db.py#L76-L81
train
saltstack/salt
salt/sdb/keyring_db.py
get
def get(key, service=None, profile=None): ''' Get a value from a keyring service ''' service = _get_service(service, profile) return keyring.get_password(service, key)
python
def get(key, service=None, profile=None): ''' Get a value from a keyring service ''' service = _get_service(service, profile) return keyring.get_password(service, key)
[ "def", "get", "(", "key", ",", "service", "=", "None", ",", "profile", "=", "None", ")", ":", "service", "=", "_get_service", "(", "service", ",", "profile", ")", "return", "keyring", ".", "get_password", "(", "service", ",", "key", ")" ]
Get a value from a keyring service
[ "Get", "a", "value", "from", "a", "keyring", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/keyring_db.py#L84-L89
train
saltstack/salt
salt/returners/sentry_return.py
returner
def returner(ret): ''' Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience. ''' try: _connect_sentry(_get_message(ret), ret) except Ex...
python
def returner(ret): ''' Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience. ''' try: _connect_sentry(_get_message(ret), ret) except Ex...
[ "def", "returner", "(", "ret", ")", ":", "try", ":", "_connect_sentry", "(", "_get_message", "(", "ret", ")", ",", "ret", ")", "except", "Exception", "as", "err", ":", "log", ".", "error", "(", "'Can\\'t run connect_sentry: %s'", ",", "err", ",", "exc_info...
Log outcome to sentry. The returner tries to identify errors and report them as such. All other messages will be reported at info level. Failed states will be appended as separate list for convenience.
[ "Log", "outcome", "to", "sentry", ".", "The", "returner", "tries", "to", "identify", "errors", "and", "report", "them", "as", "such", ".", "All", "other", "messages", "will", "be", "reported", "at", "info", "level", ".", "Failed", "states", "will", "be", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sentry_return.py#L74-L84
train
saltstack/salt
salt/returners/sentry_return.py
_connect_sentry
def _connect_sentry(message, result): ''' Connect to the Sentry server ''' pillar_data = __salt__['pillar.raw']() grains = __salt__['grains.items']() raven_config = pillar_data['raven'] hide_pillar = raven_config.get('hide_pillar') sentry_data = { 'result': result, 'pilla...
python
def _connect_sentry(message, result): ''' Connect to the Sentry server ''' pillar_data = __salt__['pillar.raw']() grains = __salt__['grains.items']() raven_config = pillar_data['raven'] hide_pillar = raven_config.get('hide_pillar') sentry_data = { 'result': result, 'pilla...
[ "def", "_connect_sentry", "(", "message", ",", "result", ")", ":", "pillar_data", "=", "__salt__", "[", "'pillar.raw'", "]", "(", ")", "grains", "=", "__salt__", "[", "'grains.items'", "]", "(", ")", "raven_config", "=", "pillar_data", "[", "'raven'", "]", ...
Connect to the Sentry server
[ "Connect", "to", "the", "Sentry", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sentry_return.py#L120-L180
train
saltstack/salt
salt/modules/vboxmanage.py
list_nodes_min
def list_nodes_min(): ''' Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min ''' ret = {} cmd = '{0} list vms'.format(vboxcmd()) for line in salt.modules.cmdmod.run(cmd).splitlines(): if not li...
python
def list_nodes_min(): ''' Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min ''' ret = {} cmd = '{0} list vms'.format(vboxcmd()) for line in salt.modules.cmdmod.run(cmd).splitlines(): if not li...
[ "def", "list_nodes_min", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'{0} list vms'", ".", "format", "(", "vboxcmd", "(", ")", ")", "for", "line", "in", "salt", ".", "modules", ".", "cmdmod", ".", "run", "(", "cmd", ")", ".", "splitlines", "(...
Return a list of registered VMs, with minimal information CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes_min
[ "Return", "a", "list", "of", "registered", "VMs", "with", "minimal", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L77-L95
train
saltstack/salt
salt/modules/vboxmanage.py
list_nodes
def list_nodes(): ''' Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = { 'id': nodes[node]['UUID'], 'image': nodes[node]['Guest...
python
def list_nodes(): ''' Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes ''' ret = {} nodes = list_nodes_full() for node in nodes: ret[node] = { 'id': nodes[node]['UUID'], 'image': nodes[node]['Guest...
[ "def", "list_nodes", "(", ")", ":", "ret", "=", "{", "}", "nodes", "=", "list_nodes_full", "(", ")", "for", "node", "in", "nodes", ":", "ret", "[", "node", "]", "=", "{", "'id'", ":", "nodes", "[", "node", "]", "[", "'UUID'", "]", ",", "'image'",...
Return a list of registered VMs CLI Example: .. code-block:: bash salt '*' vboxmanage.list_nodes
[ "Return", "a", "list", "of", "registered", "VMs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L111-L136
train
saltstack/salt
salt/modules/vboxmanage.py
start
def start(name): ''' Start a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.start my_vm ''' ret = {} cmd = '{0} startvm {1}'.format(vboxcmd(), name) ret = salt.modules.cmdmod.run(cmd).splitlines() return ret
python
def start(name): ''' Start a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.start my_vm ''' ret = {} cmd = '{0} startvm {1}'.format(vboxcmd(), name) ret = salt.modules.cmdmod.run(cmd).splitlines() return ret
[ "def", "start", "(", "name", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'{0} startvm {1}'", ".", "format", "(", "vboxcmd", "(", ")", ",", "name", ")", "ret", "=", "salt", ".", "modules", ".", "cmdmod", ".", "run", "(", "cmd", ")", ".", "splitli...
Start a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.start my_vm
[ "Start", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L139-L152
train
saltstack/salt
salt/modules/vboxmanage.py
register
def register(filename): ''' Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename ''' if not os.path.isfile(filename): raise CommandExecutionError( 'The specified filename ({0}) does not exist.'.format(filename) ) ...
python
def register(filename): ''' Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename ''' if not os.path.isfile(filename): raise CommandExecutionError( 'The specified filename ({0}) does not exist.'.format(filename) ) ...
[ "def", "register", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "raise", "CommandExecutionError", "(", "'The specified filename ({0}) does not exist.'", ".", "format", "(", "filename", ")", ")", "cmd", "=...
Register a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.register my_vm_filename
[ "Register", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L170-L189
train
saltstack/salt
salt/modules/vboxmanage.py
unregister
def unregister(name, delete=False): ''' Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename ''' nodes = list_nodes_min() if name not in nodes: raise CommandExecutionError( 'The specified VM ({0}) is not registered.'.f...
python
def unregister(name, delete=False): ''' Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename ''' nodes = list_nodes_min() if name not in nodes: raise CommandExecutionError( 'The specified VM ({0}) is not registered.'.f...
[ "def", "unregister", "(", "name", ",", "delete", "=", "False", ")", ":", "nodes", "=", "list_nodes_min", "(", ")", "if", "name", "not", "in", "nodes", ":", "raise", "CommandExecutionError", "(", "'The specified VM ({0}) is not registered.'", ".", "format", "(", ...
Unregister a VM CLI Example: .. code-block:: bash salt '*' vboxmanage.unregister my_vm_filename
[ "Unregister", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L192-L214
train
saltstack/salt
salt/modules/vboxmanage.py
create
def create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs): ''' Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name> ''' nodes = list_node...
python
def create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs): ''' Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name> ''' nodes = list_node...
[ "def", "create", "(", "name", ",", "groups", "=", "None", ",", "ostype", "=", "None", ",", "register", "=", "True", ",", "basefolder", "=", "None", ",", "new_uuid", "=", "None", ",", "*", "*", "kwargs", ")", ":", "nodes", "=", "list_nodes_min", "(", ...
Create a new VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.create <name>
[ "Create", "a", "new", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L230-L294
train
saltstack/salt
salt/modules/vboxmanage.py
clonevm
def clonevm(name=None, uuid=None, new_name=None, snapshot_uuid=None, snapshot_name=None, mode='machine', options=None, basefolder=None, new_uuid=None, register=False, groups=None, **kwargs...
python
def clonevm(name=None, uuid=None, new_name=None, snapshot_uuid=None, snapshot_name=None, mode='machine', options=None, basefolder=None, new_uuid=None, register=False, groups=None, **kwargs...
[ "def", "clonevm", "(", "name", "=", "None", ",", "uuid", "=", "None", ",", "new_name", "=", "None", ",", "snapshot_uuid", "=", "None", ",", "snapshot_name", "=", "None", ",", "mode", "=", "'machine'", ",", "options", "=", "None", ",", "basefolder", "="...
Clone a new VM from an existing VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.clonevm <name> <new_name>
[ "Clone", "a", "new", "VM", "from", "an", "existing", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L297-L401
train
saltstack/salt
salt/modules/vboxmanage.py
clonemedium
def clonemedium(medium, uuid_in=None, file_in=None, uuid_out=None, file_out=None, mformat=None, variant=None, existing=False, **kwargs): ''' Clone a new VM from an existing VM CLI...
python
def clonemedium(medium, uuid_in=None, file_in=None, uuid_out=None, file_out=None, mformat=None, variant=None, existing=False, **kwargs): ''' Clone a new VM from an existing VM CLI...
[ "def", "clonemedium", "(", "medium", ",", "uuid_in", "=", "None", ",", "file_in", "=", "None", ",", "uuid_out", "=", "None", ",", "file_out", "=", "None", ",", "mformat", "=", "None", ",", "variant", "=", "None", ",", "existing", "=", "False", ",", "...
Clone a new VM from an existing VM CLI Example: .. code-block:: bash salt 'hypervisor' vboxmanage.clonemedium <name> <new_name>
[ "Clone", "a", "new", "VM", "from", "an", "existing", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L404-L494
train
saltstack/salt
salt/modules/vboxmanage.py
list_items
def list_items(item, details=False, group_by='UUID'): ''' Return a list of a specific type of item. The following items are available: vms runningvms ostypes hostdvds hostfloppies intnets bridgedifs hostonlyifs natnets dhcpservers ...
python
def list_items(item, details=False, group_by='UUID'): ''' Return a list of a specific type of item. The following items are available: vms runningvms ostypes hostdvds hostfloppies intnets bridgedifs hostonlyifs natnets dhcpservers ...
[ "def", "list_items", "(", "item", ",", "details", "=", "False", ",", "group_by", "=", "'UUID'", ")", ":", "types", "=", "(", "'vms'", ",", "'runningvms'", ",", "'ostypes'", ",", "'hostdvds'", ",", "'hostfloppies'", ",", "'intnets'", ",", "'bridgedifs'", ",...
Return a list of a specific type of item. The following items are available: vms runningvms ostypes hostdvds hostfloppies intnets bridgedifs hostonlyifs natnets dhcpservers hostinfo hostcpuids hddbackends hd...
[ "Return", "a", "list", "of", "a", "specific", "type", "of", "item", ".", "The", "following", "items", "are", "available", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vboxmanage.py#L497-L571
train
saltstack/salt
salt/modules/oracle.py
_unicode_output
def _unicode_output(cursor, name, default_type, size, precision, scale): ''' Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html ''' if default_type in (cx_Oracle.STRING, cx_Oracle.LONG_STRING, cx_Oracl...
python
def _unicode_output(cursor, name, default_type, size, precision, scale): ''' Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html ''' if default_type in (cx_Oracle.STRING, cx_Oracle.LONG_STRING, cx_Oracl...
[ "def", "_unicode_output", "(", "cursor", ",", "name", ",", "default_type", ",", "size", ",", "precision", ",", "scale", ")", ":", "if", "default_type", "in", "(", "cx_Oracle", ".", "STRING", ",", "cx_Oracle", ".", "LONG_STRING", ",", "cx_Oracle", ".", "FIX...
Return strings values as python unicode string http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html
[ "Return", "strings", "values", "as", "python", "unicode", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L80-L88
train
saltstack/salt
salt/modules/oracle.py
_connect
def _connect(uri): ''' uri = user/password@host[:port]/sid[servicename as {sysdba|sysoper}] or uri = sid[ as {sysdba|sysoper}] (this syntax only makes sense on non-Windows minions, ORAHOME is taken from oratab) Return cx_Oracle.Connection instance ''' # cx_Oracle.Connection() does not...
python
def _connect(uri): ''' uri = user/password@host[:port]/sid[servicename as {sysdba|sysoper}] or uri = sid[ as {sysdba|sysoper}] (this syntax only makes sense on non-Windows minions, ORAHOME is taken from oratab) Return cx_Oracle.Connection instance ''' # cx_Oracle.Connection() does not...
[ "def", "_connect", "(", "uri", ")", ":", "# cx_Oracle.Connection() does not support 'as sysdba' syntax", "uri_l", "=", "uri", ".", "rsplit", "(", "' as '", ",", "1", ")", "if", "len", "(", "uri_l", ")", "==", "2", ":", "credentials", ",", "mode", "=", "uri_l...
uri = user/password@host[:port]/sid[servicename as {sysdba|sysoper}] or uri = sid[ as {sysdba|sysoper}] (this syntax only makes sense on non-Windows minions, ORAHOME is taken from oratab) Return cx_Oracle.Connection instance
[ "uri", "=", "user", "/", "password@host", "[", ":", "port", "]", "/", "sid", "[", "servicename", "as", "{", "sysdba|sysoper", "}", "]", "or", "uri", "=", "sid", "[", "as", "{", "sysdba|sysoper", "}", "]", "(", "this", "syntax", "only", "makes", "sens...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L91-L140
train
saltstack/salt
salt/modules/oracle.py
_parse_oratab
def _parse_oratab(sid): ''' Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions ''' if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD'): ORATAB = '/etc/oratab' elif __grains__.get('kernel') in 'SunOS': ORATAB = '...
python
def _parse_oratab(sid): ''' Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions ''' if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD'): ORATAB = '/etc/oratab' elif __grains__.get('kernel') in 'SunOS': ORATAB = '...
[ "def", "_parse_oratab", "(", "sid", ")", ":", "if", "__grains__", ".", "get", "(", "'kernel'", ")", "in", "(", "'Linux'", ",", "'AIX'", ",", "'FreeBSD'", ",", "'OpenBSD'", ",", "'NetBSD'", ")", ":", "ORATAB", "=", "'/etc/oratab'", "elif", "__grains__", "...
Return ORACLE_HOME for a given SID found in oratab Note: only works with Unix-like minions
[ "Return", "ORACLE_HOME", "for", "a", "given", "SID", "found", "in", "oratab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L143-L166
train
saltstack/salt
salt/modules/oracle.py
run_query
def run_query(db, query): ''' Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table" ''' if db in [x.keys()[0] for x in show_dbs()]: conn = _connect(show_dbs(db)[db]['uri']) else: log.debug('No uri...
python
def run_query(db, query): ''' Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table" ''' if db in [x.keys()[0] for x in show_dbs()]: conn = _connect(show_dbs(db)[db]['uri']) else: log.debug('No uri...
[ "def", "run_query", "(", "db", ",", "query", ")", ":", "if", "db", "in", "[", "x", ".", "keys", "(", ")", "[", "0", "]", "for", "x", "in", "show_dbs", "(", ")", "]", ":", "conn", "=", "_connect", "(", "show_dbs", "(", "db", ")", "[", "db", ...
Run SQL query and return result CLI Example: .. code-block:: bash salt '*' oracle.run_query my_db "select * from my_table"
[ "Run", "SQL", "query", "and", "return", "result" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L170-L187
train
saltstack/salt
salt/modules/oracle.py
show_dbs
def show_dbs(*dbs): ''' Show databases configuration from pillar. Filter by `*args` CLI Example: .. code-block:: bash salt '*' oracle.show_dbs salt '*' oracle.show_dbs my_db ''' if dbs: log.debug('get db versions for: %s', dbs) result = {} for db in dbs...
python
def show_dbs(*dbs): ''' Show databases configuration from pillar. Filter by `*args` CLI Example: .. code-block:: bash salt '*' oracle.show_dbs salt '*' oracle.show_dbs my_db ''' if dbs: log.debug('get db versions for: %s', dbs) result = {} for db in dbs...
[ "def", "show_dbs", "(", "*", "dbs", ")", ":", "if", "dbs", ":", "log", ".", "debug", "(", "'get db versions for: %s'", ",", "dbs", ")", "result", "=", "{", "}", "for", "db", "in", "dbs", ":", "result", "[", "db", "]", "=", "__salt__", "[", "'pillar...
Show databases configuration from pillar. Filter by `*args` CLI Example: .. code-block:: bash salt '*' oracle.show_dbs salt '*' oracle.show_dbs my_db
[ "Show", "databases", "configuration", "from", "pillar", ".", "Filter", "by", "*", "args" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L190-L210
train
saltstack/salt
salt/modules/oracle.py
version
def version(*dbs): ''' Server Version (select banner from v$version) CLI Example: .. code-block:: bash salt '*' oracle.version salt '*' oracle.version my_db ''' pillar_dbs = __salt__['pillar.get']('oracle:dbs') get_version = lambda x: [ r[0] for r in run_query(x, ...
python
def version(*dbs): ''' Server Version (select banner from v$version) CLI Example: .. code-block:: bash salt '*' oracle.version salt '*' oracle.version my_db ''' pillar_dbs = __salt__['pillar.get']('oracle:dbs') get_version = lambda x: [ r[0] for r in run_query(x, ...
[ "def", "version", "(", "*", "dbs", ")", ":", "pillar_dbs", "=", "__salt__", "[", "'pillar.get'", "]", "(", "'oracle:dbs'", ")", "get_version", "=", "lambda", "x", ":", "[", "r", "[", "0", "]", "for", "r", "in", "run_query", "(", "x", ",", "\"select b...
Server Version (select banner from v$version) CLI Example: .. code-block:: bash salt '*' oracle.version salt '*' oracle.version my_db
[ "Server", "Version", "(", "select", "banner", "from", "v$version", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L214-L239
train
saltstack/salt
salt/modules/oracle.py
show_env
def show_env(): ''' Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8' ''' envs = ['PATH', 'ORACLE_HOME', 'TNS_ADMIN', 'NLS_LANG'] result = {} for ...
python
def show_env(): ''' Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8' ''' envs = ['PATH', 'ORACLE_HOME', 'TNS_ADMIN', 'NLS_LANG'] result = {} for ...
[ "def", "show_env", "(", ")", ":", "envs", "=", "[", "'PATH'", ",", "'ORACLE_HOME'", ",", "'TNS_ADMIN'", ",", "'NLS_LANG'", "]", "result", "=", "{", "}", "for", "env", "in", "envs", ":", "if", "env", "in", "os", ".", "environ", ":", "result", "[", "...
Show Environment used by Oracle Client CLI Example: .. code-block:: bash salt '*' oracle.show_env .. note:: at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8'
[ "Show", "Environment", "used", "by", "Oracle", "Client" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/oracle.py#L273-L291
train
saltstack/salt
salt/modules/solaris_user.py
_get_gecos
def _get_gecos(name): ''' Retrieve GECOS field info and return it in dictionary form ''' gecos_field = pwd.getpwnam(name).pw_gecos.split(',', 3) if not gecos_field: return {} else: # Assign empty strings for any unspecified trailing GECOS fields while len(gecos_field) < 4...
python
def _get_gecos(name): ''' Retrieve GECOS field info and return it in dictionary form ''' gecos_field = pwd.getpwnam(name).pw_gecos.split(',', 3) if not gecos_field: return {} else: # Assign empty strings for any unspecified trailing GECOS fields while len(gecos_field) < 4...
[ "def", "_get_gecos", "(", "name", ")", ":", "gecos_field", "=", "pwd", ".", "getpwnam", "(", "name", ")", ".", "pw_gecos", ".", "split", "(", "','", ",", "3", ")", "if", "not", "gecos_field", ":", "return", "{", "}", "else", ":", "# Assign empty string...
Retrieve GECOS field info and return it in dictionary form
[ "Retrieve", "GECOS", "field", "info", "and", "return", "it", "in", "dictionary", "form" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L46-L60
train
saltstack/salt
salt/modules/solaris_user.py
_build_gecos
def _build_gecos(gecos_dict): ''' Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod. ''' return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''), gecos_dict.get('roomnu...
python
def _build_gecos(gecos_dict): ''' Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod. ''' return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''), gecos_dict.get('roomnu...
[ "def", "_build_gecos", "(", "gecos_dict", ")", ":", "return", "'{0},{1},{2},{3}'", ".", "format", "(", "gecos_dict", ".", "get", "(", "'fullname'", ",", "''", ")", ",", "gecos_dict", ".", "get", "(", "'roomnumber'", ",", "''", ")", ",", "gecos_dict", ".", ...
Accepts a dictionary entry containing GECOS field names and their values, and returns a full GECOS comment string, to be used with usermod.
[ "Accepts", "a", "dictionary", "entry", "containing", "GECOS", "field", "names", "and", "their", "values", "and", "returns", "a", "full", "GECOS", "comment", "string", "to", "be", "used", "with", "usermod", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L63-L71
train
saltstack/salt
salt/modules/solaris_user.py
_update_gecos
def _update_gecos(name, key, value): ''' Common code to change a user's GECOS information ''' if not isinstance(value, six.string_types): value = six.text_type(value) pre_info = _get_gecos(name) if not pre_info: return False if value == pre_info[key]: return True ...
python
def _update_gecos(name, key, value): ''' Common code to change a user's GECOS information ''' if not isinstance(value, six.string_types): value = six.text_type(value) pre_info = _get_gecos(name) if not pre_info: return False if value == pre_info[key]: return True ...
[ "def", "_update_gecos", "(", "name", ",", "key", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "value", "=", "six", ".", "text_type", "(", "value", ")", "pre_info", "=", "_get_gecos", "(", ...
Common code to change a user's GECOS information
[ "Common", "code", "to", "change", "a", "user", "s", "GECOS", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L74-L90
train
saltstack/salt
salt/modules/solaris_user.py
add
def add(name, uid=None, gid=None, groups=None, home=None, shell=None, unique=True, fullname='', roomnumber='', workphone='', homephone='', createhome=True, **kwargs): ''' Add a user to the minion CLI Example: ...
python
def add(name, uid=None, gid=None, groups=None, home=None, shell=None, unique=True, fullname='', roomnumber='', workphone='', homephone='', createhome=True, **kwargs): ''' Add a user to the minion CLI Example: ...
[ "def", "add", "(", "name", ",", "uid", "=", "None", ",", "gid", "=", "None", ",", "groups", "=", "None", ",", "home", "=", "None", ",", "shell", "=", "None", ",", "unique", "=", "True", ",", "fullname", "=", "''", ",", "roomnumber", "=", "''", ...
Add a user to the minion CLI Example: .. code-block:: bash salt '*' user.add name <uid> <gid> <groups> <home> <shell>
[ "Add", "a", "user", "to", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L93-L159
train
saltstack/salt
salt/modules/solaris_user.py
delete
def delete(name, remove=False, force=False): ''' Remove a user from the minion CLI Example: .. code-block:: bash salt '*' user.delete name remove=True force=True ''' if salt.utils.data.is_true(force): log.warning( 'userdel does not support force-deleting user while...
python
def delete(name, remove=False, force=False): ''' Remove a user from the minion CLI Example: .. code-block:: bash salt '*' user.delete name remove=True force=True ''' if salt.utils.data.is_true(force): log.warning( 'userdel does not support force-deleting user while...
[ "def", "delete", "(", "name", ",", "remove", "=", "False", ",", "force", "=", "False", ")", ":", "if", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "force", ")", ":", "log", ".", "warning", "(", "'userdel does not support force-deleting user whi...
Remove a user from the minion CLI Example: .. code-block:: bash salt '*' user.delete name remove=True force=True
[ "Remove", "a", "user", "from", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L162-L181
train
saltstack/salt
salt/modules/solaris_user.py
chgid
def chgid(name, gid): ''' Change the default group of the user CLI Example: .. code-block:: bash salt '*' user.chgid foo 4376 ''' pre_info = info(name) if not pre_info: raise CommandExecutionError( 'User \'{0}\' does not exist'.format(name) ) if gid...
python
def chgid(name, gid): ''' Change the default group of the user CLI Example: .. code-block:: bash salt '*' user.chgid foo 4376 ''' pre_info = info(name) if not pre_info: raise CommandExecutionError( 'User \'{0}\' does not exist'.format(name) ) if gid...
[ "def", "chgid", "(", "name", ",", "gid", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "not", "pre_info", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "name", ")", ")", "if", "gid", "==", ...
Change the default group of the user CLI Example: .. code-block:: bash salt '*' user.chgid foo 4376
[ "Change", "the", "default", "group", "of", "the", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L226-L245
train
saltstack/salt
salt/modules/solaris_user.py
chshell
def chshell(name, shell): ''' Change the default shell of the user CLI Example: .. code-block:: bash salt '*' user.chshell foo /bin/zsh ''' pre_info = info(name) if not pre_info: raise CommandExecutionError( 'User \'{0}\' does not exist'.format(name) ) ...
python
def chshell(name, shell): ''' Change the default shell of the user CLI Example: .. code-block:: bash salt '*' user.chshell foo /bin/zsh ''' pre_info = info(name) if not pre_info: raise CommandExecutionError( 'User \'{0}\' does not exist'.format(name) ) ...
[ "def", "chshell", "(", "name", ",", "shell", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "not", "pre_info", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "name", ")", ")", "if", "shell", "...
Change the default shell of the user CLI Example: .. code-block:: bash salt '*' user.chshell foo /bin/zsh
[ "Change", "the", "default", "shell", "of", "the", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L248-L267
train
saltstack/salt
salt/modules/solaris_user.py
chhome
def chhome(name, home, persist=False): ''' Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the fi...
python
def chhome(name, home, persist=False): ''' Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the fi...
[ "def", "chhome", "(", "name", ",", "home", ",", "persist", "=", "False", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "not", "pre_info", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "name", ...
Set a new home directory for an existing user name Username to modify home New home directory to set persist : False Set to ``True`` to prevent configuration files in the new home directory from being overwritten by the files from the skeleton directory. CLI E...
[ "Set", "a", "new", "home", "directory", "for", "an", "existing", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L270-L303
train
saltstack/salt
salt/modules/solaris_user.py
chgroups
def chgroups(name, groups, append=False): ''' Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these group...
python
def chgroups(name, groups, append=False): ''' Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these group...
[ "def", "chgroups", "(", "name", ",", "groups", ",", "append", "=", "False", ")", ":", "if", "isinstance", "(", "groups", ",", "six", ".", "string_types", ")", ":", "groups", "=", "groups", ".", "split", "(", "','", ")", "ugrps", "=", "set", "(", "l...
Change the groups to which a user belongs name Username to modify groups List of groups to set for the user. Can be passed as a comma-separated list or a Python list. append : False Set to ``True`` to append these groups to the user's existing list of groups. Other...
[ "Change", "the", "groups", "to", "which", "a", "user", "belongs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L306-L336
train
saltstack/salt
salt/modules/solaris_user.py
rename
def rename(name, new_name): ''' Change the username for a named user CLI Example: .. code-block:: bash salt '*' user.rename name new_name ''' current_info = info(name) if not current_info: raise CommandExecutionError('User \'{0}\' does not exist'.format(name)) new_info...
python
def rename(name, new_name): ''' Change the username for a named user CLI Example: .. code-block:: bash salt '*' user.rename name new_name ''' current_info = info(name) if not current_info: raise CommandExecutionError('User \'{0}\' does not exist'.format(name)) new_info...
[ "def", "rename", "(", "name", ",", "new_name", ")", ":", "current_info", "=", "info", "(", "name", ")", "if", "not", "current_info", ":", "raise", "CommandExecutionError", "(", "'User \\'{0}\\' does not exist'", ".", "format", "(", "name", ")", ")", "new_info"...
Change the username for a named user CLI Example: .. code-block:: bash salt '*' user.rename name new_name
[ "Change", "the", "username", "for", "a", "named", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_user.py#L451-L471
train
saltstack/salt
salt/utils/virtualbox.py
vb_get_manager
def vb_get_manager(): ''' Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager ''' global _virtualboxManager if _virtualboxManager is None and HAS_LIBS: salt.utils.compat.reload(vboxapi) _virtualboxManager = vboxa...
python
def vb_get_manager(): ''' Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager ''' global _virtualboxManager if _virtualboxManager is None and HAS_LIBS: salt.utils.compat.reload(vboxapi) _virtualboxManager = vboxa...
[ "def", "vb_get_manager", "(", ")", ":", "global", "_virtualboxManager", "if", "_virtualboxManager", "is", "None", "and", "HAS_LIBS", ":", "salt", ".", "utils", ".", "compat", ".", "reload", "(", "vboxapi", ")", "_virtualboxManager", "=", "vboxapi", ".", "Virtu...
Creates a 'singleton' manager to communicate with a local virtualbox hypervisor. @return: @rtype: VirtualBoxManager
[ "Creates", "a", "singleton", "manager", "to", "communicate", "with", "a", "local", "virtualbox", "hypervisor", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L133-L144
train
saltstack/salt
salt/utils/virtualbox.py
vb_get_box
def vb_get_box(): ''' Needed for certain operations in the SDK e.g creating sessions @return: @rtype: IVirtualBox ''' vb_get_manager() try: # This works in older versions of the SDK, but does not seem to work anymore. vbox = _virtualboxManager.vbox except AttributeError:...
python
def vb_get_box(): ''' Needed for certain operations in the SDK e.g creating sessions @return: @rtype: IVirtualBox ''' vb_get_manager() try: # This works in older versions of the SDK, but does not seem to work anymore. vbox = _virtualboxManager.vbox except AttributeError:...
[ "def", "vb_get_box", "(", ")", ":", "vb_get_manager", "(", ")", "try", ":", "# This works in older versions of the SDK, but does not seem to work anymore.", "vbox", "=", "_virtualboxManager", ".", "vbox", "except", "AttributeError", ":", "vbox", "=", "_virtualboxManager", ...
Needed for certain operations in the SDK e.g creating sessions @return: @rtype: IVirtualBox
[ "Needed", "for", "certain", "operations", "in", "the", "SDK", "e", ".", "g", "creating", "sessions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L147-L161
train
saltstack/salt
salt/utils/virtualbox.py
vb_get_max_network_slots
def vb_get_max_network_slots(): ''' Max number of slots any machine can have @return: @rtype: number ''' sysprops = vb_get_box().systemProperties totals = [ sysprops.getMaxNetworkAdapters(adapter_type) for adapter_type in [ 1, # PIIX3 A PIIX3 (PCI IDE ISA Xcelera...
python
def vb_get_max_network_slots(): ''' Max number of slots any machine can have @return: @rtype: number ''' sysprops = vb_get_box().systemProperties totals = [ sysprops.getMaxNetworkAdapters(adapter_type) for adapter_type in [ 1, # PIIX3 A PIIX3 (PCI IDE ISA Xcelera...
[ "def", "vb_get_max_network_slots", "(", ")", ":", "sysprops", "=", "vb_get_box", "(", ")", ".", "systemProperties", "totals", "=", "[", "sysprops", ".", "getMaxNetworkAdapters", "(", "adapter_type", ")", "for", "adapter_type", "in", "[", "1", ",", "# PIIX3 A PII...
Max number of slots any machine can have @return: @rtype: number
[ "Max", "number", "of", "slots", "any", "machine", "can", "have" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L164-L178
train
saltstack/salt
salt/utils/virtualbox.py
vb_get_network_adapters
def vb_get_network_adapters(machine_name=None, machine=None): ''' A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict] ''' ...
python
def vb_get_network_adapters(machine_name=None, machine=None): ''' A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict] ''' ...
[ "def", "vb_get_network_adapters", "(", "machine_name", "=", "None", ",", "machine", "=", "None", ")", ":", "if", "machine_name", ":", "machine", "=", "vb_get_box", "(", ")", ".", "findMachine", "(", "machine_name", ")", "network_adapters", "=", "[", "]", "fo...
A valid machine_name or a machine is needed to make this work! @param machine_name: @type machine_name: str @param machine: @type machine: IMachine @return: INetorkAdapter's converted to dicts @rtype: [dict]
[ "A", "valid", "machine_name", "or", "a", "machine", "is", "needed", "to", "make", "this", "work!" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L181-L208
train
saltstack/salt
salt/utils/virtualbox.py
vb_wait_for_network_address
def vb_wait_for_network_address(timeout, step=None, machine_name=None, machine=None, wait_for_pattern=None): ''' Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in sec...
python
def vb_wait_for_network_address(timeout, step=None, machine_name=None, machine=None, wait_for_pattern=None): ''' Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in sec...
[ "def", "vb_wait_for_network_address", "(", "timeout", ",", "step", "=", "None", ",", "machine_name", "=", "None", ",", "machine", "=", "None", ",", "wait_for_pattern", "=", "None", ")", ":", "kwargs", "=", "{", "'machine_name'", ":", "machine_name", ",", "'m...
Wait until a machine has a network address to return or quit after the timeout @param timeout: in seconds @type timeout: float @param step: How regularly we want to check for ips (in seconds) @type step: float @param machine_name: @type machine_name: str @param machine: @type machine: I...
[ "Wait", "until", "a", "machine", "has", "a", "network", "address", "to", "return", "or", "quit", "after", "the", "timeout" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L211-L234
train
saltstack/salt
salt/utils/virtualbox.py
vb_wait_for_session_state
def vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None): ''' Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs ...
python
def vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None): ''' Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs ...
[ "def", "vb_wait_for_session_state", "(", "xp_session", ",", "state", "=", "'Unlocked'", ",", "timeout", "=", "10", ",", "step", "=", "None", ")", ":", "args", "=", "(", "xp_session", ",", "state", ")", "wait_for", "(", "_check_session_state", ",", "timeout",...
Waits until a session state has been reached, checking at regular intervals. @param xp_session: @type xp_session: ISession from the Virtualbox API @param state: The constant descriptor according to the docs @type state: str @param timeout: in seconds @type timeout: int | float @param step: ...
[ "Waits", "until", "a", "session", "state", "has", "been", "reached", "checking", "at", "regular", "intervals", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L250-L266
train
saltstack/salt
salt/utils/virtualbox.py
vb_get_network_addresses
def vb_get_network_addresses(machine_name=None, machine=None, wait_for_pattern=None): ''' TODO distinguish between private and public addresses A valid machine_name or a machine is needed to make this work! !!! Guest prerequisite: GuestAddition !!! Thanks to Shrikant Havale for the StackO...
python
def vb_get_network_addresses(machine_name=None, machine=None, wait_for_pattern=None): ''' TODO distinguish between private and public addresses A valid machine_name or a machine is needed to make this work! !!! Guest prerequisite: GuestAddition !!! Thanks to Shrikant Havale for the StackO...
[ "def", "vb_get_network_addresses", "(", "machine_name", "=", "None", ",", "machine", "=", "None", ",", "wait_for_pattern", "=", "None", ")", ":", "if", "machine_name", ":", "machine", "=", "vb_get_box", "(", ")", ".", "findMachine", "(", "machine_name", ")", ...
TODO distinguish between private and public addresses A valid machine_name or a machine is needed to make this work! !!! Guest prerequisite: GuestAddition !!! Thanks to Shrikant Havale for the StackOverflow answer http://stackoverflow.com/a/29335390 More information on guest properties: http...
[ "TODO", "distinguish", "between", "private", "and", "public", "addresses" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/virtualbox.py#L269-L326
train