Browse Source

Sync charm-helpers for Rocky series support

Change-Id: Iec56fb9c4a2bfd79c3580dca54c5ba68d64fc4c0
Corey Bryant 10 months ago
parent
commit
ec8bcd5f9d

+ 3
- 0
hooks/charmhelpers/contrib/openstack/amulet/deployment.py View File

@@ -291,6 +291,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
291 291
             ('zesty', None): self.zesty_ocata,
292 292
             ('artful', None): self.artful_pike,
293 293
             ('bionic', None): self.bionic_queens,
294
+            ('bionic', 'cloud:bionic-rocky'): self.bionic_rocky,
295
+            ('cosmic', None): self.cosmic_rocky,
294 296
         }
295 297
         return releases[(self.series, self.openstack)]
296 298
 
@@ -306,6 +308,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
306 308
             ('zesty', 'ocata'),
307 309
             ('artful', 'pike'),
308 310
             ('bionic', 'queens'),
311
+            ('cosmic', 'rocky'),
309 312
         ])
310 313
         if self.openstack:
311 314
             os_origin = self.openstack.split(':')[1]

+ 1
- 1
hooks/charmhelpers/contrib/openstack/amulet/utils.py View File

@@ -56,7 +56,7 @@ OPENSTACK_RELEASES_PAIRS = [
56 56
     'trusty_mitaka', 'xenial_mitaka', 'xenial_newton',
57 57
     'yakkety_newton', 'xenial_ocata', 'zesty_ocata',
58 58
     'xenial_pike', 'artful_pike', 'xenial_queens',
59
-    'bionic_queens']
59
+    'bionic_queens', 'bionic_rocky', 'cosmic_rocky']
60 60
 
61 61
 
62 62
 class OpenStackAmuletUtils(AmuletUtils):

+ 17
- 5
hooks/charmhelpers/contrib/openstack/context.py View File

@@ -190,8 +190,8 @@ class OSContextGenerator(object):
190 190
 class SharedDBContext(OSContextGenerator):
191 191
     interfaces = ['shared-db']
192 192
 
193
-    def __init__(self,
194
-                 database=None, user=None, relation_prefix=None, ssl_dir=None):
193
+    def __init__(self, database=None, user=None, relation_prefix=None,
194
+                 ssl_dir=None, relation_id=None):
195 195
         """Allows inspecting relation for settings prefixed with
196 196
         relation_prefix. This is useful for parsing access for multiple
197 197
         databases returned via the shared-db interface (eg, nova_password,
@@ -202,6 +202,7 @@ class SharedDBContext(OSContextGenerator):
202 202
         self.user = user
203 203
         self.ssl_dir = ssl_dir
204 204
         self.rel_name = self.interfaces[0]
205
+        self.relation_id = relation_id
205 206
 
206 207
     def __call__(self):
207 208
         self.database = self.database or config('database')
@@ -235,7 +236,12 @@ class SharedDBContext(OSContextGenerator):
235 236
         if self.relation_prefix:
236 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 245
             self.related = True
240 246
             for unit in related_units(rid):
241 247
                 rdata = relation_get(rid=rid, unit=unit)
@@ -448,11 +454,13 @@ class IdentityCredentialsContext(IdentityServiceContext):
448 454
 
449 455
 class 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 459
         self.ssl_dir = ssl_dir
453 460
         self.rel_name = rel_name
454 461
         self.relation_prefix = relation_prefix
455 462
         self.interfaces = [rel_name]
463
+        self.relation_id = relation_id
456 464
 
457 465
     def __call__(self):
458 466
         log('Generating template context for amqp', level=DEBUG)
@@ -473,7 +481,11 @@ class AMQPContext(OSContextGenerator):
473 481
             raise OSContextError
474 482
 
475 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 489
             ha_vip_only = False
478 490
             self.related = True
479 491
             transport_hosts = None

+ 4
- 0
hooks/charmhelpers/contrib/openstack/utils.py View File

@@ -133,6 +133,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([
133 133
     ('zesty', 'ocata'),
134 134
     ('artful', 'pike'),
135 135
     ('bionic', 'queens'),
136
+    ('cosmic', 'rocky'),
136 137
 ])
137 138
 
138 139
 
@@ -151,6 +152,7 @@ OPENSTACK_CODENAMES = OrderedDict([
151 152
     ('2017.1', 'ocata'),
152 153
     ('2017.2', 'pike'),
153 154
     ('2018.1', 'queens'),
155
+    ('2018.2', 'rocky'),
154 156
 ])
155 157
 
156 158
 # The ugly duckling - must list releases oldest to newest
@@ -183,6 +185,8 @@ SWIFT_CODENAMES = OrderedDict([
183 185
         ['2.13.0', '2.15.0']),
184 186
     ('queens',
185 187
         ['2.16.0', '2.17.0']),
188
+    ('rocky',
189
+        ['2.18.0']),
186 190
 ])
187 191
 
188 192
 # >= Liberty version->codename mapping

+ 8
- 0
hooks/charmhelpers/fetch/ubuntu.py View File

@@ -158,6 +158,14 @@ CLOUD_ARCHIVE_POCKETS = {
158 158
     'queens/proposed': 'xenial-proposed/queens',
159 159
     'xenial-queens/proposed': 'xenial-proposed/queens',
160 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
 

+ 3
- 0
tests/charmhelpers/contrib/openstack/amulet/deployment.py View File

@@ -291,6 +291,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
291 291
             ('zesty', None): self.zesty_ocata,
292 292
             ('artful', None): self.artful_pike,
293 293
             ('bionic', None): self.bionic_queens,
294
+            ('bionic', 'cloud:bionic-rocky'): self.bionic_rocky,
295
+            ('cosmic', None): self.cosmic_rocky,
294 296
         }
295 297
         return releases[(self.series, self.openstack)]
296 298
 
@@ -306,6 +308,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
306 308
             ('zesty', 'ocata'),
307 309
             ('artful', 'pike'),
308 310
             ('bionic', 'queens'),
311
+            ('cosmic', 'rocky'),
309 312
         ])
310 313
         if self.openstack:
311 314
             os_origin = self.openstack.split(':')[1]

+ 1
- 1
tests/charmhelpers/contrib/openstack/amulet/utils.py View File

@@ -56,7 +56,7 @@ OPENSTACK_RELEASES_PAIRS = [
56 56
     'trusty_mitaka', 'xenial_mitaka', 'xenial_newton',
57 57
     'yakkety_newton', 'xenial_ocata', 'zesty_ocata',
58 58
     'xenial_pike', 'artful_pike', 'xenial_queens',
59
-    'bionic_queens']
59
+    'bionic_queens', 'bionic_rocky', 'cosmic_rocky']
60 60
 
61 61
 
62 62
 class OpenStackAmuletUtils(AmuletUtils):

Loading…
Cancel
Save