def neutron_settings(): neutron_settings = {} if is_relation_made('neutron-api', 'neutron-plugin'): neutron_api_info = NeutronAPIContext()() neutron_settings.update({ # XXX: Rename these relations settings? 'quantum_plugin': neutron_api_info['neutron_plugin'], 'region': config('region'), 'quantum_security_groups': neutron_api_info['neutron_security_groups'], 'quantum_url': neutron_api_info['neutron_url'], }) else: neutron_settings.update({ # XXX: Rename these relations settings? 'quantum_plugin': neutron_plugin(), 'region': config('region'), 'quantum_security_groups': config('quantum-security-groups'), 'quantum_url': "{}:{}".format(canonical_url(CONFIGS, INTERNAL), str(api_port('neutron-server'))), }) neutron_url = urlparse(neutron_settings['quantum_url']) neutron_settings['quantum_host'] = neutron_url.hostname neutron_settings['quantum_port'] = neutron_url.port return neutron_settings
def nova_vmware_relation_joined(rid=None): rel_settings = {'network_manager': network_manager()} ks_auth = _auth_config() if ks_auth: rel_settings.update(ks_auth) rel_settings.update({ 'quantum_plugin': neutron_plugin(), 'quantum_security_groups': config('quantum-security-groups'), 'quantum_url': "{}:{}".format(canonical_url(CONFIGS, INTERNAL), str(api_port('neutron-server')))}) relation_set(relation_id=rid, **rel_settings)
def db_changed(): if 'shared-db' not in CONFIGS.complete_contexts(): log('shared-db relation incomplete. Peer not ready?') return CONFIGS.write(NOVA_CONF) if network_manager() in ['neutron', 'quantum']: plugin = neutron_plugin() # DB config might have been moved to main neutron.conf in H? CONFIGS.write(neutron_plugin_attribute(plugin, 'config')) if eligible_leader(CLUSTER_RES): migrate_database() log('Triggering remote cloud-compute restarts.') [compute_joined(rid=rid, remote_restart=True) for rid in relation_ids('cloud-compute')]
def nova_vmware_relation_joined(rid=None): rel_settings = {'network_manager': network_manager()} ks_auth = _auth_config() if ks_auth: rel_settings.update(ks_auth) rel_settings.update({ 'quantum_plugin': neutron_plugin(), 'quantum_security_groups': config('quantum-security-groups'), 'quantum_url': "{}:{}".format(canonical_url(CONFIGS, INTERNAL), str(api_port('neutron-server'))) }) relation_set(relation_id=rid, **rel_settings)
def keystone_compute_settings(): ks_auth_config = _auth_config() rel_settings = {} if network_manager() in ['quantum', 'neutron']: if ks_auth_config: rel_settings.update(ks_auth_config) rel_settings.update({ # XXX: Rename these relations settings? 'quantum_plugin': neutron_plugin(), 'region': config('region'), 'quantum_security_groups': config('quantum-security-groups'), 'quantum_url': (canonical_url(CONFIGS) + ':' + str(api_port('neutron-server'))), }) ks_ca = keystone_ca_cert_b64() if ks_auth_config and ks_ca: rel_settings['ca_cert'] = ks_ca return rel_settings
def quantum_joined(rid=None): if not eligible_leader(CLUSTER_RES): return url = canonical_url(CONFIGS) + ':9696' # XXX: Can we rename to neutron_*? rel_settings = { 'quantum_host': urlparse(url).hostname, 'quantum_url': url, 'quantum_port': 9696, 'quantum_plugin': neutron_plugin(), 'region': config('region') } # inform quantum about local keystone auth config ks_auth_config = _auth_config() rel_settings.update(ks_auth_config) # must pass the keystone CA cert, if it exists. ks_ca = keystone_ca_cert_b64() if ks_auth_config and ks_ca: rel_settings['ca_cert'] = ks_ca relation_set(relation_id=rid, **rel_settings)
def postgresql_neutron_db_changed(): if network_manager() in ['neutron', 'quantum']: plugin = neutron_plugin() # DB config might have been moved to main neutron.conf in H? CONFIGS.write(neutron_plugin_attribute(plugin, 'config'))
def plugin(self): from nova_cc_utils import neutron_plugin return neutron_plugin()