Add return messages to log_mds and log_osds. assess_status crashes if None is returned
This commit is contained in:
parent
3e3552584c
commit
4c1ae21a49
|
@ -116,14 +116,14 @@ def log_osds():
|
||||||
# Check for mon relation
|
# Check for mon relation
|
||||||
if len(relation_ids('mon')) < 1:
|
if len(relation_ids('mon')) < 1:
|
||||||
status_set('blocked', 'Missing relation: monitor')
|
status_set('blocked', 'Missing relation: monitor')
|
||||||
return
|
return 'blocked', 'Missing relation: monitor'
|
||||||
|
|
||||||
# Check for monitors with presented addresses
|
# Check for monitors with presented addresses
|
||||||
# Check for bootstrap key presentation
|
# Check for bootstrap key presentation
|
||||||
monitors = get_mon_hosts()
|
monitors = get_mon_hosts()
|
||||||
if len(monitors) < 1 or not get_conf('osd_bootstrap_key'):
|
if len(monitors) < 1 or not get_conf('osd_bootstrap_key'):
|
||||||
status_set('waiting', 'Incomplete relation: monitor')
|
status_set('waiting', 'Incomplete relation: monitor')
|
||||||
return
|
return 'waiting', 'Incomplete relation: monitor'
|
||||||
|
|
||||||
# Check for OSD device creation parity i.e. at least some devices
|
# Check for OSD device creation parity i.e. at least some devices
|
||||||
# must have been presented and used for this charm to be operational
|
# must have been presented and used for this charm to be operational
|
||||||
|
@ -138,15 +138,12 @@ def log_osds():
|
||||||
|
|
||||||
def log_mds():
|
def log_mds():
|
||||||
if len(relation_ids('mon')) < 1:
|
if len(relation_ids('mon')) < 1:
|
||||||
status_set('blocked', 'Missing relation: monitor')
|
return 'blocked', 'Missing relation: monitor'
|
||||||
return
|
|
||||||
running_mds = get_running_mds()
|
running_mds = get_running_mds()
|
||||||
if not running_mds:
|
if not running_mds:
|
||||||
return ('blocked',
|
return 'blocked', 'No MDS detected using current configuration'
|
||||||
'No MDS detected using current configuration')
|
|
||||||
else:
|
else:
|
||||||
return ('active',
|
return 'active', 'Unit is ready ({} MDS)'.format(len(running_mds))
|
||||||
'Unit is ready ({} MDS)'.format(len(running_mds)))
|
|
||||||
|
|
||||||
# Per https://github.com/juju-solutions/charms.reactive/issues/33,
|
# Per https://github.com/juju-solutions/charms.reactive/issues/33,
|
||||||
# this module may be imported multiple times so ensure the
|
# this module may be imported multiple times so ensure the
|
||||||
|
|
Loading…
Reference in New Issue