partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | floating_ip_create | Allocate a floating IP
.. versionadded:: 2016.3.0 | salt/cloud/clouds/nova.py | 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('... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1395-L1411 | [
"def",
"floating_ip_create",
"(",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The floating_ip_create action must be called with -f or --function'",
")",
"if",
"'pool'",
"not",
"in",
"kwarg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | floating_ip_associate | Associate a floating IP address to a server
.. versionadded:: 2016.3.0 | salt/cloud/clouds/nova.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1433-L1450 | [
"def",
"floating_ip_associate",
"(",
"name",
",",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The floating_ip_associate action must be called with -a of --action.'",
")",
"if",
"'floating_ip'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single VM from a data dict | salt/cloud/clouds/gogrid.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L82-L189 | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
"'gogri... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | List of nodes, keeping only a brief listing
CLI Example:
.. code-block:: bash
salt-cloud -Q | salt/cloud/clouds/gogrid.py | def list_nodes(full=False, call=None):
'''
List of nodes, keeping only a brief listing
CLI Example:
.. code-block:: bash
salt-cloud -Q
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
... | def list_nodes(full=False, call=None):
'''
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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L192-L217 | [
"def",
"list_nodes",
"(",
"full",
"=",
"False",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"nodes",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_full | List nodes, with all available information
CLI Example:
.. code-block:: bash
salt-cloud -F | salt/cloud/clouds/gogrid.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L220-L246 | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
")",
":",
"response",
"=",
"_query",
"(",
"'grid'",
",",
"'server/list'",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"[",
"'list'",
"]",
":",
"name",
"=",
"item",
"[",
"'name'",
"]"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_locations | Available locations | salt/cloud/clouds/gogrid.py | 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 | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L264-L275 | [
"def",
"avail_locations",
"(",
")",
":",
"response",
"=",
"list_common_lookups",
"(",
"kwargs",
"=",
"{",
"'lookup'",
":",
"'ip.datacenter'",
"}",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"[",
"'list'",
"]",
":",
"name",
"=",
"item",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_sizes | Available sizes | salt/cloud/clouds/gogrid.py | 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 | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L278-L289 | [
"def",
"avail_sizes",
"(",
")",
":",
"response",
"=",
"list_common_lookups",
"(",
"kwargs",
"=",
"{",
"'lookup'",
":",
"'server.ram'",
"}",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"[",
"'list'",
"]",
":",
"name",
"=",
"item",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Available images | salt/cloud/clouds/gogrid.py | def avail_images():
'''
Available images
'''
response = _query('grid', 'image/list')
ret = {}
for item in response['list']:
name = item['friendlyName']
ret[name] = item
return ret | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L292-L303 | [
"def",
"avail_images",
"(",
")",
":",
"response",
"=",
"_query",
"(",
"'grid'",
",",
"'image/list'",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"[",
"'list'",
"]",
":",
"name",
"=",
"item",
"[",
"'friendlyName'",
"]",
"ret",
"[",
"na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_passwords | List all password on the account
.. versionadded:: 2015.8.0 | salt/cloud/clouds/gogrid.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L306-L322 | [
"def",
"list_passwords",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"response",
"=",
"_query",
"(",
"'support'",
",",
"'password/list'",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"[",
"'list'",
"]",
":",
"if",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_public_ips | 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 | salt/cloud/clouds/gogrid.py | 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> ... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L325-L364 | [
"def",
"list_public_ips",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"args",
"=",
"{",
"}",
"if",
"'state'",
"in",
"kwargs",
":",
"if",
"kwargs",
"[",
"'state'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_common_lookups | List common lookups for a particular type of item
.. versionadded:: 2015.8.0 | salt/cloud/clouds/gogrid.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L367-L382 | [
"def",
"list_common_lookups",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"args",
"=",
"{",
"}",
"if",
"'lookup'",
"in",
"kwargs",
":",
"args",
"[",
"'lookup'",
"]",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -d vm_name | salt/cloud/clouds/gogrid.py | 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.'
... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L385-L424 | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"__utils__",
"[",
"'cloud.fire_event'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_instance | Start a machine by name
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
.. versionadded:: 2015.8.0 | salt/cloud/clouds/gogrid.py | 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']:
... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L472-L498 | [
"def",
"show_instance",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"response",
"=",
"_query",
"(",
"'grid'",
",",
"'server/get'",
",",
"args",
"=",
"{",
"'name'",
":",
"name",
"}",
")",
"ret",
"=",
"{",
"}",
"for",
"item",
"in",
"response",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _query | Make a web call to GoGrid
.. versionadded:: 2015.8.0 | salt/cloud/clouds/gogrid.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gogrid.py#L501-L565 | [
"def",
"_query",
"(",
"action",
"=",
"None",
",",
"command",
"=",
"None",
",",
"args",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"header_dict",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"vm_",
"=",
"get_configured_provider",
"(",
")",
"ap... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_key | split the hive from the key | salt/states/reg.py | def _parse_key(key):
'''
split the hive from the key
'''
splt = key.split("\\")
hive = splt.pop(0)
key = '\\'.join(splt)
return hive, key | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L104-L111 | [
"def",
"_parse_key",
"(",
"key",
")",
":",
"splt",
"=",
"key",
".",
"split",
"(",
"\"\\\\\"",
")",
"hive",
"=",
"splt",
".",
"pop",
"(",
"0",
")",
"key",
"=",
"'\\\\'",
".",
"join",
"(",
"splt",
")",
"return",
"hive",
",",
"key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | 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:
... | salt/states/reg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L114-L458 | [
"def",
"present",
"(",
"name",
",",
"vname",
"=",
"None",
",",
"vdata",
"=",
"None",
",",
"vtype",
"=",
"'REG_SZ'",
",",
"use_32bit_registry",
"=",
"False",
",",
"win_owner",
"=",
"None",
",",
"win_perms",
"=",
"None",
",",
"win_deny_perms",
"=",
"None",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | 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... | salt/states/reg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L461-L539 | [
"def",
"absent",
"(",
"name",
",",
"vname",
"=",
"None",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"hi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | key_absent | 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
... | salt/states/reg.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/reg.py#L542-L619 | [
"def",
"key_absent",
"(",
"name",
",",
"use_32bit_registry",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"hive",
",",
"key",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_salt_call | 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: | salt/utils/thin.py | 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... | 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",
")",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L89-L131 | [
"def",
"_get_salt_call",
"(",
"*",
"dirs",
",",
"*",
"*",
"namespaces",
")",
":",
"template",
"=",
"'''# -*- coding: utf-8 -*-\nimport os\nimport sys\n\n# Namespaces is a map: {namespace: major/minor version}, like {'2016.11.4': [2, 6]}\n# Appears only when configured in Master configurati... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _add_dependency | Add a dependency to the top list.
:param obj:
:param is_file:
:return: | salt/utils/thin.py | 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(... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L155-L166 | [
"def",
"_add_dependency",
"(",
"container",
",",
"obj",
")",
":",
"if",
"os",
".",
"path",
".",
"basename",
"(",
"obj",
".",
"__file__",
")",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
"==",
"'__init__'",
":",
"container",
".",
"append",
"(",
"o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gte | This function is called externally from the alternative
Python interpreter from within _get_tops function.
:param extra_mods:
:param so_mods:
:return: | salt/utils/thin.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L169-L181 | [
"def",
"gte",
"(",
")",
":",
"extra",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"loads",
"(",
"sys",
".",
"argv",
"[",
"1",
"]",
")",
"tops",
"=",
"get_tops",
"(",
"*",
"*",
"extra",
")",
"return",
"salt",
".",
"utils",
".",
"json",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_ext_tops | Get top directories for the dependencies, based on external configuration.
:return: | salt/utils/thin.py | 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 {}):
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L184-L233 | [
"def",
"get_ext_tops",
"(",
"config",
")",
":",
"config",
"=",
"copy",
".",
"deepcopy",
"(",
"config",
")",
"alternatives",
"=",
"{",
"}",
"required",
"=",
"[",
"'jinja2'",
",",
"'yaml'",
",",
"'tornado'",
",",
"'msgpack'",
"]",
"tops",
"=",
"[",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_ext_namespaces | Get namespaces from the existing configuration.
:param config:
:return: | salt/utils/thin.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L236-L255 | [
"def",
"_get_ext_namespaces",
"(",
"config",
")",
":",
"namespaces",
"=",
"{",
"}",
"if",
"not",
"config",
":",
"return",
"namespaces",
"for",
"ns",
"in",
"config",
":",
"constraint_version",
"=",
"tuple",
"(",
"config",
"[",
"ns",
"]",
".",
"get",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_tops | Get top directories for the dependencies, based on Python interpreter.
:param extra_mods:
:param so_mods:
:return: | salt/utils/thin.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L258-L295 | [
"def",
"get_tops",
"(",
"extra_mods",
"=",
"''",
",",
"so_mods",
"=",
"''",
")",
":",
"tops",
"=",
"[",
"]",
"for",
"mod",
"in",
"[",
"salt",
",",
"jinja2",
",",
"yaml",
",",
"tornado",
",",
"msgpack",
",",
"certifi",
",",
"singledispatch",
",",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_supported_py_config | 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... | salt/utils/thin.py | 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... | 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",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L298-L320 | [
"def",
"_get_supported_py_config",
"(",
"tops",
",",
"extended_cfg",
")",
":",
"pymap",
"=",
"[",
"]",
"for",
"py_ver",
",",
"tops",
"in",
"_six",
".",
"iteritems",
"(",
"copy",
".",
"deepcopy",
"(",
"tops",
")",
")",
":",
"py_ver",
"=",
"int",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_thintar_prefix | Make sure thintar temporary name is concurrent and secure.
:param tarname: name of the chosen tarball
:return: prefixed tarname | salt/utils/thin.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L323-L334 | [
"def",
"_get_thintar_prefix",
"(",
"tarname",
")",
":",
"tfd",
",",
"tmp_tarname",
"=",
"tempfile",
".",
"mkstemp",
"(",
"dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"tarname",
")",
",",
"prefix",
"=",
"\".thin-\"",
",",
"suffix",
"=",
"\".\"",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_thin | 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... | salt/utils/thin.py | 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... | 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... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L337-L563 | [
"def",
"gen_thin",
"(",
"cachedir",
",",
"extra_mods",
"=",
"''",
",",
"overwrite",
"=",
"False",
",",
"so_mods",
"=",
"''",
",",
"python2_bin",
"=",
"'python2'",
",",
"python3_bin",
"=",
"'python3'",
",",
"absonly",
"=",
"True",
",",
"compress",
"=",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | thin_sum | Return the checksum of the current thin tarball | salt/utils/thin.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L566-L578 | [
"def",
"thin_sum",
"(",
"cachedir",
",",
"form",
"=",
"'sha1'",
")",
":",
"thintar",
"=",
"gen_thin",
"(",
"cachedir",
")",
"code_checksum_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cachedir",
",",
"'thin'",
",",
"'code-checksum'",
")",
"if",
"os"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_min | 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... | salt/utils/thin.py | 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... | 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"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L581-L859 | [
"def",
"gen_min",
"(",
"cachedir",
",",
"extra_mods",
"=",
"''",
",",
"overwrite",
"=",
"False",
",",
"so_mods",
"=",
"''",
",",
"python2_bin",
"=",
"'python2'",
",",
"python3_bin",
"=",
"'python3'",
")",
":",
"mindir",
"=",
"os",
".",
"path",
".",
"jo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | min_sum | Return the checksum of the current thin tarball | salt/utils/thin.py | 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) | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/thin.py#L862-L867 | [
"def",
"min_sum",
"(",
"cachedir",
",",
"form",
"=",
"'sha1'",
")",
":",
"mintar",
"=",
"gen_min",
"(",
"cachedir",
")",
"return",
"salt",
".",
"utils",
".",
"hashutils",
".",
"get_hash",
"(",
"mintar",
",",
"form",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | refresh_db | 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 | salt/modules/solarisipspkg.py | 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 '*'... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L112-L133 | [
"def",
"refresh_db",
"(",
"full",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"if",
"full",
":",
"return",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | upgrade_available | 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 | salt/modules/solarisipspkg.py | 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', ... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L136-L155 | [
"def",
"upgrade_available",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"version",
"=",
"None",
"cmd",
"=",
"[",
"'pkg'",
",",
"'list'",
",",
"'-Huv'",
",",
"name",
"]",
"lines",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"cmd",
")",
"."... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_upgrades | 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... | salt/modules/solarisipspkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L158-L196 | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"refresh",
")",
":",
"refresh_db",
"(",
"full",
"=",
"True",
")",
"upgrades",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | upgrade | 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
... | salt/modules/solarisipspkg.py | 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... | 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",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L199-L248 | [
"def",
"upgrade",
"(",
"refresh",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"refresh",
")",
":",
"refresh_db",
"(",
")",
"# Get a list of the packages before install so we can diff after to see... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the currently installed packages as a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | salt/modules/solarisipspkg.py | 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... | 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",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L251-L289 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# not yet implemented or not applicable",
"if",
"any",
"(",
"[",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"kwargs",
".",
"get",
"(",
"x",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | 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... | salt/modules/solarisipspkg.py | 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 '*' ... | 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... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L292-L328 | [
"def",
"version",
"(",
"*",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"names",
":",
"return",
"''",
"cmd",
"=",
"[",
"'/bin/pkg'",
",",
"'list'",
",",
"'-Hv'",
"]",
"cmd",
".",
"extend",
"(",
"names",
")",
"lines",
"=",
"__salt__",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_fmri | 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 | salt/modules/solarisipspkg.py | 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://'):
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L394-L418 | [
"def",
"get_fmri",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"name",
".",
"startswith",
"(",
"'pkg://'",
")",
":",
"# already full fmri",
"return",
"name",
"cmd",
"=",
"[",
"'/bin/pkg'",
",",
"'list'",
",",
"'-aHv'",
",",
"name",
"]",
"# th... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | normalize_name | 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 | salt/modules/solarisipspkg.py | 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 ... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L421-L445 | [
"def",
"normalize_name",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"name",
".",
"startswith",
"(",
"'pkg://'",
")",
":",
"# already full fmri",
"return",
"name",
"cmd",
"=",
"[",
"'/bin/pkg'",
",",
"'list'",
",",
"'-aHv'",
",",
"name",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | search | 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 | salt/modules/solarisipspkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L465-L493 | [
"def",
"search",
"(",
"name",
",",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"cmd",
"=",
"[",
"'/bin/pkg'",
",",
"'list'",
",",
"'-aHv'",
",",
"name",
"]",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | 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... | salt/modules/solarisipspkg.py | 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>',
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L496-L586 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"version",
"=",
"None",
",",
"test",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"pkgs",
":",
"if",
"is_installed",
"(",
"n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | 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``... | salt/modules/solarisipspkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solarisipspkg.py#L589-L645 | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"targets",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"split_input",
"(",
"pkgs",
")",
"if",
"pkgs",
"else",
"[",
"name",
"]",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ext_pillar | Execute a command and read the output as JSON | salt/pillar/cmd_json.py | 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))
... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_json.py#L20-L31 | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"# pylint: disable=W0613",
"pillar",
",",
"# pylint: disable=W0613",
"command",
")",
":",
"try",
":",
"command",
"=",
"command",
".",
"replace",
"(",
"'%s'",
",",
"minion_id",
")",
"return",
"salt",
".",
"utils",
"."... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _tap | Add unofficial GitHub repos to the list of formulas that brew tracks,
updates, and installs from. | salt/modules/mac_brew_pkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L55-L70 | [
"def",
"_tap",
"(",
"tap",
",",
"runas",
"=",
"None",
")",
":",
"if",
"tap",
"in",
"_list_taps",
"(",
")",
":",
"return",
"True",
"cmd",
"=",
"'tap {0}'",
".",
"format",
"(",
"tap",
")",
"try",
":",
"_call_brew",
"(",
"cmd",
")",
"except",
"Command... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _call_brew | Calls the brew command with the user account of brew | salt/modules/mac_brew_pkg.py | 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,... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L82-L96 | [
"def",
"_call_brew",
"(",
"cmd",
",",
"failhard",
"=",
"True",
")",
":",
"user",
"=",
"__salt__",
"[",
"'file.get_user'",
"]",
"(",
"_homebrew_bin",
"(",
")",
")",
"runas",
"=",
"user",
"if",
"user",
"!=",
"__opts__",
"[",
"'user'",
"]",
"else",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_pkgs | List the packages currently installed in a dict::
{'<package_name>': '<version>'}
CLI Example:
.. code-block:: bash
salt '*' pkg.list_pkgs | salt/modules/mac_brew_pkg.py | 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... | 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",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L99-L166 | [
"def",
"list_pkgs",
"(",
"versions_as_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"versions_as_list",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"is_true",
"(",
"versions_as_list",
")",
"# not yet implemented or not applicable",
"if",
"any",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | 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
... | salt/modules/mac_brew_pkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L220-L276 | [
"def",
"remove",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
"=",
"__salt__",
"[",
"'pkg_resource.parse_targets'",
"]",
"(",
"name",
",",
"pkgs",
",",
"*",
"*",
"kwargs",
")",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | refresh_db | Update the homebrew package repository.
CLI Example:
.. code-block:: bash
salt '*' pkg.refresh_db | salt/modules/mac_brew_pkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L279-L296 | [
"def",
"refresh_db",
"(",
"*",
"*",
"kwargs",
")",
":",
"# Remove rtag file to keep multiple refreshes from happening in pkg states",
"salt",
".",
"utils",
".",
"pkg",
".",
"clear_rtag",
"(",
"__opts__",
")",
"cmd",
"=",
"'update'",
"if",
"_call_brew",
"(",
"cmd",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _info | 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... | salt/modules/mac_brew_pkg.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L299-L321 | [
"def",
"_info",
"(",
"*",
"pkgs",
")",
":",
"cmd",
"=",
"'info --json=v1 {0}'",
".",
"format",
"(",
"' '",
".",
"join",
"(",
"pkgs",
")",
")",
"brew_result",
"=",
"_call_brew",
"(",
"cmd",
")",
"if",
"brew_result",
"[",
"'retcode'",
"]",
":",
"log",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | 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... | salt/modules/mac_brew_pkg.py | 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
... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L324-L430 | [
"def",
"install",
"(",
"name",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"taps",
"=",
"None",
",",
"options",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pkg_params",
",",
"pkg_type",
"=",
"__salt__",
"[",
"'pkg_resource.parse_target... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_upgrades | Check whether or not an upgrade is available for all packages
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades | salt/modules/mac_brew_pkg.py | 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 =... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L433-L459 | [
"def",
"list_upgrades",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"if",
"refresh",
":",
"refresh_db",
"(",
")",
"res",
"=",
"_call_brew",
"(",
"'outdated --json=v1'",
")",
"ret",
"=",
"{",
"}",
"try",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | upgrade | 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>'}}
... | salt/modules/mac_brew_pkg.py | 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>',
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_brew_pkg.py#L475-L517 | [
"def",
"upgrade",
"(",
"refresh",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
",",
"}",
"old",
"=",
"list_pkgs",
"(",
")",
"if",
"salt",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | 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 | salt/states/chronos_job.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/chronos_job.py#L27-L113 | [
"def",
"config",
"(",
"name",
",",
"config",
")",
":",
"# setup return structure",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"}",
"# get existing config if job ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | 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... | salt/states/infoblox_range.py | 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:
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_range.py#L17-L140 | [
"def",
"present",
"(",
"name",
"=",
"None",
",",
"start_addr",
"=",
"None",
",",
"end_addr",
"=",
"None",
",",
"data",
"=",
"None",
",",
"*",
"*",
"api_opts",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | 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 | salt/states/infoblox_range.py | 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:
- ... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_range.py#L143-L191 | [
"def",
"absent",
"(",
"name",
"=",
"None",
",",
"start_addr",
"=",
"None",
",",
"end_addr",
"=",
"None",
",",
"data",
"=",
"None",
",",
"*",
"*",
"api_opts",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SSHConnection.sendline | 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. | salt/utils/vt_helper.py | 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
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vt_helper.py#L107-L133 | [
"def",
"sendline",
"(",
"self",
",",
"cmd",
")",
":",
"self",
".",
"conn",
".",
"sendline",
"(",
"cmd",
",",
"self",
".",
"linesep",
")",
"# saw_prompt = False",
"ret_stdout",
"=",
"[",
"]",
"ret_stderr",
"=",
"[",
"]",
"while",
"self",
".",
"conn",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | esxcli | 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... | salt/utils/vmware.py | 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:... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L125-L179 | [
"def",
"esxcli",
"(",
"host",
",",
"user",
",",
"pwd",
",",
"cmd",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_host",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"esx_cmd",
"=",
"salt",
".",
"utils",
".",
"path",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_service_instance | Internal method to authenticate with a vCenter server or ESX/ESXi host
and return the service instance object. | salt/utils/vmware.py | 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 =... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L182-L278 | [
"def",
"_get_service_instance",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
",",
"port",
",",
"mechanism",
",",
"principal",
",",
"domain",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving new service instance'",
")",
"token",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_customizationspec_ref | 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 | salt/utils/vmware.py | 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
... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L281-L293 | [
"def",
"get_customizationspec_ref",
"(",
"si",
",",
"customization_spec_name",
")",
":",
"customization_spec_name",
"=",
"si",
".",
"content",
".",
"customizationSpecManager",
".",
"GetCustomizationSpec",
"(",
"name",
"=",
"customization_spec_name",
")",
"return",
"cust... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_service_instance | 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
... | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L318-L411 | [
"def",
"get_service_instance",
"(",
"host",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"mechanism",
"=",
"'userpass'",
",",
"principal",
"=",
"None",
",",
"domain",
"=",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_new_service_instance_stub | 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... | salt/utils/vmware.py | 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
... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L414-L454 | [
"def",
"get_new_service_instance_stub",
"(",
"service_instance",
",",
"path",
",",
"ns",
"=",
"None",
",",
"version",
"=",
"None",
")",
":",
"# For python 2.7.9 and later, the default SSL context has more strict",
"# connection handshaking rule. We may need turn off the hostname ch... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_service_instance_from_managed_object | 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. | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L457-L472 | [
"def",
"get_service_instance_from_managed_object",
"(",
"mo_ref",
",",
"name",
"=",
"'<unnamed>'",
")",
":",
"if",
"not",
"name",
":",
"name",
"=",
"mo_ref",
".",
"name",
"log",
".",
"trace",
"(",
"'[%s] Retrieving service instance from managed object'",
",",
"name"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | disconnect | Function that disconnects from the vCenter server or ESXi host
service_instance
The Service Instance from which to obtain managed object references. | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L475-L495 | [
"def",
"disconnect",
"(",
"service_instance",
")",
":",
"log",
".",
"trace",
"(",
"'Disconnecting'",
")",
"try",
":",
"Disconnect",
"(",
"service_instance",
")",
"except",
"vim",
".",
"fault",
".",
"NoPermission",
"as",
"exc",
":",
"log",
".",
"exception",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | is_connection_to_a_vcenter | 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. | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L498-L527 | [
"def",
"is_connection_to_a_vcenter",
"(",
"service_instance",
")",
":",
"try",
":",
"api_type",
"=",
"service_instance",
".",
"content",
".",
"about",
".",
"apiType",
"except",
"vim",
".",
"fault",
".",
"NoPermission",
"as",
"exc",
":",
"log",
".",
"exception"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_service_info | Returns information of the vCenter or ESXi host
service_instance
The Service Instance from which to obtain managed object references. | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L530-L549 | [
"def",
"get_service_info",
"(",
"service_instance",
")",
":",
"try",
":",
"return",
"service_instance",
".",
"content",
".",
"about",
"except",
"vim",
".",
"fault",
".",
"NoPermission",
"as",
"exc",
":",
"log",
".",
"exception",
"(",
"exc",
")",
"raise",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_dvs | 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 | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L552-L568 | [
"def",
"_get_dvs",
"(",
"service_instance",
",",
"dvs_name",
")",
":",
"switches",
"=",
"list_dvs",
"(",
"service_instance",
")",
"if",
"dvs_name",
"in",
"switches",
":",
"inventory",
"=",
"get_inventory",
"(",
"service_instance",
")",
"container",
"=",
"invento... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_dvs_portgroup | 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 | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L593-L605 | [
"def",
"_get_dvs_portgroup",
"(",
"dvs",
",",
"portgroup_name",
")",
":",
"for",
"portgroup",
"in",
"dvs",
".",
"portgroup",
":",
"if",
"portgroup",
".",
"name",
"==",
"portgroup_name",
":",
"return",
"portgroup",
"return",
"None"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_dvs_uplink_portgroup | 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 | salt/utils/vmware.py | 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 ... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L608-L620 | [
"def",
"_get_dvs_uplink_portgroup",
"(",
"dvs",
",",
"portgroup_name",
")",
":",
"for",
"portgroup",
"in",
"dvs",
".",
"portgroup",
":",
"if",
"portgroup",
".",
"name",
"==",
"portgroup_name",
":",
"return",
"portgroup",
"return",
"None"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_gssapi_token | Get the gssapi token for Kerberos connection
principal
The service principal
host
Host url where we would like to authenticate
domain
Kerberos user domain | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L623-L655 | [
"def",
"get_gssapi_token",
"(",
"principal",
",",
"host",
",",
"domain",
")",
":",
"if",
"not",
"HAS_GSSAPI",
":",
"raise",
"ImportError",
"(",
"'The gssapi library is not imported.'",
")",
"service",
"=",
"'{0}/{1}@{2}'",
".",
"format",
"(",
"principal",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_hardware_grains | 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 | salt/utils/vmware.py | 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... | 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"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L658-L719 | [
"def",
"get_hardware_grains",
"(",
"service_instance",
")",
":",
"hw_grain_data",
"=",
"{",
"}",
"if",
"get_inventory",
"(",
"service_instance",
")",
".",
"about",
".",
"apiType",
"==",
"'HostAgent'",
":",
"view",
"=",
"service_instance",
".",
"content",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_root_folder | Returns the root folder of a vCenter.
service_instance
The Service Instance Object for which to obtain the root folder. | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L732-L752 | [
"def",
"get_root_folder",
"(",
"service_instance",
")",
":",
"try",
":",
"log",
".",
"trace",
"(",
"'Retrieving root folder'",
")",
"return",
"service_instance",
".",
"RetrieveContent",
"(",
")",
".",
"rootFolder",
"except",
"vim",
".",
"fault",
".",
"NoPermissi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_content | 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.
... | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L755-L874 | [
"def",
"get_content",
"(",
"service_instance",
",",
"obj_type",
",",
"property_list",
"=",
"None",
",",
"container_ref",
"=",
"None",
",",
"traversal_spec",
"=",
"None",
",",
"local_properties",
"=",
"False",
")",
":",
"# Start at the rootFolder if container starting ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_mor_by_property | 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... | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L877-L906 | [
"def",
"get_mor_by_property",
"(",
"service_instance",
",",
"object_type",
",",
"property_value",
",",
"property_name",
"=",
"'name'",
",",
"container_ref",
"=",
"None",
")",
":",
"# Get list of all managed object references with specified property",
"object_list",
"=",
"ge... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_mors_with_properties | 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... | salt/utils/vmware.py | 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_... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L909-L960 | [
"def",
"get_mors_with_properties",
"(",
"service_instance",
",",
"object_type",
",",
"property_list",
"=",
"None",
",",
"container_ref",
"=",
"None",
",",
"traversal_spec",
"=",
"None",
",",
"local_properties",
"=",
"False",
")",
":",
"# Get all the content",
"conte... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_properties_of_managed_object | 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. | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L963-L996 | [
"def",
"get_properties_of_managed_object",
"(",
"mo_ref",
",",
"properties",
")",
":",
"service_instance",
"=",
"get_service_instance_from_managed_object",
"(",
"mo_ref",
")",
"log",
".",
"trace",
"(",
"'Retrieving name of %s'",
",",
"type",
"(",
"mo_ref",
")",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_network_adapter_type | Return the network adapter type.
adpater_type
The adapter type from which to obtain the network adapter type. | salt/utils/vmware.py | 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.... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1011-L1029 | [
"def",
"get_network_adapter_type",
"(",
"adapter_type",
")",
":",
"if",
"adapter_type",
"==",
"'vmxnet'",
":",
"return",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualVmxnet",
"(",
")",
"elif",
"adapter_type",
"==",
"'vmxnet2'",
":",
"return",
"vim",
".",
"v... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_network_adapter_object_type | Returns the network adapter type.
adapter_object
The adapter object from which to obtain the network adapter type. | salt/utils/vmware.py | 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... | 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",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1032-L1050 | [
"def",
"get_network_adapter_object_type",
"(",
"adapter_object",
")",
":",
"if",
"isinstance",
"(",
"adapter_object",
",",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualVmxnet2",
")",
":",
"return",
"'vmxnet2'",
"if",
"isinstance",
"(",
"adapter_object",
",",
"v... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_dvss | Returns distributed virtual switches (DVSs) in a datacenter.
dc_ref
The parent datacenter reference.
dvs_names
The names of the DVSs to return. Default is None.
get_all_dvss
Return all DVSs in the datacenter. Default is False. | salt/utils/vmware.py | def get_dvss(dc_ref, dvs_names=None, get_all_dvss=False):
'''
Returns distributed virtual switches (DVSs) in a datacenter.
dc_ref
The parent datacenter reference.
dvs_names
The names of the DVSs to return. Default is None.
get_all_dvss
Return all DVSs in the datacenter. De... | def get_dvss(dc_ref, dvs_names=None, get_all_dvss=False):
'''
Returns distributed virtual switches (DVSs) in a datacenter.
dc_ref
The parent datacenter reference.
dvs_names
The names of the DVSs to return. Default is None.
get_all_dvss
Return all DVSs in the datacenter. De... | [
"Returns",
"distributed",
"virtual",
"switches",
"(",
"DVSs",
")",
"in",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1053-L1090 | [
"def",
"get_dvss",
"(",
"dc_ref",
",",
"dvs_names",
"=",
"None",
",",
"get_all_dvss",
"=",
"False",
")",
":",
"dc_name",
"=",
"get_managed_object_name",
"(",
"dc_ref",
")",
"log",
".",
"trace",
"(",
"'Retrieving DVSs in datacenter \\'%s\\', dvs_names=\\'%s\\', get_all... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_network_folder | Retrieves the network folder of a datacenter | salt/utils/vmware.py | def get_network_folder(dc_ref):
'''
Retrieves the network folder of a datacenter
'''
dc_name = get_managed_object_name(dc_ref)
log.trace('Retrieving network folder in datacenter \'%s\'', dc_name)
service_instance = get_service_instance_from_managed_object(dc_ref)
traversal_spec = vmodl.query... | def get_network_folder(dc_ref):
'''
Retrieves the network folder of a datacenter
'''
dc_name = get_managed_object_name(dc_ref)
log.trace('Retrieving network folder in datacenter \'%s\'', dc_name)
service_instance = get_service_instance_from_managed_object(dc_ref)
traversal_spec = vmodl.query... | [
"Retrieves",
"the",
"network",
"folder",
"of",
"a",
"datacenter"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1093-L1113 | [
"def",
"get_network_folder",
"(",
"dc_ref",
")",
":",
"dc_name",
"=",
"get_managed_object_name",
"(",
"dc_ref",
")",
"log",
".",
"trace",
"(",
"'Retrieving network folder in datacenter \\'%s\\''",
",",
"dc_name",
")",
"service_instance",
"=",
"get_service_instance_from_ma... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_dvs | Creates a distributed virtual switches (DVS) in a datacenter.
Returns the reference to the newly created distributed virtual switch.
dc_ref
The parent datacenter reference.
dvs_name
The name of the DVS to create.
dvs_create_spec
The DVS spec (vim.DVSCreateSpec) to use when cre... | salt/utils/vmware.py | def create_dvs(dc_ref, dvs_name, dvs_create_spec=None):
'''
Creates a distributed virtual switches (DVS) in a datacenter.
Returns the reference to the newly created distributed virtual switch.
dc_ref
The parent datacenter reference.
dvs_name
The name of the DVS to create.
dvs_... | def create_dvs(dc_ref, dvs_name, dvs_create_spec=None):
'''
Creates a distributed virtual switches (DVS) in a datacenter.
Returns the reference to the newly created distributed virtual switch.
dc_ref
The parent datacenter reference.
dvs_name
The name of the DVS to create.
dvs_... | [
"Creates",
"a",
"distributed",
"virtual",
"switches",
"(",
"DVS",
")",
"in",
"a",
"datacenter",
".",
"Returns",
"the",
"reference",
"to",
"the",
"newly",
"created",
"distributed",
"virtual",
"switch",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1116-L1152 | [
"def",
"create_dvs",
"(",
"dc_ref",
",",
"dvs_name",
",",
"dvs_create_spec",
"=",
"None",
")",
":",
"dc_name",
"=",
"get_managed_object_name",
"(",
"dc_ref",
")",
"log",
".",
"trace",
"(",
"'Creating DVS \\'%s\\' in datacenter \\'%s\\''",
",",
"dvs_name",
",",
"dc... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_dvs | Updates a distributed virtual switch with the config_spec.
dvs_ref
The DVS reference.
dvs_config_spec
The updated config spec (vim.VMwareDVSConfigSpec) to be applied to
the DVS. | salt/utils/vmware.py | def update_dvs(dvs_ref, dvs_config_spec):
'''
Updates a distributed virtual switch with the config_spec.
dvs_ref
The DVS reference.
dvs_config_spec
The updated config spec (vim.VMwareDVSConfigSpec) to be applied to
the DVS.
'''
dvs_name = get_managed_object_name(dvs_ref... | def update_dvs(dvs_ref, dvs_config_spec):
'''
Updates a distributed virtual switch with the config_spec.
dvs_ref
The DVS reference.
dvs_config_spec
The updated config spec (vim.VMwareDVSConfigSpec) to be applied to
the DVS.
'''
dvs_name = get_managed_object_name(dvs_ref... | [
"Updates",
"a",
"distributed",
"virtual",
"switch",
"with",
"the",
"config_spec",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1155-L1181 | [
"def",
"update_dvs",
"(",
"dvs_ref",
",",
"dvs_config_spec",
")",
":",
"dvs_name",
"=",
"get_managed_object_name",
"(",
"dvs_ref",
")",
"log",
".",
"trace",
"(",
"'Updating dvs \\'%s\\''",
",",
"dvs_name",
")",
"try",
":",
"task",
"=",
"dvs_ref",
".",
"Reconfi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_dvs_network_resource_management_enabled | Sets whether NIOC is enabled on a DVS.
dvs_ref
The DVS reference.
enabled
Flag specifying whether NIOC is enabled. | salt/utils/vmware.py | def set_dvs_network_resource_management_enabled(dvs_ref, enabled):
'''
Sets whether NIOC is enabled on a DVS.
dvs_ref
The DVS reference.
enabled
Flag specifying whether NIOC is enabled.
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Setting network resource mana... | def set_dvs_network_resource_management_enabled(dvs_ref, enabled):
'''
Sets whether NIOC is enabled on a DVS.
dvs_ref
The DVS reference.
enabled
Flag specifying whether NIOC is enabled.
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Setting network resource mana... | [
"Sets",
"whether",
"NIOC",
"is",
"enabled",
"on",
"a",
"DVS",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1184-L1209 | [
"def",
"set_dvs_network_resource_management_enabled",
"(",
"dvs_ref",
",",
"enabled",
")",
":",
"dvs_name",
"=",
"get_managed_object_name",
"(",
"dvs_ref",
")",
"log",
".",
"trace",
"(",
"'Setting network resource management enable to %s on '",
"'dvs \\'%s\\''",
",",
"enabl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_dvportgroups | Returns distributed virtual porgroups (dvportgroups).
The parent object can be either a datacenter or a dvs.
parent_ref
The parent object reference. Can be either a datacenter or a dvs.
portgroup_names
The names of the dvss to return. Default is None.
get_all_portgroups
Return... | salt/utils/vmware.py | def get_dvportgroups(parent_ref, portgroup_names=None,
get_all_portgroups=False):
'''
Returns distributed virtual porgroups (dvportgroups).
The parent object can be either a datacenter or a dvs.
parent_ref
The parent object reference. Can be either a datacenter or a dvs.
... | def get_dvportgroups(parent_ref, portgroup_names=None,
get_all_portgroups=False):
'''
Returns distributed virtual porgroups (dvportgroups).
The parent object can be either a datacenter or a dvs.
parent_ref
The parent object reference. Can be either a datacenter or a dvs.
... | [
"Returns",
"distributed",
"virtual",
"porgroups",
"(",
"dvportgroups",
")",
".",
"The",
"parent",
"object",
"can",
"be",
"either",
"a",
"datacenter",
"or",
"a",
"dvs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1212-L1264 | [
"def",
"get_dvportgroups",
"(",
"parent_ref",
",",
"portgroup_names",
"=",
"None",
",",
"get_all_portgroups",
"=",
"False",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"parent_ref",
",",
"(",
"vim",
".",
"Datacenter",
",",
"vim",
".",
"DistributedVirtualSwi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_uplink_dvportgroup | Returns the uplink distributed virtual portgroup of a distributed virtual
switch (dvs)
dvs_ref
The dvs reference | salt/utils/vmware.py | def get_uplink_dvportgroup(dvs_ref):
'''
Returns the uplink distributed virtual portgroup of a distributed virtual
switch (dvs)
dvs_ref
The dvs reference
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Retrieving uplink portgroup of dvs \'%s\'', dvs_name)
traversal_sp... | def get_uplink_dvportgroup(dvs_ref):
'''
Returns the uplink distributed virtual portgroup of a distributed virtual
switch (dvs)
dvs_ref
The dvs reference
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Retrieving uplink portgroup of dvs \'%s\'', dvs_name)
traversal_sp... | [
"Returns",
"the",
"uplink",
"distributed",
"virtual",
"portgroup",
"of",
"a",
"distributed",
"virtual",
"switch",
"(",
"dvs",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1267-L1293 | [
"def",
"get_uplink_dvportgroup",
"(",
"dvs_ref",
")",
":",
"dvs_name",
"=",
"get_managed_object_name",
"(",
"dvs_ref",
")",
"log",
".",
"trace",
"(",
"'Retrieving uplink portgroup of dvs \\'%s\\''",
",",
"dvs_name",
")",
"traversal_spec",
"=",
"vmodl",
".",
"query",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_dvportgroup | Creates a distributed virtual portgroup on a distributed virtual switch
(dvs)
dvs_ref
The dvs reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec) | salt/utils/vmware.py | def create_dvportgroup(dvs_ref, spec):
'''
Creates a distributed virtual portgroup on a distributed virtual switch
(dvs)
dvs_ref
The dvs reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec)
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Adding portgroup... | def create_dvportgroup(dvs_ref, spec):
'''
Creates a distributed virtual portgroup on a distributed virtual switch
(dvs)
dvs_ref
The dvs reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec)
'''
dvs_name = get_managed_object_name(dvs_ref)
log.trace('Adding portgroup... | [
"Creates",
"a",
"distributed",
"virtual",
"portgroup",
"on",
"a",
"distributed",
"virtual",
"switch",
"(",
"dvs",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1296-L1323 | [
"def",
"create_dvportgroup",
"(",
"dvs_ref",
",",
"spec",
")",
":",
"dvs_name",
"=",
"get_managed_object_name",
"(",
"dvs_ref",
")",
"log",
".",
"trace",
"(",
"'Adding portgroup %s to dvs \\'%s\\''",
",",
"spec",
".",
"name",
",",
"dvs_name",
")",
"log",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_dvportgroup | Updates a distributed virtual portgroup
portgroup_ref
The portgroup reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec) | salt/utils/vmware.py | def update_dvportgroup(portgroup_ref, spec):
'''
Updates a distributed virtual portgroup
portgroup_ref
The portgroup reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec)
'''
pg_name = get_managed_object_name(portgroup_ref)
log.trace('Updating portgrouo %s', pg_name)
... | def update_dvportgroup(portgroup_ref, spec):
'''
Updates a distributed virtual portgroup
portgroup_ref
The portgroup reference
spec
Portgroup spec (vim.DVPortgroupConfigSpec)
'''
pg_name = get_managed_object_name(portgroup_ref)
log.trace('Updating portgrouo %s', pg_name)
... | [
"Updates",
"a",
"distributed",
"virtual",
"portgroup"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1326-L1351 | [
"def",
"update_dvportgroup",
"(",
"portgroup_ref",
",",
"spec",
")",
":",
"pg_name",
"=",
"get_managed_object_name",
"(",
"portgroup_ref",
")",
"log",
".",
"trace",
"(",
"'Updating portgrouo %s'",
",",
"pg_name",
")",
"try",
":",
"task",
"=",
"portgroup_ref",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_networks | Returns networks of standard switches.
The parent object can be a datacenter.
parent_ref
The parent object reference. A datacenter object.
network_names
The name of the standard switch networks. Default is None.
get_all_networks
Boolean indicates whether to return all networks... | salt/utils/vmware.py | def get_networks(parent_ref, network_names=None, get_all_networks=False):
'''
Returns networks of standard switches.
The parent object can be a datacenter.
parent_ref
The parent object reference. A datacenter object.
network_names
The name of the standard switch networks. Default i... | def get_networks(parent_ref, network_names=None, get_all_networks=False):
'''
Returns networks of standard switches.
The parent object can be a datacenter.
parent_ref
The parent object reference. A datacenter object.
network_names
The name of the standard switch networks. Default i... | [
"Returns",
"networks",
"of",
"standard",
"switches",
".",
"The",
"parent",
"object",
"can",
"be",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1379-L1423 | [
"def",
"get_networks",
"(",
"parent_ref",
",",
"network_names",
"=",
"None",
",",
"get_all_networks",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"parent_ref",
",",
"vim",
".",
"Datacenter",
")",
":",
"raise",
"salt",
".",
"exceptions",
".",
"A... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_objects | Returns a simple list of objects from a given service instance.
service_instance
The Service Instance for which to obtain a list of objects.
object_type
The type of content for which to obtain information.
properties
An optional list of object properties used to return reference r... | salt/utils/vmware.py | def list_objects(service_instance, vim_object, properties=None):
'''
Returns a simple list of objects from a given service instance.
service_instance
The Service Instance for which to obtain a list of objects.
object_type
The type of content for which to obtain information.
proper... | def list_objects(service_instance, vim_object, properties=None):
'''
Returns a simple list of objects from a given service instance.
service_instance
The Service Instance for which to obtain a list of objects.
object_type
The type of content for which to obtain information.
proper... | [
"Returns",
"a",
"simple",
"list",
"of",
"objects",
"from",
"a",
"given",
"service",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1426-L1447 | [
"def",
"list_objects",
"(",
"service_instance",
",",
"vim_object",
",",
"properties",
"=",
"None",
")",
":",
"if",
"properties",
"is",
"None",
":",
"properties",
"=",
"[",
"'name'",
"]",
"items",
"=",
"[",
"]",
"item_list",
"=",
"get_mors_with_properties",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_license_manager | Returns the license manager.
service_instance
The Service Instance Object from which to obrain the license manager. | salt/utils/vmware.py | def get_license_manager(service_instance):
'''
Returns the license manager.
service_instance
The Service Instance Object from which to obrain the license manager.
'''
log.debug('Retrieving license manager')
try:
lic_manager = service_instance.content.licenseManager
except v... | def get_license_manager(service_instance):
'''
Returns the license manager.
service_instance
The Service Instance Object from which to obrain the license manager.
'''
log.debug('Retrieving license manager')
try:
lic_manager = service_instance.content.licenseManager
except v... | [
"Returns",
"the",
"license",
"manager",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1450-L1472 | [
"def",
"get_license_manager",
"(",
"service_instance",
")",
":",
"log",
".",
"debug",
"(",
"'Retrieving license manager'",
")",
"try",
":",
"lic_manager",
"=",
"service_instance",
".",
"content",
".",
"licenseManager",
"except",
"vim",
".",
"fault",
".",
"NoPermis... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_license_assignment_manager | Returns the license assignment manager.
service_instance
The Service Instance Object from which to obrain the license manager. | salt/utils/vmware.py | def get_license_assignment_manager(service_instance):
'''
Returns the license assignment manager.
service_instance
The Service Instance Object from which to obrain the license manager.
'''
log.debug('Retrieving license assignment manager')
try:
lic_assignment_manager = \
... | def get_license_assignment_manager(service_instance):
'''
Returns the license assignment manager.
service_instance
The Service Instance Object from which to obrain the license manager.
'''
log.debug('Retrieving license assignment manager')
try:
lic_assignment_manager = \
... | [
"Returns",
"the",
"license",
"assignment",
"manager",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1475-L1501 | [
"def",
"get_license_assignment_manager",
"(",
"service_instance",
")",
":",
"log",
".",
"debug",
"(",
"'Retrieving license assignment manager'",
")",
"try",
":",
"lic_assignment_manager",
"=",
"service_instance",
".",
"content",
".",
"licenseManager",
".",
"licenseAssignm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_licenses | Returns the licenses on a specific instance.
service_instance
The Service Instance Object from which to obrain the licenses.
license_manager
The License Manager object of the service instance. If not provided it
will be retrieved. | salt/utils/vmware.py | def get_licenses(service_instance, license_manager=None):
'''
Returns the licenses on a specific instance.
service_instance
The Service Instance Object from which to obrain the licenses.
license_manager
The License Manager object of the service instance. If not provided it
will... | def get_licenses(service_instance, license_manager=None):
'''
Returns the licenses on a specific instance.
service_instance
The Service Instance Object from which to obrain the licenses.
license_manager
The License Manager object of the service instance. If not provided it
will... | [
"Returns",
"the",
"licenses",
"on",
"a",
"specific",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1504-L1531 | [
"def",
"get_licenses",
"(",
"service_instance",
",",
"license_manager",
"=",
"None",
")",
":",
"if",
"not",
"license_manager",
":",
"license_manager",
"=",
"get_license_manager",
"(",
"service_instance",
")",
"log",
".",
"debug",
"(",
"'Retrieving licenses'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_license | Adds a license.
service_instance
The Service Instance Object.
key
The key of the license to add.
description
The description of the license to add.
license_manager
The License Manager object of the service instance. If not provided it
will be retrieved. | salt/utils/vmware.py | def add_license(service_instance, key, description, license_manager=None):
'''
Adds a license.
service_instance
The Service Instance Object.
key
The key of the license to add.
description
The description of the license to add.
license_manager
The License Manag... | def add_license(service_instance, key, description, license_manager=None):
'''
Adds a license.
service_instance
The Service Instance Object.
key
The key of the license to add.
description
The description of the license to add.
license_manager
The License Manag... | [
"Adds",
"a",
"license",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1534-L1570 | [
"def",
"add_license",
"(",
"service_instance",
",",
"key",
",",
"description",
",",
"license_manager",
"=",
"None",
")",
":",
"if",
"not",
"license_manager",
":",
"license_manager",
"=",
"get_license_manager",
"(",
"service_instance",
")",
"label",
"=",
"vim",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_assigned_licenses | Returns the licenses assigned to an entity. If entity ref is not provided,
then entity_name is assumed to be the vcenter. This is later checked if
the entity name is provided.
service_instance
The Service Instance Object from which to obtain the licenses.
entity_ref
VMware entity to ge... | salt/utils/vmware.py | def get_assigned_licenses(service_instance, entity_ref=None, entity_name=None,
license_assignment_manager=None):
'''
Returns the licenses assigned to an entity. If entity ref is not provided,
then entity_name is assumed to be the vcenter. This is later checked if
the entity nam... | def get_assigned_licenses(service_instance, entity_ref=None, entity_name=None,
license_assignment_manager=None):
'''
Returns the licenses assigned to an entity. If entity ref is not provided,
then entity_name is assumed to be the vcenter. This is later checked if
the entity nam... | [
"Returns",
"the",
"licenses",
"assigned",
"to",
"an",
"entity",
".",
"If",
"entity",
"ref",
"is",
"not",
"provided",
"then",
"entity_name",
"is",
"assumed",
"to",
"be",
"the",
"vcenter",
".",
"This",
"is",
"later",
"checked",
"if",
"the",
"entity",
"name",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1573-L1655 | [
"def",
"get_assigned_licenses",
"(",
"service_instance",
",",
"entity_ref",
"=",
"None",
",",
"entity_name",
"=",
"None",
",",
"license_assignment_manager",
"=",
"None",
")",
":",
"if",
"not",
"license_assignment_manager",
":",
"license_assignment_manager",
"=",
"get_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | assign_license | Assigns a license to an entity.
service_instance
The Service Instance Object from which to obrain the licenses.
license_key
The key of the license to add.
license_name
The description of the license to add.
entity_ref
VMware entity to assign the license to.
If... | salt/utils/vmware.py | def assign_license(service_instance, license_key, license_name,
entity_ref=None, entity_name=None,
license_assignment_manager=None):
'''
Assigns a license to an entity.
service_instance
The Service Instance Object from which to obrain the licenses.
license... | def assign_license(service_instance, license_key, license_name,
entity_ref=None, entity_name=None,
license_assignment_manager=None):
'''
Assigns a license to an entity.
service_instance
The Service Instance Object from which to obrain the licenses.
license... | [
"Assigns",
"a",
"license",
"to",
"an",
"entity",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1658-L1728 | [
"def",
"assign_license",
"(",
"service_instance",
",",
"license_key",
",",
"license_name",
",",
"entity_ref",
"=",
"None",
",",
"entity_name",
"=",
"None",
",",
"license_assignment_manager",
"=",
"None",
")",
":",
"if",
"not",
"license_assignment_manager",
":",
"l... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_datacenters | Returns all datacenters in a vCenter.
service_instance
The Service Instance Object from which to obtain cluster.
datacenter_names
List of datacenter names to filter by. Default value is None.
get_all_datacenters
Flag specifying whether to retrieve all datacenters.
Default ... | salt/utils/vmware.py | def get_datacenters(service_instance, datacenter_names=None,
get_all_datacenters=False):
'''
Returns all datacenters in a vCenter.
service_instance
The Service Instance Object from which to obtain cluster.
datacenter_names
List of datacenter names to filter by. Defa... | def get_datacenters(service_instance, datacenter_names=None,
get_all_datacenters=False):
'''
Returns all datacenters in a vCenter.
service_instance
The Service Instance Object from which to obtain cluster.
datacenter_names
List of datacenter names to filter by. Defa... | [
"Returns",
"all",
"datacenters",
"in",
"a",
"vCenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1741-L1762 | [
"def",
"get_datacenters",
"(",
"service_instance",
",",
"datacenter_names",
"=",
"None",
",",
"get_all_datacenters",
"=",
"False",
")",
":",
"items",
"=",
"[",
"i",
"[",
"'object'",
"]",
"for",
"i",
"in",
"get_mors_with_properties",
"(",
"service_instance",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_datacenter | Returns a vim.Datacenter managed object.
service_instance
The Service Instance Object from which to obtain datacenter.
datacenter_name
The datacenter name | salt/utils/vmware.py | def get_datacenter(service_instance, datacenter_name):
'''
Returns a vim.Datacenter managed object.
service_instance
The Service Instance Object from which to obtain datacenter.
datacenter_name
The datacenter name
'''
items = get_datacenters(service_instance,
... | def get_datacenter(service_instance, datacenter_name):
'''
Returns a vim.Datacenter managed object.
service_instance
The Service Instance Object from which to obtain datacenter.
datacenter_name
The datacenter name
'''
items = get_datacenters(service_instance,
... | [
"Returns",
"a",
"vim",
".",
"Datacenter",
"managed",
"object",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1765-L1780 | [
"def",
"get_datacenter",
"(",
"service_instance",
",",
"datacenter_name",
")",
":",
"items",
"=",
"get_datacenters",
"(",
"service_instance",
",",
"datacenter_names",
"=",
"[",
"datacenter_name",
"]",
")",
"if",
"not",
"items",
":",
"raise",
"salt",
".",
"except... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_datacenter | Creates a datacenter.
.. versionadded:: 2017.7.0
service_instance
The Service Instance Object
datacenter_name
The datacenter name | salt/utils/vmware.py | def create_datacenter(service_instance, datacenter_name):
'''
Creates a datacenter.
.. versionadded:: 2017.7.0
service_instance
The Service Instance Object
datacenter_name
The datacenter name
'''
root_folder = get_root_folder(service_instance)
log.trace('Creating datac... | def create_datacenter(service_instance, datacenter_name):
'''
Creates a datacenter.
.. versionadded:: 2017.7.0
service_instance
The Service Instance Object
datacenter_name
The datacenter name
'''
root_folder = get_root_folder(service_instance)
log.trace('Creating datac... | [
"Creates",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1783-L1810 | [
"def",
"create_datacenter",
"(",
"service_instance",
",",
"datacenter_name",
")",
":",
"root_folder",
"=",
"get_root_folder",
"(",
"service_instance",
")",
"log",
".",
"trace",
"(",
"'Creating datacenter \\'%s\\''",
",",
"datacenter_name",
")",
"try",
":",
"dc_obj",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_cluster | Returns a cluster in a datacenter.
dc_ref
The datacenter reference
cluster
The cluster to be retrieved | salt/utils/vmware.py | def get_cluster(dc_ref, cluster):
'''
Returns a cluster in a datacenter.
dc_ref
The datacenter reference
cluster
The cluster to be retrieved
'''
dc_name = get_managed_object_name(dc_ref)
log.trace('Retrieving cluster \'%s\' from datacenter \'%s\'',
cluster, dc... | def get_cluster(dc_ref, cluster):
'''
Returns a cluster in a datacenter.
dc_ref
The datacenter reference
cluster
The cluster to be retrieved
'''
dc_name = get_managed_object_name(dc_ref)
log.trace('Retrieving cluster \'%s\' from datacenter \'%s\'',
cluster, dc... | [
"Returns",
"a",
"cluster",
"in",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1813-L1846 | [
"def",
"get_cluster",
"(",
"dc_ref",
",",
"cluster",
")",
":",
"dc_name",
"=",
"get_managed_object_name",
"(",
"dc_ref",
")",
"log",
".",
"trace",
"(",
"'Retrieving cluster \\'%s\\' from datacenter \\'%s\\''",
",",
"cluster",
",",
"dc_name",
")",
"si",
"=",
"get_s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_cluster | Creates a cluster in a datacenter.
dc_ref
The parent datacenter reference.
cluster_name
The cluster name.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None. | salt/utils/vmware.py | def create_cluster(dc_ref, cluster_name, cluster_spec):
'''
Creates a cluster in a datacenter.
dc_ref
The parent datacenter reference.
cluster_name
The cluster name.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None.
'''
dc_name = ge... | def create_cluster(dc_ref, cluster_name, cluster_spec):
'''
Creates a cluster in a datacenter.
dc_ref
The parent datacenter reference.
cluster_name
The cluster name.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None.
'''
dc_name = ge... | [
"Creates",
"a",
"cluster",
"in",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1849-L1878 | [
"def",
"create_cluster",
"(",
"dc_ref",
",",
"cluster_name",
",",
"cluster_spec",
")",
":",
"dc_name",
"=",
"get_managed_object_name",
"(",
"dc_ref",
")",
"log",
".",
"trace",
"(",
"'Creating cluster \\'%s\\' in datacenter \\'%s\\''",
",",
"cluster_name",
",",
"dc_nam... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_cluster | Updates a cluster in a datacenter.
cluster_ref
The cluster reference.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None. | salt/utils/vmware.py | def update_cluster(cluster_ref, cluster_spec):
'''
Updates a cluster in a datacenter.
cluster_ref
The cluster reference.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None.
'''
cluster_name = get_managed_object_name(cluster_ref)
log.trace('Upd... | def update_cluster(cluster_ref, cluster_spec):
'''
Updates a cluster in a datacenter.
cluster_ref
The cluster reference.
cluster_spec
The cluster spec (vim.ClusterConfigSpecEx).
Defaults to None.
'''
cluster_name = get_managed_object_name(cluster_ref)
log.trace('Upd... | [
"Updates",
"a",
"cluster",
"in",
"a",
"datacenter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1881-L1908 | [
"def",
"update_cluster",
"(",
"cluster_ref",
",",
"cluster_spec",
")",
":",
"cluster_name",
"=",
"get_managed_object_name",
"(",
"cluster_ref",
")",
"log",
".",
"trace",
"(",
"'Updating cluster \\'%s\\''",
",",
"cluster_name",
")",
"try",
":",
"task",
"=",
"cluste... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_datastores_full | Returns a list of datastores associated with a given service instance.
The list contains basic information about the datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to obtain datastores. | salt/utils/vmware.py | def list_datastores_full(service_instance):
'''
Returns a list of datastores associated with a given service instance.
The list contains basic information about the datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to ... | def list_datastores_full(service_instance):
'''
Returns a list of datastores associated with a given service instance.
The list contains basic information about the datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to ... | [
"Returns",
"a",
"list",
"of",
"datastores",
"associated",
"with",
"a",
"given",
"service",
"instance",
".",
"The",
"list",
"contains",
"basic",
"information",
"about",
"the",
"datastore",
":",
"name",
"type",
"url",
"capacity",
"free",
"used",
"usage",
"hosts"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1941-L1956 | [
"def",
"list_datastores_full",
"(",
"service_instance",
")",
":",
"datastores_list",
"=",
"list_objects",
"(",
"service_instance",
",",
"vim",
".",
"Datastore",
")",
"datastores",
"=",
"{",
"}",
"for",
"datastore",
"in",
"datastores_list",
":",
"datastores",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.