diff options
| author | Christopher Yeoh <cyeoh@au1.ibm.com> | 2013-03-10 15:43:19 +1030 |
|---|---|---|
| committer | Christopher Yeoh <cyeoh@au1.ibm.com> | 2013-03-13 00:32:49 +1030 |
| commit | 02c7cd97fa4b8a81f0795be757bd99a29a037795 (patch) | |
| tree | b6fcb6f5145ffc6befa7b232e93302e56e8c5997 /nova/api | |
| parent | 92482459963e21cb692c0515450abc81d69e40ed (diff) | |
| download | nova-02c7cd97fa4b8a81f0795be757bd99a29a037795.tar.gz nova-02c7cd97fa4b8a81f0795be757bd99a29a037795.tar.xz nova-02c7cd97fa4b8a81f0795be757bd99a29a037795.zip | |
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
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 13 |
1 files changed, 11 insertions, 2 deletions
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 |
