summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-23 22:27:35 +0000
committerGerrit Code Review <review@openstack.org>2016-09-23 22:27:35 +0000
commitab17ac75ea83dc81efa48cf5c03ad140945a7bbd (patch)
treef73d59983608554e963016a902982c745b566bb4
parent0c040170f97726c5dc5789a49c9bfb74d40c1daf (diff)
parent595146163ef4c44c0061e97d7be7427daeae9c2d (diff)
Merge "Add orig and seed env versions to astute.yaml"
-rw-r--r--cluster_upgrade/extension.py7
-rw-r--r--cluster_upgrade/tests/test_extension.py5
2 files changed, 12 insertions, 0 deletions
diff --git a/cluster_upgrade/extension.py b/cluster_upgrade/extension.py
index ccda7a3..1233bea 100644
--- a/cluster_upgrade/extension.py
+++ b/cluster_upgrade/extension.py
@@ -17,6 +17,7 @@
17import os 17import os
18 18
19from nailgun import extensions 19from nailgun import extensions
20from nailgun.objects import Cluster
20 21
21from cluster_upgrade import handlers 22from cluster_upgrade import handlers
22 23
@@ -27,10 +28,16 @@ class UpgradePipeline(extensions.BasePipeline):
27 from cluster_upgrade.objects.relations import UpgradeRelationObject 28 from cluster_upgrade.objects.relations import UpgradeRelationObject
28 29
29 relation = UpgradeRelationObject.get_cluster_relation(cluster.id) 30 relation = UpgradeRelationObject.get_cluster_relation(cluster.id)
31
32 orig_env = Cluster.get_by_uid(relation.orig_cluster_id)
33 seed_env = Cluster.get_by_uid(relation.seed_cluster_id)
34
30 cluster_data['upgrade'] = { 35 cluster_data['upgrade'] = {
31 'relation_info': { 36 'relation_info': {
32 'orig_cluster_id': relation.orig_cluster_id, 37 'orig_cluster_id': relation.orig_cluster_id,
33 'seed_cluster_id': relation.seed_cluster_id, 38 'seed_cluster_id': relation.seed_cluster_id,
39 'orig_cluster_version': orig_env.release.environment_version,
40 'seed_cluster_version': seed_env.release.environment_version
34 } 41 }
35 } 42 }
36 43
diff --git a/cluster_upgrade/tests/test_extension.py b/cluster_upgrade/tests/test_extension.py
index 39166ff..d0d768d 100644
--- a/cluster_upgrade/tests/test_extension.py
+++ b/cluster_upgrade/tests/test_extension.py
@@ -53,10 +53,15 @@ class TestPipeline(base.BaseCloneClusterTest):
53 self.dst_cluster_db, [] 53 self.dst_cluster_db, []
54 ) 54 )
55 55
56 orig_release = self.src_cluster_db.release
57 seed_release = self.dst_cluster_db.release
58
56 expected = { 59 expected = {
57 'relation_info': { 60 'relation_info': {
58 'orig_cluster_id': self.src_cluster_db.id, 61 'orig_cluster_id': self.src_cluster_db.id,
59 'seed_cluster_id': self.dst_cluster_db.id, 62 'seed_cluster_id': self.dst_cluster_db.id,
63 'orig_cluster_version': orig_release.environment_version,
64 'seed_cluster_version': seed_release.environment_version,
60 } 65 }
61 } 66 }
62 67