From 0514fedea6693543e0be1c14eb4a043825a4b3bc Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Sun, 24 Oct 2010 20:02:17 -0700 Subject: [PATCH] new UI - rebootVirtualMachine API was changed recently (doesn't return embedded object any more). This is a temporary fix until API is fixed. --- ui/new/scripts/cloud.core2.instance.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/new/scripts/cloud.core2.instance.js b/ui/new/scripts/cloud.core2.instance.js index 6f3f7af935b..c0dfb12837f 100644 --- a/ui/new/scripts/cloud.core2.instance.js +++ b/ui/new/scripts/cloud.core2.instance.js @@ -690,7 +690,17 @@ var vmActionMap = { asyncJobResponse: "rebootvirtualmachineresponse", inProcessText: "Rebooting Instance....", afterActionSeccessFn: function(json, $midmenuItem1, id) { - var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0]; + //call listVirtualMachine to get embedded object until Bug 6751("rebootVirtualMachine API should return an embedded object") is fixed. + var jsonObj; + $.ajax({ + data: createURL("command=listVirtualMachines&id="+id), + dataType: "json", + async: false, + success: function(json) { + jsonObj = json.listvirtualmachinesresponse.virtualmachine[0]; + } + }); + vmToMidmenu(jsonObj, $midmenuItem1); vmToRightPanel($midmenuItem1); }