def amqp_changed(): if 'amqp' not in CONFIGS.complete_contexts(): log('amqp relation incomplete. Peer not ready?') return CONFIGS.write(NOVA_CONF) if network_manager() == 'quantum' and neutron_plugin() == 'ovs': CONFIGS.write(QUANTUM_CONF) if network_manager() == 'neutron' and neutron_plugin() == 'ovs': CONFIGS.write(NEUTRON_CONF)
def db_changed(): if 'shared-db' not in CONFIGS.complete_contexts(): log('shared-db relation incomplete. Peer not ready?') return CONFIGS.write(NOVA_CONF) nm = network_manager() plugin = neutron_plugin() if nm in ['quantum', 'neutron'] and plugin == 'ovs': CONFIGS.write(neutron_plugin_attribute(plugin, 'config', nm))
def compute_changed(): # rewriting all configs to pick up possible net or vol manager # config advertised from controller. CONFIGS.write_all() import_authorized_keys() import_keystone_ca_cert() if (network_manager() in ['quantum', 'neutron'] and neutron_plugin() == 'ovs'): # in case we already have a database relation, need to request # access to the additional neutron database. [db_joined(rid) for rid in relation_ids('shared-db')]
def db_joined(rid=None): relation_set(relation_id=rid, nova_database=config('database'), nova_username=config('database-user'), nova_hostname=unit_get('private-address')) if (network_manager() in ['quantum', 'neutron'] and neutron_plugin() == 'ovs'): # XXX: Renaming relations from quantum_* to neutron_* here. relation_set(relation_id=rid, neutron_database=config('neutron-database'), neutron_username=config('neutron-database-user'), neutron_hostname=unit_get('private-address'))
def _neutron_plugin(): from nova_compute_utils import neutron_plugin return neutron_plugin()