[ionutbalutoiu, r=thedac] Variable 'swift-url' is useful when generating temporary URLs with Swift.
Adds object-store-relation-joined hook. Needed for OpenStack Ironic charm (http://bazaar.launchpad.net/~cloudbaseit/charms/trusty/ironic/trunk/view/head:/hooks/ironic_context.py#L99), but might also be generally useful.
This commit is contained in:
@@ -152,6 +152,9 @@ def config_changed():
|
|||||||
for r_id in relation_ids('identity-service'):
|
for r_id in relation_ids('identity-service'):
|
||||||
keystone_joined(relid=r_id)
|
keystone_joined(relid=r_id)
|
||||||
|
|
||||||
|
for r_id in relation_ids('object-store'):
|
||||||
|
object_store_joined(relation_id=r_id)
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('identity-service-relation-joined')
|
@hooks.hook('identity-service-relation-joined')
|
||||||
def keystone_joined(relid=None):
|
def keystone_joined(relid=None):
|
||||||
@@ -256,6 +259,16 @@ def storage_broken():
|
|||||||
CONFIGS.write_all()
|
CONFIGS.write_all()
|
||||||
|
|
||||||
|
|
||||||
|
@hooks.hook('object-store-relation-joined')
|
||||||
|
def object_store_joined(relation_id=None):
|
||||||
|
relation_data = {
|
||||||
|
'swift-url':
|
||||||
|
"{}:{}".format(canonical_url(CONFIGS, INTERNAL), config('bind-port'))
|
||||||
|
}
|
||||||
|
|
||||||
|
relation_set(relation_id=relation_id, **relation_data)
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('cluster-relation-joined')
|
@hooks.hook('cluster-relation-joined')
|
||||||
def cluster_joined(relation_id=None):
|
def cluster_joined(relation_id=None):
|
||||||
for addr_type in ADDRESS_TYPES:
|
for addr_type in ADDRESS_TYPES:
|
||||||
|
|||||||
Reference in New Issue
Block a user