Set action output for get_health
Change-Id: I23287bd153f1e61a94593734b1de43ef6abad36a Closes-Bug: 1808189
This commit is contained in:
parent
e7c2c31fa7
commit
d78297c6b3
|
@ -66,7 +66,7 @@ def get_health():
|
|||
On error, 'unknown' is returned.
|
||||
"""
|
||||
try:
|
||||
value = check_output(['ceph', 'health'])
|
||||
value = check_output(['ceph', 'health']).decode('utf-8')
|
||||
return value
|
||||
except CalledProcessError as e:
|
||||
action_fail(e.message)
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from ceph_ops import get_health
|
||||
from charmhelpers.core.hookenv import log, action_set, action_fail
|
||||
|
||||
if __name__ == '__main__':
|
||||
get_health()
|
||||
try:
|
||||
action_set({'message': get_health()})
|
||||
except CalledProcessError as e:
|
||||
log(e)
|
||||
action_fail(
|
||||
"ceph health failed with message: {}".format(str(e)))
|
Loading…
Reference in New Issue