mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Lint
This commit is contained in:
parent
1a3b1f2626
commit
b5c7a46f7a
3 changed files with 45 additions and 3 deletions
|
@ -2651,4 +2651,3 @@ class ProxyMinion(Minion):
|
|||
}, persist=True)
|
||||
|
||||
self.grains_cache = self.opts['grains']
|
||||
|
||||
|
|
|
@ -182,6 +182,7 @@ log = logging.getLogger(__name__)
|
|||
__virtualname__ = 'vsphere'
|
||||
__proxyenabled__ = ['esxi']
|
||||
|
||||
|
||||
def __virtual__():
|
||||
if not HAS_PYVMOMI:
|
||||
return False, 'Missing dependency: The vSphere module requires the pyVmomi Python module.'
|
||||
|
@ -3224,6 +3225,19 @@ def vsan_enable(host, username, password, protocol=None, port=None, host_names=N
|
|||
return ret
|
||||
|
||||
|
||||
def get_dvs_portgroup_assignment(service_instance, host, dvs_name,
|
||||
portgroup_name, host_names):
|
||||
'''
|
||||
|
||||
:param service_instance: Reference to the vSphere server
|
||||
:param dvs_name: Name of the DVS
|
||||
:param portgroup_name: Portgroup to examine
|
||||
:param host_names: Names of hosts
|
||||
:return:
|
||||
'''
|
||||
host_refs = _check_hosts(service_instance, host, host_names)
|
||||
|
||||
|
||||
def _check_hosts(service_instance, host, host_names):
|
||||
'''
|
||||
Helper function that checks to see if the host provided is a vCenter Server or
|
||||
|
@ -3521,6 +3535,36 @@ def _set_syslog_config_helper(host, username, password, syslog_config, config_va
|
|||
return ret_dict
|
||||
|
||||
|
||||
def add_host_to_vsphere(host, username, password, vsphere_protocol=None,
|
||||
vsphere_port=None, host_names=None, host_username=None,
|
||||
host_password=None):
|
||||
'''
|
||||
Add an ESX host to vSphere.
|
||||
:param host: vSphere hostname or IP
|
||||
:param username: Login to vSphere with this username
|
||||
:param password: Login to vSphere with this password
|
||||
:param vsphere_protocol:
|
||||
:param vsphere_port:
|
||||
:param host_names:
|
||||
:param host_username:
|
||||
:param host_password:
|
||||
:return:
|
||||
'''
|
||||
|
||||
service_instance = salt.utils.vmware.get_service_instance(host=host,
|
||||
username=username,
|
||||
password=password,
|
||||
protocol=protocol,
|
||||
port=port)
|
||||
|
||||
for host_name in host_names:
|
||||
# try:
|
||||
ret[host_name] = {}
|
||||
|
||||
ret[host_name].update({'status': False})
|
||||
host_ref = _get_host_ref(service_instance, host, host_name)
|
||||
|
||||
|
||||
def add_host_to_dvs(host, username, password, vmknic_name, vmnic_name,
|
||||
dvs_name, portgroup_name, protocol=None, port=None,
|
||||
host_names=None):
|
||||
|
@ -3624,5 +3668,3 @@ def add_host_to_dvs(host, username, password, vmknic_name, vmnic_name,
|
|||
# network_system.UpdateNetworkConfig(changeMode='modify',
|
||||
# config=host_network_config)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -306,6 +306,7 @@ def _get_dvs_uplink_portgroup(dvs, portgroup_name):
|
|||
|
||||
return None
|
||||
|
||||
|
||||
def get_inventory(service_instance):
|
||||
'''
|
||||
Return the inventory of a Service Instance Object.
|
||||
|
|
Loading…
Add table
Reference in a new issue