Ensure remote service name is resolved

In the event that no units have presented on a relation, the
remote_service_name function will return 'None'.

Ensure this situation is detected and skip broker request
processing if this is the case.

Change-Id: I210ed914326761b7b353a7b86303d8877a112ca5
Related-Bug: 1819892
This commit is contained in:
James Page 2019-03-14 13:54:17 +00:00
parent 3b9ca42751
commit 2dd7491a3e
1 changed files with 4 additions and 0 deletions

View File

@ -760,6 +760,10 @@ def client_relation(relid=None, unit=None):
log('mon cluster in quorum and osds bootstrapped '
'- providing client with keys, processing broker requests')
service_name = hookenv.remote_service_name(relid=relid)
if not service_name:
log('Unable to determine remote service name, deferring '
'processing of broker requests')
return
public_addr = get_public_addr()
data = {'key': ceph.get_named_key(service_name),
'auth': config('auth-supported'),