Write policy.json on leader-settings-changed

Commit 855c954c30 revealed a bug
that occurrs some times when having multpile Keystone units.

Change-Id: I7bfce6db6b0dba855af32aef4c3f496f03a5a34b
Related-Bug: #1637453
This commit is contained in:
Frode Nordahl 2018-07-23 15:43:26 +02:00
parent f1a112c193
commit c5f616e99b
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
2 changed files with 8 additions and 1 deletions

View File

@ -480,6 +480,9 @@ def leader_settings_changed():
# sure only the leader is running the cron job.
CONFIGS.write(TOKEN_FLUSH_CRON_FILE)
# Make sure we keep domain and/or project ids used in templates up to date
CONFIGS.write(POLICY_JSON)
update_all_identity_relation_units()

View File

@ -455,7 +455,11 @@ class KeystoneRelationTests(CharmTestCase):
self.relation_ids.return_value = ['identity:1']
self.related_units.return_value = ['keystone/1']
hooks.leader_settings_changed()
mock_write.assert_has_calls([call(utils.TOKEN_FLUSH_CRON_FILE)])
mock_write.assert_has_calls(
[
call(utils.TOKEN_FLUSH_CRON_FILE),
call(utils.POLICY_JSON),
])
self.assertTrue(update.called)
def test_ha_joined(self):