]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Enable E121,E122,E123,E126,E128 hacking rules
authorZhiteng Huang <zhithuang@ebaysf.com>
Fri, 27 Jun 2014 19:03:00 +0000 (03:03 +0800)
committerZhiteng Huang <zhithuang@ebaysf.com>
Thu, 3 Jul 2014 11:58:44 +0000 (19:58 +0800)
This change enables E121,E122,E123,E126,E128 hacking rule and fixes
all violations found in Cinder.

Change-Id: Ibfdcb3e286393d932e1534500e31a5f90c031adf

23 files changed:
cinder/api/contrib/hosts.py
cinder/api/contrib/volume_actions.py
cinder/backup/drivers/tsm.py
cinder/backup/manager.py
cinder/brick/initiator/connector.py
cinder/image/image_utils.py
cinder/scheduler/filter_scheduler.py
cinder/scheduler/filters/capacity_filter.py
cinder/tests/api/contrib/test_services.py
cinder/tests/api/contrib/test_volume_actions.py
cinder/tests/api/v2/test_volumes.py
cinder/tests/test_hds_iscsi.py
cinder/tests/test_huawei_t_dorado.py
cinder/tests/test_image_utils.py
cinder/tests/test_solidfire.py
cinder/tests/test_storwize_svc.py
cinder/tests/test_volume_types.py
cinder/volume/api.py
cinder/volume/drivers/emc/emc_smis_common.py
cinder/volume/drivers/emc/emc_vnx_cli.py
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/netapp/common.py
tox.ini

index 93c64b7c30b035d61dce0390880429293ecaeb09..1fd5858d91954ccd01c9822c4d2c28fedfb8545e 100644 (file)
@@ -222,10 +222,10 @@ class HostController(wsgi.Controller):
         snap_count_total = 0
         snap_sum_total = 0
         resources = [{'resource': {'host': host, 'project': '(total)',
-                      'volume_count': str(count),
-                      'total_volume_gb': str(sum),
-                      'snapshot_count': str(snap_count_total),
-                      'total_snapshot_gb': str(snap_sum_total)}}]
+                                   'volume_count': str(count),
+                                   'total_volume_gb': str(sum),
+                                   'snapshot_count': str(snap_count_total),
+                                   'total_snapshot_gb': str(snap_sum_total)}}]
 
         project_ids = [v['project_id'] for v in volume_refs]
         project_ids = list(set(project_ids))
index f2859904addce4300ed1bc7d14b9ee4ab47d801b..2d14e4a457e6c9ed58c89a724184112618ddc648 100644 (file)
@@ -100,9 +100,9 @@ class VolumeActionsController(wsgi.Controller):
             msg = _("Invalid request to attach volume to an "
                     "instance %(instance_uuid)s and a "
                     "host %(host_name)s simultaneously") % {
-                        'instance_uuid': instance_uuid,
-                        'host_name': host_name,
-                    }
+                'instance_uuid': instance_uuid,
+                'host_name': host_name,
+            }
             raise webob.exc.HTTPBadRequest(explanation=msg)
         elif instance_uuid is None and host_name is None:
             msg = _("Invalid request to attach volume to an invalid target")
index 9dffdae734bc3378b8fb1176e800fac2117ab67f..60b73060c8d1db994dcb1b9670dd24564b967287 100644 (file)
@@ -324,8 +324,8 @@ class TSMBackupDriver(BackupDriver):
             restore_cmd.append('-replace=yes')  # suppress prompt
 
         restore_cmd.extend(['-quiet',
-                           '-password=%s' % self.tsm_password,
-                           backup_path])
+                            '-password=%s' % self.tsm_password,
+                            backup_path])
 
         if restore_path != backup_path:
             restore_cmd.append(restore_path)
index 0c4e9593fc387978e3deaab1ea5b9b340b51e3b7..7efa42f82a272b8cac43dab0174889d59fb53b58 100644 (file)
@@ -241,9 +241,9 @@ class BackupManager(manager.SchedulerDependentManager):
         if actual_status != expected_status:
             err = _('Create backup aborted, expected volume status '
                     '%(expected_status)s but got %(actual_status)s.') % {
-                        'expected_status': expected_status,
-                        'actual_status': actual_status,
-                    }
+                'expected_status': expected_status,
+                'actual_status': actual_status,
+            }
             self.db.backup_update(context, backup_id, {'status': 'error',
                                                        'fail_reason': err})
             raise exception.InvalidVolume(reason=err)
@@ -253,9 +253,9 @@ class BackupManager(manager.SchedulerDependentManager):
         if actual_status != expected_status:
             err = _('Create backup aborted, expected backup status '
                     '%(expected_status)s but got %(actual_status)s.') % {
-                        'expected_status': expected_status,
-                        'actual_status': actual_status,
-                    }
+                'expected_status': expected_status,
+                'actual_status': actual_status,
+            }
             self.db.volume_update(context, volume_id, {'status': 'available'})
             self.db.backup_update(context, backup_id, {'status': 'error',
                                                        'fail_reason': err})
@@ -333,9 +333,9 @@ class BackupManager(manager.SchedulerDependentManager):
                     ' configured [%(configured_service)s] is not the'
                     ' backup service that was used to create this'
                     ' backup [%(backup_service)s].') % {
-                        'configured_service': configured_service,
-                        'backup_service': backup_service,
-                    }
+                'configured_service': configured_service,
+                'backup_service': backup_service,
+            }
             self.db.backup_update(context, backup_id, {'status': 'available'})
             self.db.volume_update(context, volume_id, {'status': 'error'})
             raise exception.InvalidBackup(reason=err)
@@ -388,9 +388,9 @@ class BackupManager(manager.SchedulerDependentManager):
         if actual_status != expected_status:
             err = _('Delete_backup aborted, expected backup status '
                     '%(expected_status)s but got %(actual_status)s.') % {
-                        'expected_status': expected_status,
-                        'actual_status': actual_status,
-                    }
+                'expected_status': expected_status,
+                'actual_status': actual_status,
+            }
             self.db.backup_update(context, backup_id, {'status': 'error',
                                                        'fail_reason': err})
             raise exception.InvalidBackup(reason=err)
@@ -403,9 +403,9 @@ class BackupManager(manager.SchedulerDependentManager):
                         ' configured [%(configured_service)s] is not the'
                         ' backup service that was used to create this'
                         ' backup [%(backup_service)s].') % {
-                            'configured_service': configured_service,
-                            'backup_service': backup_service,
-                        }
+                    'configured_service': configured_service,
+                    'backup_service': backup_service,
+                }
                 self.db.backup_update(context, backup_id,
                                       {'status': 'error'})
                 raise exception.InvalidBackup(reason=err)
@@ -525,7 +525,7 @@ class BackupManager(manager.SchedulerDependentManager):
                 self.db.backup_update(context,
                                       backup_id,
                                       {'status': 'error',
-                                      'fail_reason': msg})
+                                       'fail_reason': msg})
                 raise exception.InvalidBackup(reason=msg)
 
             required_import_options = ['display_name',
index 57dbef26c114001839441a4108c0558f20d1a922..52c6b8355b0c2525e73b56baa76d1811fc7aa599 100644 (file)
@@ -199,11 +199,11 @@ class ISCSIConnector(InitiatorConnector):
             #multipath installed, discovering other targets if available
             target_portal = connection_properties['target_portal']
             out = self._run_iscsiadm_bare(['-m',
-                                          'discovery',
-                                          '-t',
-                                          'sendtargets',
-                                          '-p',
-                                          target_portal],
+                                           'discovery',
+                                           '-t',
+                                           'sendtargets',
+                                           '-p',
+                                           target_portal],
                                           check_exit_code=[0, 255])[0] \
                 or ""
 
@@ -361,10 +361,10 @@ class ISCSIConnector(InitiatorConnector):
         # Targets for multiple paths for the same multipath device
         # may not be the same.
         out = self._run_iscsiadm_bare(['-m',
-                                      'discovery',
-                                      '-t',
-                                      'sendtargets',
-                                      '-p',
+                                       'discovery',
+                                       '-t',
+                                       'sendtargets',
+                                       '-p',
                                       connection_properties['target_portal']],
                                       check_exit_code=[0, 255])[0] \
             or ""
@@ -599,9 +599,10 @@ class FibreChannelConnector(InitiatorConnector):
                 for wwn in wwns:
                     target_wwn = "0x%s" % wwn.lower()
                     host_device = ("/dev/disk/by-path/pci-%s-fc-%s-lun-%s" %
-                                  (pci_num,
-                                   target_wwn,
-                                   connection_properties.get('target_lun', 0)))
+                                   (pci_num,
+                                    target_wwn,
+                                    connection_properties.get(
+                                        'target_lun', 0)))
                     host_devices.append(host_device)
 
         if len(host_devices) == 0:
index 8e032335e28605623bb839a480f409ca3b613d8e..941181920a27a53c054095b0a478d44e8b010e79 100644 (file)
@@ -42,9 +42,9 @@ from cinder.volume import utils as volume_utils
 LOG = logging.getLogger(__name__)
 
 image_helper_opt = [cfg.StrOpt('image_conversion_dir',
-                    default='$state_path/conversion',
-                    help='Directory used for temporary storage '
-                         'during image conversion'), ]
+                               default='$state_path/conversion',
+                               help='Directory used for temporary storage '
+                                    'during image conversion'), ]
 
 CONF = cfg.CONF
 CONF.register_opts(image_helper_opt)
index 41ba8dedcec2842c82652b549aa0f3d17aa3cf5c..7af95d5b8263f2950a05e7902a6ddff3c17fc04d 100644 (file)
@@ -176,7 +176,7 @@ class FilterScheduler(driver.Scheduler):
                     'volume_id': volume_id,
                     'last_host': last_host,
                     'exc': exc,
-                }
+        }
         LOG.error(msg)
 
     def _populate_retry(self, filter_properties, properties):
@@ -208,7 +208,7 @@ class FilterScheduler(driver.Scheduler):
                     "volume %(volume_id)s") % {
                         'max_attempts': max_attempts,
                         'volume_id': volume_id,
-                    }
+            }
             raise exception.NoValidHost(reason=msg)
 
     def _get_weighted_candidates(self, context, request_spec,
index 4f06281d9128b6a9192120f5ee3aff92726ae7e8..b7b2bc039421c37a918c9608dcf368841369380d 100644 (file)
@@ -55,8 +55,8 @@ class CapacityFilter(filters.BaseHostFilter):
         free = math.floor(free_space * (1 - reserved))
         if free < volume_size:
             LOG.warning(_("Insufficient free space for volume creation "
-                        "(requested / avail): "
-                        "%(requested)s/%(available)s")
+                          "(requested / avail): "
+                          "%(requested)s/%(available)s")
                         % {'requested': volume_size,
                            'available': free})
 
index 0f26514351111e19dc485cc7a66fa20ff81fe9e9..92806d4e3b9e40b5c5c30466336f3881794e7d08 100644 (file)
@@ -154,21 +154,27 @@ class ServicesTest(test.TestCase):
         res_dict = self.controller.index(req)
 
         response = {'services': [{'binary': 'cinder-scheduler',
-                    'host': 'host1', 'zone': 'cinder',
-                    'status': 'disabled', 'state': 'up',
-                    'updated_at': datetime(2012, 10, 29, 13, 42, 2)},
-                    {'binary': 'cinder-volume',
-                     'host': 'host1', 'zone': 'cinder',
-                     'status': 'disabled', 'state': 'up',
-                     'updated_at': datetime(2012, 10, 29, 13, 42, 5)},
-                    {'binary': 'cinder-scheduler', 'host': 'host2',
-                     'zone': 'cinder',
-                     'status': 'enabled', 'state': 'down',
-                     'updated_at': datetime(2012, 9, 19, 6, 55, 34)},
-                    {'binary': 'cinder-volume', 'host': 'host2',
-                     'zone': 'cinder',
-                     'status': 'disabled', 'state': 'down',
-                     'updated_at': datetime(2012, 9, 18, 8, 3, 38)}]}
+                                  'host': 'host1', 'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'up',
+                                  'updated_at': datetime(
+                                      2012, 10, 29, 13, 42, 2)},
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host1', 'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'up',
+                                  'updated_at': datetime(
+                                      2012, 10, 29, 13, 42, 5)},
+                                 {'binary': 'cinder-scheduler',
+                                  'host': 'host2',
+                                  'zone': 'cinder',
+                                  'status': 'enabled', 'state': 'down',
+                                  'updated_at': datetime(
+                                      2012, 9, 19, 6, 55, 34)},
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host2',
+                                  'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'down',
+                                  'updated_at': datetime(
+                                      2012, 9, 18, 8, 3, 38)}]}
         self.assertEqual(res_dict, response)
 
     def test_services_detail(self):
@@ -178,25 +184,31 @@ class ServicesTest(test.TestCase):
         res_dict = self.controller.index(req)
 
         response = {'services': [{'binary': 'cinder-scheduler',
-                    'host': 'host1', 'zone': 'cinder',
-                    'status': 'disabled', 'state': 'up',
-                    'updated_at': datetime(2012, 10, 29, 13, 42, 2),
-                    'disabled_reason': 'test1'},
-                    {'binary': 'cinder-volume',
-                     'host': 'host1', 'zone': 'cinder',
-                     'status': 'disabled', 'state': 'up',
-                     'updated_at': datetime(2012, 10, 29, 13, 42, 5),
-                     'disabled_reason': 'test2'},
-                    {'binary': 'cinder-scheduler', 'host': 'host2',
-                     'zone': 'cinder',
-                     'status': 'enabled', 'state': 'down',
-                     'updated_at': datetime(2012, 9, 19, 6, 55, 34),
-                     'disabled_reason': ''},
-                    {'binary': 'cinder-volume', 'host': 'host2',
-                     'zone': 'cinder',
-                     'status': 'disabled', 'state': 'down',
-                     'updated_at': datetime(2012, 9, 18, 8, 3, 38),
-                     'disabled_reason': 'test4'}]}
+                                  'host': 'host1', 'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'up',
+                                  'updated_at': datetime(
+                                      2012, 10, 29, 13, 42, 2),
+                                  'disabled_reason': 'test1'},
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host1', 'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'up',
+                                  'updated_at': datetime(
+                                      2012, 10, 29, 13, 42, 5),
+                                  'disabled_reason': 'test2'},
+                                 {'binary': 'cinder-scheduler',
+                                  'host': 'host2',
+                                  'zone': 'cinder',
+                                  'status': 'enabled', 'state': 'down',
+                                  'updated_at': datetime(
+                                      2012, 9, 19, 6, 55, 34),
+                                  'disabled_reason': ''},
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host2',
+                                  'zone': 'cinder',
+                                  'status': 'disabled', 'state': 'down',
+                                  'updated_at': datetime(
+                                      2012, 9, 18, 8, 3, 38),
+                                  'disabled_reason': 'test4'}]}
         self.assertEqual(res_dict, response)
 
     def test_services_list_with_host(self):
@@ -209,7 +221,8 @@ class ServicesTest(test.TestCase):
                                   'status': 'disabled', 'state': 'up',
                                   'updated_at': datetime(2012, 10,
                                                          29, 13, 42, 2)},
-                                 {'binary': 'cinder-volume', 'host': 'host1',
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host1',
                                   'zone': 'cinder',
                                   'status': 'disabled', 'state': 'up',
                                   'updated_at': datetime(2012, 10, 29,
@@ -229,7 +242,8 @@ class ServicesTest(test.TestCase):
                                   'updated_at': datetime(2012, 10,
                                                          29, 13, 42, 2),
                                   'disabled_reason': 'test1'},
-                                 {'binary': 'cinder-volume', 'host': 'host1',
+                                 {'binary': 'cinder-volume',
+                                  'host': 'host1',
                                   'zone': 'cinder',
                                   'status': 'disabled', 'state': 'up',
                                   'updated_at': datetime(2012, 10, 29,
index 6a8f5b7a29babefef9e21ff3c5d541daba1466dd..c8c1feb3ed00aa9c3d46223e9a9629472c6b25d2 100644 (file)
@@ -508,16 +508,17 @@ class VolumeImageActionsTest(test.TestCase):
         body = {"os-volume_upload_image": vol}
         req = fakes.HTTPRequest.blank('/v2/tenant1/volumes/%s/action' % id)
         res_dict = self.controller._volume_upload_image(req, id, body)
-        expected = {'os-volume_upload_image': {'id': id,
-                    'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
-                    'status': 'uploading',
-                    'display_description': 'displaydesc',
-                    'size': 1,
-                    'volume_type': {'name': 'vol_type_name'},
-                    'image_id': 1,
-                    'container_format': 'bare',
-                    'disk_format': 'raw',
-                    'image_name': 'image_name'}}
+        expected = {'os-volume_upload_image':
+                    {'id': id,
+                     'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
+                     'status': 'uploading',
+                     'display_description': 'displaydesc',
+                     'size': 1,
+                     'volume_type': {'name': 'vol_type_name'},
+                     'image_id': 1,
+                     'container_format': 'bare',
+                     'disk_format': 'raw',
+                     'image_name': 'image_name'}}
         self.assertDictMatch(res_dict, expected)
 
     def test_copy_volume_to_image_volumenotfound(self):
index 7263eedcc2d758e5e8d0db62b75df79c4e84fc84..349e91b385c901c54f2894faa29a30ca17e52d2b 100644 (file)
@@ -194,10 +194,10 @@ class VolumeApiTest(test.TestCase):
                "availability_zone": "nova",
                "imageRef": 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'}
         ex = {'volume': {'attachments': [{'device': '/',
-                         'host_name': None,
-                         'id': '1',
-                         'server_id': 'fakeuuid',
-                         'volume_id': '1'}],
+                                          'host_name': None,
+                                          'id': '1',
+                                          'server_id': 'fakeuuid',
+                                          'volume_id': '1'}],
                          'availability_zone': 'nova',
                          'bootable': 'false',
                          'created_at': datetime.datetime(1, 1, 1, 1, 1, 1),
index d5f572884762ccbbb1d08cb43cec580dc19b2c6a..6a673ef2d8794cc04581bdbe4402551a20420a7a 100644 (file)
@@ -163,7 +163,7 @@ class SimulatedHnasBackend(object):
     def create_lu(self, cmd, ip0, user, pw, hdp, size, name):
         vol_id = name
         _out = ("LUN: %d HDP: fs2 size: %s MB, is successfully created" %
-               (self.start_lun, size))
+                (self.start_lun, size))
         self.createVolume(name, vol_id, size, "create-lu")
         self.start_lun += 1
         return _out
@@ -179,7 +179,7 @@ class SimulatedHnasBackend(object):
 
     def create_dup(self, cmd, ip0, user, pw, src_lun, hdp, size, name):
         _out = ("LUN: %s HDP: 9 size: %s MB, is successfully created" %
-               (self.start_lun, size))
+                (self.start_lun, size))
 
         id = name
         LOG.info("HNAS Create_Dup: %d" % self.start_lun)
index 1e641d67cab84f5d73372f4ddad6b4548234278e..b9bdf175f97622047ae2c63356366f7715e101d8 100644 (file)
@@ -366,7 +366,7 @@ class HuaweiTCLIResSimulator():
             if LUN_INFO['ID'] is None:
                 out = 'command operates successfully, but no information.'
             elif CLONED_LUN_INFO['ID'] is None:
-                out = """/>showlun
+                msg = """/>showlun
 ===========================================================================
                            LUN Information
 ---------------------------------------------------------------------------
@@ -375,10 +375,13 @@ class HuaweiTCLIResSimulator():
 ---------------------------------------------------------------------------
   %s    %s    --    Normal    %s    %s    %s    64    THICK
 ===========================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-       str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'])
+"""
+                out = msg % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'],
+                             LUN_INFO['Owner Controller'],
+                             str(int(LUN_INFO['Size']) * 1024),
+                             LUN_INFO['Name'])
             else:
-                out = """/>showlun
+                msg = """/>showlun
 ============================================================================
                                LUN Information
 ----------------------------------------------------------------------------
@@ -388,15 +391,18 @@ class HuaweiTCLIResSimulator():
   %s    %s    --    Normal    %s    %s    %s    64    THICK
   %s    %s    --    Normal    %s    %s    %s    64    THICK
 ============================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-       str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'],
-       CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['RAID Group ID'],
-       CLONED_LUN_INFO['Owner Controller'],
-       str(int(CLONED_LUN_INFO['Size']) * 1024),
-       CLONED_LUN_INFO['Name'])
+"""
+                out = msg % (
+                    LUN_INFO['ID'], LUN_INFO['RAID Group ID'],
+                    LUN_INFO['Owner Controller'],
+                    str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'],
+                    CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['RAID Group ID'],
+                    CLONED_LUN_INFO['Owner Controller'],
+                    str(int(CLONED_LUN_INFO['Size']) * 1024),
+                    CLONED_LUN_INFO['Name'])
 
         elif params[params.index('-lun') + 1] in VOLUME_SNAP_ID.values():
-            out = """/>showlun
+            msg = """/>showlun
 ================================================
                  LUN Information
 ------------------------------------------------
@@ -411,17 +417,23 @@ class HuaweiTCLIResSimulator():
   SnapShot ID            |  %s
   LunCopy ID             |  %s
 ================================================
-""" % ((LUN_INFO['ID'], LUN_INFO['Name'], LUN_INFO['Visible Capacity'],
-        LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-        LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
-        LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
-       if params[params.index('-lun') + 1] == VOLUME_SNAP_ID['vol'] else
-       (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
-        CLONED_LUN_INFO['Visible Capacity'], CLONED_LUN_INFO['RAID Group ID'],
-        CLONED_LUN_INFO['Owner Controller'],
-        CLONED_LUN_INFO['Worker Controller'],
-        CLONED_LUN_INFO['Lun Type'], CLONED_LUN_INFO['SnapShot ID'],
-        CLONED_LUN_INFO['LunCopy ID']))
+"""
+            out = msg % (
+                (LUN_INFO['ID'], LUN_INFO['Name'],
+                 LUN_INFO['Visible Capacity'],
+                 LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
+                 LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
+                 LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
+                if (params[params.index('-lun') + 1] ==
+                    VOLUME_SNAP_ID['vol']) else
+                (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
+                 CLONED_LUN_INFO['Visible Capacity'],
+                 CLONED_LUN_INFO['RAID Group ID'],
+                 CLONED_LUN_INFO['Owner Controller'],
+                 CLONED_LUN_INFO['Worker Controller'],
+                 CLONED_LUN_INFO['Lun Type'],
+                 CLONED_LUN_INFO['SnapShot ID'],
+                 CLONED_LUN_INFO['LunCopy ID']))
         else:
             out = 'ERROR: The object does not exist.'
         return out
@@ -452,7 +464,7 @@ class HuaweiTCLIResSimulator():
         return out
 
     def cli_showrg(self, params):
-        out = """/>showrg
+        msg = """/>showrg
 =====================================================================
                       RAID Group Information
 ---------------------------------------------------------------------
@@ -461,9 +473,10 @@ class HuaweiTCLIResSimulator():
   0     RAID6    Normal    1024                 0,0;0,2;     RAID003
   %s    %s       %s        %s                   %s           %s
 =====================================================================
--""" % (POOL_SETTING['ID'], POOL_SETTING['Level'],
-        POOL_SETTING['Status'], POOL_SETTING['Free Capacity'],
-        POOL_SETTING['Disk List'], POOL_SETTING['Name'])
+-"""
+        out = msg % (POOL_SETTING['ID'], POOL_SETTING['Level'],
+                     POOL_SETTING['Status'], POOL_SETTING['Free Capacity'],
+                     POOL_SETTING['Disk List'], POOL_SETTING['Name'])
         return out
 
     def cli_showpool(self, params):
@@ -499,7 +512,7 @@ class HuaweiTCLIResSimulator():
             LUNCOPY_INFO['State'] = 'Copying'
         elif LUNCOPY_INFO['State'] == 'Copying':
             LUNCOPY_INFO['State'] = 'Complete'
-        out = """/>showluncopy
+        msg = """/>showluncopy
 ============================================================================
                             LUN Copy Information
 ----------------------------------------------------------------------------
@@ -507,8 +520,10 @@ class HuaweiTCLIResSimulator():
 ----------------------------------------------------------------------------
   %s               %s             %s      %s                %s
 ============================================================================
-""" % (LUNCOPY_INFO['Name'], LUNCOPY_INFO['ID'], LUNCOPY_INFO['Type'],
-       LUNCOPY_INFO['State'], LUNCOPY_INFO['Status'])
+"""
+        out = msg % (LUNCOPY_INFO['Name'], LUNCOPY_INFO['ID'],
+                     LUNCOPY_INFO['Type'], LUNCOPY_INFO['State'],
+                     LUNCOPY_INFO['Status'])
         return out
 
     def cli_delluncopy(self, params):
@@ -566,7 +581,7 @@ class HuaweiTCLIResSimulator():
         return out
 
     def cli_showrespool(self, params):
-        out = """/>showrespool
+        msg = """/>showrespool
 ===========================================================================
                          Resource Pool Information
 ---------------------------------------------------------------------------
@@ -575,8 +590,9 @@ class HuaweiTCLIResSimulator():
   A          %s          0.0          %s                80
   B          %s          0.0         %s                80
 ===========================================================================
--""" % (RESPOOL_A_SIM['Size'], RESPOOL_A_SIM['Valid Size'],
-        RESPOOL_B_SIM['Size'], RESPOOL_B_SIM['Valid Size'])
+-"""
+        out = msg % (RESPOOL_A_SIM['Size'], RESPOOL_A_SIM['Valid Size'],
+                     RESPOOL_B_SIM['Size'], RESPOOL_B_SIM['Valid Size'])
         return out
 
     def cli_showiscsitgtname(self, params):
@@ -696,7 +712,7 @@ class HuaweiTCLIResSimulator():
         if MAP_INFO['INI Port ID'] is None:
             out = 'command operates successfully, but no information.'
         else:
-            out = """/>showhostport
+            msg = """/>showhostport
 ============================================================================
                         Host Port Information
 ----------------------------------------------------------------------------
@@ -705,9 +721,10 @@ Multipath Type
 ----------------------------------------------------------------------------
  %s      %s       %s       %s       %s       Unconnected       Default
 ============================================================================
-""" % (MAP_INFO['INI Port ID'], MAP_INFO['INI Port Name'],
-       MAP_INFO['INI Port Info'], MAP_INFO['INI Port Type'],
-       MAP_INFO['Host ID'])
+"""
+            out = msg % (MAP_INFO['INI Port ID'], MAP_INFO['INI Port Name'],
+                         MAP_INFO['INI Port Info'], MAP_INFO['INI Port Type'],
+                         MAP_INFO['Host ID'])
         return out
 
     def cli_addhostport(self, params):
@@ -734,7 +751,7 @@ Multipath Type
         if MAP_INFO['DEV LUN ID'] is None:
             out = 'command operates successfully, but no information.'
         else:
-            out = """/>showhostmap
+            msg = """/>showhostmap
 ===========================================================================
                            Map Information
 ---------------------------------------------------------------------------
@@ -743,9 +760,11 @@ Multipath Type
 ----------------------------------------------------------------------------
   2147483649   %s   %s   %s   %s   Host: %s   %s   %s   HOST   No   --
 ============================================================================
-""" % (LUN_INFO['Worker Controller'], LUN_INFO['ID'], LUN_INFO['LUN WWN'],
-       MAP_INFO['Host LUN ID'], MAP_INFO['Host ID'], LUN_INFO['RAID Group ID'],
-       str(int(LUN_INFO['Size']) * 1024))
+"""
+            out = msg % (LUN_INFO['Worker Controller'], LUN_INFO['ID'],
+                         LUN_INFO['LUN WWN'], MAP_INFO['Host LUN ID'],
+                         MAP_INFO['Host ID'], LUN_INFO['RAID Group ID'],
+                         str(int(LUN_INFO['Size']) * 1024))
         return out
 
     def cli_addhostmap(self, params):
@@ -854,7 +873,7 @@ class HuaweiDorado5100CLIResSimulator(HuaweiTCLIResSimulator):
             if LUN_INFO['ID'] is None:
                 out = 'command operates successfully, but no information.'
             elif CLONED_LUN_INFO['ID'] is None:
-                out = """/>showlun
+                msg = """/>showlun
 ===========================================================================
                            LUN Information
 ---------------------------------------------------------------------------
@@ -863,11 +882,13 @@ class HuaweiDorado5100CLIResSimulator(HuaweiTCLIResSimulator):
 ---------------------------------------------------------------------------
   %s      %s       Normal       %s      %s       %s       64       THICK
 ===========================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'],
-       LUN_INFO['Owner Controller'], str(int(LUN_INFO['Size']) * 1024),
-       LUN_INFO['Name'])
+"""
+                out = msg % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'],
+                             LUN_INFO['Owner Controller'],
+                             str(int(LUN_INFO['Size']) * 1024),
+                             LUN_INFO['Name'])
             else:
-                out = """/>showlun
+                msg = """/>showlun
 ===========================================================================
                            LUN Information
 ---------------------------------------------------------------------------
@@ -877,14 +898,17 @@ class HuaweiDorado5100CLIResSimulator(HuaweiTCLIResSimulator):
   %s      %s       Normal      %s      %s       %s        64       THICK
   %s      %s       Norma       %s      %s       %s        64       THICK
 ===========================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-       str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'],
-       CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['RAID Group ID'],
-       CLONED_LUN_INFO['Owner Controller'],
-       str(int(CLONED_LUN_INFO['Size']) * 1024),
-       CLONED_LUN_INFO['Name'])
+"""
+                out = msg % (LUN_INFO['ID'], LUN_INFO['RAID Group ID'],
+                             LUN_INFO['Owner Controller'],
+                             str(int(LUN_INFO['Size']) * 1024),
+                             LUN_INFO['Name'], CLONED_LUN_INFO['ID'],
+                             CLONED_LUN_INFO['RAID Group ID'],
+                             CLONED_LUN_INFO['Owner Controller'],
+                             str(int(CLONED_LUN_INFO['Size']) * 1024),
+                             CLONED_LUN_INFO['Name'])
         elif params[params.index('-lun') + 1] in VOLUME_SNAP_ID.values():
-            out = """/>showlun
+            msg = """/>showlun
 ================================================
                  LUN Information
 ------------------------------------------------
@@ -899,17 +923,22 @@ class HuaweiDorado5100CLIResSimulator(HuaweiTCLIResSimulator):
   SnapShot ID            |  %s
   LunCopy ID             |  %s
 ================================================
-""" % ((LUN_INFO['ID'], LUN_INFO['Name'], LUN_INFO['Visible Capacity'],
-        LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-        LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
-        LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
-       if params[params.index('-lun') + 1] == VOLUME_SNAP_ID['vol'] else
-       (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
-        CLONED_LUN_INFO['Visible Capacity'], CLONED_LUN_INFO['RAID Group ID'],
-        CLONED_LUN_INFO['Owner Controller'],
-        CLONED_LUN_INFO['Worker Controller'],
-        CLONED_LUN_INFO['Lun Type'], CLONED_LUN_INFO['SnapShot ID'],
-        CLONED_LUN_INFO['LunCopy ID']))
+"""
+            out = msg % (
+                (LUN_INFO['ID'], LUN_INFO['Name'],
+                 LUN_INFO['Visible Capacity'],
+                 LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
+                 LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
+                 LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
+                if (params[params.index('-lun') + 1] ==
+                    VOLUME_SNAP_ID['vol']) else
+                (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
+                 CLONED_LUN_INFO['Visible Capacity'],
+                 CLONED_LUN_INFO['RAID Group ID'],
+                 CLONED_LUN_INFO['Owner Controller'],
+                 CLONED_LUN_INFO['Worker Controller'],
+                 CLONED_LUN_INFO['Lun Type'], CLONED_LUN_INFO['SnapShot ID'],
+                 CLONED_LUN_INFO['LunCopy ID']))
         else:
             out = 'ERROR: The object does not exist.'
         return out
@@ -962,7 +991,7 @@ class HuaweiDorado2100G2CLIResSimulator(HuaweiTCLIResSimulator):
             if LUN_INFO['ID'] is None:
                 out = 'command operates successfully, but no information.'
             elif CLONED_LUN_INFO['ID'] is None:
-                out = """/>showlun
+                msg = """/>showlun
 ===========================================================================
                            LUN Information
 ---------------------------------------------------------------------------
@@ -970,10 +999,12 @@ class HuaweiDorado2100G2CLIResSimulator(HuaweiTCLIResSimulator):
 ---------------------------------------------------------------------------
   %s   Normal   %s          %s                     %s        THICK
 ===========================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['Owner Controller'],
-       str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'])
+"""
+                out = msg % (LUN_INFO['ID'], LUN_INFO['Owner Controller'],
+                             str(int(LUN_INFO['Size']) * 1024),
+                             LUN_INFO['Name'])
             else:
-                out = """/>showlun
+                msg = """/>showlun
 ===========================================================================
                            LUN Information
 ---------------------------------------------------------------------------
@@ -982,13 +1013,17 @@ class HuaweiDorado2100G2CLIResSimulator(HuaweiTCLIResSimulator):
   %s   Normal   %s          %s                     %s         THICK
   %s   Normal   %s          %s                     %s         THICK
 ===========================================================================
-""" % (LUN_INFO['ID'], LUN_INFO['Owner Controller'],
-       str(int(LUN_INFO['Size']) * 1024), LUN_INFO['Name'],
-       CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Owner Controller'],
-       str(int(CLONED_LUN_INFO['Size']) * 1024), CLONED_LUN_INFO['Name'])
+"""
+                out = msg % (LUN_INFO['ID'], LUN_INFO['Owner Controller'],
+                             str(int(LUN_INFO['Size']) * 1024),
+                             LUN_INFO['Name'],
+                             CLONED_LUN_INFO['ID'],
+                             CLONED_LUN_INFO['Owner Controller'],
+                             str(int(CLONED_LUN_INFO['Size']) * 1024),
+                             CLONED_LUN_INFO['Name'])
 
         elif params[params.index('-lun') + 1] in VOLUME_SNAP_ID.values():
-            out = """/>showlun
+            msg = """/>showlun
 ================================================
                  LUN Information
 ------------------------------------------------
@@ -1003,17 +1038,21 @@ class HuaweiDorado2100G2CLIResSimulator(HuaweiTCLIResSimulator):
   SnapShot ID            |  %s
   LunCopy ID             |  %s
 ================================================
-""" % ((LUN_INFO['ID'], LUN_INFO['Name'], LUN_INFO['Visible Capacity'],
-        LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
-        LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
-        LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
-       if params[params.index('-lun')] == VOLUME_SNAP_ID['vol'] else
-       (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
-        CLONED_LUN_INFO['Visible Capacity'], CLONED_LUN_INFO['RAID Group ID'],
-        CLONED_LUN_INFO['Owner Controller'],
-        CLONED_LUN_INFO['Worker Controller'],
-        CLONED_LUN_INFO['Lun Type'], CLONED_LUN_INFO['SnapShot ID'],
-        CLONED_LUN_INFO['LunCopy ID']))
+"""
+            out = msg % (
+                (LUN_INFO['ID'], LUN_INFO['Name'],
+                 LUN_INFO['Visible Capacity'],
+                 LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
+                 LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
+                 LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
+                if params[params.index('-lun')] == VOLUME_SNAP_ID['vol'] else
+                (CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
+                 CLONED_LUN_INFO['Visible Capacity'],
+                 CLONED_LUN_INFO['RAID Group ID'],
+                 CLONED_LUN_INFO['Owner Controller'],
+                 CLONED_LUN_INFO['Worker Controller'],
+                 CLONED_LUN_INFO['Lun Type'], CLONED_LUN_INFO['SnapShot ID'],
+                 CLONED_LUN_INFO['LunCopy ID']))
 
         else:
             out = 'ERROR: The object does not exist.'
index f06cd904de5b20d370e7860459814ad21508e094..32d8421473f48242c672a3babb43fbccfec77861 100644 (file)
@@ -121,8 +121,7 @@ class TestUtils(test.TestCase):
         utils.execute(
             'env', 'LC_ALL=C', 'qemu-img', 'info',
             TEST_PATH, run_as_root=True).AndReturn(
-                (TEST_RETURN, 'ignored')
-            )
+                (TEST_RETURN, 'ignored'))
 
         mox.ReplayAll()
 
@@ -228,8 +227,7 @@ class TestUtils(test.TestCase):
             utils.execute(
                 'env', 'LC_ALL=C', 'qemu-img', 'info',
                 self.TEST_DEV_PATH, run_as_root=True).AndReturn(
-                    (src_inf, 'ignored')
-                )
+                    (src_inf, 'ignored'))
 
         if has_qemu and dest_inf:
             if bps_limit:
@@ -249,8 +247,7 @@ class TestUtils(test.TestCase):
             utils.execute(
                 'env', 'LC_ALL=C', 'qemu-img', 'info',
                 self.TEST_DEV_PATH, run_as_root=True).AndReturn(
-                    (dest_inf, 'ignored')
-                )
+                    (dest_inf, 'ignored'))
 
         self._mox.ReplayAll()
 
@@ -378,8 +375,7 @@ class TestUtils(test.TestCase):
         utils.execute(
             'env', 'LC_ALL=C', 'qemu-img', 'info',
             self.TEST_DEV_PATH, run_as_root=True).AndReturn(
-                (qemu_info, 'ignored')
-            )
+                (qemu_info, 'ignored'))
 
         self._mox.ReplayAll()
         self.assertRaises(exception.ImageUnacceptable,
@@ -450,8 +446,7 @@ class TestUtils(test.TestCase):
         utils.execute(
             'env', 'LC_ALL=C', 'qemu-img', 'info',
             mox.IgnoreArg(), run_as_root=True).AndReturn(
-                (TEST_RET, 'ignored')
-            )
+                (TEST_RET, 'ignored'))
 
         m.ReplayAll()
 
@@ -491,8 +486,7 @@ class TestUtils(test.TestCase):
         utils.execute(
             'env', 'LC_ALL=C', 'qemu-img', 'info',
             mox.IgnoreArg(), run_as_root=True).AndReturn(
-                (TEST_RET, 'ignored')
-            )
+                (TEST_RET, 'ignored'))
 
         m.ReplayAll()
 
@@ -510,8 +504,7 @@ class TestExtractTo(test.TestCase):
 
         utils.execute(
             'tar', '-xzf', 'archive.tgz', '-C', 'targetpath').AndReturn(
-                ('ignored', 'ignored')
-            )
+                ('ignored', 'ignored'))
 
         mox.ReplayAll()
 
@@ -526,8 +519,7 @@ class TestSetVhdParent(test.TestCase):
 
         utils.execute(
             'vhd-util', 'modify', '-n', 'child', '-p', 'parent').AndReturn(
-                ('ignored', 'ignored')
-            )
+                ('ignored', 'ignored'))
 
         mox.ReplayAll()
 
@@ -567,8 +559,7 @@ class TestGetSize(test.TestCase):
 
         utils.execute(
             'vhd-util', 'query', '-n', 'vhdfile', '-v').AndReturn(
-                ('1024', 'ignored')
-            )
+                ('1024', 'ignored'))
 
         mox.ReplayAll()
 
index fb462f9a67d315bd5732274efc9281101e78835f..189e04b03f03c3a95178fa6f85ab0677d0e3150d 100644 (file)
@@ -61,10 +61,10 @@ class SolidFireVolumeTestCase(test.TestCase):
             LOG.info('Called Fake GetClusterCapacity...')
             data = {'result':
                     {'clusterCapacity': {'maxProvisionedSpace': 107374182400,
-                     'usedSpace': 1073741824,
-                     'compressionPercent': 100,
-                     'deDuplicationPercent': 100,
-                     'thinProvisioningPercent': 100}}}
+                                         'usedSpace': 1073741824,
+                                         'compressionPercent': 100,
+                                         'deDuplicationPercent': 100,
+                                         'thinProvisioningPercent': 100}}}
             return data
 
         elif method is 'GetClusterInfo' and version == '1.0':
index bf32c4fbc3ce2441e54df761c077cdfcaa64a724..375594a09087994a9bccba6e2f163d74a3f89c4c 100644 (file)
@@ -505,8 +505,8 @@ port_speed!N/A
         for host_info in host_infos:
             for wwpn in host_info['wwpns']:
                 rows.append([wwpn, '123456', host_info['id'], 'nodeN',
-                            'AABBCCDDEEFF0011', '1', '0123ABC', 'active',
-                            host_info['host_name'], '', 'host'])
+                             'AABBCCDDEEFF0011', '1', '0123ABC', 'active',
+                             host_info['host_name'], '', 'host'])
 
         if self._next_cmd_error['lsfabric'] == 'header_mismatch':
             rows[0].pop(0)
@@ -664,13 +664,13 @@ port_speed!N/A
                 else:
                     cap = vol['capacity']
                 rows.append([str(vol['id']), vol['name'], vol['IO_group_id'],
-                            vol['IO_group_name'], 'online', '0',
-                            self._flags['storwize_svc_volpool_name'],
-                            cap, 'striped',
-                            fcmap_info['fc_id'], fcmap_info['fc_name'],
-                            '', '', vol['uid'],
-                            fcmap_info['fc_map_count'], '1', 'empty',
-                            '1', 'no'])
+                             vol['IO_group_name'], 'online', '0',
+                             self._flags['storwize_svc_volpool_name'],
+                             cap, 'striped',
+                             fcmap_info['fc_id'], fcmap_info['fc_name'],
+                             '', '', vol['uid'],
+                             fcmap_info['fc_map_count'], '1', 'empty',
+                             '1', 'no'])
 
         if 'obj' not in kwargs:
             return self._print_info_cmd(rows=rows, **kwargs)
@@ -1191,10 +1191,10 @@ port_speed!N/A
                     to_delete.append(k)
                 else:
                     rows.append([v['id'], v['name'], source['id'],
-                                source['name'], target['id'], target['name'],
-                                '', '', v['status'], v['progress'],
-                                v['copyrate'], '100', 'off', '', '', 'no', '',
-                                'no'])
+                                 source['name'], target['id'], target['name'],
+                                 '', '', v['status'], v['progress'],
+                                 v['copyrate'], '100', 'off', '', '', 'no', '',
+                                 'no'])
 
         for d in to_delete:
             del self._fcmappings_list[d]
index 8dad322e02836d51041fc603fd0845fa34977862..f7433df28833d3268f1fbbd6380a14938b26115f 100644 (file)
@@ -217,7 +217,7 @@ class VolumeTypeTestCase(test.TestCase):
                                                               'k2': 'v2',
                                                               'k3': 'v3'})
         type_ref = volume_types.create(self.ctxt, "type1", {"key2": "val2",
-                                                  "key3": "val3"})
+                                                            "key3": "val3"})
         res = volume_types.get_volume_type_qos_specs(type_ref['id'])
         self.assertIsNone(res['qos_specs'])
         qos_specs.associate_qos_with_type(self.ctxt,
index 39e9d9fc51d834537dbc950b892c049c60247256..875bee62ec24cc6d936cd580ef83ac3b04d43230 100644 (file)
@@ -735,7 +735,7 @@ class API(base.Base):
                 volume_image_metadata = self.get_volume_image_metadata(context,
                                                                        volume)
                 custom_property_set = (set(volume_image_metadata).difference
-                                      (set(glance_core_properties)))
+                                       (set(glance_core_properties)))
                 if custom_property_set:
                     metadata.update(dict(properties=dict((custom_property,
                                                           volume_image_metadata
index d457d8a6446904b785dc5668193c29a3ea83cf98..9dbba5808e6e91087f4aaeba9c5d224e2d07f4b4 100644 (file)
@@ -108,8 +108,8 @@ class EMCSMISCommon():
             storage_system)
         if configservice is None:
             exception_message = (_("Error Create Volume: %(volumename)s. "
-                                 "Storage Configuration Service not found for "
-                                 "pool %(storage_type)s.")
+                                   "Storage Configuration Service not found "
+                                   "for pool %(storage_type)s.")
                                  % {'volumename': volumename,
                                     'storage_type': storage_type})
             LOG.error(exception_message)
@@ -199,9 +199,9 @@ class EMCSMISCommon():
         isVMAX = storage_system.find('SYMMETRIX')
         if isVMAX > -1:
             exception_message = (_('Error Create Volume from Snapshot: '
-                                 'Volume: %(volumename)s  Snapshot: '
-                                 '%(snapshotname)s. Create Volume '
-                                 'from Snapshot is NOT supported on VMAX.')
+                                   'Volume: %(volumename)s  Snapshot: '
+                                   '%(snapshotname)s. Create Volume '
+                                   'from Snapshot is NOT supported on VMAX.')
                                  % {'volumename': volumename,
                                     'snapshotname': snapshotname})
             LOG.error(exception_message)
@@ -210,9 +210,9 @@ class EMCSMISCommon():
         repservice = self._find_replication_service(storage_system)
         if repservice is None:
             exception_message = (_('Error Create Volume from Snapshot: '
-                                 'Volume: %(volumename)s  Snapshot: '
-                                 '%(snapshotname)s. Cannot find Replication '
-                                 'Service to create volume from snapshot.')
+                                   'Volume: %(volumename)s  Snapshot: '
+                                   '%(snapshotname)s. Cannot find Replication '
+                                   'Service to create volume from snapshot.')
                                  % {'volumename': volumename,
                                     'snapshotname': snapshotname})
             LOG.error(exception_message)
@@ -240,9 +240,9 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Create Volume from Snapshot: '
-                                     'Volume: %(volumename)s  Snapshot:'
-                                     '%(snapshotname)s.  Return code: %(rc)lu.'
-                                     'Error: %(error)s')
+                                       'Volume: %(volumename)s  Snapshot:'
+                                       '%(snapshotname)s.  Return code: '
+                                       '%(rc)lu. Error: %(error)s')
                                      % {'volumename': volumename,
                                         'snapshotname': snapshotname,
                                         'rc': rc,
@@ -303,9 +303,10 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Create Volume from Snapshot: '
-                                     'Volume: %(volumename)s  '
-                                     'Snapshot: %(snapshotname)s.  '
-                                     'Return code: %(rc)lu.  Error: %(error)s')
+                                       'Volume: %(volumename)s  '
+                                       'Snapshot: %(snapshotname)s.  '
+                                       'Return code: %(rc)lu.  Error: '
+                                       '%(error)s')
                                      % {'volumename': volumename,
                                         'snapshotname': snapshotname,
                                         'rc': rc,
@@ -351,9 +352,9 @@ class EMCSMISCommon():
         repservice = self._find_replication_service(storage_system)
         if repservice is None:
             exception_message = (_('Error Create Cloned Volume: '
-                                 'Volume: %(volumename)s  Source Volume: '
-                                 '%(srcname)s. Cannot find Replication '
-                                 'Service to create cloned volume.')
+                                   'Volume: %(volumename)s  Source Volume: '
+                                   '%(srcname)s. Cannot find Replication '
+                                   'Service to create cloned volume.')
                                  % {'volumename': volumename,
                                     'srcname': srcname})
             LOG.error(exception_message)
@@ -381,9 +382,9 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Create Cloned Volume: '
-                                     'Volume: %(volumename)s  Source Volume:'
-                                     '%(srcname)s.  Return code: %(rc)lu.'
-                                     'Error: %(error)s')
+                                       'Volume: %(volumename)s  Source Volume:'
+                                       '%(srcname)s.  Return code: %(rc)lu.'
+                                       'Error: %(error)s')
                                      % {'volumename': volumename,
                                         'srcname': srcname,
                                         'rc': rc,
@@ -444,9 +445,10 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Create Cloned Volume: '
-                                     'Volume: %(volumename)s  '
-                                     'Source Volume: %(srcname)s.  '
-                                     'Return code: %(rc)lu.  Error: %(error)s')
+                                       'Volume: %(volumename)s  '
+                                       'Source Volume: %(srcname)s.  '
+                                       'Return code: %(rc)lu.  Error: '
+                                       '%(error)s')
                                      % {'volumename': volumename,
                                         'srcname': srcname,
                                         'rc': rc,
@@ -486,7 +488,7 @@ class EMCSMISCommon():
             self._find_storage_configuration_service(storage_system)
         if configservice is None:
             exception_message = (_("Error Delete Volume: %(volumename)s. "
-                                 "Storage Configuration Service not found.")
+                                   "Storage Configuration Service not found.")
                                  % {'volumename': volumename})
             LOG.error(exception_message)
             raise exception.VolumeBackendAPIException(data=exception_message)
@@ -512,7 +514,8 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Delete Volume: %(volumename)s.  '
-                                     'Return code: %(rc)lu.  Error: %(error)s')
+                                       'Return code: %(rc)lu.  Error: '
+                                       '%(error)s')
                                      % {'volumename': volumename,
                                         'rc': rc,
                                         'error': errordesc})
@@ -581,7 +584,8 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Create Snapshot: %(snapshot)s '
-                                     'Volume: %(volume)s Error: %(errordesc)s')
+                                       'Volume: %(volume)s Error: '
+                                       '%(errordesc)s')
                                      % {'snapshot': snapshotname, 'volume':
                                         volumename, 'errordesc': errordesc})
                 LOG.error(exception_message)
@@ -669,9 +673,9 @@ class EMCSMISCommon():
             rc, errordesc = self._wait_for_job_complete(job)
             if rc != 0L:
                 exception_message = (_('Error Delete Snapshot: Volume: '
-                                     '%(volumename)s  Snapshot: '
-                                     '%(snapshotname)s. Return code: %(rc)lu.'
-                                     ' Error: %(error)s')
+                                       '%(volumename)s  Snapshot: '
+                                       '%(snapshotname)s. Return code: '
+                                       '%(rc)lu.  Error: %(error)s')
                                      % {'volumename': volumename,
                                         'snapshotname': snapshotname,
                                         'rc': rc,
@@ -694,7 +698,7 @@ class EMCSMISCommon():
                     self._find_storage_sync_sv_sv(snapshot, volume, False)
                 if sync_name is None:
                     LOG.info(_('Snapshot: %(snapshot)s: volume: %(volume)s. '
-                             'Snapshot is deleted.')
+                               'Snapshot is deleted.')
                              % {'snapshot': snapshotname,
                                 'volume': volumename})
                     break
@@ -709,7 +713,7 @@ class EMCSMISCommon():
                 if ex.args[0] == 6:
                     # 6 means object not found, so snapshot is deleted cleanly
                     LOG.info(_('Snapshot: %(snapshot)s: volume: %(volume)s. '
-                             'Snapshot is deleted.')
+                               'Snapshot is deleted.')
                              % {'snapshot': snapshotname,
                                 'volume': volumename})
                 else:
index 1368b732a56346a7524c252b7c9f8743fe42c735..ce0b3edd4b542c3908f9d211c302571ecbca702d 100644 (file)
@@ -212,8 +212,8 @@ class EMCVnxCli(object):
                      'out': out})
         if rc == 97:
             msg = (_('The LUN cannot be expanded or shrunk because '
-                   'it has snapshots. Command to extend the specified '
-                   'volume failed.'))
+                     'it has snapshots. Command to extend the specified '
+                     'volume failed.'))
             LOG.error(msg)
             raise exception.VolumeBackendAPIException(data=msg)
         if rc != 0:
@@ -601,9 +601,9 @@ class EMCVnxCli(object):
 
                     if len(host_lun_id_list) >= self.max_luns:
                         msg = (_('The storage group has reached the '
-                               'maximum capacity of LUNs. '
-                               'Command to add LUN for volume - %s '
-                               'in storagegroup failed') % (volumename))
+                                 'maximum capacity of LUNs. '
+                                 'Command to add LUN for volume - %s '
+                                 'in storagegroup failed') % (volumename))
                         LOG.error(msg)
                         raise exception.VolumeBackendAPIException(data=msg)
 
@@ -611,10 +611,10 @@ class EMCVnxCli(object):
 
                     if host_lun_id is None:
                         msg = (_('Unable to get new host lun id. Please '
-                               'check if the storage group can accommodate '
-                               'new LUN. '
-                               'Command to add LUN for volume - %s '
-                               'in storagegroup failed') % (volumename))
+                                 'check if the storage group can accommodate '
+                                 'new LUN. '
+                                 'Command to add LUN for volume - %s '
+                                 'in storagegroup failed') % (volumename))
                         LOG.error(msg)
                         raise exception.VolumeBackendAPIException(data=msg)
                 else:
index 8105356439b56be823c1bb5863c7f4df24f54279..97c0e1c1ffe5abd81edd9fb1da4873d26e488f6a 100644 (file)
@@ -419,9 +419,9 @@ class StorwizeSVCDriver(san.SanDriver):
                             break
                     else:
                         LOG.warning(_('Unable to find a preferred node match '
-                                    'for node %(node)s in the list of '
-                                    'available WWPNs on %(host)s. '
-                                    'Using first available.') %
+                                      'for node %(node)s in the list of '
+                                      'available WWPNs on %(host)s. '
+                                      'Using first available.') %
                                     {'node': preferred_node,
                                      'host': host_name})
                         properties['target_wwn'] = conn_wwpns[0]
index bab80b95f6c2cccd01eeee8d998e883e178cf19b..7efd6e160024b862822d10d1fa8120826c7995e9 100644 (file)
@@ -38,17 +38,19 @@ netapp_unified_plugin_registry =\
          'iscsi':
          'cinder.volume.drivers.netapp.iscsi.NetAppDirectCmodeISCSIDriver',
          'nfs': 'cinder.volume.drivers.netapp.nfs.NetAppDirectCmodeNfsDriver'
-     }, 'ontap_7mode':
-        {
-            'iscsi':
-            'cinder.volume.drivers.netapp.iscsi.NetAppDirect7modeISCSIDriver',
-            'nfs':
-            'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver'
-        }, 'eseries':
-        {
-            'iscsi':
-            'cinder.volume.drivers.netapp.eseries.iscsi.Driver'
-        },
+     },
+     'ontap_7mode':
+     {
+         'iscsi':
+         'cinder.volume.drivers.netapp.iscsi.NetAppDirect7modeISCSIDriver',
+         'nfs':
+         'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver'
+     },
+     'eseries':
+     {
+         'iscsi':
+         'cinder.volume.drivers.netapp.eseries.iscsi.Driver'
+     },
      }
 
 #NOTE(singn): Holds family:protocol information.
diff --git a/tox.ini b/tox.ini
index ae8c95fd6c39591add71b95d5210588add55e8c3..76932487d1eaa0eccf661bf27a8d541cab81b3b0 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -50,7 +50,7 @@ commands = {posargs}
 # Due to hacking 0.9.2 following checking are ignored on purpose for now
 #  E111,E112,E113,E121,E122,E123,E126,E128,E251,E265
 #  E713,F403,F841,H302,H305,H307,H402,H405,H803,H904
-ignore = E121,E122,E123,E126,E128,E251,E265,E711,E712,E713,F402,F841,H104,H302,H305,H307,H402,H405,H803,H904
+ignore = E251,E265,E711,E712,E713,F402,F841,H104,H302,H305,H307,H402,H405,H803,H904
 builtins = _
 exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build