Switch to flake8 from pep8.
* flake8 supports more checks than pep8 (e.g. detection of unused imports and variables), and has an extension mechanism. A plugin to support automatic HACKING validation is planned. * See: http://flake8.readthedocs.org/ Change-Id: I8c9314c606802109a4d01908dbc74ecb792ad0ac
This commit is contained in:
@@ -63,7 +63,7 @@ class NECPluginApi(agent_rpc.PluginApi):
|
||||
datapath_id=datapath_id,
|
||||
port_added=port_added,
|
||||
port_removed=port_removed))
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
LOG.warn(_("update_ports() failed."))
|
||||
return
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
from oslo.config import cfg
|
||||
|
||||
from quantum.agent.common import config
|
||||
# import rpc config options
|
||||
from quantum.openstack.common import rpc
|
||||
from quantum.openstack.common import rpc # noqa
|
||||
from quantum import scheduler
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ from quantum.db import securitygroups_db as sg_db
|
||||
from quantum.extensions import securitygroup as ext_sg
|
||||
from quantum import manager
|
||||
from quantum.openstack.common import log as logging
|
||||
# NOTE (e0ne): this import is needed for config init
|
||||
from quantum.plugins.nec.common import config
|
||||
from quantum.plugins.nec.common import config # noqa
|
||||
from quantum.plugins.nec.common import exceptions as nexc
|
||||
from quantum.plugins.nec.db import models as nmodels
|
||||
|
||||
@@ -221,7 +220,7 @@ def get_port_from_device(port_id):
|
||||
plugin = manager.QuantumManager.get_plugin()
|
||||
port_dict = plugin._make_port_dict(port)
|
||||
port_dict[ext_sg.SECURITYGROUPS] = [
|
||||
sg_id for port, sg_id in port_and_sgs if sg_id]
|
||||
sg_id for port_, sg_id in port_and_sgs if sg_id]
|
||||
port_dict['security_group_rules'] = []
|
||||
port_dict['security_group_source_groups'] = []
|
||||
port_dict['fixed_ips'] = [ip['ip_address']
|
||||
|
||||
@@ -76,7 +76,7 @@ class PFCDriverBase(ofc_driver_base.OFCDriverBase):
|
||||
def create_tenant(self, description, tenant_id=None):
|
||||
ofc_tenant_id = self._generate_pfc_id(tenant_id)
|
||||
body = {'id': ofc_tenant_id}
|
||||
res = self.client.post('/tenants', body=body)
|
||||
self.client.post('/tenants', body=body)
|
||||
return '/tenants/' + ofc_tenant_id
|
||||
|
||||
def delete_tenant(self, ofc_tenant_id):
|
||||
|
||||
@@ -19,21 +19,16 @@
|
||||
from quantum.agent import securitygroups_rpc as sg_rpc
|
||||
from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api
|
||||
from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api
|
||||
from quantum.common import constants as q_const
|
||||
from quantum.common import exceptions as q_exc
|
||||
from quantum.common import rpc as q_rpc
|
||||
from quantum.common import topics
|
||||
from quantum import context
|
||||
from quantum.db import agents_db
|
||||
from quantum.db import agentschedulers_db
|
||||
from quantum.db import dhcp_rpc_base
|
||||
from quantum.db import extraroute_db
|
||||
from quantum.db import l3_rpc_base
|
||||
#NOTE(amotoki): quota_db cannot be removed, it is for db model
|
||||
from quantum.db import quota_db
|
||||
from quantum.db import quota_db # noqa
|
||||
from quantum.db import securitygroups_rpc_base as sg_db_rpc
|
||||
from quantum.extensions import portbindings
|
||||
from quantum.extensions import securitygroup as ext_sg
|
||||
from quantum.openstack.common import importutils
|
||||
from quantum.openstack.common import log as logging
|
||||
from quantum.openstack.common import rpc
|
||||
@@ -670,7 +665,6 @@ class NECPluginV2RPCCallbacks(object):
|
||||
"""
|
||||
LOG.debug(_("NECPluginV2RPCCallbacks.update_ports() called, "
|
||||
"kwargs=%s ."), kwargs)
|
||||
topic = kwargs['topic']
|
||||
datapath_id = kwargs['datapath_id']
|
||||
session = rpc_context.session
|
||||
for p in kwargs.get('port_added', []):
|
||||
|
||||
@@ -132,5 +132,5 @@ class OFCManager(object):
|
||||
ofc_pf_id = self._get_ofc_id(context, "ofc_packet_filter", filter_id)
|
||||
ofc_pf_id = self.driver.convert_ofc_filter_id(context, ofc_pf_id)
|
||||
|
||||
res = self.driver.delete_filter(ofc_pf_id)
|
||||
self.driver.delete_filter(ofc_pf_id)
|
||||
self._del_ofc_item(context, "ofc_packet_filter", filter_id)
|
||||
|
||||
Reference in New Issue
Block a user