Gate initial update of relations on having reached expected scale

At present the Keystone charm frequently initiates updates to its
relations before it has reached a stable state.

Make use information from ``juju goal-state`` to predict scale and gate
initial update of relations on having reached expected scale.

Depends-On: https://github.com/juju/charm-helpers/pull/226
Change-Id: I96d4aff7c4ec9fb9ea160c7e294581bab3103df8
This commit is contained in:
Frode Nordahl
2018-10-02 16:36:04 +02:00
parent 78f2e5e049
commit a449a53885
6 changed files with 206 additions and 7 deletions

View File

@@ -104,6 +104,7 @@ from keystone_utils import (
send_notifications,
is_db_ready,
is_db_initialised,
is_expected_scale,
filter_null,
is_service_present,
delete_service_entry,
@@ -310,6 +311,10 @@ def update_all_identity_relation_units(check_db_ready=True):
log("Database not yet initialised - deferring identity-relation "
"updates", level=INFO)
return
if not is_expected_scale():
log("Keystone charm and it's dependencies not yet at expected scale "
"- deferring identity-relation updates", level=INFO)
return
log('Firing identity_changed hook for all related services.')
for rid in relation_ids('identity-service'):