From e709ed34c8ddee17a2a61d0c80d89a091711207e Mon Sep 17 00:00:00 2001 From: zhulingjie Date: Sat, 5 Jan 2019 01:08:34 +0800 Subject: [PATCH] Update hacking version Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: Ia932544d2491ca86e8b3edc6d794b24c12e1f8f9 --- HACKING.rst | 2 +- test-requirements.txt | 2 +- tox.ini | 3 ++- vitrage_tempest_plugin/tests/api/rca/base.py | 9 +++++---- .../mock_datasource/test_3rd_degree_scenarios.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index cd3c49c..3392185 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ openstack Style Commandments -=============================================== +============================ Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ diff --git a/test-requirements.txt b/test-requirements.txt index b6dbe2b..c4b7880 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.13,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD openstackdocstheme>=1.24.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index d36d31f..58b79a2 100644 --- a/tox.ini +++ b/tox.ini @@ -49,8 +49,9 @@ commands = oslo_debug_helper {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8. +# E731 skipped as assign a lambda expression show-source = True -ignore = E123,E125 +ignore = E123,E125,E731 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build diff --git a/vitrage_tempest_plugin/tests/api/rca/base.py b/vitrage_tempest_plugin/tests/api/rca/base.py index 0e2ea9d..149aa14 100644 --- a/vitrage_tempest_plugin/tests/api/rca/base.py +++ b/vitrage_tempest_plugin/tests/api/rca/base.py @@ -140,10 +140,11 @@ class BaseRcaTest(BaseAlarmsTest): for item in links: source_alarm_name = alarms[item['source']].get(VProps.NAME) target_alarm_name = alarms[item['target']].get(VProps.NAME) - if item.get('key') != EdgeLabel.CAUSES \ - or item.get(EdgeProperties.RELATIONSHIP_TYPE) != EdgeLabel.CAUSES \ - or source_alarm_name != RCA_ALARM_NAME \ - or target_alarm_name != VITRAGE_ALARM_NAME: + relationship_type = item.get(EdgeProperties.RELATIONSHIP_TYPE) + if (item.get('key') != EdgeLabel.CAUSES or + relationship_type != EdgeLabel.CAUSES or + source_alarm_name != RCA_ALARM_NAME or + target_alarm_name != VITRAGE_ALARM_NAME): flag = False self.assertThat(alarms, matchers.HasLength(3)) diff --git a/vitrage_tempest_plugin/tests/resources/mock_datasource/test_3rd_degree_scenarios.py b/vitrage_tempest_plugin/tests/resources/mock_datasource/test_3rd_degree_scenarios.py index 53b4235..3764f20 100644 --- a/vitrage_tempest_plugin/tests/resources/mock_datasource/test_3rd_degree_scenarios.py +++ b/vitrage_tempest_plugin/tests/resources/mock_datasource/test_3rd_degree_scenarios.py @@ -222,8 +222,8 @@ class TestLongProcessing(TestActionsBase): try: v_utils.generate_fake_host_alarm( 'nova.host-0-nova.zone-0-openstack.cluster-0', - 'test_high_availability_events' - + str(self.num_of_sent_events)) + 'test_high_availability_events' + + str(self.num_of_sent_events)) self.num_of_sent_events += 1 time.sleep(spacing) except Exception: