Database is optional for nova-compute. Fix decorator ordering

This commit is contained in:
David Ames 2015-09-29 08:14:35 -07:00
parent 335b6bf2a3
commit 5dd57d970a
2 changed files with 5 additions and 3 deletions

View File

@ -288,9 +288,9 @@ def compute_changed():
@hooks.hook('ceph-relation-joined')
@restart_on_change(restart_map())
@os_workload_status(CONFIGS, REQUIRED_INTERFACES,
charm_func=check_optional_relations)
@restart_on_change(restart_map())
def ceph_joined():
status_set('maintenance', 'Installing apt packages')
apt_install(filter_installed_packages(['ceph-common']), fatal=True)
@ -306,9 +306,9 @@ def get_ceph_request():
@hooks.hook('ceph-relation-changed')
@restart_on_change(restart_map())
@os_workload_status(CONFIGS, REQUIRED_INTERFACES,
charm_func=check_optional_relations)
@restart_on_change(restart_map())
def ceph_changed():
if 'ceph' not in CONFIGS.complete_contexts():
log('ceph relation incomplete. Peer not ready?')

View File

@ -253,7 +253,6 @@ LIBVIRT_URIS = {
# The interface is said to be satisfied if anyone of the interfaces in the
# list has a complete context.
REQUIRED_INTERFACES = {
'database': ['shared-db', 'pgsql-db'],
'message': ['amqp', 'zeromq-configuration'],
'image': ['image-service'],
}
@ -849,6 +848,9 @@ def check_optional_relations(configs):
if relation_ids('neutron-plugin'):
required_interfaces['neutron-plugin'] = ['neutron-plugin']
if relation_ids('shared-db') or relation_ids('pgsql-db'):
required_interfaces['database'] = ['shared-db', 'pgsql-db']
if required_interfaces:
set_os_workload_status(configs, required_interfaces)
return status_get()