Merge "Add abbreviation of --meter-name hint in threshold alarm creation"

This commit is contained in:
Jenkins
2016-02-17 13:36:16 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -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):

View File

@@ -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