Browse Source

Enable image-based provisioning for 6.0 upgrades

This fix has been lost during the process of
migration of cluster data manipulation functionality
from the octane to this extension.

Change-Id: Ife92cbd0e8d8f8376ffcb1f333d1fac9e911ff3e
Closes-bug: 1573100
Dmitry Nikishov 2 years ago
parent
commit
89839b88c3

+ 10
- 5
cluster_upgrade/tests/test_transformations.py View File

@@ -238,11 +238,16 @@ class TestClusterTransformers(nailgun_test_base.BaseUnitTest):
238 238
 
239 239
     def test_manager(self):
240 240
         man = cluster.Manager()  # verify default config and entry points
241
-        self.assertEqual(man.transformers, [(version.StrictVersion('9.0'), [
242
-            cluster.transform_dns_list,
243
-            cluster.transform_ntp_list,
244
-            cluster.drop_generated_provision,
245
-        ])])
241
+        self.assertEqual(man.transformers, [
242
+            (version.StrictVersion('6.1'), [
243
+                cluster.enable_ibp,
244
+            ]),
245
+            (version.StrictVersion('9.0'), [
246
+                cluster.transform_dns_list,
247
+                cluster.transform_ntp_list,
248
+                cluster.drop_generated_provision,
249
+            ])
250
+        ])
246 251
 
247 252
 
248 253
 class TestVipTransformers(nailgun_test_base.BaseUnitTest):

+ 6
- 0
cluster_upgrade/transformations/cluster.py View File

@@ -45,8 +45,14 @@ def drop_generated_provision(data):
45 45
     return data
46 46
 
47 47
 
48
+def enable_ibp(data):
49
+    data['editable']['provision']['method']['value'] = 'image'
50
+    return data
51
+
52
+
48 53
 class Manager(transformations.Manager):
49 54
     default_config = {
50 55
         '9.0': ['dns_list', 'ntp_list', 'drop_provision'],
56
+        '6.1': ['image_provision'],
51 57
     }
52 58
     name = 'cluster'

+ 2
- 0
setup.cfg View File

@@ -26,6 +26,8 @@ nailgun.extensions =
26 26
     cluster_upgrade = cluster_upgrade.extension:ClusterUpgradeExtension
27 27
 nailgun.cluster_upgrade.transformations.volumes.6.1 =
28 28
     node_volumes = cluster_upgrade.transformations.volumes:transform_node_volumes
29
+nailgun.cluster_upgrade.transformations.cluster.6.1 =
30
+    image_provision = cluster_upgrade.transformations.cluster:enable_ibp
29 31
 nailgun.cluster_upgrade.transformations.cluster.9.0 =
30 32
     dns_list = cluster_upgrade.transformations.cluster:transform_dns_list
31 33
     ntp_list = cluster_upgrade.transformations.cluster:transform_ntp_list

Loading…
Cancel
Save