Sync charm-helpers and corresponding amulet update
Change-Id: Ic112efef37125b0c47c92f3c168d041467409f3f
This commit is contained in:
parent
52c4bd4448
commit
42b9ced7f3
@ -126,7 +126,7 @@ class CheckException(Exception):
|
||||
|
||||
|
||||
class Check(object):
|
||||
shortname_re = '[A-Za-z0-9-_.]+$'
|
||||
shortname_re = '[A-Za-z0-9-_.@]+$'
|
||||
service_template = ("""
|
||||
#---------------------------------------------------
|
||||
# This file is Juju managed
|
||||
|
@ -97,6 +97,7 @@ from charmhelpers.contrib.network.ip import (
|
||||
)
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
config_flags_parser,
|
||||
get_os_codename_install_source,
|
||||
enable_memcache,
|
||||
CompareOpenStackReleases,
|
||||
os_release,
|
||||
@ -240,6 +241,8 @@ class SharedDBContext(OSContextGenerator):
|
||||
else:
|
||||
rids = relation_ids(self.interfaces[0])
|
||||
|
||||
rel = (get_os_codename_install_source(config('openstack-origin')) or
|
||||
'icehouse')
|
||||
for rid in rids:
|
||||
self.related = True
|
||||
for unit in related_units(rid):
|
||||
@ -253,6 +256,8 @@ class SharedDBContext(OSContextGenerator):
|
||||
'database_password': rdata.get(password_setting),
|
||||
'database_type': 'mysql+pymysql'
|
||||
}
|
||||
if CompareOpenStackReleases(rel) < 'stein':
|
||||
ctxt['database_type'] = 'mysql'
|
||||
if self.context_complete(ctxt):
|
||||
db_ssl(rdata, ctxt, self.ssl_dir)
|
||||
return ctxt
|
||||
|
@ -378,10 +378,15 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
|
||||
unit = self.glance_sentry
|
||||
rel_mq_gl = self.rabbitmq_sentry.relation('amqp', 'glance:amqp')
|
||||
rel_my_gl = self.pxc_sentry.relation('shared-db', 'glance:shared-db')
|
||||
db_uri = "mysql+pymysql://{}:{}@{}/{}".format('glance',
|
||||
rel_my_gl['password'],
|
||||
rel_my_gl['db_host'],
|
||||
'glance')
|
||||
if self._get_openstack_release() < self.bionic_stein:
|
||||
dialect = 'mysql'
|
||||
else:
|
||||
dialect = 'mysql+pymysql'
|
||||
db_uri = "{}://{}:{}@{}/{}".format(dialect,
|
||||
'glance',
|
||||
rel_my_gl['password'],
|
||||
rel_my_gl['db_host'],
|
||||
'glance')
|
||||
conf = '/etc/glance/glance-api.conf'
|
||||
expected = {
|
||||
'DEFAULT': {
|
||||
@ -462,10 +467,15 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
|
||||
u.log.debug('Checking glance registry config file...')
|
||||
unit = self.glance_sentry
|
||||
rel_my_gl = self.pxc_sentry.relation('shared-db', 'glance:shared-db')
|
||||
db_uri = "mysql+pymysql://{}:{}@{}/{}".format('glance',
|
||||
rel_my_gl['password'],
|
||||
rel_my_gl['db_host'],
|
||||
'glance')
|
||||
if self._get_openstack_release() < self.bionic_stein:
|
||||
dialect = 'mysql'
|
||||
else:
|
||||
dialect = 'mysql+pymysql'
|
||||
db_uri = "{}://{}:{}@{}/{}".format(dialect,
|
||||
'glance',
|
||||
rel_my_gl['password'],
|
||||
rel_my_gl['db_host'],
|
||||
'glance')
|
||||
conf = '/etc/glance/glance-registry.conf'
|
||||
|
||||
expected = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user