Duplicate ssh keys after every upgrade-charm hook
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Nova Cloud Controller Charm |
Fix Released
|
Undecided
|
Rodrigo Barbieri |
Bug Description
version: stable/21.04
deployment: bionic-ussuri
Upon deploying this charm and then trying to upgrade it (even if the code is exactly the same), when the upgrade-charm hook runs, the contents of:
- /etc/nova/
- /etc/nova/
- cloud-compute relations
gets duplicated.
Starting a fresh deploying with 3 compute nodes:
- authorized_keys has 3 keys
- known_hosts has 9 keys, where they are already duplicated 3 times with only the host hash being different
Investigating this, I found:
Condition [0] always returns false. Testing with "public_key in keys.read()" works.
Command [1] exit code is always 1, therefore the function always returns None. Also, testing the command does not show "'# Host xx found: line 1 type RSA'," as the code comment implies. When the code is changed to always return the output even if RC=1 (and lines[0] instead of lines[1]) the deduplication logic at [2] is invoked and works.
Changed in charm-nova-cloud-controller: | |
assignee: | nobody → Rodrigo Barbieri (rodrigo-barbieri2010) |
Changed in charm-nova-cloud-controller: | |
milestone: | none → 21.10 |
Changed in charm-nova-cloud-controller: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. opendev. org/c/openstack /charm- nova-cloud- controller/ +/809281
Review: https:/