summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Bryant <corey.bryant@canonical.com>2018-06-21 18:51:34 +0000
committerCorey Bryant <corey.bryant@canonical.com>2018-06-21 18:51:42 +0000
commitec8bcd5f9de981f9bf262c08ffd4a5dd440a8e12 (patch)
tree554f0e93cad0650bc4b5c6ff3196b2edc6ce7d3e
parenta7223f09683afdc28ed8696d335150fb364d1068 (diff)
Sync charm-helpers for Rocky series support
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: Frode Nordahl <frode.nordahl@canonical.com> Workflow+1: Frode Nordahl <frode.nordahl@canonical.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 28 Jun 2018 06:02:26 +0000 Reviewed-on: https://review.openstack.org/577259 Project: openstack/charm-ceph-osd Branch: refs/heads/master
-rw-r--r--hooks/charmhelpers/contrib/openstack/amulet/deployment.py3
-rw-r--r--hooks/charmhelpers/contrib/openstack/amulet/utils.py2
-rw-r--r--hooks/charmhelpers/contrib/openstack/context.py22
-rw-r--r--hooks/charmhelpers/contrib/openstack/utils.py4
-rw-r--r--hooks/charmhelpers/fetch/ubuntu.py8
-rw-r--r--tests/charmhelpers/contrib/openstack/amulet/deployment.py3
-rw-r--r--tests/charmhelpers/contrib/openstack/amulet/utils.py2
7 files changed, 37 insertions, 7 deletions
diff --git a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
index 66beeda..1c96752 100644
--- a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
+++ b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
@@ -291,6 +291,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
291 ('zesty', None): self.zesty_ocata, 291 ('zesty', None): self.zesty_ocata,
292 ('artful', None): self.artful_pike, 292 ('artful', None): self.artful_pike,
293 ('bionic', None): self.bionic_queens, 293 ('bionic', None): self.bionic_queens,
294 ('bionic', 'cloud:bionic-rocky'): self.bionic_rocky,
295 ('cosmic', None): self.cosmic_rocky,
294 } 296 }
295 return releases[(self.series, self.openstack)] 297 return releases[(self.series, self.openstack)]
296 298
@@ -306,6 +308,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
306 ('zesty', 'ocata'), 308 ('zesty', 'ocata'),
307 ('artful', 'pike'), 309 ('artful', 'pike'),
308 ('bionic', 'queens'), 310 ('bionic', 'queens'),
311 ('cosmic', 'rocky'),
309 ]) 312 ])
310 if self.openstack: 313 if self.openstack:
311 os_origin = self.openstack.split(':')[1] 314 os_origin = self.openstack.split(':')[1]
diff --git a/hooks/charmhelpers/contrib/openstack/amulet/utils.py b/hooks/charmhelpers/contrib/openstack/amulet/utils.py
index d43038b..ef4ab54 100644
--- a/hooks/charmhelpers/contrib/openstack/amulet/utils.py
+++ b/hooks/charmhelpers/contrib/openstack/amulet/utils.py
@@ -56,7 +56,7 @@ OPENSTACK_RELEASES_PAIRS = [
56 'trusty_mitaka', 'xenial_mitaka', 'xenial_newton', 56 'trusty_mitaka', 'xenial_mitaka', 'xenial_newton',
57 'yakkety_newton', 'xenial_ocata', 'zesty_ocata', 57 'yakkety_newton', 'xenial_ocata', 'zesty_ocata',
58 'xenial_pike', 'artful_pike', 'xenial_queens', 58 'xenial_pike', 'artful_pike', 'xenial_queens',
59 'bionic_queens'] 59 'bionic_queens', 'bionic_rocky', 'cosmic_rocky']
60 60
61 61
62class OpenStackAmuletUtils(AmuletUtils): 62class OpenStackAmuletUtils(AmuletUtils):
diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py
index b196d63..f3741b0 100644
--- a/hooks/charmhelpers/contrib/openstack/context.py
+++ b/hooks/charmhelpers/contrib/openstack/context.py
@@ -190,8 +190,8 @@ class OSContextGenerator(object):
190class SharedDBContext(OSContextGenerator): 190class SharedDBContext(OSContextGenerator):
191 interfaces = ['shared-db'] 191 interfaces = ['shared-db']
192 192
193 def __init__(self, 193 def __init__(self, database=None, user=None, relation_prefix=None,
194 database=None, user=None, relation_prefix=None, ssl_dir=None): 194 ssl_dir=None, relation_id=None):
195 """Allows inspecting relation for settings prefixed with 195 """Allows inspecting relation for settings prefixed with
196 relation_prefix. This is useful for parsing access for multiple 196 relation_prefix. This is useful for parsing access for multiple
197 databases returned via the shared-db interface (eg, nova_password, 197 databases returned via the shared-db interface (eg, nova_password,
@@ -202,6 +202,7 @@ class SharedDBContext(OSContextGenerator):
202 self.user = user 202 self.user = user
203 self.ssl_dir = ssl_dir 203 self.ssl_dir = ssl_dir
204 self.rel_name = self.interfaces[0] 204 self.rel_name = self.interfaces[0]
205 self.relation_id = relation_id
205 206
206 def __call__(self): 207 def __call__(self):
207 self.database = self.database or config('database') 208 self.database = self.database or config('database')
@@ -235,7 +236,12 @@ class SharedDBContext(OSContextGenerator):
235 if self.relation_prefix: 236 if self.relation_prefix:
236 password_setting = self.relation_prefix + '_password' 237 password_setting = self.relation_prefix + '_password'
237 238
238 for rid in relation_ids(self.interfaces[0]): 239 if self.relation_id:
240 rids = [self.relation_id]
241 else:
242 rids = relation_ids(self.interfaces[0])
243
244 for rid in rids:
239 self.related = True 245 self.related = True
240 for unit in related_units(rid): 246 for unit in related_units(rid):
241 rdata = relation_get(rid=rid, unit=unit) 247 rdata = relation_get(rid=rid, unit=unit)
@@ -448,11 +454,13 @@ class IdentityCredentialsContext(IdentityServiceContext):
448 454
449class AMQPContext(OSContextGenerator): 455class AMQPContext(OSContextGenerator):
450 456
451 def __init__(self, ssl_dir=None, rel_name='amqp', relation_prefix=None): 457 def __init__(self, ssl_dir=None, rel_name='amqp', relation_prefix=None,
458 relation_id=None):
452 self.ssl_dir = ssl_dir 459 self.ssl_dir = ssl_dir
453 self.rel_name = rel_name 460 self.rel_name = rel_name
454 self.relation_prefix = relation_prefix 461 self.relation_prefix = relation_prefix
455 self.interfaces = [rel_name] 462 self.interfaces = [rel_name]
463 self.relation_id = relation_id
456 464
457 def __call__(self): 465 def __call__(self):
458 log('Generating template context for amqp', level=DEBUG) 466 log('Generating template context for amqp', level=DEBUG)
@@ -473,7 +481,11 @@ class AMQPContext(OSContextGenerator):
473 raise OSContextError 481 raise OSContextError
474 482
475 ctxt = {} 483 ctxt = {}
476 for rid in relation_ids(self.rel_name): 484 if self.relation_id:
485 rids = [self.relation_id]
486 else:
487 rids = relation_ids(self.rel_name)
488 for rid in rids:
477 ha_vip_only = False 489 ha_vip_only = False
478 self.related = True 490 self.related = True
479 transport_hosts = None 491 transport_hosts = None
diff --git a/hooks/charmhelpers/contrib/openstack/utils.py b/hooks/charmhelpers/contrib/openstack/utils.py
index 6184abd..0180e55 100644
--- a/hooks/charmhelpers/contrib/openstack/utils.py
+++ b/hooks/charmhelpers/contrib/openstack/utils.py
@@ -133,6 +133,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([
133 ('zesty', 'ocata'), 133 ('zesty', 'ocata'),
134 ('artful', 'pike'), 134 ('artful', 'pike'),
135 ('bionic', 'queens'), 135 ('bionic', 'queens'),
136 ('cosmic', 'rocky'),
136]) 137])
137 138
138 139
@@ -151,6 +152,7 @@ OPENSTACK_CODENAMES = OrderedDict([
151 ('2017.1', 'ocata'), 152 ('2017.1', 'ocata'),
152 ('2017.2', 'pike'), 153 ('2017.2', 'pike'),
153 ('2018.1', 'queens'), 154 ('2018.1', 'queens'),
155 ('2018.2', 'rocky'),
154]) 156])
155 157
156# The ugly duckling - must list releases oldest to newest 158# The ugly duckling - must list releases oldest to newest
@@ -183,6 +185,8 @@ SWIFT_CODENAMES = OrderedDict([
183 ['2.13.0', '2.15.0']), 185 ['2.13.0', '2.15.0']),
184 ('queens', 186 ('queens',
185 ['2.16.0', '2.17.0']), 187 ['2.16.0', '2.17.0']),
188 ('rocky',
189 ['2.18.0']),
186]) 190])
187 191
188# >= Liberty version->codename mapping 192# >= Liberty version->codename mapping
diff --git a/hooks/charmhelpers/fetch/ubuntu.py b/hooks/charmhelpers/fetch/ubuntu.py
index 653d58f..736be71 100644
--- a/hooks/charmhelpers/fetch/ubuntu.py
+++ b/hooks/charmhelpers/fetch/ubuntu.py
@@ -158,6 +158,14 @@ CLOUD_ARCHIVE_POCKETS = {
158 'queens/proposed': 'xenial-proposed/queens', 158 'queens/proposed': 'xenial-proposed/queens',
159 'xenial-queens/proposed': 'xenial-proposed/queens', 159 'xenial-queens/proposed': 'xenial-proposed/queens',
160 'xenial-proposed/queens': 'xenial-proposed/queens', 160 'xenial-proposed/queens': 'xenial-proposed/queens',
161 # Rocky
162 'rocky': 'bionic-updates/rocky',
163 'bionic-rocky': 'bionic-updates/rocky',
164 'bionic-rocky/updates': 'bionic-updates/rocky',
165 'bionic-updates/rocky': 'bionic-updates/rocky',
166 'rocky/proposed': 'bionic-proposed/rocky',
167 'bionic-rocky/proposed': 'bionic-proposed/rocky',
168 'bionic-proposed/rocky': 'bionic-proposed/rocky',
161} 169}
162 170
163 171
diff --git a/tests/charmhelpers/contrib/openstack/amulet/deployment.py b/tests/charmhelpers/contrib/openstack/amulet/deployment.py
index 66beeda..1c96752 100644
--- a/tests/charmhelpers/contrib/openstack/amulet/deployment.py
+++ b/tests/charmhelpers/contrib/openstack/amulet/deployment.py
@@ -291,6 +291,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
291 ('zesty', None): self.zesty_ocata, 291 ('zesty', None): self.zesty_ocata,
292 ('artful', None): self.artful_pike, 292 ('artful', None): self.artful_pike,
293 ('bionic', None): self.bionic_queens, 293 ('bionic', None): self.bionic_queens,
294 ('bionic', 'cloud:bionic-rocky'): self.bionic_rocky,
295 ('cosmic', None): self.cosmic_rocky,
294 } 296 }
295 return releases[(self.series, self.openstack)] 297 return releases[(self.series, self.openstack)]
296 298
@@ -306,6 +308,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
306 ('zesty', 'ocata'), 308 ('zesty', 'ocata'),
307 ('artful', 'pike'), 309 ('artful', 'pike'),
308 ('bionic', 'queens'), 310 ('bionic', 'queens'),
311 ('cosmic', 'rocky'),
309 ]) 312 ])
310 if self.openstack: 313 if self.openstack:
311 os_origin = self.openstack.split(':')[1] 314 os_origin = self.openstack.split(':')[1]
diff --git a/tests/charmhelpers/contrib/openstack/amulet/utils.py b/tests/charmhelpers/contrib/openstack/amulet/utils.py
index d43038b..ef4ab54 100644
--- a/tests/charmhelpers/contrib/openstack/amulet/utils.py
+++ b/tests/charmhelpers/contrib/openstack/amulet/utils.py
@@ -56,7 +56,7 @@ OPENSTACK_RELEASES_PAIRS = [
56 'trusty_mitaka', 'xenial_mitaka', 'xenial_newton', 56 'trusty_mitaka', 'xenial_mitaka', 'xenial_newton',
57 'yakkety_newton', 'xenial_ocata', 'zesty_ocata', 57 'yakkety_newton', 'xenial_ocata', 'zesty_ocata',
58 'xenial_pike', 'artful_pike', 'xenial_queens', 58 'xenial_pike', 'artful_pike', 'xenial_queens',
59 'bionic_queens'] 59 'bionic_queens', 'bionic_rocky', 'cosmic_rocky']
60 60
61 61
62class OpenStackAmuletUtils(AmuletUtils): 62class OpenStackAmuletUtils(AmuletUtils):