diff --git a/aodhclient/shell.py b/aodhclient/shell.py index 0307657..87ae7a6 100644 --- a/aodhclient/shell.py +++ b/aodhclient/shell.py @@ -59,7 +59,7 @@ class AodhShell(app.App): version=__version__, command_manager=AodhCommandManager('aodhclient'), deferred_help=True, - ) + ) self._client = None diff --git a/aodhclient/tests/unit/test_alarm_cli.py b/aodhclient/tests/unit/test_alarm_cli.py index 0745c84..04c7f55 100644 --- a/aodhclient/tests/unit/test_alarm_cli.py +++ b/aodhclient/tests/unit/test_alarm_cli.py @@ -42,7 +42,7 @@ class CliAlarmCreateTest(testtools.TestCase): '--aggregation-method', 'last', '--resource-type', 'generic', '--threshold', '80' - ]) + ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_once_with( 'gnocchi_resources_threshold requires --metric, ' @@ -58,7 +58,7 @@ class CliAlarmCreateTest(testtools.TestCase): '--name', 'threshold_test', '--type', 'threshold', '--threshold', '80' - ]) + ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_once_with( 'Threshold alarm requires -m/--meter-name and ' @@ -73,7 +73,7 @@ class CliAlarmCreateTest(testtools.TestCase): test_parsed_args = parser.parse_args([ '--name', 'composite_test', '--type', 'composite' - ]) + ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_once_with( 'Composite alarm requires --composite-rule parameter') @@ -90,7 +90,7 @@ class CliAlarmCreateTest(testtools.TestCase): '--aggregation-method', 'last', '--resource-type', 'generic', '--threshold', '80' - ]) + ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_once_with( 'gnocchi_aggregation_by_resources_threshold requires ' @@ -107,7 +107,7 @@ class CliAlarmCreateTest(testtools.TestCase): '--type', 'gnocchi_aggregation_by_metrics_threshold', '--resource-type', 'generic', '--threshold', '80' - ]) + ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_once_with( 'gnocchi_aggregation_by_metrics_threshold requires ' @@ -145,7 +145,7 @@ class CliAlarmCreateTest(testtools.TestCase): '--stack-id', '0809ab348-8b0e-451c-be28-abe250ae9c1c', '--pool-id', '79832aabf-343ba-be28-abe250ae9c1c', '--autoscaling-group-id', 'abe250ae9c1c-79832aabf-343ba-be28' - ]) + ]) # Output for the test alarm = { @@ -217,7 +217,7 @@ class CliAlarmCreateTest(testtools.TestCase): }, 'composite_rule': None, 'type': 'event' - } + } alarm_rep = self.cli_alarm_create._alarm_from_args(test_parsed_args) self.assertEqual(alarm, alarm_rep) diff --git a/aodhclient/utils.py b/aodhclient/utils.py index 8d2fd55..4b6577f 100644 --- a/aodhclient/utils.py +++ b/aodhclient/utils.py @@ -25,7 +25,7 @@ operator = pp.Regex(u"|".join(binary_operator)) null = pp.Regex("None|none|null").setParseAction(pp.replaceWith(None)) boolean = "False|True|false|true" boolean = pp.Regex(boolean).setParseAction(lambda t: t[0].lower() == "true") -hex_string = lambda n: pp.Word(pp.hexnums, exact=n) +hex_string = lambda n: pp.Word(pp.hexnums, exact=n) # noqa: E731 uuid = pp.Combine(hex_string(8) + ("-" + hex_string(4)) * 3 + "-" + hex_string(12)) number = r"[+-]?\d+(:?\.\d*)?(:?[eE][+-]?\d+)?" diff --git a/tox.ini b/tox.ini index 38f661f..1e7b5a6 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ deps = commands = pifpaf run aodh -- stestr run --slowest {posargs} [testenv:pep8] -deps = hacking<0.13,>=0.12 +deps = hacking<3.1.0,>=3.0 commands = flake8 [testenv:venv] @@ -55,4 +55,7 @@ commands = pifpaf --debug run aodh -- oslo_debug_helper {posargs} [flake8] show-source = True +# W503 line break before binary operator +# W504 line break after binary operator +ignore = W503,W504 exclude=.venv,.git,.tox,dist,doc,*egg,build