Fix pep8 issues
Change-Id: I673536bdb0d769de7e5e8f3e0dd315d81c6d23fe
This commit is contained in:
parent
03821d9534
commit
e28f9c13fb
@ -101,7 +101,9 @@ disable=
|
|||||||
invalid-overridden-method,
|
invalid-overridden-method,
|
||||||
raising-format-tuple,
|
raising-format-tuple,
|
||||||
comparison-with-callable,
|
comparison-with-callable,
|
||||||
consider-using-with
|
consider-using-with,
|
||||||
|
unused-private-member,
|
||||||
|
arguments-renamed,
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
# Variable names can be 1 to 31 characters long, with lowercase and underscores
|
# Variable names can be 1 to 31 characters long, with lowercase and underscores
|
||||||
|
@ -450,10 +450,10 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
|
|||||||
|
|
||||||
# Create the rules after all security groups are created to allow
|
# Create the rules after all security groups are created to allow
|
||||||
# dependencies in remote_group_id
|
# dependencies in remote_group_id
|
||||||
for sg_id in rules_dict:
|
for sg_id, sg in rules_dict.items():
|
||||||
try:
|
try:
|
||||||
rules = self.dest_neutron.create_security_group_rule(
|
rules = self.dest_neutron.create_security_group_rule(
|
||||||
{'security_group_rules': rules_dict[sg_id]})
|
{'security_group_rules': sg})
|
||||||
LOG.info("Created %d security group rules for SG %s: %s",
|
LOG.info("Created %d security group rules for SG %s: %s",
|
||||||
len(rules), sg_id,
|
len(rules), sg_id,
|
||||||
",".join([rule.get('id') for rule in
|
",".join([rule.get('id') for rule in
|
||||||
|
@ -197,15 +197,15 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
def init_extensions(self):
|
def init_extensions(self):
|
||||||
# Support all the extensions supported by any of the plugins
|
# Support all the extensions supported by any of the plugins
|
||||||
extensions = []
|
extensions = []
|
||||||
for plugin in self.plugins:
|
for plugin in self.plugins.values():
|
||||||
extensions.extend(self.plugins[plugin].supported_extension_aliases)
|
extensions.extend(plugin.supported_extension_aliases)
|
||||||
self.supported_extension_aliases.extend(list(set(extensions)))
|
self.supported_extension_aliases.extend(list(set(extensions)))
|
||||||
|
|
||||||
# mark extensions which are supported by only one of the plugins
|
# mark extensions which are supported by only one of the plugins
|
||||||
self._unsupported_fields = {}
|
self._unsupported_fields = {}
|
||||||
for plugin in self.plugins:
|
for plugin in self.plugins.values():
|
||||||
# TODO(asarfaty): add other resources here
|
# TODO(asarfaty): add other resources here
|
||||||
plugin_type = self.plugins[plugin].plugin_type()
|
plugin_type = plugin.plugin_type()
|
||||||
self._unsupported_fields[plugin_type] = {'router': [],
|
self._unsupported_fields[plugin_type] = {'router': [],
|
||||||
'port': [],
|
'port': [],
|
||||||
'security_group': []}
|
'security_group': []}
|
||||||
@ -290,8 +290,7 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
|
|
||||||
def start_rpc_listeners(self):
|
def start_rpc_listeners(self):
|
||||||
# Run the start_rpc_listeners of one of the sub-plugins
|
# Run the start_rpc_listeners of one of the sub-plugins
|
||||||
for plugin_type in self.plugins:
|
for plugin in self.plugins.values():
|
||||||
plugin = self.plugins[plugin_type]
|
|
||||||
if plugin.rpc_workers_supported():
|
if plugin.rpc_workers_supported():
|
||||||
return plugin.start_rpc_listeners()
|
return plugin.start_rpc_listeners()
|
||||||
|
|
||||||
|
@ -453,20 +453,20 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
|||||||
NO_SLAAC_NDRA_PROFILE_ID: policy_constants.IPV6_RA_MODE_DISABLED
|
NO_SLAAC_NDRA_PROFILE_ID: policy_constants.IPV6_RA_MODE_DISABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
for profile in ndra_profiles:
|
for profile_key, profile_value in ndra_profiles.items():
|
||||||
try:
|
try:
|
||||||
self.nsxpolicy.ipv6_ndra_profile.get(profile, silent=True)
|
self.nsxpolicy.ipv6_ndra_profile.get(profile_key, silent=True)
|
||||||
except nsx_lib_exc.ResourceNotFound:
|
except nsx_lib_exc.ResourceNotFound:
|
||||||
try:
|
try:
|
||||||
self.nsxpolicy.ipv6_ndra_profile.create_or_overwrite(
|
self.nsxpolicy.ipv6_ndra_profile.create_or_overwrite(
|
||||||
profile,
|
profile_key,
|
||||||
profile_id=profile,
|
profile_id=profile_key,
|
||||||
ra_mode=ndra_profiles[profile],
|
ra_mode=profile_value,
|
||||||
tags=self.nsxpolicy.build_v3_api_version_tag())
|
tags=self.nsxpolicy.build_v3_api_version_tag())
|
||||||
except nsx_lib_exc.StaleRevision as e:
|
except nsx_lib_exc.StaleRevision as e:
|
||||||
# This means that another controller is also creating this
|
# This means that another controller is also creating this
|
||||||
LOG.info("Failed to configure ipv6_ndra_profile %s: %s",
|
LOG.info("Failed to configure ipv6_ndra_profile %s: %s",
|
||||||
profile, e)
|
profile_key, e)
|
||||||
|
|
||||||
self.client_ssl_profile = None
|
self.client_ssl_profile = None
|
||||||
|
|
||||||
|
@ -217,12 +217,11 @@ class TaskManager(object):
|
|||||||
|
|
||||||
def _check_pending_tasks(self):
|
def _check_pending_tasks(self):
|
||||||
"""Check all pending tasks status."""
|
"""Check all pending tasks status."""
|
||||||
for resource_id in self._tasks.keys():
|
for resource_id, tasks in self._tasks.items():
|
||||||
if self._stopped:
|
if self._stopped:
|
||||||
# Task manager is stopped, return now
|
# Task manager is stopped, return now
|
||||||
return
|
return
|
||||||
|
|
||||||
tasks = self._tasks[resource_id]
|
|
||||||
# only the first task is executed and pending
|
# only the first task is executed and pending
|
||||||
task = tasks[0]
|
task = tasks[0]
|
||||||
try:
|
try:
|
||||||
|
@ -108,7 +108,8 @@ class NsxAbstractIpamDriver(subnet_alloc.SubnetAllocator, NsxIpamBase):
|
|||||||
# override the OOB factory to add the network ID
|
# override the OOB factory to add the network ID
|
||||||
return NsxSubnetRequestFactory
|
return NsxSubnetRequestFactory
|
||||||
|
|
||||||
@abc.abstractproperty
|
@property
|
||||||
|
@abc.abstractmethod
|
||||||
def _subnet_class(self):
|
def _subnet_class(self):
|
||||||
"""Return the class of the subnet that should be used."""
|
"""Return the class of the subnet that should be used."""
|
||||||
pass
|
pass
|
||||||
|
@ -424,8 +424,8 @@ def stats_getter(context, core_plugin, ignore_list=None):
|
|||||||
stats['id'] = p_utils.path_to_id(
|
stats['id'] = p_utils.path_to_id(
|
||||||
vs['virtual_server_path'])
|
vs['virtual_server_path'])
|
||||||
stats['request_errors'] = 0 # currently unsupported
|
stats['request_errors'] = 0 # currently unsupported
|
||||||
for stat in lb_const.LB_STATS_MAP:
|
for stat, stat_value in lb_const.LB_STATS_MAP.items():
|
||||||
lb_stat = lb_const.LB_STATS_MAP[stat]
|
lb_stat = stat_value
|
||||||
stats[stat] += vs_stats[lb_stat]
|
stats[stat] += vs_stats[lb_stat]
|
||||||
stat_list.append(stats)
|
stat_list.append(stats)
|
||||||
|
|
||||||
|
@ -431,8 +431,8 @@ def stats_getter(context, core_plugin, ignore_list=None):
|
|||||||
stats = copy.copy(lb_const.LB_EMPTY_STATS)
|
stats = copy.copy(lb_const.LB_EMPTY_STATS)
|
||||||
stats['id'] = vs_bind.listener_id
|
stats['id'] = vs_bind.listener_id
|
||||||
stats['request_errors'] = 0 # currently unsupported
|
stats['request_errors'] = 0 # currently unsupported
|
||||||
for stat in lb_const.LB_STATS_MAP:
|
for stat, stat_value in lb_const.LB_STATS_MAP.items():
|
||||||
lb_stat = lb_const.LB_STATS_MAP[stat]
|
lb_stat = stat_value
|
||||||
stats[stat] += vs_stats[lb_stat]
|
stats[stat] += vs_stats[lb_stat]
|
||||||
stat_list.append(stats)
|
stat_list.append(stats)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ from vmware_nsx.plugins.nsx_v.vshield import edge_utils
|
|||||||
from vmware_nsx.shell.admin.plugins.common import constants
|
from vmware_nsx.shell.admin.plugins.common import constants
|
||||||
from vmware_nsx.shell.admin.plugins.common import formatters
|
from vmware_nsx.shell.admin.plugins.common import formatters
|
||||||
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
||||||
import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils
|
from vmware_nsx.shell.admin.plugins.nsxv.resources import utils
|
||||||
import vmware_nsx.shell.resources as shell
|
import vmware_nsx.shell.resources as shell
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ from oslo_log import log as logging
|
|||||||
|
|
||||||
from vmware_nsx.shell.admin.plugins.common import constants
|
from vmware_nsx.shell.admin.plugins.common import constants
|
||||||
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
||||||
import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils
|
from vmware_nsx.shell.admin.plugins.nsxv.resources import utils
|
||||||
import vmware_nsx.shell.resources as shell
|
import vmware_nsx.shell.resources as shell
|
||||||
|
|
||||||
from neutron_lib.callbacks import registry
|
from neutron_lib.callbacks import registry
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
from vmware_nsx.shell.admin.plugins.common import constants
|
from vmware_nsx.shell.admin.plugins.common import constants
|
||||||
from vmware_nsx.shell.admin.plugins.common import formatters
|
from vmware_nsx.shell.admin.plugins.common import formatters
|
||||||
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
||||||
import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils
|
from vmware_nsx.shell.admin.plugins.nsxv.resources import utils
|
||||||
import vmware_nsx.shell.resources as shell
|
import vmware_nsx.shell.resources as shell
|
||||||
|
|
||||||
from neutron_lib.callbacks import registry
|
from neutron_lib.callbacks import registry
|
||||||
|
@ -17,7 +17,7 @@ from vmware_nsx.shell.admin.plugins.common import constants
|
|||||||
from vmware_nsx.shell.admin.plugins.common import formatters
|
from vmware_nsx.shell.admin.plugins.common import formatters
|
||||||
|
|
||||||
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
import vmware_nsx.shell.admin.plugins.common.utils as admin_utils
|
||||||
import vmware_nsx.shell.admin.plugins.nsxv.resources.utils as utils
|
from vmware_nsx.shell.admin.plugins.nsxv.resources import utils
|
||||||
import vmware_nsx.shell.resources as shell
|
import vmware_nsx.shell.resources as shell
|
||||||
|
|
||||||
from neutron_lib.callbacks import registry
|
from neutron_lib.callbacks import registry
|
||||||
|
Loading…
Reference in New Issue
Block a user