repository_name stringclasses 316
values | func_path_in_repository stringlengths 6 223 | func_name stringlengths 1 134 | language stringclasses 1
value | func_code_string stringlengths 57 65.5k | func_documentation_string stringlengths 1 46.3k | split_name stringclasses 1
value | func_code_url stringlengths 91 315 | called_functions listlengths 1 156 ⌀ | enclosing_scope stringlengths 2 1.48M |
|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/mac_service.py | enabled | python | def enabled(name, runas=None):
'''
Check if the specified service is enabled
:param str name: The name of the service to look up
:param str runas: User to run launchctl commands
:return: True if the specified service enabled, otherwise False
:rtype: bool
CLI Example:
.. code-block::... | Check if the specified service is enabled
:param str name: The name of the service to look up
:param str runas: User to run launchctl commands
:return: True if the specified service enabled, otherwise False
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' service.enabled org... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L571-L593 | [
"def list_(name=None, runas=None):\n '''\n Run launchctl list and return the output\n\n :param str name: The name of the service to list\n\n :param str runas: User to run launchctl commands\n\n :return: If a name is passed returns information about the named service,\n otherwise returns a list... | # -*- coding: utf-8 -*-
'''
The service module for macOS
.. versionadded:: 2016.3.0
This module has support for services in the following locations.
.. code-block:: bash
/System/Library/LaunchDaemons/
/System/Library/LaunchAgents/
/Library/LaunchDaemons/
/Library/LaunchAgents/
# As of version "... |
saltstack/salt | salt/modules/mac_service.py | disabled | python | def disabled(name, runas=None, domain='system'):
'''
Check if the specified service is not enabled. This is the opposite of
``service.enabled``
:param str name: The name to look up
:param str runas: User to run launchctl commands
:param str domain: domain to check for disabled services. Defau... | Check if the specified service is not enabled. This is the opposite of
``service.enabled``
:param str name: The name to look up
:param str runas: User to run launchctl commands
:param str domain: domain to check for disabled services. Default is system.
:return: True if the specified service is ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L596-L630 | [
"def launchctl(sub_cmd, *args, **kwargs):\n '''\n Run a launchctl command and raise an error if it fails\n\n :param str sub_cmd: Sub command supplied to launchctl\n\n :param tuple args: Tuple containing additional arguments to pass to\n launchctl\n\n :param dict kwargs: Dictionary containing a... | # -*- coding: utf-8 -*-
'''
The service module for macOS
.. versionadded:: 2016.3.0
This module has support for services in the following locations.
.. code-block:: bash
/System/Library/LaunchDaemons/
/System/Library/LaunchAgents/
/Library/LaunchDaemons/
/Library/LaunchAgents/
# As of version "... |
saltstack/salt | salt/modules/mac_service.py | get_all | python | def get_all(runas=None):
'''
Return a list of services that are enabled or available. Can be used to
find the name of a service.
:param str runas: User to run launchctl commands
:return: A list of all the services available or enabled
:rtype: list
CLI Example:
.. code-block:: bash
... | Return a list of services that are enabled or available. Can be used to
find the name of a service.
:param str runas: User to run launchctl commands
:return: A list of all the services available or enabled
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' service.get_all | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L633-L656 | [
"def get_enabled(runas=None):\n '''\n Return a list of all services that are enabled. Can be used to find the\n name of a service.\n\n :param str runas: User to run launchctl commands\n\n :return: A list of all the services enabled on the system\n :rtype: list\n\n CLI Example:\n\n .. code-bl... | # -*- coding: utf-8 -*-
'''
The service module for macOS
.. versionadded:: 2016.3.0
This module has support for services in the following locations.
.. code-block:: bash
/System/Library/LaunchDaemons/
/System/Library/LaunchAgents/
/Library/LaunchDaemons/
/Library/LaunchAgents/
# As of version "... |
saltstack/salt | salt/modules/mac_service.py | get_enabled | python | def get_enabled(runas=None):
'''
Return a list of all services that are enabled. Can be used to find the
name of a service.
:param str runas: User to run launchctl commands
:return: A list of all the services enabled on the system
:rtype: list
CLI Example:
.. code-block:: bash
... | Return a list of all services that are enabled. Can be used to find the
name of a service.
:param str runas: User to run launchctl commands
:return: A list of all the services enabled on the system
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L659-L689 | [
"def list_(name=None, runas=None):\n '''\n Run launchctl list and return the output\n\n :param str name: The name of the service to list\n\n :param str runas: User to run launchctl commands\n\n :return: If a name is passed returns information about the named service,\n otherwise returns a list... | # -*- coding: utf-8 -*-
'''
The service module for macOS
.. versionadded:: 2016.3.0
This module has support for services in the following locations.
.. code-block:: bash
/System/Library/LaunchDaemons/
/System/Library/LaunchAgents/
/Library/LaunchDaemons/
/Library/LaunchAgents/
# As of version "... |
saltstack/salt | salt/cloud/clouds/nova.py | get_conn | python | def get_conn():
'''
Return a conn object for the passed VM data
'''
vm_ = get_configured_provider()
kwargs = vm_.copy() # pylint: disable=E1103
kwargs['username'] = vm_['user']
kwargs['project_id'] = vm_['tenant']
kwargs['auth_url'] = vm_['identity_url']
kwargs['region_name'] = vm... | Return a conn object for the passed VM data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L301-L324 | [
"def get_configured_provider():\n '''\n Return the first configured instance.\n '''\n return config.is_provider_configured(\n __opts__,\n __active_provider_name__ or __virtualname__,\n ('user', 'tenant', 'identity_url', 'compute_region',)\n )\n"
] | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | avail_locations | python | def avail_locations(conn=None, call=None):
'''
Return a list of locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
if conn is None:
... | Return a list of locations | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L327-L345 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | get_image | python | def get_image(conn, vm_):
'''
Return the image object to use
'''
vm_image = config.get_cloud_config_value('image', vm_, __opts__, default='').encode(
'ascii', 'salt-cloud-force-ascii'
)
if not vm_image:
log.debug('No image set, must be boot from volume')
return None
... | Return the image object to use | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L348-L374 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | show_instance | python | def show_instance(name, call=None):
'''
Show the details from the provider concerning an instance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance action must be called with -a or --action.'
)
conn = get_conn()
node = conn.show_instance(name).__... | Show the details from the provider concerning an instance | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L388-L400 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | get_size | python | def get_size(conn, vm_):
'''
Return the VM's size object
'''
sizes = conn.list_sizes()
vm_size = config.get_cloud_config_value('size', vm_, __opts__)
if not vm_size:
return sizes[0]
for size in sizes:
if vm_size and six.text_type(vm_size) in (six.text_type(sizes[size]['id'])... | Return the VM's size object | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L403-L417 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | ignore_cidr | python | def ignore_cidr(vm_, ip):
'''
Return True if we are to ignore the specified IP. Compatible with IPv4.
'''
if HAS_NETADDR is False:
log.error('Error: netaddr is not installed')
return 'Error: netaddr is not installed'
cidr = config.get_cloud_config_value(
'ignore_cidr', vm_, ... | Return True if we are to ignore the specified IP. Compatible with IPv4. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L441-L456 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | rackconnect | python | def rackconnect(vm_):
'''
Determine if we should wait for rackconnect automation before running.
Either 'False' (default) or 'True'.
'''
return config.get_cloud_config_value(
'rackconnect', vm_, __opts__, default=False,
search_global=False
) | Determine if we should wait for rackconnect automation before running.
Either 'False' (default) or 'True'. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L470-L478 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | rackconnectv3 | python | def rackconnectv3(vm_):
'''
Determine if server is using rackconnectv3 or not
Return the rackconnect network name or False
'''
return config.get_cloud_config_value(
'rackconnectv3', vm_, __opts__, default=False,
search_global=False
) | Determine if server is using rackconnectv3 or not
Return the rackconnect network name or False | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L481-L489 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | cloudnetwork | python | def cloudnetwork(vm_):
'''
Determine if we should use an extra network to bootstrap
Either 'False' (default) or 'True'.
'''
return config.get_cloud_config_value(
'cloudnetwork', vm_, __opts__, default=False,
search_global=False
) | Determine if we should use an extra network to bootstrap
Either 'False' (default) or 'True'. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L492-L500 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | managedcloud | python | def managedcloud(vm_):
'''
Determine if we should wait for the managed cloud automation before
running. Either 'False' (default) or 'True'.
'''
return config.get_cloud_config_value(
'managedcloud', vm_, __opts__, default=False,
search_global=False
) | Determine if we should wait for the managed cloud automation before
running. Either 'False' (default) or 'True'. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L503-L511 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | destroy | python | def destroy(name, conn=None, call=None):
'''
Delete a single VM
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --destroy, '
'-a or --action.'
)
__utils__['cloud.fire_event'](
'event',
'destroy... | Delete a single VM | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L514-L575 | [
"def get_local_client(\n c_path=os.path.join(syspaths.CONFIG_DIR, 'master'),\n mopts=None,\n skip_perm_errors=False,\n io_loop=None,\n auto_reconnect=False):\n '''\n .. versionadded:: 2014.7.0\n\n Read in the config and return the correct LocalClient object based on\n ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | request_instance | python | def request_instance(vm_=None, call=None):
'''
Put together all of the information necessary to request an instance
through Novaclient and then fire off the request the instance.
Returns data about the instance
'''
if call == 'function':
# Technically this function may be called other w... | Put together all of the information necessary to request an instance
through Novaclient and then fire off the request the instance.
Returns data about the instance | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L578-L791 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | create | python | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_name__ or 'nov... | Create a single VM from a data dict | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L934-L1077 | [
"def destroy(name, conn=None, call=None):\n '''\n Delete a single VM\n '''\n if call == 'function':\n raise SaltCloudSystemExit(\n 'The destroy action must be called with -d, --destroy, '\n '-a or --action.'\n )\n\n __utils__['cloud.fire_event'](\n 'event',\... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | list_nodes | python | def list_nodes(call=None, **kwargs):
'''
Return a list of the VMs that in this location
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
ret = {}
conn = get_conn()
server_list = conn.server_list... | Return a list of the VMs that in this location | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1096-L1147 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | list_nodes_full | python | def list_nodes_full(call=None, **kwargs):
'''
Return a list of the VMs that in this location
'''
if call == 'action':
raise SaltCloudSystemExit(
(
'The list_nodes_full function must be called with'
' -f or --function.'
)
)
ret ... | Return a list of the VMs that in this location | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1150-L1177 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | list_nodes_min | python | def list_nodes_min(call=None, **kwargs):
'''
Return a list of the VMs that in this location
'''
if call == 'action':
raise SaltCloudSystemExit(
(
'The list_nodes_min function must be called with'
' -f or --function.'
)
)
conn =... | Return a list of the VMs that in this location | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1180-L1197 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | volume_create | python | def volume_create(name, size=100, snapshot=None, voltype=None, **kwargs):
'''
Create block storage device
'''
conn = get_conn()
create_kwargs = {'name': name,
'size': size,
'snapshot': snapshot,
'voltype': voltype}
create_kwargs['ava... | Create block storage device | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1209-L1219 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | volume_attach | python | def volume_attach(name, server_name, device='/dev/xvdb', **kwargs):
'''
Attach block volume
'''
conn = get_conn()
return conn.volume_attach(
name,
server_name,
device,
timeout=300
) | Attach block volume | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1245-L1255 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | volume_create_attach | python | def volume_create_attach(name, call=None, **kwargs):
'''
Create and attach volumes to created node
'''
if call == 'function':
raise SaltCloudSystemExit(
'The create_attach_volumes action must be called with '
'-a or --action.'
)
if type(kwargs['volumes']) is ... | Create and attach volumes to created node | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1262-L1318 | [
"def safe_load(stream, Loader=SaltYamlSafeLoader):\n '''\n .. versionadded:: 2018.3.0\n\n Helper function which automagically uses our custom loader.\n '''\n return yaml.load(stream, Loader=Loader)\n",
"def volume_create(name, size=100, snapshot=None, voltype=None, **kwargs):\n '''\n Create b... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | virtual_interface_create | python | def virtual_interface_create(name, net_name, **kwargs):
'''
Create private networks
'''
conn = get_conn()
return conn.virtual_interface_create(name, net_name) | Create private networks | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1357-L1362 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | floating_ip_create | python | def floating_ip_create(kwargs, call=None):
'''
Allocate a floating IP
.. versionadded:: 2016.3.0
'''
if call != 'function':
raise SaltCloudSystemExit(
'The floating_ip_create action must be called with -f or --function'
)
if 'pool' not in kwargs:
log.error('... | Allocate a floating IP
.. versionadded:: 2016.3.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1395-L1411 | [
"def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n vm_ = get_configured_provider()\n\n kwargs = vm_.copy() # pylint: disable=E1103\n\n kwargs['username'] = vm_['user']\n kwargs['project_id'] = vm_['tenant']\n kwargs['auth_url'] = vm_['identity_url']\n kwargs['re... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/nova.py | floating_ip_associate | python | def floating_ip_associate(name, kwargs, call=None):
'''
Associate a floating IP address to a server
.. versionadded:: 2016.3.0
'''
if call != 'action':
raise SaltCloudSystemExit(
'The floating_ip_associate action must be called with -a of --action.'
)
if 'floating_i... | Associate a floating IP address to a server
.. versionadded:: 2016.3.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1433-L1450 | [
"def list_nodes(call=None, **kwargs):\n '''\n Return a list of the VMs that in this location\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The list_nodes function must be called with -f or --function.'\n )\n\n ret = {}\n conn = get_conn()\n server_list = ... | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... |
saltstack/salt | salt/cloud/clouds/gogrid.py | create | python | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_name__ or 'gog... | Create a single VM from a data dict | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L82-L189 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | list_nodes | 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.'
)
... | List of nodes, keeping only a brief listing
CLI Example:
.. code-block:: bash
salt-cloud -Q | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L192-L217 | [
"def list_nodes_full(call=None):\n '''\n List nodes, with all available information\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -F\n '''\n response = _query('grid', 'server/list')\n\n ret = {}\n for item in response['list']:\n name = item['name']\n ret[name]... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | list_nodes_full | python | def list_nodes_full(call=None):
'''
List nodes, with all available information
CLI Example:
.. code-block:: bash
salt-cloud -F
'''
response = _query('grid', 'server/list')
ret = {}
for item in response['list']:
name = item['name']
ret[name] = item
ret... | List nodes, with all available information
CLI Example:
.. code-block:: bash
salt-cloud -F | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L220-L246 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | avail_locations | python | def avail_locations():
'''
Available locations
'''
response = list_common_lookups(kwargs={'lookup': 'ip.datacenter'})
ret = {}
for item in response['list']:
name = item['name']
ret[name] = item
return ret | Available locations | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L264-L275 | [
"def list_common_lookups(kwargs=None, call=None):\n '''\n List common lookups for a particular type of item\n\n .. versionadded:: 2015.8.0\n '''\n if kwargs is None:\n kwargs = {}\n\n args = {}\n if 'lookup' in kwargs:\n args['lookup'] = kwargs['lookup']\n\n response = _query('... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | avail_sizes | python | def avail_sizes():
'''
Available sizes
'''
response = list_common_lookups(kwargs={'lookup': 'server.ram'})
ret = {}
for item in response['list']:
name = item['name']
ret[name] = item
return ret | Available sizes | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L278-L289 | [
"def list_common_lookups(kwargs=None, call=None):\n '''\n List common lookups for a particular type of item\n\n .. versionadded:: 2015.8.0\n '''\n if kwargs is None:\n kwargs = {}\n\n args = {}\n if 'lookup' in kwargs:\n args['lookup'] = kwargs['lookup']\n\n response = _query('... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | avail_images | python | def avail_images():
'''
Available images
'''
response = _query('grid', 'image/list')
ret = {}
for item in response['list']:
name = item['friendlyName']
ret[name] = item
return ret | Available images | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L292-L303 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | list_passwords | python | def list_passwords(kwargs=None, call=None):
'''
List all password on the account
.. versionadded:: 2015.8.0
'''
response = _query('support', 'password/list')
ret = {}
for item in response['list']:
if 'server' in item:
server = item['server']['name']
if serve... | List all password on the account
.. versionadded:: 2015.8.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L306-L322 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | list_public_ips | python | def list_public_ips(kwargs=None, call=None):
'''
List all available public IPs.
CLI Example:
.. code-block:: bash
salt-cloud -f list_public_ips <provider>
To list unavailable (assigned) IPs, use:
CLI Example:
.. code-block:: bash
salt-cloud -f list_public_ips <provider> ... | List all available public IPs.
CLI Example:
.. code-block:: bash
salt-cloud -f list_public_ips <provider>
To list unavailable (assigned) IPs, use:
CLI Example:
.. code-block:: bash
salt-cloud -f list_public_ips <provider> state=assigned
.. versionadded:: 2015.8.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L325-L364 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | list_common_lookups | python | def list_common_lookups(kwargs=None, call=None):
'''
List common lookups for a particular type of item
.. versionadded:: 2015.8.0
'''
if kwargs is None:
kwargs = {}
args = {}
if 'lookup' in kwargs:
args['lookup'] = kwargs['lookup']
response = _query('common', 'lookup/l... | List common lookups for a particular type of item
.. versionadded:: 2015.8.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L367-L382 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | destroy | python | def destroy(name, call=None):
'''
Destroy a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -d vm_name
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --destroy, '
'-a or --action.'
... | Destroy a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -d vm_name | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L385-L424 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | show_instance | python | def show_instance(name, call=None):
'''
Start a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
.. versionadded:: 2015.8.0
'''
response = _query('grid', 'server/get', args={'name': name})
ret = {}
for item in response['list']:
... | Start a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
.. versionadded:: 2015.8.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L472-L498 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None):\n '''\n Make a web call to GoGrid\n\n .. versionadded:: 2015.8.0\n '''\n vm_ = get_configured_provider()\n apikey = config.get_cloud_config_valu... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/cloud/clouds/gogrid.py | _query | python | def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None):
'''
Make a web call to GoGrid
.. versionadded:: 2015.8.0
'''
vm_ = get_configured_provider()
apikey = config.get_cloud_config_value(
'apike... | Make a web call to GoGrid
.. versionadded:: 2015.8.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L501-L565 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
GoGrid Cloud Module
====================
The GoGrid cloud module. This module interfaces with the gogrid public cloud
service. To use Salt Cloud with GoGrid log into the GoGrid web interface and
create an api key. Do this by clicking on "My Account" and then going to the
API Keys tab.
Set ... |
saltstack/salt | salt/states/reg.py | _parse_key | python | def _parse_key(key):
'''
split the hive from the key
'''
splt = key.split("\\")
hive = splt.pop(0)
key = '\\'.join(splt)
return hive, key | split the hive from the key | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L104-L111 | null | # -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
Hives
-----
This is the top level of the registry. T... |
saltstack/salt | salt/states/reg.py | present | python | def present(name,
vname=None,
vdata=None,
vtype='REG_SZ',
use_32bit_registry=False,
win_owner=None,
win_perms=None,
win_deny_perms=None,
win_inheritance=True,
win_perms_reset=False):
r'''
Ensure a registr... | r'''
Ensure a registry key or value is present.
Args:
name (str):
A string value representing the full path of the key to include the
HIVE, Key, and all Subkeys. For example:
``HKEY_LOCAL_MACHINE\\SOFTWARE\\Salt``
Valid hive values include:
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L114-L458 | [
"def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det... | # -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
Hives
-----
This is the top level of the registry. T... |
saltstack/salt | salt/states/reg.py | absent | python | def absent(name, vname=None, use_32bit_registry=False):
r'''
Ensure a registry value is removed. To remove a key use key_absent.
Args:
name (str):
A string value representing the full path of the key to include the
HIVE, Key, and all Subkeys. For example:
``HKEY... | r'''
Ensure a registry value is removed. To remove a key use key_absent.
Args:
name (str):
A string value representing the full path of the key to include the
HIVE, Key, and all Subkeys. For example:
``HKEY_LOCAL_MACHINE\\SOFTWARE\\Salt``
Valid hive val... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L461-L539 | [
"def _parse_key(key):\n '''\n split the hive from the key\n '''\n splt = key.split(\"\\\\\")\n hive = splt.pop(0)\n key = '\\\\'.join(splt)\n return hive, key\n"
] | # -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
Hives
-----
This is the top level of the registry. T... |
saltstack/salt | salt/states/reg.py | key_absent | python | def key_absent(name, use_32bit_registry=False):
r'''
.. versionadded:: 2015.5.4
Ensure a registry key is removed. This will remove the key, subkeys, and all
value entries.
Args:
name (str):
A string representing the full path to the key to be removed to
include the... | r'''
.. versionadded:: 2015.5.4
Ensure a registry key is removed. This will remove the key, subkeys, and all
value entries.
Args:
name (str):
A string representing the full path to the key to be removed to
include the hive and the keypath. The hive can be any of the
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L542-L619 | [
"def _parse_key(key):\n '''\n split the hive from the key\n '''\n splt = key.split(\"\\\\\")\n hive = splt.pop(0)\n key = '\\\\'.join(splt)\n return hive, key\n"
] | # -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
Hives
-----
This is the top level of the registry. T... |
saltstack/salt | salt/utils/thin.py | _get_salt_call | python | def _get_salt_call(*dirs, **namespaces):
'''
Return salt-call source, based on configuration.
This will include additional namespaces for another versions of Salt,
if needed (e.g. older interpreters etc).
:dirs: List of directories to include in the system path
:namespaces: Dictionary of namesp... | Return salt-call source, based on configuration.
This will include additional namespaces for another versions of Salt,
if needed (e.g. older interpreters etc).
:dirs: List of directories to include in the system path
:namespaces: Dictionary of namespace
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L89-L131 | [
"def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | _add_dependency | python | def _add_dependency(container, obj):
'''
Add a dependency to the top list.
:param obj:
:param is_file:
:return:
'''
if os.path.basename(obj.__file__).split('.')[0] == '__init__':
container.append(os.path.dirname(obj.__file__))
else:
container.append(obj.__file__.replace(... | Add a dependency to the top list.
:param obj:
:param is_file:
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L155-L166 | null | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | gte | python | def gte():
'''
This function is called externally from the alternative
Python interpreter from within _get_tops function.
:param extra_mods:
:param so_mods:
:return:
'''
extra = salt.utils.json.loads(sys.argv[1])
tops = get_tops(**extra)
return salt.utils.json.dumps(tops, ensur... | This function is called externally from the alternative
Python interpreter from within _get_tops function.
:param extra_mods:
:param so_mods:
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L169-L181 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | get_ext_tops | python | def get_ext_tops(config):
'''
Get top directories for the dependencies, based on external configuration.
:return:
'''
config = copy.deepcopy(config)
alternatives = {}
required = ['jinja2', 'yaml', 'tornado', 'msgpack']
tops = []
for ns, cfg in salt.ext.six.iteritems(config or {}):
... | Get top directories for the dependencies, based on external configuration.
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L184-L233 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | _get_ext_namespaces | python | def _get_ext_namespaces(config):
'''
Get namespaces from the existing configuration.
:param config:
:return:
'''
namespaces = {}
if not config:
return namespaces
for ns in config:
constraint_version = tuple(config[ns].get('py-version', []))
if not constraint_ver... | Get namespaces from the existing configuration.
:param config:
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L236-L255 | null | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | get_tops | python | def get_tops(extra_mods='', so_mods=''):
'''
Get top directories for the dependencies, based on Python interpreter.
:param extra_mods:
:param so_mods:
:return:
'''
tops = []
for mod in [salt, jinja2, yaml, tornado, msgpack, certifi, singledispatch, concurrent,
singledisp... | Get top directories for the dependencies, based on Python interpreter.
:param extra_mods:
:param so_mods:
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L258-L295 | [
"def _add_dependency(container, obj):\n '''\n Add a dependency to the top list.\n\n :param obj:\n :param is_file:\n :return:\n '''\n if os.path.basename(obj.__file__).split('.')[0] == '__init__':\n container.append(os.path.dirname(obj.__file__))\n else:\n container.append(obj._... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | _get_supported_py_config | python | def _get_supported_py_config(tops, extended_cfg):
'''
Based on the Salt SSH configuration, create a YAML configuration
for the supported Python interpreter versions. This is then written into the thin.tgz
archive and then verified by salt.client.ssh.ssh_py_shim.get_executable()
Note: Minimum defaul... | Based on the Salt SSH configuration, create a YAML configuration
for the supported Python interpreter versions. This is then written into the thin.tgz
archive and then verified by salt.client.ssh.ssh_py_shim.get_executable()
Note: Minimum default of 2.x versions is 2.7 and 3.x is 3.0, unless specified in n... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L298-L320 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | _get_thintar_prefix | python | def _get_thintar_prefix(tarname):
'''
Make sure thintar temporary name is concurrent and secure.
:param tarname: name of the chosen tarball
:return: prefixed tarname
'''
tfd, tmp_tarname = tempfile.mkstemp(dir=os.path.dirname(tarname), prefix=".thin-",
su... | Make sure thintar temporary name is concurrent and secure.
:param tarname: name of the chosen tarball
:return: prefixed tarname | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L323-L334 | null | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | gen_thin | python | def gen_thin(cachedir, extra_mods='', overwrite=False, so_mods='',
python2_bin='python2', python3_bin='python3', absonly=True,
compress='gzip', extended_cfg=None):
'''
Generate the salt-thin tarball and print the location of the tarball
Optional additional mods to include (e.g. mak... | Generate the salt-thin tarball and print the location of the tarball
Optional additional mods to include (e.g. mako) can be supplied as a comma
delimited string. Permits forcing an overwrite of the output file as well.
CLI Example:
.. code-block:: bash
salt-run thin.generate
salt-run... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L337-L563 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | thin_sum | python | def thin_sum(cachedir, form='sha1'):
'''
Return the checksum of the current thin tarball
'''
thintar = gen_thin(cachedir)
code_checksum_path = os.path.join(cachedir, 'thin', 'code-checksum')
if os.path.isfile(code_checksum_path):
with salt.utils.files.fopen(code_checksum_path, 'r') as fh... | Return the checksum of the current thin tarball | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L566-L578 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | gen_min | python | def gen_min(cachedir, extra_mods='', overwrite=False, so_mods='',
python2_bin='python2', python3_bin='python3'):
'''
Generate the salt-min tarball and print the location of the tarball
Optional additional mods to include (e.g. mako) can be supplied as a comma
delimited string. Permits forci... | Generate the salt-min tarball and print the location of the tarball
Optional additional mods to include (e.g. mako) can be supplied as a comma
delimited string. Permits forcing an overwrite of the output file as well.
CLI Example:
.. code-block:: bash
salt-run min.generate
salt-run m... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L581-L859 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/utils/thin.py | min_sum | python | def min_sum(cachedir, form='sha1'):
'''
Return the checksum of the current thin tarball
'''
mintar = gen_min(cachedir)
return salt.utils.hashutils.get_hash(mintar, form) | Return the checksum of the current thin tarball | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L862-L867 | [
"def gen_min(cachedir, extra_mods='', overwrite=False, so_mods='',\n python2_bin='python2', python3_bin='python3'):\n '''\n Generate the salt-min tarball and print the location of the tarball\n Optional additional mods to include (e.g. mako) can be supplied as a comma\n delimited string. Per... | # -*- coding: utf-8 -*-
'''
Generate the salt thin tarball from the installed python files
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
# ... |
saltstack/salt | salt/modules/solarisipspkg.py | refresh_db | python | def refresh_db(full=False, **kwargs):
'''
Updates the remote repos database.
full : False
Set to ``True`` to force a refresh of the pkg DB from all publishers,
regardless of the last refresh time.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
salt '*'... | Updates the remote repos database.
full : False
Set to ``True`` to force a refresh of the pkg DB from all publishers,
regardless of the last refresh time.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
salt '*' pkg.refresh_db full=True | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L112-L133 | [
"def clear_rtag(opts):\n '''\n Remove the rtag file\n '''\n try:\n os.remove(rtag(opts))\n except OSError as exc:\n if exc.errno != errno.ENOENT:\n # Using __str__() here to get the fully-formatted error message\n # (error number, error message, path)\n ... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | upgrade_available | python | def upgrade_available(name, **kwargs):
'''
Check if there is an upgrade available for a certain package
Accepts full or partial FMRI. Returns all matches found.
CLI Example:
.. code-block:: bash
salt '*' pkg.upgrade_available apache-22
'''
version = None
cmd = ['pkg', 'list', ... | Check if there is an upgrade available for a certain package
Accepts full or partial FMRI. Returns all matches found.
CLI Example:
.. code-block:: bash
salt '*' pkg.upgrade_available apache-22 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L136-L155 | [
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | list_upgrades | python | def list_upgrades(refresh=True, **kwargs): # pylint: disable=W0613
'''
Lists all packages available for update.
When run in global zone, it reports only upgradable packages for the global
zone.
When run in non-global zone, it can report more upgradable packages than
``pkg update -vn``, becaus... | Lists all packages available for update.
When run in global zone, it reports only upgradable packages for the global
zone.
When run in non-global zone, it can report more upgradable packages than
``pkg update -vn``, because ``pkg update`` hides packages that require
newer version of ``pkg://solari... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L158-L196 | [
"def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | upgrade | python | def upgrade(refresh=False, **kwargs):
'''
Upgrade all packages to the latest possible version.
When run in global zone, it updates also all non-global zones.
In non-global zones upgrade is limited by dependency constrains linked to
the version of pkg://solaris/entire.
Returns a dictionary conta... | Upgrade all packages to the latest possible version.
When run in global zone, it updates also all non-global zones.
In non-global zones upgrade is limited by dependency constrains linked to
the version of pkg://solaris/entire.
Returns a dictionary containing the changes:
.. code-block:: python
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L199-L248 | [
"def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | list_pkgs | python | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the currently installed packages as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
# not yet implemented or not applicable
if any([salt.utils.data.is_true(kwar... | List the currently installed packages as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L251-L289 | [
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | version | python | def version(*names, **kwargs):
'''
Common interface for obtaining the version of installed packages.
Accepts full or partial FMRI. If called using pkg_resource, full FMRI is required.
Partial FMRI is returned if the package is not installed.
CLI Example:
.. code-block:: bash
salt '*' ... | Common interface for obtaining the version of installed packages.
Accepts full or partial FMRI. If called using pkg_resource, full FMRI is required.
Partial FMRI is returned if the package is not installed.
CLI Example:
.. code-block:: bash
salt '*' pkg.version vim
salt '*' pkg.versio... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L292-L328 | [
"def itervalues(d, **kw):\n return d.itervalues(**kw)\n",
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://sola... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | get_fmri | python | def get_fmri(name, **kwargs):
'''
Returns FMRI from partial name. Returns empty string ('') if not found.
In case of multiple match, the function returns list of all matched packages.
CLI Example:
.. code-block:: bash
salt '*' pkg.get_fmri bash
'''
if name.startswith('pkg://'):
... | Returns FMRI from partial name. Returns empty string ('') if not found.
In case of multiple match, the function returns list of all matched packages.
CLI Example:
.. code-block:: bash
salt '*' pkg.get_fmri bash | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L394-L418 | [
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | normalize_name | python | def normalize_name(name, **kwargs):
'''
Internal function. Normalizes pkg name to full FMRI before running
pkg.install. In case of multiple matches or no match, it returns the name
without modifications.
CLI Example:
.. code-block:: bash
salt '*' pkg.normalize_name vim
'''
if ... | Internal function. Normalizes pkg name to full FMRI before running
pkg.install. In case of multiple matches or no match, it returns the name
without modifications.
CLI Example:
.. code-block:: bash
salt '*' pkg.normalize_name vim | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L421-L445 | [
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | search | python | def search(name, versions_as_list=False, **kwargs):
'''
Searches the repository for given pkg name.
The name can be full or partial FMRI. All matches are printed. Globs are
also supported.
CLI Example:
.. code-block:: bash
salt '*' pkg.search bash
'''
ret = {}
cmd = ['/bi... | Searches the repository for given pkg name.
The name can be full or partial FMRI. All matches are printed. Globs are
also supported.
CLI Example:
.. code-block:: bash
salt '*' pkg.search bash | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L465-L493 | [
"def _ips_get_pkgname(line):\n '''\n Extracts package name from \"pkg list -v\" output.\n Input: one line of the command output\n Output: pkg name (e.g.: \"pkg://solaris/x11/library/toolkit/libxt\")\n Example use:\n line = \"pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | install | python | def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs):
'''
Install the named package using the IPS pkg command.
Accepts full or partial FMRI.
Returns a dict containing the new package names and versions::
{'<package>': {'old': '<old-version>',
... | Install the named package using the IPS pkg command.
Accepts full or partial FMRI.
Returns a dict containing the new package names and versions::
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
Multiple Package Installation Options:
pkgs
A list... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L496-L586 | [
"def list_pkgs(versions_as_list=False, **kwargs):\n '''\n List the currently installed packages as a dict::\n\n {'<package_name>': '<version>'}\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' pkg.list_pkgs\n '''\n # not yet implemented or not applicable\n if any([salt.utils... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/modules/solarisipspkg.py | remove | python | def remove(name=None, pkgs=None, **kwargs):
'''
Remove specified package. Accepts full or partial FMRI.
In case of multiple match, the command fails and won't modify the OS.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delet... | Remove specified package. Accepts full or partial FMRI.
In case of multiple match, the command fails and won't modify the OS.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name``... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L589-L645 | [
"def split_input(val, mapper=None):\n '''\n Take an input value and split it into a list, returning the resulting list\n '''\n if mapper is None:\n mapper = lambda x: x\n if isinstance(val, list):\n return list(map(mapper, val))\n try:\n return list(map(mapper, [x.strip() for ... | # -*- coding: utf-8 -*-
'''
IPS pkg support for Solaris
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
This ... |
saltstack/salt | salt/pillar/cmd_json.py | ext_pillar | python | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as JSON
'''
try:
command = command.replace('%s', minion_id)
return salt.utils.json.loads(__salt__['cmd.run'](command))
... | Execute a command and read the output as JSON | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_json.py#L20-L31 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Execute a command and read the output as JSON. The JSON data is then directly overlaid onto the minion's Pillar data.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Don't "fix" the above docstring to put it on two lines, as the sphinx
# autosummary pulls only... |
saltstack/salt | salt/modules/mac_brew_pkg.py | _tap | python | def _tap(tap, runas=None):
'''
Add unofficial GitHub repos to the list of formulas that brew tracks,
updates, and installs from.
'''
if tap in _list_taps():
return True
cmd = 'tap {0}'.format(tap)
try:
_call_brew(cmd)
except CommandExecutionError:
log.error('Fail... | Add unofficial GitHub repos to the list of formulas that brew tracks,
updates, and installs from. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L55-L70 | [
"def _list_taps():\n '''\n List currently installed brew taps\n '''\n cmd = 'tap'\n return _call_brew(cmd)['stdout'].splitlines()\n",
"def _call_brew(cmd, failhard=True):\n '''\n Calls the brew command with the user account of brew\n '''\n user = __salt__['file.get_user'](_homebrew_bin(... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | _call_brew | python | def _call_brew(cmd, failhard=True):
'''
Calls the brew command with the user account of brew
'''
user = __salt__['file.get_user'](_homebrew_bin())
runas = user if user != __opts__['user'] else None
cmd = '{} {}'.format(salt.utils.path.which('brew'), cmd)
result = __salt__['cmd.run_all'](cmd,... | Calls the brew command with the user account of brew | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L82-L96 | [
"def _homebrew_bin():\n '''\n Returns the full path to the homebrew binary in the PATH\n '''\n ret = __salt__['cmd.run']('brew --prefix', output_loglevel='trace')\n ret += '/bin/brew'\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | list_pkgs | python | def list_pkgs(versions_as_list=False, **kwargs):
'''
List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs
'''
versions_as_list = salt.utils.data.is_true(versions_as_list)
# not yet imple... | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L99-L166 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | remove | python | def remove(name=None, pkgs=None, **kwargs):
'''
Removes packages with ``brew uninstall``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if th... | Removes packages with ``brew uninstall``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this option is passed.
.. versionadded:: 0.16.0
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L220-L276 | [
"def list_pkgs(versions_as_list=False, **kwargs):\n '''\n List the packages currently installed in a dict::\n\n {'<package_name>': '<version>'}\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' pkg.list_pkgs\n '''\n versions_as_list = salt.utils.data.is_true(versions_as_list)\n ... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | refresh_db | python | def refresh_db(**kwargs):
'''
Update the homebrew package repository.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db
'''
# Remove rtag file to keep multiple refreshes from happening in pkg states
salt.utils.pkg.clear_rtag(__opts__)
cmd = 'update'
if _call_brew(c... | Update the homebrew package repository.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L279-L296 | [
"def clear_rtag(opts):\n '''\n Remove the rtag file\n '''\n try:\n os.remove(rtag(opts))\n except OSError as exc:\n if exc.errno != errno.ENOENT:\n # Using __str__() here to get the fully-formatted error message\n # (error number, error message, path)\n ... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | _info | python | def _info(*pkgs):
'''
Get all info brew can provide about a list of packages.
Does not do any kind of processing, so the format depends entirely on
the output brew gives. This may change if a new version of the format is
requested.
On failure, returns an empty dict and logs failure.
On suc... | Get all info brew can provide about a list of packages.
Does not do any kind of processing, so the format depends entirely on
the output brew gives. This may change if a new version of the format is
requested.
On failure, returns an empty dict and logs failure.
On success, returns a dict mapping e... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L299-L321 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | install | python | def install(name=None, pkgs=None, taps=None, options=None, **kwargs):
'''
Install the passed package(s) with ``brew install``
name
The name of the formula to be installed. Note that this parameter is
ignored if "pkgs" is passed.
CLI Example:
.. code-block:: bash
... | Install the passed package(s) with ``brew install``
name
The name of the formula to be installed. Note that this parameter is
ignored if "pkgs" is passed.
CLI Example:
.. code-block:: bash
salt '*' pkg.install <package name>
taps
Unofficial GitHub repos t... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L324-L430 | [
"def list_pkgs(versions_as_list=False, **kwargs):\n '''\n List the packages currently installed in a dict::\n\n {'<package_name>': '<version>'}\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' pkg.list_pkgs\n '''\n versions_as_list = salt.utils.data.is_true(versions_as_list)\n ... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | list_upgrades | python | def list_upgrades(refresh=True, **kwargs): # pylint: disable=W0613
'''
Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
'''
if refresh:
refresh_db()
res = _call_brew('outdated --json=v1')
ret =... | Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L433-L459 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/modules/mac_brew_pkg.py | upgrade | python | def upgrade(refresh=True, **kwargs):
'''
Upgrade outdated, unpinned brews.
refresh
Fetch the newest version of Homebrew and all formulae from GitHub before installing.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
... | Upgrade outdated, unpinned brews.
refresh
Fetch the newest version of Homebrew and all formulae from GitHub before installing.
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L475-L517 | [
"def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr... | # -*- coding: utf-8 -*-
'''
Homebrew for macOS
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futu... |
saltstack/salt | salt/states/chronos_job.py | config | python | def config(name, config):
'''
Ensure that the chronos job with the given name is present and is configured
to match the given config values.
:param name: The job name
:param config: The configuration to apply (dict)
:return: A standard Salt changes dictionary
'''
# setup return structur... | Ensure that the chronos job with the given name is present and is configured
to match the given config values.
:param name: The job name
:param config: The configuration to apply (dict)
:return: A standard Salt changes dictionary | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/chronos_job.py#L27-L113 | [
"def compare_and_update_config(config, update_config, changes, namespace=''):\n '''\n Recursively compare two configs, writing any needed changes to the\n update_config and capturing changes in the changes dict.\n '''\n if isinstance(config, dict):\n if not update_config:\n if confi... | # -*- coding: utf-8 -*-
'''
Configure Chronos jobs via a salt proxy.
.. code-block:: yaml
my_job:
chronos_job.config:
- config:
schedule: "R//PT2S"
command: "echo 'hi'"
owner: "me@example.com"
.. versionadded:: 2015.8.2
'''
from __future__ import absolute_import,... |
saltstack/salt | salt/states/infoblox_range.py | present | python | def present(name=None, start_addr=None, end_addr=None, data=None, **api_opts):
'''
Ensure range record is present.
infoblox_range.present:
start_addr: '129.97.150.160',
end_addr: '129.97.150.170',
Verbose state example:
.. code-block:: yaml
infoblox_range.present:
... | Ensure range record is present.
infoblox_range.present:
start_addr: '129.97.150.160',
end_addr: '129.97.150.170',
Verbose state example:
.. code-block:: yaml
infoblox_range.present:
data: {
'always_update_dns': False,
'authority': False... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_range.py#L17-L140 | null | # -*- coding: utf-8 -*-
'''
Infoblox host record managment.
functions accept api_opts:
api_verifyssl: verify SSL [default to True or pillar value]
api_url: server to connect to [default to pillar value]
api_username: [default to pillar value]
api_password: [default to pillar value]
'''
# Import Pyt... |
saltstack/salt | salt/states/infoblox_range.py | absent | python | def absent(name=None, start_addr=None, end_addr=None, data=None, **api_opts):
'''
Ensure the range is removed
Supplying the end of the range is optional.
State example:
.. code-block:: yaml
infoblox_range.absent:
- name: 'vlan10'
infoblox_range.absent:
- ... | Ensure the range is removed
Supplying the end of the range is optional.
State example:
.. code-block:: yaml
infoblox_range.absent:
- name: 'vlan10'
infoblox_range.absent:
- name:
- start_addr: 127.0.1.20 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_range.py#L143-L191 | null | # -*- coding: utf-8 -*-
'''
Infoblox host record managment.
functions accept api_opts:
api_verifyssl: verify SSL [default to True or pillar value]
api_url: server to connect to [default to pillar value]
api_username: [default to pillar value]
api_password: [default to pillar value]
'''
# Import Pyt... |
saltstack/salt | salt/utils/vt_helper.py | SSHConnection.sendline | python | def sendline(self, cmd):
'''
Send this command to the server and
return a tuple of the output and the stderr.
The format for parameters is:
cmd (string): The command to send to the sever.
'''
self.conn.sendline(cmd, self.linesep)
# saw_prompt = False
... | Send this command to the server and
return a tuple of the output and the stderr.
The format for parameters is:
cmd (string): The command to send to the sever. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt_helper.py#L107-L133 | null | class SSHConnection(object):
'''
SSH Connection to a remote server.
'''
def __init__(self,
username='salt',
password='password',
host='localhost',
key_accept=False,
prompt=r'(Cmd)',
passwd_retries=3,
... |
saltstack/salt | salt/utils/vmware.py | esxcli | python | def esxcli(host, user, pwd, cmd, protocol=None, port=None, esxi_host=None, credstore=None):
'''
Shell out and call the specified esxcli commmand, parse the result
and return something sane.
:param host: ESXi or vCenter host to connect to
:param user: User to connect as, usually root
:param pwd:... | Shell out and call the specified esxcli commmand, parse the result
and return something sane.
:param host: ESXi or vCenter host to connect to
:param user: User to connect as, usually root
:param pwd: Password to connect with
:param port: TCP port
:param cmd: esxcli command and arguments
:pa... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L125-L179 | [
"def run_all(cmd,\n cwd=None,\n stdin=None,\n runas=None,\n group=None,\n shell=DEFAULT_SHELL,\n python_shell=None,\n env=None,\n clean_env=False,\n template=None,\n rstrip=True,\n umask=None,\n ... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | _get_service_instance | python | def _get_service_instance(host, username, password, protocol,
port, mechanism, principal, domain):
'''
Internal method to authenticate with a vCenter server or ESX/ESXi host
and return the service instance object.
'''
log.trace('Retrieving new service instance')
token =... | Internal method to authenticate with a vCenter server or ESX/ESXi host
and return the service instance object. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L182-L278 | [
"def get_gssapi_token(principal, host, domain):\n '''\n Get the gssapi token for Kerberos connection\n\n principal\n The service principal\n host\n Host url where we would like to authenticate\n domain\n Kerberos user domain\n '''\n\n if not HAS_GSSAPI:\n raise ImportEr... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_customizationspec_ref | python | def get_customizationspec_ref(si, customization_spec_name):
'''
Get a reference to a VMware customization spec for the purposes of customizing a clone
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
customization_spec_name
Name of the customization spec
... | Get a reference to a VMware customization spec for the purposes of customizing a clone
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
customization_spec_name
Name of the customization spec | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L281-L293 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_service_instance | python | def get_service_instance(host, username=None, password=None, protocol=None,
port=None, mechanism='userpass', principal=None,
domain=None):
'''
Authenticate with a vCenter server or ESX/ESXi host and return the service instance object.
host
The locat... | Authenticate with a vCenter server or ESX/ESXi host and return the service instance object.
host
The location of the vCenter server or ESX/ESXi host.
username
The username used to login to the vCenter server or ESX/ESXi host.
Required if mechanism is ``userpass``
password
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L318-L411 | [
"def _get_service_instance(host, username, password, protocol,\n port, mechanism, principal, domain):\n '''\n Internal method to authenticate with a vCenter server or ESX/ESXi host\n and return the service instance object.\n '''\n log.trace('Retrieving new service instance')\... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_new_service_instance_stub | python | def get_new_service_instance_stub(service_instance, path, ns=None,
version=None):
'''
Returns a stub that points to a different path,
created from an existing connection.
service_instance
The Service Instance.
path
Path of the new stub.
ns
... | Returns a stub that points to a different path,
created from an existing connection.
service_instance
The Service Instance.
path
Path of the new stub.
ns
Namespace of the new stub.
Default value is None
version
Version of the new stub.
Default valu... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L414-L454 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_service_instance_from_managed_object | python | def get_service_instance_from_managed_object(mo_ref, name='<unnamed>'):
'''
Retrieves the service instance from a managed object.
me_ref
Reference to a managed object (of type vim.ManagedEntity).
name
Name of managed object. This field is optional.
'''
if not name:
name... | Retrieves the service instance from a managed object.
me_ref
Reference to a managed object (of type vim.ManagedEntity).
name
Name of managed object. This field is optional. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L457-L472 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | disconnect | python | def disconnect(service_instance):
'''
Function that disconnects from the vCenter server or ESXi host
service_instance
The Service Instance from which to obtain managed object references.
'''
log.trace('Disconnecting')
try:
Disconnect(service_instance)
except vim.fault.NoPerm... | Function that disconnects from the vCenter server or ESXi host
service_instance
The Service Instance from which to obtain managed object references. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L475-L495 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | is_connection_to_a_vcenter | python | def is_connection_to_a_vcenter(service_instance):
'''
Function that returns True if the connection is made to a vCenter Server and
False if the connection is made to an ESXi host
service_instance
The Service Instance from which to obtain managed object references.
'''
try:
api_t... | Function that returns True if the connection is made to a vCenter Server and
False if the connection is made to an ESXi host
service_instance
The Service Instance from which to obtain managed object references. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L498-L527 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_service_info | python | def get_service_info(service_instance):
'''
Returns information of the vCenter or ESXi host
service_instance
The Service Instance from which to obtain managed object references.
'''
try:
return service_instance.content.about
except vim.fault.NoPermission as exc:
log.exce... | Returns information of the vCenter or ESXi host
service_instance
The Service Instance from which to obtain managed object references. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L530-L549 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | _get_dvs | python | def _get_dvs(service_instance, dvs_name):
'''
Return a reference to a Distributed Virtual Switch object.
:param service_instance: PyVmomi service instance
:param dvs_name: Name of DVS to return
:return: A PyVmomi DVS object
'''
switches = list_dvs(service_instance)
if dvs_name in switch... | Return a reference to a Distributed Virtual Switch object.
:param service_instance: PyVmomi service instance
:param dvs_name: Name of DVS to return
:return: A PyVmomi DVS object | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L552-L568 | [
"def list_dvs(service_instance):\n '''\n Returns a list of distributed virtual switches associated with a given service instance.\n\n service_instance\n The Service Instance Object from which to obtain distributed virtual switches.\n '''\n return list_objects(service_instance, vim.DistributedV... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | _get_dvs_portgroup | python | def _get_dvs_portgroup(dvs, portgroup_name):
'''
Return a portgroup object corresponding to the portgroup name on the dvs
:param dvs: DVS object
:param portgroup_name: Name of portgroup to return
:return: Portgroup object
'''
for portgroup in dvs.portgroup:
if portgroup.name == port... | Return a portgroup object corresponding to the portgroup name on the dvs
:param dvs: DVS object
:param portgroup_name: Name of portgroup to return
:return: Portgroup object | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L593-L605 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | _get_dvs_uplink_portgroup | python | def _get_dvs_uplink_portgroup(dvs, portgroup_name):
'''
Return a portgroup object corresponding to the portgroup name on the dvs
:param dvs: DVS object
:param portgroup_name: Name of portgroup to return
:return: Portgroup object
'''
for portgroup in dvs.portgroup:
if portgroup.name ... | Return a portgroup object corresponding to the portgroup name on the dvs
:param dvs: DVS object
:param portgroup_name: Name of portgroup to return
:return: Portgroup object | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L608-L620 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_gssapi_token | python | def get_gssapi_token(principal, host, domain):
'''
Get the gssapi token for Kerberos connection
principal
The service principal
host
Host url where we would like to authenticate
domain
Kerberos user domain
'''
if not HAS_GSSAPI:
raise ImportError('The gssapi li... | Get the gssapi token for Kerberos connection
principal
The service principal
host
Host url where we would like to authenticate
domain
Kerberos user domain | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L623-L655 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_hardware_grains | python | def get_hardware_grains(service_instance):
'''
Return hardware info for standard minion grains if the service_instance is a HostAgent type
service_instance
The service instance object to get hardware info for
.. versionadded:: 2016.11.0
'''
hw_grain_data = {}
if get_inventory(servi... | Return hardware info for standard minion grains if the service_instance is a HostAgent type
service_instance
The service instance object to get hardware info for
.. versionadded:: 2016.11.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L658-L719 | [
"def get_inventory(service_instance):\n '''\n Return the inventory of a Service Instance Object.\n\n service_instance\n The Service Instance Object for which to obtain inventory.\n '''\n return service_instance.RetrieveContent()\n"
] | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_root_folder | python | def get_root_folder(service_instance):
'''
Returns the root folder of a vCenter.
service_instance
The Service Instance Object for which to obtain the root folder.
'''
try:
log.trace('Retrieving root folder')
return service_instance.RetrieveContent().rootFolder
except vim... | Returns the root folder of a vCenter.
service_instance
The Service Instance Object for which to obtain the root folder. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L732-L752 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_content | python | def get_content(service_instance, obj_type, property_list=None,
container_ref=None, traversal_spec=None,
local_properties=False):
'''
Returns the content of the specified type of object for a Service Instance.
For more information, please see:
http://pubs.vmware.com/vsph... | Returns the content of the specified type of object for a Service Instance.
For more information, please see:
http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc_50%2FPG_Ch5_PropertyCollector.7.6.html
service_instance
The Service Instance from which to obtain content.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L755-L874 | [
"def get_root_folder(service_instance):\n '''\n Returns the root folder of a vCenter.\n\n service_instance\n The Service Instance Object for which to obtain the root folder.\n '''\n try:\n log.trace('Retrieving root folder')\n return service_instance.RetrieveContent().rootFolder\... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_mor_by_property | python | def get_mor_by_property(service_instance, object_type, property_value, property_name='name', container_ref=None):
'''
Returns the first managed object reference having the specified property value.
service_instance
The Service Instance from which to obtain managed object references.
object_typ... | Returns the first managed object reference having the specified property value.
service_instance
The Service Instance from which to obtain managed object references.
object_type
The type of content for which to obtain managed object references.
property_value
The name of the prope... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L877-L906 | [
"def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_mors_with_properties | python | def get_mors_with_properties(service_instance, object_type, property_list=None,
container_ref=None, traversal_spec=None,
local_properties=False):
'''
Returns a list containing properties and managed object references for the managed object.
service_... | Returns a list containing properties and managed object references for the managed object.
service_instance
The Service Instance from which to obtain managed object references.
object_type
The type of content for which to obtain managed object references.
property_list
An optional... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L909-L960 | [
"def get_content(service_instance, obj_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns the content of the specified type of object for a Service Instance.\n\n For more information, please see:\n http://pubs.vmw... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_properties_of_managed_object | python | def get_properties_of_managed_object(mo_ref, properties):
'''
Returns specific properties of a managed object, retrieved in an
optimally.
mo_ref
The managed object reference.
properties
List of properties of the managed object to retrieve.
'''
service_instance = get_service... | Returns specific properties of a managed object, retrieved in an
optimally.
mo_ref
The managed object reference.
properties
List of properties of the managed object to retrieve. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L963-L996 | [
"def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ... | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_network_adapter_type | python | def get_network_adapter_type(adapter_type):
'''
Return the network adapter type.
adpater_type
The adapter type from which to obtain the network adapter type.
'''
if adapter_type == 'vmxnet':
return vim.vm.device.VirtualVmxnet()
elif adapter_type == 'vmxnet2':
return vim.... | Return the network adapter type.
adpater_type
The adapter type from which to obtain the network adapter type. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1011-L1029 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
saltstack/salt | salt/utils/vmware.py | get_network_adapter_object_type | python | def get_network_adapter_object_type(adapter_object):
'''
Returns the network adapter type.
adapter_object
The adapter object from which to obtain the network adapter type.
'''
if isinstance(adapter_object, vim.vm.device.VirtualVmxnet2):
return 'vmxnet2'
if isinstance(adapter_obj... | Returns the network adapter type.
adapter_object
The adapter object from which to obtain the network adapter type. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1032-L1050 | null | # -*- coding: utf-8 -*-
'''
Connection library for VMware
.. versionadded:: 2015.8.2
This is a base library used by a number of VMware services such as VMware
ESX, ESXi, and vCenter servers.
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com>
Dependenci... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.