]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix some warnings about 'unused variable' for XIO
authorJaveme <zhangmei.li@easystack.cn>
Tue, 29 Dec 2015 06:57:14 +0000 (14:57 +0800)
committerJaveme <zhangmei.li@easystack.cn>
Tue, 29 Dec 2015 06:57:14 +0000 (14:57 +0800)
Fix some warnings about 'unused variable' in xio driver and xio unit test.

Change-Id: Iab5d81800330e13f72705f8e689bb6b8f5126761

cinder/tests/unit/test_xio.py
cinder/volume/drivers/xio.py

index 1cdfc7c591d159ac3172a3132ff241ad71f0dbc5..9c922821fba2de666f413970e4a61ecaf1d14a1a 100644 (file)
@@ -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,
index c3b4d95bf13492dfa1ff0d3ee67692449159e30b..d0b111ed1ebaf8e404ab6f663ee8e4be6d725dd0 100644 (file)
@@ -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' % \