From a4c4944d568e4c01da0f7d1a7afdaf1b8ebbe45c Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 20 Mar 2019 16:16:58 -0700 Subject: [PATCH] Update neutron-lbaas for gate changes The gates are now testing with python3 and we needed to update some requirements. Change-Id: I6e48becf2f1267e7059baeb12b5f0a137205fcff --- lower-constraints.txt | 8 ++++---- neutron_lbaas/drivers/haproxy/jinja_cfg.py | 2 +- neutron_lbaas/tests/unit/agent/test_agent.py | 4 +++- .../haproxy/sample_configs/sample_configs.py | 4 ++-- .../unit/drivers/haproxy/test_jinja_cfg.py | 18 +++++++++--------- requirements.txt | 8 ++++---- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 68c989976..6870ef87b 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -52,8 +52,8 @@ msgpack-python==0.4.0 munch==2.1.0 netaddr==0.7.18 netifaces==0.10.4 -neutron-lib==1.20.0 -neutron==12.0.0 +neutron-lib==1.25.0 +neutron==13.0.0 openstackdocstheme==1.18.1 openstacksdk==0.11.2 os-client-config==1.28.0 @@ -65,7 +65,7 @@ oslo.cache==1.26.0 oslo.concurrency==3.26.0 oslo.config==5.2.0 oslo.context==2.19.2 -oslo.db==4.27.0 +oslo.db==4.37.0 oslo.i18n==3.15.3 oslo.log==3.36.0 oslo.messaging==5.29.0 @@ -132,7 +132,7 @@ snowballstemmer==1.2.1 Sphinx==1.6.2 sphinxcontrib-websupport==1.0.1 sqlalchemy-migrate==0.11.0 -SQLAlchemy==1.0.10 +SQLAlchemy==1.2.0 sqlparse==0.2.2 statsd==3.2.1 stestr==1.0.0 diff --git a/neutron_lbaas/drivers/haproxy/jinja_cfg.py b/neutron_lbaas/drivers/haproxy/jinja_cfg.py index 22dadf310..beb5cc452 100644 --- a/neutron_lbaas/drivers/haproxy/jinja_cfg.py +++ b/neutron_lbaas/drivers/haproxy/jinja_cfg.py @@ -409,4 +409,4 @@ def _expand_expected_codes(codes): str(i) for i in six.moves.range(int(low), int(hi) + 1)) else: retval.add(code) - return retval + return sorted(retval) diff --git a/neutron_lbaas/tests/unit/agent/test_agent.py b/neutron_lbaas/tests/unit/agent/test_agent.py index c70cfbac6..639540a34 100644 --- a/neutron_lbaas/tests/unit/agent/test_agent.py +++ b/neutron_lbaas/tests/unit/agent/test_agent.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import sys + import mock from oslo_config import cfg @@ -39,7 +41,7 @@ class TestLbaasService(base.BaseTestCase): with mock.patch(logging_str), \ mock.patch(privsep_str), \ mock.patch.object(agent.service, 'launch') as mock_launch, \ - mock.patch('sys.argv'), \ + mock.patch.object(sys, 'argv', ['neutron-lbaasv2-agent']), \ mock.patch.object(agent.manager, 'LbaasAgentManager'), \ mock.patch.object(cfg.CONF, 'register_opts'): agent.main() diff --git a/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py b/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py index 2025c67a9..41734765b 100644 --- a/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py +++ b/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py @@ -21,7 +21,7 @@ RET_PERSISTENCE = { 'type': 'HTTP_COOKIE', 'cookie_name': 'HTTP_COOKIE'} -HASHSEED_ORDERED_CODES = list({'404', '405', '500'}) +HASHSEED_ORDERED_CODES = ['404', '405', '500'] PIPED_CODES = '|'.join(HASHSEED_ORDERED_CODES) RET_MONITOR = { @@ -269,7 +269,7 @@ def sample_health_monitor_tuple(proto='HTTP', admin_state=True): return monitor(id='sample_monitor_id_1', type=proto, delay=30, timeout=31, max_retries=3, http_method='GET', - url_path='/index.html', expected_codes='500, 405, 404', + url_path='/index.html', expected_codes='404, 405, 500', admin_state_up=admin_state) diff --git a/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py b/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py index b995779e7..1487e8d2f 100644 --- a/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py +++ b/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py @@ -480,30 +480,30 @@ class TestHaproxyCfg(base.BaseTestCase): def test_expand_expected_codes(self): exp_codes = '' - self.assertEqual(set([]), jinja_cfg._expand_expected_codes(exp_codes)) + self.assertEqual([], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200' - self.assertEqual(set(['200']), + self.assertEqual(['200'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200, 201' - self.assertEqual(set(['200', '201']), + self.assertEqual(['200', '201'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200, 201,202' - self.assertEqual(set(['200', '201', '202']), + self.assertEqual(['200', '201', '202'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200-202' - self.assertEqual(set(['200', '201', '202']), + self.assertEqual(['200', '201', '202'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200-202, 205' - self.assertEqual(set(['200', '201', '202', '205']), + self.assertEqual(['200', '201', '202', '205'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200, 201-203' - self.assertEqual(set(['200', '201', '202', '203']), + self.assertEqual(['200', '201', '202', '203'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '200, 201-203, 205' - self.assertEqual(set(['200', '201', '202', '203', '205']), + self.assertEqual(['200', '201', '202', '203', '205'], jinja_cfg._expand_expected_codes(exp_codes)) exp_codes = '201-200, 205' - self.assertEqual(set(['205']), + self.assertEqual(['205'], jinja_cfg._expand_expected_codes(exp_codes)) def test_render_template_about_option_log(self): diff --git a/requirements.txt b/requirements.txt index 12fbab9cf..ed21bf4a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,13 +6,13 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT requests>=2.14.2 # Apache-2.0 netaddr>=0.7.18 # BSD -neutron-lib>=1.20.0 # Apache-2.0 -neutron>=12.0.0 # Apache-2.0 -SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT +neutron-lib>=1.25.0 # Apache-2.0 +neutron>=13.0.0 # Apache-2.0 +SQLAlchemy>=1.2.0 # MIT alembic>=0.8.10 # MIT six>=1.10.0 # MIT oslo.config>=5.2.0 # Apache-2.0 -oslo.db>=4.27.0 # Apache-2.0 +oslo.db>=4.37.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0