Merge hloeung's admin relation code into current trunk.
This is meant to fix up https://code.launchpad.net/~hloeung/charms/precise/keystone/add-admin-relation/+merge/212759 to work with the current trusty/icehouse version of the charm.
This commit is contained in:
commit
71cb3d9285
1
.bzrignore
Normal file
1
.bzrignore
Normal file
@ -0,0 +1 @@
|
||||
revision
|
1
hooks/identity-admin-relation-changed
Symbolic link
1
hooks/identity-admin-relation-changed
Symbolic link
@ -0,0 +1 @@
|
||||
keystone_hooks.py
|
1
hooks/identity-admin-relation-joined
Symbolic link
1
hooks/identity-admin-relation-joined
Symbolic link
@ -0,0 +1 @@
|
||||
keystone_hooks.py
|
@ -51,6 +51,7 @@ from keystone_utils import (
|
||||
CLUSTER_RES,
|
||||
KEYSTONE_CONF,
|
||||
SSH_USER,
|
||||
stored_passwd,
|
||||
)
|
||||
|
||||
from charmhelpers.contrib.hahelpers.cluster import (
|
||||
@ -242,6 +243,27 @@ def ha_changed():
|
||||
service_host=config('vip'))
|
||||
|
||||
|
||||
@hooks.hook('identity-admin-relation-joined')
|
||||
def admin_relation_joined():
|
||||
""" Do nothing until we get information about requested service """
|
||||
pass
|
||||
|
||||
|
||||
@hooks.hook('identity-admin-relation-changed')
|
||||
def admin_relation_changed():
|
||||
relation_data = {
|
||||
'service_hostname': config('hostname'),
|
||||
'service_port': config('service-port'),
|
||||
'service_username': config('admin-user'),
|
||||
'service_tenant_name': config('admin-role'),
|
||||
'service_region': config('region'),
|
||||
}
|
||||
if os.path.isfile(stored_passwd):
|
||||
with open(stored_passwd) as f:
|
||||
relation_data['service_password'] = f.readline().strip('\n')
|
||||
relation_set(**relation_data)
|
||||
|
||||
|
||||
def configure_https():
|
||||
'''
|
||||
Enables SSL API Apache config if appropriate and kicks identity-service
|
||||
|
@ -9,6 +9,8 @@ categories: ["misc"]
|
||||
provides:
|
||||
identity-service:
|
||||
interface: keystone
|
||||
identity-admin:
|
||||
interface: keystone-admin
|
||||
requires:
|
||||
shared-db:
|
||||
interface: mysql-shared
|
||||
|
Loading…
x
Reference in New Issue
Block a user