]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove duplicate import of constants module
authorAngus Lees <gus@inodes.org>
Mon, 25 Aug 2014 02:14:29 +0000 (12:14 +1000)
committerAngus Lees <gus@inodes.org>
Tue, 21 Oct 2014 05:03:22 +0000 (16:03 +1100)
.. and enable corresponding pylint check now the only offending instance
is fixed.

Change-Id: I35a12ace46c872446b8c87d0aacce45e94d71bae

.pylintrc
neutron/plugins/vmware/vshield/edge_appliance_driver.py

index c738c547c1dc78f5b756120906d133c9aa2a534d..394adcb8b880c7daa0d64fa80940e577395216e3 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -56,7 +56,6 @@ disable=
  redefined-builtin,
  redefined-outer-name,
  redefine-in-handler,
- reimported,
  signature-differs,
  star-args,
  super-init-not-called,
index 9ce708457bf3a1aaae8736cd88482d8e4c320337..700b989190faced02c408d15d52c5c788afe4298 100644 (file)
@@ -16,9 +16,7 @@ from neutron.openstack.common import excutils
 from neutron.openstack.common import jsonutils
 from neutron.openstack.common import log as logging
 from neutron.plugins.vmware.common import utils
-from neutron.plugins.vmware.vshield.common import (
-    constants as vcns_const)
-from neutron.plugins.vmware.vshield.common import constants as common_constants
+from neutron.plugins.vmware.vshield.common import constants as vcns_const
 from neutron.plugins.vmware.vshield.common import exceptions
 from neutron.plugins.vmware.vshield.tasks import constants
 from neutron.plugins.vmware.vshield.tasks import tasks
@@ -108,11 +106,11 @@ class EdgeApplianceDriver(object):
 
     def _edge_status_to_level(self, status):
         if status == 'GREEN':
-            status_level = common_constants.RouterStatus.ROUTER_STATUS_ACTIVE
+            status_level = vcns_const.RouterStatus.ROUTER_STATUS_ACTIVE
         elif status in ('GREY', 'YELLOW'):
-            status_level = common_constants.RouterStatus.ROUTER_STATUS_DOWN
+            status_level = vcns_const.RouterStatus.ROUTER_STATUS_DOWN
         else:
-            status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
+            status_level = vcns_const.RouterStatus.ROUTER_STATUS_ERROR
         return status_level
 
     def _enable_loadbalancer(self, edge):
@@ -131,13 +129,13 @@ class EdgeApplianceDriver(object):
         except exceptions.VcnsApiException as e:
             LOG.exception(_("VCNS: Failed to get edge status:\n%s"),
                           e.response)
-            status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
+            status_level = vcns_const.RouterStatus.ROUTER_STATUS_ERROR
             try:
                 desc = jsonutils.loads(e.response)
                 if desc.get('errorCode') == (
                     vcns_const.VCNS_ERROR_CODE_EDGE_NOT_RUNNING):
                     status_level = (
-                        common_constants.RouterStatus.ROUTER_STATUS_DOWN)
+                        vcns_const.RouterStatus.ROUTER_STATUS_DOWN)
             except ValueError:
                 LOG.exception(e.response)