Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cloud
charms
Federated Keystone
Commits
e935274e
Commit
e935274e
authored
Jul 12, 2018
by
Zuul
Committed by
Gerrit Code Review
Jul 12, 2018
Browse files
Merge "Remove uneccessary calls from update_all_identity_relation_units"
parents
6ff4ff9d
e519e2d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
hooks/keystone_hooks.py
View file @
e935274e
...
...
@@ -263,8 +263,6 @@ def db_joined():
def
update_all_identity_relation_units
(
check_db_ready
=
True
):
if
is_unit_paused_set
():
return
CONFIGS
.
write_all
()
configure_https
()
if
check_db_ready
and
not
is_db_ready
():
log
(
'Allowed_units list provided and this unit not present'
,
level
=
INFO
)
...
...
unit_tests/test_keystone_hooks.py
View file @
e935274e
...
...
@@ -770,7 +770,6 @@ class KeystoneRelationTests(CharmTestCase):
call
(
'Firing identity_credentials_changed hook for all '
'related services.'
)]
hooks
.
update_all_identity_relation_units
(
check_db_ready
=
False
)
self
.
assertTrue
(
configs
.
write_all
.
called
)
identity_changed
.
assert_called_with
(
relation_id
=
'identity-relation:0'
,
remote_unit
=
'unit/0'
)
...
...
@@ -786,7 +785,6 @@ class KeystoneRelationTests(CharmTestCase):
""" Verify update identity relations when DB is not ready """
self
.
is_db_ready
.
return_value
=
False
hooks
.
update_all_identity_relation_units
(
check_db_ready
=
True
)
self
.
assertTrue
(
configs
.
write_all
.
called
)
self
.
assertTrue
(
self
.
is_db_ready
.
called
)
self
.
log
.
assert_called_with
(
'Allowed_units list provided and this '
'unit not present'
,
level
=
'INFO'
)
...
...
@@ -800,7 +798,6 @@ class KeystoneRelationTests(CharmTestCase):
""" Verify update identity relations when DB is not initialized """
is_db_initialized
.
return_value
=
False
hooks
.
update_all_identity_relation_units
(
check_db_ready
=
False
)
self
.
assertTrue
(
configs
.
write_all
.
called
)
self
.
assertFalse
(
self
.
is_db_ready
.
called
)
self
.
log
.
assert_called_with
(
'Database not yet initialised - '
'deferring identity-relation updates'
,
...
...
@@ -816,7 +813,6 @@ class KeystoneRelationTests(CharmTestCase):
self
.
is_elected_leader
.
return_value
=
True
is_db_initialized
.
return_value
=
True
hooks
.
update_all_identity_relation_units
(
check_db_ready
=
False
)
self
.
assertTrue
(
configs
.
write_all
.
called
)
self
.
assertTrue
(
self
.
ensure_initial_admin
.
called
)
# Still updates relations
self
.
assertTrue
(
self
.
relation_ids
.
called
)
...
...
@@ -830,7 +826,6 @@ class KeystoneRelationTests(CharmTestCase):
self
.
is_elected_leader
.
return_value
=
False
is_db_initialized
.
return_value
=
True
hooks
.
update_all_identity_relation_units
(
check_db_ready
=
False
)
self
.
assertTrue
(
configs
.
write_all
.
called
)
self
.
assertFalse
(
self
.
ensure_initial_admin
.
called
)
# Still updates relations
self
.
assertTrue
(
self
.
relation_ids
.
called
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment