Ensure relation id is passed to remote_service_name
Its possible for the client_relation handler to be called from outside of the original hook context; as a result use of remote_service_name is not safe as this will evaluate in the current hook context, rather than the relation_id/unit context provided in the function parameters. Passing the relation_id to the helper ensures that the remote units for the intended relation are used to generate the remote service name. Change-Id: I2305a111c0a618156208e4f96acda5e63736051c Closes-Bug: 1819892
This commit is contained in:
parent
17de051792
commit
fe3097f9d7
|
@ -759,7 +759,7 @@ def client_relation(relid=None, unit=None):
|
|||
if ready_for_service():
|
||||
log('mon cluster in quorum and osds bootstrapped '
|
||||
'- providing client with keys, processing broker requests')
|
||||
service_name = hookenv.remote_service_name()
|
||||
service_name = hookenv.remote_service_name(relid=relid)
|
||||
public_addr = get_public_addr()
|
||||
data = {'key': ceph.get_named_key(service_name),
|
||||
'auth': config('auth-supported'),
|
||||
|
|
Loading…
Reference in New Issue