Update hacking for Python3

The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

The tempest plugin is used on older branches as well.
We really only need hacking on master anyways,
where we no longer support python 2, so here we
make the requirement specific to python 3.

Change-Id: I39f95e4ce193c1435c4901825bed949cdaaba72e
This commit is contained in:
Andreas Jaeger 2020-03-31 21:48:51 +02:00
parent 34a5bdff42
commit 1ddfa88fec
4 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ ALARM_DEFINITION_CREATION_WAIT = 3
MAX_METRIC_NAME_LENGTH = 255
MAX_DIMENSION_KEY_LENGTH = 255
MAX_DIMENSION_VALUE_LENGTH = 255
INVALID_DIMENSION_CHARS = "<>={},\"\;&"
INVALID_DIMENSION_CHARS = "<>={},\"\\;&"
INVALID_NAME_CHARS = INVALID_DIMENSION_CHARS + "()"
MAX_ALARM_DEFINITION_NAME_LENGTH = 255
@ -31,7 +31,7 @@ MAX_ALARM_DEFINITION_ACTIONS_LENGTH = 50
MAX_NOTIFICATION_METHOD_NAME_LENGTH = 250
MAX_NOTIFICATION_METHOD_TYPE_LENGTH = 100
MAX_NOTIFICATION_METHOD_ADDRESS_LENGTH = 512
INVALID_CHARS_NOTIFICATION = "<>={}(),\"\;&"
INVALID_CHARS_NOTIFICATION = "<>={}(),\"\\;&"
MAX_LIST_MEASUREMENTS_NAME_LENGTH = 255

View File

@ -220,7 +220,7 @@ class TestAlarmDefinitions(base.BaseMonascaTest):
alarm_def_name = data_utils.rand_name('monitoring_alarm')
alarm_definition = helpers.create_alarm_definition(
name=alarm_def_name,
expression="avg(mem_total_mb{dev=\\usr\local\bin}) gt 0",
expression="avg(mem_total_mb{dev=\\usr\local\bin}) gt 0", # noqa
alarm_actions=[notification_id],
ok_actions=[notification_id],
undetermined_actions=[notification_id],

View File

@ -232,7 +232,7 @@ class TestAlarmsCount(base.BaseMonascaTest):
resp, response_body = self.monasca_client.list_alarms()
alarm_low_count = 0
for alarm in response_body['elements']:
if alarm['state'] is 'ALARM' and alarm['severity'] is 'LOW':
if alarm['state'] == 'ALARM' and alarm.get('severity', '') == 'LOW':
alarm_low_count += 1
# Using urlencode mimics the CLI behavior. Without the urlencode, falcon

View File

@ -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>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0,<3.1.0;python_version>='3.5' # Apache-2.0
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD
openstackdocstheme>=1.20.0 # Apache-2.0