Skip to content

Commit

Permalink
Drop assess_status() as it's duplicating work done by set_os_workload…
Browse files Browse the repository at this point in the history
…_status().
  • Loading branch information
Corey Bryant committed Oct 9, 2015
1 parent 39e1045 commit 1a02c96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 1 addition & 3 deletions hooks/swift_storage_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
PACKAGES,
RESTART_MAP,
SWIFT_SVCS,
assess_status,
determine_block_devices,
do_openstack_upgrade,
ensure_swift_directories,
Expand Down Expand Up @@ -167,8 +166,7 @@ def main():
hooks.execute(sys.argv)
except UnregisteredHookError as e:
log('Unknown hook {} - skipping.'.format(e))
set_os_workload_status(CONFIGS, REQUIRED_INTERFACES,
charm_func=assess_status)
set_os_workload_status(CONFIGS, REQUIRED_INTERFACES)


if __name__ == '__main__':
Expand Down
12 changes: 0 additions & 12 deletions lib/swift_storage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,3 @@ def setup_rsync():
f = open('/etc/rsyncd.conf', 'w')
f.write(rsyncd_base)
f.close()


def assess_status(configs):
"""Assess status of current unit"""
# Verify swift-hash received from swift-proxy
ctxt = SwiftStorageContext()()
if len(relation_ids('swift-storage')) < 1:
return '', ''
elif not ctxt or not ctxt['swift_hash']:
return 'blocked', 'Missing swift-hash from proxy relation'
else:
return 'active', 'Unit is ready'

0 comments on commit 1a02c96

Please sign in to comment.