Bump hacking

hacking 3.0.x is too old.
Try to synchronize pylint ignore and extension list with
other Networking projects.

With new pip the order of packages is not relevant, so the
related comment from requirements.txts is removed, see pip
documentation:
https://pip.pypa.io/en/stable/cli/pip_install/#installation-order

Change-Id: I586eb25b42d432e0b2158ddebb2dac013f712506
This commit is contained in:
elajkat 2024-01-30 20:07:59 +01:00 committed by Lajos Katona
parent b64ba77e3b
commit 8d82419125
9 changed files with 38 additions and 34 deletions

View File

@ -188,7 +188,7 @@ class TaasAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
#
if not self._is_driver_port_type_compatible(tap_service_msg['port']):
LOG.debug("RPC Call for Delete Tap Service. Incompatible driver "
"type. Ignoring the message. Host=[%s]" % (host))
"type. Ignoring the message. Host=[%s]", host)
return
LOG.debug("In RPC Call for Delete Tap Service: MSG=%s",
tap_service_msg)
@ -203,7 +203,7 @@ class TaasAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
LOG.debug("RPC Call for Delete Tap Flow. Either Host value [%s]"
"(received in RPC) doesn't match the host value "
"stored in agent [%s], or incompatible driver type. "
"Ignoring the message." % (host, self.conf.host))
"Ignoring the message.", host, self.conf.host)
return
LOG.debug("In RPC Call for Delete Tap Flow: MSG=%s", tap_flow_msg)

View File

@ -30,32 +30,32 @@ class TaasAgentApi(object):
self.client = n_rpc.get_client(target)
def create_tap_service(self, context, tap_service_msg, host):
LOG.debug("In RPC Call for Create Tap Service: Host=%s, MSG=%s" %
(host, tap_service_msg))
LOG.debug("In RPC Call for Create Tap Service: Host=%s, MSG=%s",
host, tap_service_msg)
cctxt = self.client.prepare(fanout=True)
cctxt.cast(context, 'create_tap_service',
tap_service_msg=tap_service_msg, host=host)
def create_tap_flow(self, context, tap_flow_msg, host):
LOG.debug("In RPC Call for Create Tap Flow: Host=%s, MSG=%s" %
(host, tap_flow_msg))
LOG.debug("In RPC Call for Create Tap Flow: Host=%s, MSG=%s",
host, tap_flow_msg)
cctxt = self.client.prepare(fanout=True)
cctxt.cast(context, 'create_tap_flow', tap_flow_msg=tap_flow_msg,
host=host)
def delete_tap_service(self, context, tap_service_msg, host):
LOG.debug("In RPC Call for Delete Tap Service: Host=%s, MSG=%s" %
(host, tap_service_msg))
LOG.debug("In RPC Call for Delete Tap Service: Host=%s, MSG=%s",
host, tap_service_msg)
cctxt = self.client.prepare(fanout=True)
cctxt.cast(context, 'delete_tap_service',
tap_service_msg=tap_service_msg, host=host)
def delete_tap_flow(self, context, tap_flow_msg, host):
LOG.debug("In RPC Call for Delete Tap Flow: Host=%s, MSG=%s" %
(host, tap_flow_msg))
LOG.debug("In RPC Call for Delete Tap Flow: Host=%s, MSG=%s",
host, tap_flow_msg)
cctxt = self.client.prepare(fanout=True)
cctxt.cast(context, 'delete_tap_flow', tap_flow_msg=tap_flow_msg,

View File

@ -45,7 +45,7 @@ class TaasCallbacks(object):
def sync_tap_resources(self, context, sync_tap_res, host):
"""Handle Rpc from Agent to sync up Tap resources."""
LOG.debug("In RPC Call for Sync Tap Resources: MSG=%s" % sync_tap_res)
LOG.debug("In RPC Call for Sync Tap Resources: MSG=%s", sync_tap_res)
# Get list of configured tap-services
active_tss = self.plugin.get_tap_services(
@ -96,7 +96,7 @@ class TaasCallbacks(object):
def set_tap_service_status(self, context, msg, status, host=None):
"""Handle Rpc from Agent to set the status of Tap resources."""
LOG.info("In RPC Call to set tap service status: Host=%s, "
"MSG=%s, STATUS=%s" % (host, msg, status))
"MSG=%s, STATUS=%s", host, msg, status)
# Clear the resource from DB once agent indicates successful deletion
# by mech driver.
@ -124,7 +124,7 @@ class TaasCallbacks(object):
def set_tap_flow_status(self, context, msg, status, host=None):
"""Handle Rpc from Agent to set the status of Tap resources."""
LOG.info("In RPC Call to set tap flow status: Host=%s, "
"MSG=%s, STATUS=%s" % (host, msg, status))
"MSG=%s, STATUS=%s", host, msg, status)
# Clear the resource from DB once agent indicates successful deletion
# by mech driver.

View File

@ -88,7 +88,7 @@ class TaasPlugin(taas_db.Taas_db_Mixin):
host = port['binding:host_id']
if host is not None:
LOG.debug("Host on which the port is created = %s" % host)
LOG.debug("Host on which the port is created = %s", host)
else:
LOG.debug("Host could not be found, Port Binding disbaled!")

View File

@ -31,7 +31,7 @@ FAKE_SRIOV_PORT = {
'id': 'fake_1', 'mac_address': "52:54:00:12:35:02",
'binding:profile': {
'pci_slot': None}, 'binding:vif_details': {'vlan': 20}
}
}
class TestSriovNicUtils(base.TaasTestCase):

View File

@ -154,7 +154,7 @@ class TestTaasPlugin(testlib_api.SqlTestCase):
cfg.CONF.set_override("vlan_range_start", 1, group="taas")
cfg.CONF.set_override("vlan_range_end", 3, group="taas")
with self.tap_service() as ts_1, self.tap_service() as ts_2, \
self.tap_service() as ts_3, self.tap_service() as ts_4:
self.tap_service() as ts_3, self.tap_service() as ts_4:
ts_id_1 = ts_1['id']
ts_id_2 = ts_2['id']
ts_id_3 = ts_3['id']
@ -183,7 +183,7 @@ class TestTaasPlugin(testlib_api.SqlTestCase):
def test_create_tap_service_wrong_tenant_id(self):
self._port_details['tenant_id'] = 'other-tenant'
with testtools.ExpectedException(taas_exc.PortDoesNotBelongToTenant), \
self.tap_service():
self.tap_service():
pass
self.assertEqual([], self.driver.mock_calls)
@ -220,7 +220,7 @@ class TestTaasPlugin(testlib_api.SqlTestCase):
def test_delete_tap_service_with_flow(self):
with self.tap_service() as ts, \
self.tap_flow(tap_service=ts['id']) as tf:
self.tap_flow(tap_service=ts['id']) as tf:
self._plugin.delete_tap_service(self._context, ts['id'])
self._tap_service['id'] = ts['id']
self._tap_flow['id'] = tf['id']
@ -255,9 +255,9 @@ class TestTaasPlugin(testlib_api.SqlTestCase):
def test_create_tap_flow_wrong_tenant_id(self):
with self.tap_service() as ts, \
testtools.ExpectedException(
taas_exc.TapServiceNotBelongToTenant), \
self.tap_flow(tap_service=ts['id'], tenant_id='other-tenant'):
testtools.ExpectedException(
taas_exc.TapServiceNotBelongToTenant), \
self.tap_flow(tap_service=ts['id'], tenant_id='other-tenant'):
pass
def test_create_tap_flow_failed_on_service_driver(self):
@ -275,7 +275,7 @@ class TestTaasPlugin(testlib_api.SqlTestCase):
def test_delete_tap_flow(self):
with self.tap_service() as ts, \
self.tap_flow(tap_service=ts['id']) as tf:
self.tap_flow(tap_service=ts['id']) as tf:
self._plugin.delete_tap_flow(self._context, tf['id'])
self._tap_flow['id'] = tf['id']
self.driver.assert_has_calls([

View File

@ -1,7 +1,3 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=5.5.0 # Apache-2.0
Babel>=2.8.0 # BSD
neutron>=16.0.0.0b1 # Apache-2.0

View File

@ -1,7 +1,3 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=6.1.0,<6.2.0 # Apache-2.0
coverage>=5.2.1 # Apache-2.0
@ -16,6 +12,6 @@ testscenarios>=0.5.0 # Apache-2.0/BSD
testtools>=2.4.0 # MIT
astroid>=2.12.4 # LGPLv2.1
pylint==2.15.6 # GPLv2
pylint==2.17.4 # GPLv2
isort==5.10.1 # MIT
WebTest>=2.0.27 # MIT

18
tox.ini
View File

@ -64,12 +64,24 @@ commands = oslopolicy-sample-generator --config-file etc/policy-generator.conf
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# W504 Line break occurred after a binary operator
show-source = True
ignore = E123,E125,W504
# N530 direct neutron imports not allowed
# W504 Line break occurred after a binary operator
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# H405 multi line docstring summary not separated with an empty line
# I202 Additional newline in a group of imports
# E731 do not assign a lambda expression, use a def
# W504 line break after binary operator
ignore = E126,E128,E731,I202,H405,N530,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
[flake8:local-plugins]
extension =