diff --git a/hooks/charmhelpers/contrib/hahelpers/cluster.py b/hooks/charmhelpers/contrib/hahelpers/cluster.py index b948cb3c..bf832f7d 100644 --- a/hooks/charmhelpers/contrib/hahelpers/cluster.py +++ b/hooks/charmhelpers/contrib/hahelpers/cluster.py @@ -28,8 +28,6 @@ class HAIncompleteConfig(Exception): def is_clustered(): - if relation_ids('ha'): - else: for r_id in (relation_ids('ha') or []): for unit in (relation_list(r_id) or []): clustered = relation_get('clustered', @@ -70,7 +68,6 @@ def oldest_peer(peers): remote_unit_no = int(peer.split('/')[1]) if remote_unit_no < local_unit_no: return False - else: return True diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 3e14beb6..94278ce8 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -42,7 +42,6 @@ from neutron_api_utils import ( restart_map, NEUTRON_CONF, api_port, - auth_token_config, keystone_ca_cert_b64, CLUSTER_RES, ) @@ -137,30 +136,6 @@ def postgresql_neutron_db_changed(): # DB config might have been moved to main neutron.conf in H? CONFIGS.write(neutron_plugin_attribute(plugin, 'config')) -def _auth_config(): - '''Grab all KS auth token config from api-paste.ini, or return empty {}''' - ks_auth_host = auth_token_config('auth_host') - if not ks_auth_host: - # if there is no auth_host set, identity-service changed hooks - # have not fired, yet. - return {} - cfg = { - 'auth_host': ks_auth_host, - 'auth_port': auth_token_config('auth_port'), - 'auth_protocol': auth_token_config('auth_protocol'), - 'service_protocol': auth_token_config('service_protocol'), - 'service_port': auth_token_config('service_port'), - 'service_username': auth_token_config('admin_user'), - 'service_password': auth_token_config('admin_password'), - 'service_tenant_name': auth_token_config('admin_tenant_name'), - 'auth_uri': auth_token_config('auth_uri'), - # quantum-gateway interface deviates a bit. - 'keystone_host': ks_auth_host, - 'service_tenant': auth_token_config('admin_tenant_name'), - } - return cfg - - @hooks.hook('amqp-relation-broken', 'identity-service-relation-broken', 'shared-db-relation-broken', diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index 733def00..bd9bf436 100644 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -132,7 +132,7 @@ def resource_map(): # update for postgres resource_map[conf]['contexts'].append( - neutron_api_context.NeutronPostgresqlDBContext()) + context.PostgresqlDBContext(database=config('database'))) return resource_map