Remove duplicate import of constants module
.. and enable corresponding pylint check now the only offending instance is fixed. Change-Id: I35a12ace46c872446b8c87d0aacce45e94d71bae
This commit is contained in:
parent
0c1223862c
commit
b45258d6fd
@ -56,7 +56,6 @@ disable=
|
|||||||
redefined-builtin,
|
redefined-builtin,
|
||||||
redefined-outer-name,
|
redefined-outer-name,
|
||||||
redefine-in-handler,
|
redefine-in-handler,
|
||||||
reimported,
|
|
||||||
signature-differs,
|
signature-differs,
|
||||||
star-args,
|
star-args,
|
||||||
super-init-not-called,
|
super-init-not-called,
|
||||||
|
@ -16,9 +16,7 @@ from neutron.openstack.common import excutils
|
|||||||
from neutron.openstack.common import jsonutils
|
from neutron.openstack.common import jsonutils
|
||||||
from neutron.openstack.common import log as logging
|
from neutron.openstack.common import log as logging
|
||||||
from neutron.plugins.vmware.common import utils
|
from neutron.plugins.vmware.common import utils
|
||||||
from neutron.plugins.vmware.vshield.common import (
|
from neutron.plugins.vmware.vshield.common import constants as vcns_const
|
||||||
constants as vcns_const)
|
|
||||||
from neutron.plugins.vmware.vshield.common import constants as common_constants
|
|
||||||
from neutron.plugins.vmware.vshield.common import exceptions
|
from neutron.plugins.vmware.vshield.common import exceptions
|
||||||
from neutron.plugins.vmware.vshield.tasks import constants
|
from neutron.plugins.vmware.vshield.tasks import constants
|
||||||
from neutron.plugins.vmware.vshield.tasks import tasks
|
from neutron.plugins.vmware.vshield.tasks import tasks
|
||||||
@ -108,11 +106,11 @@ class EdgeApplianceDriver(object):
|
|||||||
|
|
||||||
def _edge_status_to_level(self, status):
|
def _edge_status_to_level(self, status):
|
||||||
if status == 'GREEN':
|
if status == 'GREEN':
|
||||||
status_level = common_constants.RouterStatus.ROUTER_STATUS_ACTIVE
|
status_level = vcns_const.RouterStatus.ROUTER_STATUS_ACTIVE
|
||||||
elif status in ('GREY', 'YELLOW'):
|
elif status in ('GREY', 'YELLOW'):
|
||||||
status_level = common_constants.RouterStatus.ROUTER_STATUS_DOWN
|
status_level = vcns_const.RouterStatus.ROUTER_STATUS_DOWN
|
||||||
else:
|
else:
|
||||||
status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
|
status_level = vcns_const.RouterStatus.ROUTER_STATUS_ERROR
|
||||||
return status_level
|
return status_level
|
||||||
|
|
||||||
def _enable_loadbalancer(self, edge):
|
def _enable_loadbalancer(self, edge):
|
||||||
@ -131,13 +129,13 @@ class EdgeApplianceDriver(object):
|
|||||||
except exceptions.VcnsApiException as e:
|
except exceptions.VcnsApiException as e:
|
||||||
LOG.exception(_("VCNS: Failed to get edge status:\n%s"),
|
LOG.exception(_("VCNS: Failed to get edge status:\n%s"),
|
||||||
e.response)
|
e.response)
|
||||||
status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
|
status_level = vcns_const.RouterStatus.ROUTER_STATUS_ERROR
|
||||||
try:
|
try:
|
||||||
desc = jsonutils.loads(e.response)
|
desc = jsonutils.loads(e.response)
|
||||||
if desc.get('errorCode') == (
|
if desc.get('errorCode') == (
|
||||||
vcns_const.VCNS_ERROR_CODE_EDGE_NOT_RUNNING):
|
vcns_const.VCNS_ERROR_CODE_EDGE_NOT_RUNNING):
|
||||||
status_level = (
|
status_level = (
|
||||||
common_constants.RouterStatus.ROUTER_STATUS_DOWN)
|
vcns_const.RouterStatus.ROUTER_STATUS_DOWN)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
LOG.exception(e.response)
|
LOG.exception(e.response)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user