Have change_alarm_state return success or failure
And actually check it in smoke.py Change-Id: I888bca006b5c0e82dd11601a2e5824579fad1048
This commit is contained in:
parent
ff8d05780a
commit
2ae8b2bbef
@ -71,7 +71,8 @@ def change_alarm_state(alarm_id, new_state):
|
||||
if result_json['state'] != new_state:
|
||||
print('Alarm patch failed, expected state of %s but was %s' %
|
||||
(result_json['state'], new_state), file=sys.stderr)
|
||||
return 1
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def find_alarms_for_definition(alarm_definition_id):
|
||||
|
@ -207,7 +207,10 @@ def smoke_test(mail_host, metric_host):
|
||||
|
||||
new_state = 'OK'
|
||||
states.append(new_state)
|
||||
cli_wrapper.change_alarm_state(alarm_id, new_state)
|
||||
if not cli_wrapper.change_alarm_state(alarm_id, new_state):
|
||||
print('Unabled to change Alarm state', file=sys.stderr)
|
||||
return False
|
||||
|
||||
# There is a bug in the API which allows this to work. Soon that
|
||||
# will be fixed and this will fail
|
||||
if len(sys.argv) > 1:
|
||||
|
Loading…
Reference in New Issue
Block a user