From 429b944187bab0803bb8d6f3922526ca1c4b5e45 Mon Sep 17 00:00:00 2001 From: liusheng Date: Tue, 16 Feb 2016 11:24:52 +0800 Subject: [PATCH] Add abbreviation of --meter-name hint in threshold alarm creation Change-Id: If3b80b55846cd176f3822eeec4740bbe64b3554e --- aodhclient/tests/unit/test_alarm_cli.py | 4 ++-- aodhclient/v2/alarm_cli.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aodhclient/tests/unit/test_alarm_cli.py b/aodhclient/tests/unit/test_alarm_cli.py index f09ffee..6a1be47 100644 --- a/aodhclient/tests/unit/test_alarm_cli.py +++ b/aodhclient/tests/unit/test_alarm_cli.py @@ -70,8 +70,8 @@ class CliAlarmCreateTest(testtools.TestCase): ]) self.cli_alarm_create._validate_args(test_parsed_args) mock_arg.assert_called_with( - 'threshold requires --meter-name and ' - '--threshold') + 'threshold alarm requires -m/--meter-name and ' + '--threshold parameters') @mock.patch.object(argparse.ArgumentParser, 'error') def test_validate_args_gno_agg_by_resources_threshold(self, mock_arg): diff --git a/aodhclient/v2/alarm_cli.py b/aodhclient/v2/alarm_cli.py index 624c935..474b136 100644 --- a/aodhclient/v2/alarm_cli.py +++ b/aodhclient/v2/alarm_cli.py @@ -230,8 +230,8 @@ class CliAlarmCreate(show.ShowOne): def _validate_args(self, parsed_args): if (parsed_args.type == 'threshold' and not (parsed_args.meter_name and parsed_args.threshold)): - self.parser.error('threshold requires --meter-name and ' - '--threshold') + self.parser.error('threshold alarm requires -m/--meter-name and ' + '--threshold parameters') elif (parsed_args.type == 'gnocchi_resources_threshold' and not (parsed_args.metric and parsed_args.threshold and parsed_args.resource_id and parsed_args.resource_type