summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Chechetin <pchechetin@mirantis.com>2016-09-22 16:24:30 +0300
committerNikita Zubkov <nzubkov@mirantis.com>2016-09-22 17:33:56 +0300
commit595146163ef4c44c0061e97d7be7427daeae9c2d (patch)
treeba8d1a461c0c5092d1289e0e1af4bbbafd4987aa
parente7b127a308fd286f948bcd4960865eca73e08e14 (diff)
Add orig and seed env versions to astute.yaml
Notes
Notes (review): Code-Review+1: Dmitriy Stremkovskiy <dstremkouski@mirantis.com> Code-Review+2: Ilya Kharin <akscram@gmail.com> Workflow+1: Ilya Kharin <akscram@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 23 Sep 2016 22:27:35 +0000 Reviewed-on: https://review.openstack.org/374812 Project: openstack/fuel-nailgun-extension-cluster-upgrade Branch: refs/heads/master
-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