Merge "Not able to set threshold value to ‘0’ in aodh alarm creation"
This commit is contained in:
@@ -344,21 +344,22 @@ class CliAlarmCreate(show.ShowOne):
|
|||||||
|
|
||||||
def _validate_args(self, parsed_args):
|
def _validate_args(self, parsed_args):
|
||||||
if (parsed_args.type == 'gnocchi_resources_threshold' and
|
if (parsed_args.type == 'gnocchi_resources_threshold' and
|
||||||
not (parsed_args.metric and parsed_args.threshold and
|
not (parsed_args.metric and parsed_args.threshold is not None
|
||||||
parsed_args.resource_id and parsed_args.resource_type
|
and parsed_args.resource_id and parsed_args.resource_type
|
||||||
and parsed_args.aggregation_method)):
|
and parsed_args.aggregation_method)):
|
||||||
self.parser.error('gnocchi_resources_threshold requires --metric, '
|
self.parser.error('gnocchi_resources_threshold requires --metric, '
|
||||||
'--threshold, --resource-id, --resource-type '
|
'--threshold, --resource-id, --resource-type '
|
||||||
'and --aggregation-method')
|
'and --aggregation-method')
|
||||||
elif (parsed_args.type == 'gnocchi_aggregation_by_metrics_threshold'
|
elif (parsed_args.type == 'gnocchi_aggregation_by_metrics_threshold'
|
||||||
and not (parsed_args.metrics and parsed_args.threshold and
|
and not (parsed_args.metrics
|
||||||
parsed_args.aggregation_method)):
|
and parsed_args.threshold is not None
|
||||||
|
and parsed_args.aggregation_method)):
|
||||||
self.parser.error('gnocchi_aggregation_by_metrics_threshold '
|
self.parser.error('gnocchi_aggregation_by_metrics_threshold '
|
||||||
'requires --metrics, --threshold and '
|
'requires --metrics, --threshold and '
|
||||||
'--aggregation-method')
|
'--aggregation-method')
|
||||||
elif (parsed_args.type == 'gnocchi_aggregation_by_resources_threshold'
|
elif (parsed_args.type == 'gnocchi_aggregation_by_resources_threshold'
|
||||||
and not (parsed_args.metric and parsed_args.threshold and
|
and not (parsed_args.metric and parsed_args.threshold is not None
|
||||||
parsed_args.query and parsed_args.resource_type and
|
and parsed_args.query and parsed_args.resource_type and
|
||||||
parsed_args.aggregation_method)):
|
parsed_args.aggregation_method)):
|
||||||
self.parser.error('gnocchi_aggregation_by_resources_threshold '
|
self.parser.error('gnocchi_aggregation_by_resources_threshold '
|
||||||
'requires --metric, --threshold, '
|
'requires --metric, --threshold, '
|
||||||
|
|||||||
Reference in New Issue
Block a user