Sync charm-helpers
Change-Id: I5606f92ca4e17494df32dcfbb6387ca28c28da62
This commit is contained in:
parent
04f4e6e756
commit
2ff1a3c347
@ -90,6 +90,6 @@ def install_ca_cert(ca_cert):
|
|||||||
log("CA cert is the same as installed version", level=INFO)
|
log("CA cert is the same as installed version", level=INFO)
|
||||||
else:
|
else:
|
||||||
log("Installing new CA cert", level=INFO)
|
log("Installing new CA cert", level=INFO)
|
||||||
with open(cert_file, 'w') as crt:
|
with open(cert_file, 'wb') as crt:
|
||||||
crt.write(ca_cert)
|
crt.write(ca_cert)
|
||||||
subprocess.check_call(['update-ca-certificates', '--fresh'])
|
subprocess.check_call(['update-ca-certificates', '--fresh'])
|
||||||
|
@ -270,7 +270,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
(self.trusty_icehouse, self.trusty_kilo, self.trusty_liberty,
|
(self.trusty_icehouse, self.trusty_kilo, self.trusty_liberty,
|
||||||
self.trusty_mitaka, self.xenial_mitaka, self.xenial_newton,
|
self.trusty_mitaka, self.xenial_mitaka, self.xenial_newton,
|
||||||
self.yakkety_newton, self.xenial_ocata, self.zesty_ocata,
|
self.yakkety_newton, self.xenial_ocata, self.zesty_ocata,
|
||||||
self.xenial_pike, self.artful_pike) = range(11)
|
self.xenial_pike, self.artful_pike, self.xenial_queens,
|
||||||
|
self.bionic_queens,) = range(13)
|
||||||
|
|
||||||
releases = {
|
releases = {
|
||||||
('trusty', None): self.trusty_icehouse,
|
('trusty', None): self.trusty_icehouse,
|
||||||
@ -281,9 +282,11 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
('xenial', 'cloud:xenial-newton'): self.xenial_newton,
|
('xenial', 'cloud:xenial-newton'): self.xenial_newton,
|
||||||
('xenial', 'cloud:xenial-ocata'): self.xenial_ocata,
|
('xenial', 'cloud:xenial-ocata'): self.xenial_ocata,
|
||||||
('xenial', 'cloud:xenial-pike'): self.xenial_pike,
|
('xenial', 'cloud:xenial-pike'): self.xenial_pike,
|
||||||
|
('xenial', 'cloud:xenial-queens'): self.xenial_queens,
|
||||||
('yakkety', None): self.yakkety_newton,
|
('yakkety', None): self.yakkety_newton,
|
||||||
('zesty', None): self.zesty_ocata,
|
('zesty', None): self.zesty_ocata,
|
||||||
('artful', None): self.artful_pike,
|
('artful', None): self.artful_pike,
|
||||||
|
('bionic', None): self.bionic_queens,
|
||||||
}
|
}
|
||||||
return releases[(self.series, self.openstack)]
|
return releases[(self.series, self.openstack)]
|
||||||
|
|
||||||
@ -298,6 +301,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
('yakkety', 'newton'),
|
('yakkety', 'newton'),
|
||||||
('zesty', 'ocata'),
|
('zesty', 'ocata'),
|
||||||
('artful', 'pike'),
|
('artful', 'pike'),
|
||||||
|
('bionic', 'queens'),
|
||||||
])
|
])
|
||||||
if self.openstack:
|
if self.openstack:
|
||||||
os_origin = self.openstack.split(':')[1]
|
os_origin = self.openstack.split(':')[1]
|
||||||
@ -310,8 +314,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
test scenario, based on OpenStack release and whether ceph radosgw
|
test scenario, based on OpenStack release and whether ceph radosgw
|
||||||
is flagged as present or not."""
|
is flagged as present or not."""
|
||||||
|
|
||||||
if self._get_openstack_release() <= self.trusty_juno:
|
if self._get_openstack_release() == self.trusty_icehouse:
|
||||||
# Juno or earlier
|
# Icehouse
|
||||||
pools = [
|
pools = [
|
||||||
'data',
|
'data',
|
||||||
'metadata',
|
'metadata',
|
||||||
@ -319,7 +323,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
'cinder-ceph',
|
'cinder-ceph',
|
||||||
'glance'
|
'glance'
|
||||||
]
|
]
|
||||||
elif (self.trust_kilo <= self._get_openstack_release() <=
|
elif (self.trusty_kilo <= self._get_openstack_release() <=
|
||||||
self.zesty_ocata):
|
self.zesty_ocata):
|
||||||
# Kilo through Ocata
|
# Kilo through Ocata
|
||||||
pools = [
|
pools = [
|
||||||
|
@ -293,7 +293,7 @@ class PostgresqlDBContext(OSContextGenerator):
|
|||||||
def db_ssl(rdata, ctxt, ssl_dir):
|
def db_ssl(rdata, ctxt, ssl_dir):
|
||||||
if 'ssl_ca' in rdata and ssl_dir:
|
if 'ssl_ca' in rdata and ssl_dir:
|
||||||
ca_path = os.path.join(ssl_dir, 'db-client.ca')
|
ca_path = os.path.join(ssl_dir, 'db-client.ca')
|
||||||
with open(ca_path, 'w') as fh:
|
with open(ca_path, 'wb') as fh:
|
||||||
fh.write(b64decode(rdata['ssl_ca']))
|
fh.write(b64decode(rdata['ssl_ca']))
|
||||||
|
|
||||||
ctxt['database_ssl_ca'] = ca_path
|
ctxt['database_ssl_ca'] = ca_path
|
||||||
@ -308,12 +308,12 @@ def db_ssl(rdata, ctxt, ssl_dir):
|
|||||||
log("Waiting 1m for ssl client cert validity", level=INFO)
|
log("Waiting 1m for ssl client cert validity", level=INFO)
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
||||||
with open(cert_path, 'w') as fh:
|
with open(cert_path, 'wb') as fh:
|
||||||
fh.write(b64decode(rdata['ssl_cert']))
|
fh.write(b64decode(rdata['ssl_cert']))
|
||||||
|
|
||||||
ctxt['database_ssl_cert'] = cert_path
|
ctxt['database_ssl_cert'] = cert_path
|
||||||
key_path = os.path.join(ssl_dir, 'db-client.key')
|
key_path = os.path.join(ssl_dir, 'db-client.key')
|
||||||
with open(key_path, 'w') as fh:
|
with open(key_path, 'wb') as fh:
|
||||||
fh.write(b64decode(rdata['ssl_key']))
|
fh.write(b64decode(rdata['ssl_key']))
|
||||||
|
|
||||||
ctxt['database_ssl_key'] = key_path
|
ctxt['database_ssl_key'] = key_path
|
||||||
@ -459,7 +459,7 @@ class AMQPContext(OSContextGenerator):
|
|||||||
|
|
||||||
ca_path = os.path.join(
|
ca_path = os.path.join(
|
||||||
self.ssl_dir, 'rabbit-client-ca.pem')
|
self.ssl_dir, 'rabbit-client-ca.pem')
|
||||||
with open(ca_path, 'w') as fh:
|
with open(ca_path, 'wb') as fh:
|
||||||
fh.write(b64decode(ctxt['rabbit_ssl_ca']))
|
fh.write(b64decode(ctxt['rabbit_ssl_ca']))
|
||||||
ctxt['rabbit_ssl_ca'] = ca_path
|
ctxt['rabbit_ssl_ca'] = ca_path
|
||||||
|
|
||||||
|
@ -140,6 +140,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([
|
|||||||
('yakkety', 'newton'),
|
('yakkety', 'newton'),
|
||||||
('zesty', 'ocata'),
|
('zesty', 'ocata'),
|
||||||
('artful', 'pike'),
|
('artful', 'pike'),
|
||||||
|
('bionic', 'queens'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@ -157,6 +158,7 @@ OPENSTACK_CODENAMES = OrderedDict([
|
|||||||
('2016.2', 'newton'),
|
('2016.2', 'newton'),
|
||||||
('2017.1', 'ocata'),
|
('2017.1', 'ocata'),
|
||||||
('2017.2', 'pike'),
|
('2017.2', 'pike'),
|
||||||
|
('2018.1', 'queens'),
|
||||||
])
|
])
|
||||||
|
|
||||||
# The ugly duckling - must list releases oldest to newest
|
# The ugly duckling - must list releases oldest to newest
|
||||||
@ -187,6 +189,8 @@ SWIFT_CODENAMES = OrderedDict([
|
|||||||
['2.11.0', '2.12.0', '2.13.0']),
|
['2.11.0', '2.12.0', '2.13.0']),
|
||||||
('pike',
|
('pike',
|
||||||
['2.13.0', '2.15.0']),
|
['2.13.0', '2.15.0']),
|
||||||
|
('queens',
|
||||||
|
['2.16.0']),
|
||||||
])
|
])
|
||||||
|
|
||||||
# >= Liberty version->codename mapping
|
# >= Liberty version->codename mapping
|
||||||
@ -412,6 +416,8 @@ def get_os_codename_package(package, fatal=True):
|
|||||||
cmd = ['snap', 'list', package]
|
cmd = ['snap', 'list', package]
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output(cmd)
|
out = subprocess.check_output(cmd)
|
||||||
|
if six.PY3:
|
||||||
|
out = out.decode('UTF-8')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
return None
|
return None
|
||||||
lines = out.split('\n')
|
lines = out.split('\n')
|
||||||
|
@ -270,7 +270,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
(self.trusty_icehouse, self.trusty_kilo, self.trusty_liberty,
|
(self.trusty_icehouse, self.trusty_kilo, self.trusty_liberty,
|
||||||
self.trusty_mitaka, self.xenial_mitaka, self.xenial_newton,
|
self.trusty_mitaka, self.xenial_mitaka, self.xenial_newton,
|
||||||
self.yakkety_newton, self.xenial_ocata, self.zesty_ocata,
|
self.yakkety_newton, self.xenial_ocata, self.zesty_ocata,
|
||||||
self.xenial_pike, self.artful_pike) = range(11)
|
self.xenial_pike, self.artful_pike, self.xenial_queens,
|
||||||
|
self.bionic_queens,) = range(13)
|
||||||
|
|
||||||
releases = {
|
releases = {
|
||||||
('trusty', None): self.trusty_icehouse,
|
('trusty', None): self.trusty_icehouse,
|
||||||
@ -281,9 +282,11 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
('xenial', 'cloud:xenial-newton'): self.xenial_newton,
|
('xenial', 'cloud:xenial-newton'): self.xenial_newton,
|
||||||
('xenial', 'cloud:xenial-ocata'): self.xenial_ocata,
|
('xenial', 'cloud:xenial-ocata'): self.xenial_ocata,
|
||||||
('xenial', 'cloud:xenial-pike'): self.xenial_pike,
|
('xenial', 'cloud:xenial-pike'): self.xenial_pike,
|
||||||
|
('xenial', 'cloud:xenial-queens'): self.xenial_queens,
|
||||||
('yakkety', None): self.yakkety_newton,
|
('yakkety', None): self.yakkety_newton,
|
||||||
('zesty', None): self.zesty_ocata,
|
('zesty', None): self.zesty_ocata,
|
||||||
('artful', None): self.artful_pike,
|
('artful', None): self.artful_pike,
|
||||||
|
('bionic', None): self.bionic_queens,
|
||||||
}
|
}
|
||||||
return releases[(self.series, self.openstack)]
|
return releases[(self.series, self.openstack)]
|
||||||
|
|
||||||
@ -298,6 +301,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
('yakkety', 'newton'),
|
('yakkety', 'newton'),
|
||||||
('zesty', 'ocata'),
|
('zesty', 'ocata'),
|
||||||
('artful', 'pike'),
|
('artful', 'pike'),
|
||||||
|
('bionic', 'queens'),
|
||||||
])
|
])
|
||||||
if self.openstack:
|
if self.openstack:
|
||||||
os_origin = self.openstack.split(':')[1]
|
os_origin = self.openstack.split(':')[1]
|
||||||
@ -310,8 +314,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
test scenario, based on OpenStack release and whether ceph radosgw
|
test scenario, based on OpenStack release and whether ceph radosgw
|
||||||
is flagged as present or not."""
|
is flagged as present or not."""
|
||||||
|
|
||||||
if self._get_openstack_release() <= self.trusty_juno:
|
if self._get_openstack_release() == self.trusty_icehouse:
|
||||||
# Juno or earlier
|
# Icehouse
|
||||||
pools = [
|
pools = [
|
||||||
'data',
|
'data',
|
||||||
'metadata',
|
'metadata',
|
||||||
@ -319,7 +323,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
'cinder-ceph',
|
'cinder-ceph',
|
||||||
'glance'
|
'glance'
|
||||||
]
|
]
|
||||||
elif (self.trust_kilo <= self._get_openstack_release() <=
|
elif (self.trusty_kilo <= self._get_openstack_release() <=
|
||||||
self.zesty_ocata):
|
self.zesty_ocata):
|
||||||
# Kilo through Ocata
|
# Kilo through Ocata
|
||||||
pools = [
|
pools = [
|
||||||
|
Loading…
Reference in New Issue
Block a user