diff --git a/hooks/utils.py b/hooks/utils.py index 20ab78e..18cde11 100644 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -33,6 +33,7 @@ from charmhelpers.core.strutils import ( bool_from_string, ) from charmhelpers.core.hookenv import ( + application_version_set, local_unit, log, TRACE, @@ -77,6 +78,7 @@ from charmhelpers.fetch import ( apt_install, add_source, apt_update, + get_upstream_version, ) from charmhelpers.contrib.hahelpers.cluster import ( peer_ips, @@ -114,6 +116,8 @@ SYSTEMD_OVERRIDES_FILE = '{}/overrides.conf' MAAS_DNS_CONF_DIR = '/etc/maas_dns' STONITH_CONFIGURED = 'stonith-configured' +VERSION_PACKAGE = "pacemaker" + class MAASConfigIncomplete(Exception): pass @@ -1382,6 +1386,8 @@ def assess_status_helper(): return ("blocked", "Resource: {} not running".format(resource)) + application_version_set(get_upstream_version(VERSION_PACKAGE)) + return status, message diff --git a/test-requirements.txt b/test-requirements.txt index 227ba85..6e428a2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -19,6 +19,8 @@ mock>=1.2,<4.0.0; python_version < '3.6' mock>=1.2; python_version >= '3.6' stestr>=2.2.0 +# stestr requires voluptuous which dropped support for python 3.6 +voluptuous<=0.14.0 # Dependency of stestr. Workaround for # https://github.com/mtreinish/stestr/issues/145