Ensure that Endpoints are discovered for openstack-upgrade

Charms that use the openstack-upgrade action have the option (by
default in charms.openstack) to re-render their configuration files
after the packages have been upgraded.  If that charm has interfaces
that are based on the charms.reactive Endpoint class, then they need to
be discovered by the charms.reactive framework so that they can be
'found' by the from_flag() function when constructing an adapters
instance for the render function in charms.openstack (and ultimately
charm-helpers as a context).,  This involves running the
hookenv._run_atstart() function.

Closes-Bug: #1908267
Change-Id: Idfeac39b6d9974bcbbe1891623ff09cc447d87bb
This commit is contained in:
Alex Kavanagh 2020-12-17 12:11:59 +00:00
parent b3a0a21f8d
commit 8100de4b24
3 changed files with 73 additions and 6 deletions

View File

@ -26,6 +26,7 @@ import charmhelpers.core.hookenv as hookenv
import charms_openstack.bus
import charms_openstack.charm
hookenv._run_atstart()
charms_openstack.bus.discover()

View File

@ -1,5 +1,26 @@
# Requirements to build the layer
charm-tools
ruamel.yaml==0.10.12
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos. See the 'global' dir contents for available
# choices of *requirements.txt files for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
# Build requirements
charm-tools>=2.4.4
# Workaround until https://github.com/juju/charm-tools/pull/589 gets
# published
keyring<21
simplejson
flake8
# Newer versions use keywords that didn't exist in python 3.5 yet (e.g.
# "ModuleNotFoundError")
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
importlib-metadata<3.0.0; python_version < '3.6'
importlib-resources<3.0.0; python_version < '3.6'

View File

@ -1,2 +1,47 @@
flake8>=2.2.4,<=2.4.1
os-testr>=0.4.1
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos. See the 'global' dir contents for available
# choices of *requirements.txt files for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
# Lint and unit test requirements
flake8>=2.2.4
stestr>=2.2.0
# Dependency of stestr. Workaround for
# https://github.com/mtreinish/stestr/issues/145
cliff<3.0.0
# Dependencies of stestr. Newer versions use keywords that didn't exist in
# python 3.5 yet (e.g. "ModuleNotFoundError")
importlib-metadata<3.0.0; python_version < '3.6'
importlib-resources<3.0.0; python_version < '3.6'
# Some Zuul nodes sometimes pull newer versions of these dependencies which
# dropped support for python 3.5:
osprofiler<2.7.0;python_version<'3.6'
stevedore<1.31.0;python_version<'3.6'
debtcollector<1.22.0;python_version<'3.6'
oslo.utils<=3.41.0;python_version<'3.6'
requests>=2.18.4
charms.reactive
# Newer mock seems to have some syntax which is newer than python3.5 (e.g.
# f'{something}'
mock>=1.2,<4.0.0; python_version < '3.6'
mock>=1.2; python_version >= '3.6'
nose>=1.3.7
coverage>=3.6
git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack
#
# Revisit for removal / mock improvement:
netifaces # vault
psycopg2-binary # vault
tenacity # vault
pbr # vault
cryptography # vault, keystone-saml-mellon
lxml # keystone-saml-mellon
hvac # vault, barbican-vault