Fix pylint error for storage_helper
modified is_cepth_healthy to return both status and output Change-Id: Iebb903bdc3d3720ae537f3f68e539a347b06693e Signed-off-by: George Postolache <george.postolache@intel.com>
This commit is contained in:
parent
9d859ef3a5
commit
1bfd671cee
|
@ -49,21 +49,21 @@ def is_ceph_healthy(con_ssh=None):
|
||||||
rtn_code, out = con_ssh.exec_cmd('ceph -s')
|
rtn_code, out = con_ssh.exec_cmd('ceph -s')
|
||||||
if rtn_code > 0:
|
if rtn_code > 0:
|
||||||
LOG.warning('ceph -s failed to execute.')
|
LOG.warning('ceph -s failed to execute.')
|
||||||
return False
|
return (False, out)
|
||||||
|
|
||||||
health_state = re.findall('health: (.*)\n', out)
|
health_state = re.findall('health: (.*)\n', out)
|
||||||
if not health_state:
|
if not health_state:
|
||||||
LOG.warning('Unable to determine ceph health state')
|
LOG.warning('Unable to determine ceph health state')
|
||||||
return False
|
return (False, out)
|
||||||
|
|
||||||
health_state = health_state[0]
|
health_state = health_state[0]
|
||||||
if health_ok in health_state:
|
if health_ok in health_state:
|
||||||
LOG.info('CEPH cluster is healthy')
|
LOG.info('CEPH cluster is healthy')
|
||||||
return True
|
return (True, out)
|
||||||
|
|
||||||
msg = 'CEPH unhealthy. State: {}'.format(health_state)
|
msg = 'CEPH unhealthy. State: {}'.format(health_state)
|
||||||
LOG.warning(msg)
|
LOG.warning(msg)
|
||||||
return False
|
return (False, out)
|
||||||
|
|
||||||
|
|
||||||
def get_ceph_osd_count(fail_ok=False, con_ssh=None):
|
def get_ceph_osd_count(fail_ok=False, con_ssh=None):
|
||||||
|
|
Loading…
Reference in New Issue