Add application version on HA Cluster charm

Closes-Bug: #2031438
Change-Id: I4dab721ebe42d4c43c09a98204ce8113892aa817
(cherry picked from commit aa557b85b7)
This commit is contained in:
Gabriel Cocenza 2023-08-16 10:58:24 -03:00
parent c72b3947fc
commit ba1303d984
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -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
@ -1374,6 +1378,8 @@ def assess_status_helper():
return ("blocked",
"Resource: {} not running".format(resource))
application_version_set(get_upstream_version(VERSION_PACKAGE))
return status, message

View File

@ -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