Repository navigation
fix: compare libvirt ceph secret with the decoded key - #230
Merged
Merged
Conversation
Guno327
force-pushed
the
fix/ensure-secret-compare
branch
3 times, most recently
from
October 7, 2026 21:50
8bf7ea8 to
911c357
Compare
Guno327
force-pushed
the
fix/ensure-secret-compare
branch
2 times, most recently
from
November 13, 2026 22:05
2b4008c to
fceb4de
Compare
Raven-182
reviewed
Nov 18, 2026
Signed-off-by: guno327 <gunnar.hovik@canonical.com>
Guno327
force-pushed
the
fix/ensure-secret-compare
branch
from
November 18, 2026 18:56
fceb4de to
98dc25d
Compare
gboutry
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_set_secretstores the ceph key in libvirt base64-decoded, because novaencodes it itself.
_ensure_secretthen compared that stored value againstbase64.b64encode(secret_value.encode()), which is base64 applied twice. Thecheck could never match, so every configure hook took the "wrong value,
replacing" path: it undefined the secret and defined it again.
This compares against
base64.b64decode(secret_value), the same form_set_secretstores. The three_ensure_secretunit tests used a key that isnot valid base64 and a stored value that is not decoded. They matched the
faulty comparison rather than real data, and are corrected.
Assisted-By: Claude Opus 5.5
QA steps
tox -e py3(the three_ensure_secrettests now use a valid base64 keyand the decoded stored value),
tox -e pep8.(
sudo snap set openstack-hypervisor ceph-access.<backend>.uuid=<same uuid>)and check
sudo snap logs openstack-hypervisor: the secret is logged ashaving the desired value, not "replacing".
sudo openstack-hypervisor.virsh secret-listshows the same uuid.
Tested
Live on Sunbeam 2026.1: across snap installs and refreshes, the existing
libvirt secret kept its uuid and was not redefined.