[train] Ensure get_requests_for_local_unit doesn't fail on incomplete relation
This is a rebuild/make sync for charms to pickup the fix in charmhelpers to fix
any inadvertant accesses of ['ca'] in the relation data before it is available
from vault in the certificates relation. Fix in charmhelpers is in [1].
When taking the nova-cloud-controller from single unit to full HA by
increasing the number of units from 1 to 3 and relating it to hacluster,
the data set on the cloud-compute relation is not updated, because the
update_nova_relation() function is only called on
cloud-compute-relation-joined and config-changed, none of these hooks
are executed when scaling out the application.
This patch introduces a call to update_nova_relation() on
ha-relation-changed.
Test case on an environment deployed with a single unit of
nova-cloud-controller:
In nova_cc_utils.py:resolve_hosts_for: .append -> .add
The method was refactored (in part) to use sets to enforce uniqueness of
the hosts. Unfortunately, a list method (.append()) slipped through
that should have been converted to .add(). This fixes that error.
Change-Id: I248430cd1a9156efab745fe110a39441b503b3a5
Closes-Bug: #1992789
(cherry picked from commit 007f9e33b0f111bcd22aebfa785bb5066832e802)
stestr runs tests in parallel and this can cause issues with locking
when SQLite is not mocked out properly and gets used in a test. This
patch just switches Storage to use :memory: so that locking does not
occur.
Closes-Bug: #1908282
Change-Id: Iaa1c7b78dee498e0cc6dc6fccf12e74f22225ecd
(cherry picked from commit 36ef217bc620bebe4475dbb1453d3c82ac5b9d73)
The original code was appending a str to a list rather than either
appending it or adding it as a list of one element. The code avoids
append to avoid unintentional side-effects.
Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
Closes-Bug: #1927698
(cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)
importlib-metadata 5.0.0 breaks compatibility with setuptools that is
pinned in the train track for bionic; thus this pins allows the py37
tests to pass.
This is the main patch for the migration of the stable/21.10
charm to charmhub for the stable/train branch (train track on
charmhub). This patch initially supports bionic from queens
to train, and does not support ussuri. It supports upgrades
from bionic-queens to bionic-train (with each intermediate
step needed). Crucially it does NOT set a default
openstack-origin, which means installing train/stable
without specifying the openstack-origin will result in a
bionic-queens installation. This is intentional as the branch
covers queens to train.