Remove whitespace exclusions in tox.ini
Some no longer triggered pep8 errors, fixed the rest with autopep8 or manually. Change-Id: I43cef5a019f42836c7eaef0758deda17e01cd6a2 Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
This commit is contained in:
@@ -67,21 +67,21 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'required_by_policy': False,
|
||||
'enforce_policy': True},
|
||||
'advertise_floating_ip_host_routes': {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'convert_to': n_conv.convert_to_boolean,
|
||||
'validate': {'type:boolean': None},
|
||||
'is_visible': True, 'default': True,
|
||||
'required_by_policy': False,
|
||||
'enforce_policy': True},
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'convert_to': n_conv.convert_to_boolean,
|
||||
'validate': {'type:boolean': None},
|
||||
'is_visible': True, 'default': True,
|
||||
'required_by_policy': False,
|
||||
'enforce_policy': True},
|
||||
'advertise_tenant_networks': {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'convert_to': n_conv.convert_to_boolean,
|
||||
'validate': {'type:boolean': None},
|
||||
'is_visible': True, 'default': True,
|
||||
'required_by_policy': False,
|
||||
'enforce_policy': True},
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'convert_to': n_conv.convert_to_boolean,
|
||||
'validate': {'type:boolean': None},
|
||||
'is_visible': True, 'default': True,
|
||||
'required_by_policy': False,
|
||||
'enforce_policy': True},
|
||||
},
|
||||
'bgp-peers': {
|
||||
'id': {'allow_post': False, 'allow_put': False,
|
||||
|
||||
@@ -118,9 +118,9 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||
'is_visible': True,
|
||||
'is_sort_key': True,
|
||||
'is_filter': True},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# The action map: it associates verbs with methods to be performed on
|
||||
# the API resource.
|
||||
|
||||
@@ -39,7 +39,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'is_visible': True,
|
||||
'validate': {
|
||||
'type:values': constants.VALID_HWOL_TYPES}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'default': constants.ATTR_NOT_SPECIFIED,
|
||||
'is_visible': True,
|
||||
'validate': {'type:boolean': None}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'validate': {'type:boolean': None}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = None
|
||||
|
||||
@@ -34,14 +34,14 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
MIN_PACKET_RATE_RULES_ALIAS: {
|
||||
**qos._QOS_RULE_COMMON_FIELDS,
|
||||
qos_constants.MIN_KPPS: {
|
||||
'allow_post': False,
|
||||
'allow_put': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
'allow_post': False,
|
||||
'allow_put': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
},
|
||||
qos_constants.DIRECTION: {
|
||||
'allow_post': False,
|
||||
|
||||
@@ -40,35 +40,37 @@ SUB_RES_ATTR_MAP.update({
|
||||
'parent': qos_apidef._PARENT,
|
||||
'parameters': dict(
|
||||
qos_apidef._QOS_RULE_COMMON_FIELDS,
|
||||
**{qos_const.MAX_KPPS: {
|
||||
'allow_post': True, 'allow_put': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
},
|
||||
qos_const.MAX_BURST_KPPS: {
|
||||
'allow_post': True, 'allow_put': True,
|
||||
'is_visible': True, 'default': 0,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
},
|
||||
qos_const.DIRECTION: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'default': constants.EGRESS_DIRECTION,
|
||||
'validate': {
|
||||
'type:values': constants.VALID_DIRECTIONS}
|
||||
}
|
||||
}),
|
||||
**{
|
||||
qos_const.MAX_KPPS: {
|
||||
'allow_post': True, 'allow_put': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
},
|
||||
qos_const.MAX_BURST_KPPS: {
|
||||
'allow_post': True, 'allow_put': True,
|
||||
'is_visible': True, 'default': 0,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'convert_to': converters.convert_to_int,
|
||||
'validate': {
|
||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||
},
|
||||
qos_const.DIRECTION: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'is_visible': True,
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'default': constants.EGRESS_DIRECTION,
|
||||
'validate': {
|
||||
'type:values': constants.VALID_DIRECTIONS}
|
||||
}
|
||||
}
|
||||
),
|
||||
}
|
||||
})
|
||||
SUB_RES_ATTR_MAP.update(
|
||||
|
||||
@@ -112,7 +112,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'validate': {
|
||||
'type:values': constants.VALID_DIRECTIONS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -389,8 +389,7 @@ DNS_DOMAIN_DEFAULT = 'openstacklocal.'
|
||||
DNS_LABEL_KEYWORDS = ['project_id', 'project_name', 'user_name', 'user_id']
|
||||
DNS_LABEL_MAX_LEN = 63
|
||||
DNS_LABEL_REGEX = "^([a-z0-9-]{1,%d}|%s)$" % (
|
||||
DNS_LABEL_MAX_LEN,
|
||||
'<' + '>|<'.join(DNS_LABEL_KEYWORDS) + '>')
|
||||
DNS_LABEL_MAX_LEN, '<' + '>|<'.join(DNS_LABEL_KEYWORDS) + '>')
|
||||
|
||||
# max value for TCP, UDP, SCTP ports
|
||||
PORT_MAX = 2**16 - 1
|
||||
|
||||
@@ -26,7 +26,7 @@ INVENTORY_OPTIONS = {
|
||||
'min_unit',
|
||||
'reserved',
|
||||
'step_size',
|
||||
}
|
||||
}
|
||||
|
||||
# Tunnelled networks resource provider default name.
|
||||
RP_TUNNELLED = 'rp_tunnelled'
|
||||
|
||||
@@ -18,7 +18,7 @@ from neutron_lib.tests.unit.api.definitions import base
|
||||
|
||||
|
||||
class NetworkIPAvailabilityDetailsDefinitionTestCase(
|
||||
base.DefinitionBaseTestCase):
|
||||
base.DefinitionBaseTestCase):
|
||||
extension_module = network_ip_availability_details
|
||||
extension_resources = (network_ip_availability.RESOURCE_PLURAL,)
|
||||
extension_attributes = (
|
||||
|
||||
@@ -148,7 +148,7 @@ class CIDRTestCase(SqlAlchemyTypesBaseTestCase):
|
||||
|
||||
def _update_row(self, key, cidr):
|
||||
row_update = self.test_table.update().values(cidr=cidr).\
|
||||
where(self.test_table.c.cidr == key)
|
||||
where(self.test_table.c.cidr == key)
|
||||
with self.engine.connect() as conn, conn.begin():
|
||||
conn.execute(row_update)
|
||||
|
||||
@@ -203,7 +203,7 @@ class MACAddressTestCase(SqlAlchemyTypesBaseTestCase):
|
||||
|
||||
def _update_row(self, key, mac):
|
||||
row_update = self.test_table.update().values(mac=mac).\
|
||||
where(self.test_table.c.mac == key)
|
||||
where(self.test_table.c.mac == key)
|
||||
with self.engine.connect() as conn, conn.begin():
|
||||
conn.execute(row_update)
|
||||
|
||||
|
||||
@@ -863,16 +863,16 @@ class TestPlacementAPIClient(base.BaseTestCase):
|
||||
|
||||
def test_update_qos_allocation_multiple_rps(self):
|
||||
mock_rsp_get = self._get_allocation_response({
|
||||
RESOURCE_PROVIDER_UUID: {'resources': {'a': 3, 'b': 2}},
|
||||
SECOND_RESOURCE_PROVIDER_UUID: {'resources': {'c': 1, 'd': 5}},
|
||||
})
|
||||
RESOURCE_PROVIDER_UUID: {'resources': {'a': 3, 'b': 2}},
|
||||
SECOND_RESOURCE_PROVIDER_UUID: {'resources': {'c': 1, 'd': 5}},
|
||||
})
|
||||
self.placement_fixture.mock_get.side_effect = [mock_rsp_get]
|
||||
self.placement_api_client.update_qos_allocation(
|
||||
consumer_uuid=CONSUMER_UUID,
|
||||
alloc_diff={
|
||||
RESOURCE_PROVIDER_UUID: {'a': -3, 'b': 2},
|
||||
SECOND_RESOURCE_PROVIDER_UUID: {'e': 3, 'd': -5},
|
||||
},
|
||||
},
|
||||
)
|
||||
self.placement_fixture.mock_put.assert_called_once_with(
|
||||
f'/allocations/{CONSUMER_UUID}',
|
||||
|
||||
3
tox.ini
3
tox.ini
@@ -90,11 +90,10 @@ commands = oslo_debug_helper -t neutron_lib/tests/unit {posargs}
|
||||
# H205: Use assert(Greater|Less)(Equal) for comparison
|
||||
# H904: Delay string interpolations at logging calls
|
||||
enable-extensions = H106,H203,H204,H205,H904
|
||||
# Most of the whitespace related rules (E12* and E131) are excluded.
|
||||
# W504 skipped because it conflicts with W503
|
||||
# I202 skipped because it does not allow newline between 3rd party libraries
|
||||
# import and neutron-lib code import, which is wrong
|
||||
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,W504,I202
|
||||
ignore = W504,I202
|
||||
show-source = True
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools
|
||||
import-order-style = pep8
|
||||
|
||||
Reference in New Issue
Block a user