mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
more pylint
This commit is contained in:
parent
adfa462c05
commit
90a174c915
4 changed files with 7 additions and 8 deletions
|
@ -405,7 +405,7 @@ def init(opts):
|
|||
log.debug('Retrieving credentials and testing vCenter connection'
|
||||
' for mehchanism \'userpass\'')
|
||||
try:
|
||||
username, password = find_credentials()
|
||||
username, password = find_credentials(DETAILS['vcenter'])
|
||||
DETAILS['password'] = password
|
||||
except SaltSystemExit as err:
|
||||
log.critical('Error: {0}'.format(err))
|
||||
|
|
|
@ -101,7 +101,8 @@ import re
|
|||
from salt.ext import six
|
||||
import salt.utils.files
|
||||
from salt.exceptions import CommandExecutionError, InvalidConfigError, \
|
||||
VMwareObjectRetrievalError, VMwareSaltError, VMwareApiError
|
||||
VMwareObjectRetrievalError, VMwareSaltError, VMwareApiError, \
|
||||
ArgumentValueError
|
||||
from salt.utils.decorators import depends
|
||||
from salt.config.schemas.esxi import DiskGroupsDiskScsiAddressSchema, \
|
||||
HostCacheSchema
|
||||
|
@ -1415,7 +1416,6 @@ def host_cache_configured(name, enabled, datastore, swap_size='100%',
|
|||
'new': enabled}})
|
||||
needs_setting = True
|
||||
|
||||
|
||||
# Check datastores
|
||||
existing_datastores = None
|
||||
if host_cache.get('datastore'):
|
||||
|
|
|
@ -2473,7 +2473,7 @@ def get_scsi_address_to_lun_map(host_ref, storage_system=None, hostname=None):
|
|||
luns_to_key_map = {d.key: d for d in
|
||||
get_all_luns(host_ref, storage_system, hostname)}
|
||||
return {scsi_addr: luns_to_key_map[lun_key] for scsi_addr, lun_key in
|
||||
lun_ids_to_six.iteritems(scsi_addr_map)}
|
||||
six.iteritems(lun_ids_to_scsi_addr_map)}
|
||||
|
||||
|
||||
def get_disks(host_ref, disk_ids=None, scsi_addresses=None,
|
||||
|
@ -2698,9 +2698,9 @@ def get_diskgroups(host_ref, cache_disk_ids=None, get_all_disk_groups=False):
|
|||
vsan_disk_mappings = vsan_storage_info.diskMapping
|
||||
if not vsan_disk_mappings:
|
||||
return []
|
||||
disk_groups = [dm for dm in vsan_disk_mappings if
|
||||
(get_all_disk_groups or
|
||||
(dm.ssd.canonicalName in cache_disk_ids))]
|
||||
disk_groups = [dm for dm in vsan_disk_mappings if
|
||||
(get_all_disk_groups or
|
||||
(dm.ssd.canonicalName in cache_disk_ids))]
|
||||
log.trace('Retrieved disk groups on host \'{0}\', with cache disk ids : '
|
||||
'{1}'.format(hostname,
|
||||
[d.ssd.canonicalName for d in disk_groups]))
|
||||
|
|
|
@ -63,7 +63,6 @@ class GetHostsTestCase(TestCase):
|
|||
'Must specify the datacenter when specifying the '
|
||||
'cluster')
|
||||
|
||||
|
||||
def test_get_si_no_datacenter_no_cluster(self):
|
||||
mock_get_mors = MagicMock()
|
||||
mock_get_root_folder = MagicMock(return_value=self.mock_root_folder)
|
||||
|
|
Loading…
Add table
Reference in a new issue