From 1fcbc696490e4b130837ea574c7afc4f0350b788 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Fri, 6 Oct 2017 09:34:06 +0000 Subject: [PATCH] Return early from identity-service-relation-joined After the previous commit landed it was suggested on that it would be cleaner to return early from identity-service-relation-joined if the cluster was partially formed rather than use a long if/else . This change makes that style update. Change-Id: I9dab5d930e13dda6cfe2c6e11648587c87bdb955 Partial-Bug: #1544959 --- hooks/nova_cc_hooks.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hooks/nova_cc_hooks.py b/hooks/nova_cc_hooks.py index 11783ad1..6ce27e0c 100755 --- a/hooks/nova_cc_hooks.py +++ b/hooks/nova_cc_hooks.py @@ -517,15 +517,16 @@ def image_service_changed(): def identity_joined(rid=None): if config('vip') and not is_clustered(): log('Defering registration until clustered', level=DEBUG) - else: - public_url = canonical_url(CONFIGS, PUBLIC) - internal_url = canonical_url(CONFIGS, INTERNAL) - admin_url = canonical_url(CONFIGS, ADMIN) - relation_set( - relation_id=rid, - **determine_endpoints(public_url, - internal_url, - admin_url)) + return + + public_url = canonical_url(CONFIGS, PUBLIC) + internal_url = canonical_url(CONFIGS, INTERNAL) + admin_url = canonical_url(CONFIGS, ADMIN) + relation_set( + relation_id=rid, + **determine_endpoints(public_url, + internal_url, + admin_url)) @hooks.hook('identity-service-relation-changed')