Start running jobs against newer python versions

Notable changes:
 - bump hacking to make it py38+ compatible
    - (with changes to pass against the newer pep8 rules)
 - ensure requests get monkey-patched to avoid exceeding
   maximum recursion depth in SSL
 - start running openstack-python3-yoga-jobs-neutron

Change-Id: I84be86737b493dfc811a772bbeabefd10e645206
changes/97/831897/1
Mitchell Jameson 2022-03-03 22:11:53 -08:00
parent 113ac088ab
commit 8a02945f61
14 changed files with 40 additions and 42 deletions

View File

@ -2,6 +2,5 @@
name: x/networking-arista
templates:
- openstack-lower-constraints-jobs-neutron
- openstack-python36-jobs-neutron
- openstack-python37-jobs-neutron
- openstack-python3-yoga-jobs-neutron
- check-requirements

View File

@ -25,13 +25,11 @@ extras==1.0.0
fasteners==0.7.0
fixtures==3.0.0
flake8-import-order==0.12
flake8==2.6.2
future==0.16.0
futurist==1.2.0
gitdb==0.6.4
GitPython==1.0.1
greenlet==0.4.14
hacking==1.1.0
httplib2==0.9.1
imagesize==0.7.1
iso8601==0.1.11
@ -48,7 +46,6 @@ logilab-common==1.4.1
logutils==0.3.5
Mako==1.0.7
MarkupSafe==1.1.1
mccabe==0.2.1
mock==3.0.0
monotonic==0.6;python_version<'3.3'
mox3==0.20.0
@ -56,7 +53,7 @@ msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
neutron-lib==2.16.0
neutron-lib==2.20.0
openstackdocstheme==1.30.0
openstacksdk==0.31.2
os-client-config==1.28.0
@ -97,9 +94,7 @@ positional==1.2.1
prettytable==0.7.2
psutil==5.3.0
pycadf==1.1.0
pycodestyle<2.1,>=2.0
pycparser==2.18
pyflakes==0.8.1
Pygments==2.2.0
pyinotify==0.9.6
pylint==2.2.0

View File

@ -122,7 +122,7 @@ class EAPIClient(object):
try:
resp_data = response.json()
return resp_data['result']
except ValueError as e:
except ValueError:
LOG.info(_LI('Ignoring invalid JSON response'))
except KeyError:
if 'error' in resp_data:

View File

@ -270,7 +270,7 @@ class AristaL3Driver(object):
result = self._run_eos_cmds(cmds, host, log_exception=False,
keep_alive=keep_alive,
update_vrf_commands=False)
LOG.info('show version result %s' % result)
LOG.info(_LI('show version result %s'), result)
except Exception:
# We don't know what exception we got return None
# At this moment we don't know what command we support for vrf

View File

@ -409,8 +409,7 @@ class AristaL3ServicePlugin(service_base.ServicePluginBase,
super(AristaL3ServicePlugin, self).remove_router_interface(
context,
router_id,
interface_info)
)
interface_info))
# Get network information of the subnet that is being removed
core = directory.get_plugin()

View File

@ -169,7 +169,7 @@ class AristaSecurityGroupSwitchHelper(object):
all_intf_info = self._port_group_info.get(switch, {})
intf_info = all_intf_info.get(port_id, {})
member_info = intf_info.get('interfaceMembership', '')
port_group_info = re.search('Member of (?P<port_group>\S+)',
port_group_info = re.search(r'Member of (?P<port_group>\S+)',
member_info)
if port_group_info:
port_id = port_group_info.group('port_group')

View File

@ -121,8 +121,7 @@ class VlanSyncService(object):
session = db_api.get_writer_session()
with session.begin(subtransactions=True):
allocs = (
session.query(vlanallocation.VlanAllocation).with_for_update()
)
session.query(vlanallocation.VlanAllocation).with_for_update())
for alloc in allocs:
if alloc.physical_network != 'default':

View File

@ -13,6 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Importing neutron.tests.common triggers neutron's eventlet monkey_patch util.
# Without this, the import of requests below will result in an unpatched
# requests module running in all tests, which will cause strange failures such
# as maximum recursion depth exceeded in SSL
import neutron.tests.common # noqa: F401
import mock
import requests
from requests import exceptions as requests_exc

View File

@ -232,8 +232,7 @@ class SecurityGroupSyncTestCase(sg_test_base.SecurityGroupTestBase):
'ip access-group SG-INGRESS-%s out' % grp1_id,
'ip access-group SG-EGRESS-%s in' % grp1_id,
'ip access-group SG-INGRESS-%s out' % grp2_id,
'ip access-group SG-EGRESS-%s in' % grp2_id
]
'ip access-group SG-EGRESS-%s in' % grp2_id]
for cmd in unexpected_cmds:
self.assertNotIn(cmd, self.switch1.received_commands)
self.assertNotIn(cmd, self.switch2.received_commands)

View File

@ -1007,7 +1007,7 @@ class BasicHpbMechDriverTestCase(ml2_test_base.MechTestBase):
# Check that the dynamic segment was created
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1050,7 +1050,7 @@ class BasicHpbMechDriverTestCase(ml2_test_base.MechTestBase):
self.assertPortBindingCreated((port['id'], port_host_1))
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1063,7 +1063,7 @@ class BasicHpbMechDriverTestCase(ml2_test_base.MechTestBase):
self.assertPortBindingCreated((port['id'], port_host_2))
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1114,7 +1114,7 @@ class UnmanagedFabricUnmanagedPhysnetHpbTestCase(ml2_test_base.MechTestBase):
# Check that the dynamic segment was created
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1170,7 +1170,7 @@ class ManagedFabricUnmanagedPhysnetHpbTestCase(ml2_test_base.MechTestBase):
# Check that the dynamic segment was created
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1230,7 +1230,7 @@ class UnmanagedFabricManagedPhysnetHpbTestCase(ml2_test_base.MechTestBase):
# Check that the dynamic segment was created
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])
@ -1286,7 +1286,7 @@ class ManagedFabricManagedFabricHpbTestCase(ml2_test_base.MechTestBase):
# Check that the dynamic segment was created
network_segments = [level['bound_segment']
for level in port_ctx.binding_levels]
self.assertTrue(len(network_segments) == 2)
self.assertEqual(len(network_segments), 2)
for segment in network_segments:
self.assertSegmentCreated(segment['id'])

View File

@ -105,25 +105,26 @@ class MockSwitch(object):
self._svis = dict()
self._vlans = dict()
self._route = dict()
self._acl_mode_re = re.compile('^(?P<delete>no )?ip access-list '
'(?P<acl>\S+)(?P<dyn> dynamic)?$')
self._acl_mode_re = re.compile(r'^(?P<delete>no )?ip access-list '
r'(?P<acl>\S+)(?P<dyn> dynamic)?$')
self._interface_mode_re = re.compile(
'^(?P<delete>no )?interface (?P<intf>.+)$')
r'^(?P<delete>no )?interface (?P<intf>.+)$')
self._access_group_re = re.compile(
'^(?P<delete>no )?ip access-group (?P<acl>\S+) (?P<dir>\S+)$')
r'^(?P<delete>no )?ip access-group (?P<acl>\S+) (?P<dir>\S+)$')
self._vrf_mode_re = re.compile(
'^(?P<delete>no )?vrf instance (?P<name>\S+)$')
self._vlan_re = re.compile('^(?P<delete>no )?vlan (?P<vlan>\d+)$')
r'^(?P<delete>no )?vrf instance (?P<name>\S+)$')
self._vlan_re = re.compile(r'^(?P<delete>no )?vlan (?P<vlan>\d+)$')
self._ip_address_re = re.compile(
'^ip address (?P<ip>[\d.]+)/(?P<mask>\d+)$')
self._vip_re = re.compile('^ip virtual-router address (?P<ip>[\d.]+)$')
r'^ip address (?P<ip>[\d.]+)/(?P<mask>\d+)$')
self._vip_re = re.compile(
r'^ip virtual-router address (?P<ip>[\d.]+)$')
self._vrf_route_re = re.compile(
'^(?P<delete>no )?ip route vrf (?P<vrf>\S+) '
'(?P<network>[\d.]+/\d+) (?P<next_hop>[\d.]+)$')
self._svi_vrf_re = re.compile('^vrf forwarding (?P<vrf>\S+)$')
self._rd_re = re.compile('^rd (?P<rd>\S+)$')
r'^(?P<delete>no )?ip route vrf (?P<vrf>\S+) '
r'(?P<network>[\d.]+/\d+) (?P<next_hop>[\d.]+)$')
self._svi_vrf_re = re.compile(r'^vrf forwarding (?P<vrf>\S+)$')
self._rd_re = re.compile(r'^rd (?P<rd>\S+)$')
self._varp_mac_re = re.compile(
'^ip virtual-router mac-address (?P<varp_mac>\S+)$')
r'^ip virtual-router mac-address (?P<varp_mac>\S+)$')
self._mode = None
def execute(self, commands, commands_to_log=None, keep_alive=True):

View File

@ -4,7 +4,7 @@
pbr>=4.0.0 # Apache-2.0
alembic>=1.6.5 # MIT
neutron-lib>=2.16.0 # Apache-2.0
neutron-lib>=2.20.0 # Apache-2.0
oslo.i18n>=3.20.0 # Apache-2.0
oslo.config>=8.0.0 # Apache-2.0
oslo.log>=4.5.0 # Apache-2.0

View File

@ -1,7 +1,7 @@
# 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>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0.1,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=3.0.0 # BSD

View File

@ -13,7 +13,7 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
whitelist_externals =
allowlist_externals =
find
commands =
stestr run {posargs}
@ -66,9 +66,9 @@ commands = python setup.py build_sphinx
[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125,H803
ignore = E126,E128,E731,I202,H405,N530,W504
enable-extensions=H106,H203,H204,H205,H904
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build