abbreviating --meter-name to -m in alarm commands

related commands of alarm:alarm-threshold-update,alarm-update,alarm-create
should support parameter --meter-name abbreviating to -m like other
commands of ceilometer.

Change-Id: I9fa9a7d14df3d93c3021f5004b444e72e1099c48
Closes-bug: #1268431
This commit is contained in:
ls1175
2014-01-13 10:51:11 +08:00
parent d8ffceeeb7
commit 8efbc188a9

View File

@@ -281,7 +281,7 @@ def common_alarm_arguments(create=False):
help='Length of each period (seconds) to evaluate over')
@utils.arg('--evaluation-periods', type=int, metavar='<COUNT>',
help='Number of periods to evaluate over')
@utils.arg('--meter-name', metavar='<METRIC>', required=True,
@utils.arg('-m', '--meter-name', metavar='<METRIC>', required=True,
help='Metric to evaluate against')
@utils.arg('--statistic', metavar='<STATISTIC>',
help='Statistic to evaluate, one of: ' + str(STATISTICS))
@@ -307,7 +307,7 @@ def do_alarm_create(cc, args={}):
@common_alarm_arguments(create=True)
@utils.arg('--meter-name', metavar='<METRIC>', required=True,
@utils.arg('-m', '--meter-name', metavar='<METRIC>', required=True,
dest='threshold_rule/meter_name',
help='Metric to evaluate against')
@utils.arg('--period', type=int, metavar='<PERIOD>',
@@ -375,7 +375,7 @@ def do_alarm_combination_create(cc, args={}):
help='Length of each period (seconds) to evaluate over')
@utils.arg('--evaluation-periods', type=int, metavar='<COUNT>',
help='Number of periods to evaluate over')
@utils.arg('--meter-name', metavar='<METRIC>',
@utils.arg('-m', '--meter-name', metavar='<METRIC>',
help='Metric to evaluate against')
@utils.arg('--statistic', metavar='<STATISTIC>',
help='Statistic to evaluate, one of: ' + str(STATISTICS))
@@ -406,7 +406,7 @@ def do_alarm_update(cc, args={}):
@utils.arg('-a', '--alarm_id', metavar='<ALARM_ID>', required=True,
help='ID of the alarm to update.')
@common_alarm_arguments()
@utils.arg('--meter-name', metavar='<METRIC>',
@utils.arg('-m', '--meter-name', metavar='<METRIC>',
dest='threshold_rule/meter_name',
help='Metric to evaluate against')
@utils.arg('--period', type=int, metavar='<PERIOD>',