summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Taraday <yorik.sar@gmail.com>2016-08-23 12:25:30 +0300
committerYuriy Taraday <yorik.sar@gmail.com>2016-08-23 12:25:52 +0300
commit6150aaca88088bcc9ff4f204d913f5250b9ecac5 (patch)
tree10bc1f29570a6ea80e23c8e3ed7a4bbb353c7460
parentff448b2d81da1cfa2ffb01fc8ba84de5921195bb (diff)
Replace @content decorator with all that madness
Change Ia3da3bd809bcca923d53666eca54def78c995f65 broke our handlers as it incorporated destructive changes to all handlers. Change-Id: I688e833b1fb8b658f01b7f858a140c315fa513a2
Notes
Notes (review): Code-Review+2: Ilya Kharin <akscram@gmail.com> Code-Review+1: Nikita Zubkov <nzubkov@mirantis.com> Code-Review+2: Sergey Abramov <sabramov@mirantis.com> Workflow+1: Ilya Kharin <akscram@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 23 Aug 2016 11:48:15 +0000 Reviewed-on: https://review.openstack.org/359066 Project: openstack/fuel-nailgun-extension-cluster-upgrade Branch: refs/heads/master
-rw-r--r--cluster_upgrade/handlers.py12
-rw-r--r--cluster_upgrade/objects/adapters.py4
2 files changed, 10 insertions, 6 deletions
diff --git a/cluster_upgrade/handlers.py b/cluster_upgrade/handlers.py
index 4f61f2e..9a89a61 100644
--- a/cluster_upgrade/handlers.py
+++ b/cluster_upgrade/handlers.py
@@ -29,7 +29,9 @@ class ClusterUpgradeCloneHandler(base.BaseHandler):
29 single = objects.Cluster 29 single = objects.Cluster
30 validator = validators.ClusterUpgradeValidator 30 validator = validators.ClusterUpgradeValidator
31 31
32 @base.content 32 @base.handle_errors
33 @base.validate
34 @base.serialize
33 def POST(self, cluster_id): 35 def POST(self, cluster_id):
34 """Initialize the upgrade of the cluster. 36 """Initialize the upgrade of the cluster.
35 37
@@ -50,7 +52,7 @@ class ClusterUpgradeCloneHandler(base.BaseHandler):
50 request_data = self.checked_data(cluster=orig_cluster) 52 request_data = self.checked_data(cluster=orig_cluster)
51 new_cluster = upgrade.UpgradeHelper.clone_cluster(orig_cluster, 53 new_cluster = upgrade.UpgradeHelper.clone_cluster(orig_cluster,
52 request_data) 54 request_data)
53 return new_cluster.to_json() 55 return new_cluster.to_dict()
54 56
55 57
56class NodeReassignHandler(base.BaseHandler): 58class NodeReassignHandler(base.BaseHandler):
@@ -67,7 +69,8 @@ class NodeReassignHandler(base.BaseHandler):
67 69
68 self.raise_task(task) 70 self.raise_task(task)
69 71
70 @base.content 72 @base.handle_errors
73 @base.validate
71 def POST(self, cluster_id): 74 def POST(self, cluster_id):
72 """Reassign node to the given cluster. 75 """Reassign node to the given cluster.
73 76
@@ -107,7 +110,8 @@ class CopyVIPsHandler(base.BaseHandler):
107 single = objects.Cluster 110 single = objects.Cluster
108 validator = validators.CopyVIPsValidator 111 validator = validators.CopyVIPsValidator
109 112
110 @base.content 113 @base.handle_errors
114 @base.validate
111 def POST(self, cluster_id): 115 def POST(self, cluster_id):
112 """Copy VIPs from original cluster to new one 116 """Copy VIPs from original cluster to new one
113 117
diff --git a/cluster_upgrade/objects/adapters.py b/cluster_upgrade/objects/adapters.py
index 3348229..cf4751b 100644
--- a/cluster_upgrade/objects/adapters.py
+++ b/cluster_upgrade/objects/adapters.py
@@ -74,8 +74,8 @@ class NailgunClusterAdapter(object):
74 instance=self.cluster) 74 instance=self.cluster)
75 return NailgunNetworkManager(self.cluster, net_manager) 75 return NailgunNetworkManager(self.cluster, net_manager)
76 76
77 def to_json(self): 77 def to_dict(self):
78 return objects.Cluster.to_json(self.cluster) 78 return objects.Cluster.to_dict(self.cluster)
79 79
80 @classmethod 80 @classmethod
81 def get_by_uid(cls, cluster_id): 81 def get_by_uid(cls, cluster_id):