Merge "Update hacking for Python3"

This commit is contained in:
Zuul 2020-04-23 10:53:26 +00:00 committed by Gerrit Code Review
commit dee5cc6388
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