Merge "Add abbreviation of --meter-name hint in threshold alarm creation"
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user