Use standard CLI object-verb ordering for alarm-{g|s}set-state

The openstack CLIs all use an object-followed-by-verb ordering
convention when construct command names.

Follow a similar convention for commands to get and set alarm
state.

Change-Id: I34e0f450019556c80476df782d4c86dca08bdc9d
This commit is contained in:
Eoghan Glynn
2013-10-02 09:59:47 +00:00
parent 7c8a676b43
commit fc201b3805
2 changed files with 4 additions and 4 deletions

View File

@@ -28,12 +28,12 @@ class ShellAlarmStateCommandsTest(utils.BaseTestCase):
self.args.alarm_id = self.ALARM_ID
def test_alarm_state_get(self):
ceilometer_shell.do_alarm_get_state(self.cc, self.args)
ceilometer_shell.do_alarm_state_get(self.cc, self.args)
self.cc.alarms.get_state.assert_called_once_with(self.ALARM_ID)
self.assertFalse(self.cc.alarms.set_state.called)
def test_alarm_state_set(self):
self.args.state = 'ok'
ceilometer_shell.do_alarm_set_state(self.cc, self.args)
ceilometer_shell.do_alarm_state_set(self.cc, self.args)
self.cc.alarms.set_state.assert_called_once_with(self.ALARM_ID, 'ok')
self.assertFalse(self.cc.alarms.get_state.called)

View File

@@ -420,7 +420,7 @@ def do_alarm_delete(cc, args={}):
help='ID of the alarm state to set.')
@utils.arg('--state', metavar='<STATE>', required=True,
help='State of the alarm, one of: ' + str(ALARM_STATES))
def do_alarm_set_state(cc, args={}):
def do_alarm_state_set(cc, args={}):
'''Set the state of an alarm.'''
try:
state = cc.alarms.set_state(args.alarm_id, args.state)
@@ -431,7 +431,7 @@ def do_alarm_set_state(cc, args={}):
@utils.arg('-a', '--alarm_id', metavar='<ALARM_ID>', required=True,
help='ID of the alarm state to show.')
def do_alarm_get_state(cc, args={}):
def do_alarm_state_get(cc, args={}):
'''Get the state of an alarm.'''
try:
state = cc.alarms.get_state(args.alarm_id)