Sync charm-helpers and corresponding amulet update

Change-Id: Ie83da73bc865994174f815d218f7dc76d0fad4ad
This commit is contained in:
Corey Bryant 2019-01-11 14:38:06 +00:00
parent 85292511ef
commit e61644060f
4 changed files with 13 additions and 4 deletions

View File

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

View File

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

View File

@ -1241,7 +1241,7 @@ def remote_restart(rel_name, remote_service=None):
def check_actually_paused(services=None, ports=None):
"""Check that services listed in the services object and ports
"""Check that services listed in the services object and and ports
are actually closed (not listened to), to verify that the unit is
properly paused.

View File

@ -424,8 +424,12 @@ class NeutronAPIBasicDeployment(OpenStackAmuletDeployment):
rel_napi_ks['auth_port'])
rel_napi_db = self.pxc_sentry.relation('shared-db',
'neutron-api:shared-db')
db_conn = 'mysql+pymysql://neutron:{}@{}/neutron'.format(
rel_napi_db['password'], rel_napi_db['db_host'])
if self._get_openstack_release() < self.bionic_stein:
dialect = 'mysql'
else:
dialect = 'mysql+pymysql'
db_conn = '{}://neutron:{}@{}/neutron'.format(
dialect, rel_napi_db['password'], rel_napi_db['db_host'])
conf = '/etc/neutron/neutron.conf'
expected = {