From 02c7cd97fa4b8a81f0795be757bd99a29a037795 Mon Sep 17 00:00:00 2001 From: Christopher Yeoh Date: Sun, 10 Mar 2013 15:43:19 +1030 Subject: Fix more OS-DCF:diskConfig XML handling Add handling in the deserialisation code to handle the OS-DCF:diskConfig attribute in the rebuild and resize actions so the diskConfig extension can handle it properly. Formerly only the older auto_disk_config attribute was managed (and incorrectly so). Fixes bug 1153133 Change-Id: I68479d258cf23083274dd21b1f9eabab2feeb093 --- nova/api/openstack/compute/servers.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index c21599300..2ef154329 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -357,7 +357,12 @@ class ActionDeserializer(CommonDeserializer): rebuild['name'] = name if node.hasAttribute("auto_disk_config"): - rebuild['auto_disk_config'] = node.getAttribute("auto_disk_config") + rebuild['OS-DCF:diskConfig'] = node.getAttribute( + "auto_disk_config") + + if node.hasAttribute("OS-DCF:diskConfig"): + rebuild['OS-DCF:diskConfig'] = node.getAttribute( + "OS-DCF:diskConfig") metadata_node = self.find_first_child_named(node, "metadata") if metadata_node is not None: @@ -391,7 +396,11 @@ class ActionDeserializer(CommonDeserializer): raise AttributeError("No flavorRef was specified in request") if node.hasAttribute("auto_disk_config"): - resize['auto_disk_config'] = node.getAttribute("auto_disk_config") + resize['OS-DCF:diskConfig'] = node.getAttribute("auto_disk_config") + + if node.hasAttribute("OS-DCF:diskConfig"): + resize['OS-DCF:diskConfig'] = node.getAttribute( + "OS-DCF:diskConfig") return resize -- cgit