From: Javeme Date: Tue, 29 Dec 2015 06:57:14 +0000 (+0800) Subject: Fix some warnings about 'unused variable' for XIO X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6ccf3182c2f5402a75d1c031439923d1712aa497;p=openstack-build%2Fcinder-build.git Fix some warnings about 'unused variable' for XIO Fix some warnings about 'unused variable' in xio driver and xio unit test. Change-Id: Iab5d81800330e13f72705f8e689bb6b8f5126761 --- diff --git a/cinder/tests/unit/test_xio.py b/cinder/tests/unit/test_xio.py index 1cdfc7c59..9c922821f 100644 --- a/cinder/tests/unit/test_xio.py +++ b/cinder/tests/unit/test_xio.py @@ -863,7 +863,6 @@ class XIOISEDriverTestCase(object): protocol = 'iSCSI' else: protocol = 'fibre_channel' - exp_result = {} exp_result = {'vendor_name': "X-IO", 'driver_version': "1.1.3", 'volume_backend_name': backend_name, diff --git a/cinder/volume/drivers/xio.py b/cinder/volume/drivers/xio.py index c3b4d95bf..d0b111ed1 100644 --- a/cinder/volume/drivers/xio.py +++ b/cinder/volume/drivers/xio.py @@ -674,7 +674,6 @@ class XIOISEDriver(object): # Set up params with volume name, host name and target lun, if # specified. target_lun = lun - params = {} params = {'volumename': volume['name'], 'hostname': hostname} # Fill in LUN if specified. @@ -801,7 +800,6 @@ class XIOISEDriver(object): LOG.debug("Create host %(host)s; %(endpoint)s", {'host': hostname, 'endpoint': endpoint_str}) # Issue REST call to create host entry of OpenStack type. - params = {} params = {'name': hostname, 'endpoint': endpoint_str, 'os': 'openstack'} url = '/storage/arrays/%s/hosts' % (self._get_ise_globalid()) @@ -1016,8 +1014,7 @@ class XIOISEDriver(object): # count volumes volumes = child.find('volumes') if volumes is not None: - for volume in volumes: - vol_cnt += 1 + vol_cnt += len(volumes) return (pools, vol_cnt) def _update_volume_stats(self): @@ -1419,7 +1416,6 @@ class XIOISEISCSIDriver(driver.ISCSIDriver): self.driver.create_volume(volume) # Volume created successfully. Fill in CHAP information. model_update = {} - chap = {} chap = self.driver.find_target_chap() if chap['chap_user'] != '': model_update['provider_auth'] = 'CHAP %s %s' % \