From 7f213bc3561d38d932232ca3378342b1b4b5e65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 8 Jul 2015 18:17:39 +0200 Subject: [PATCH] Feature #3748: Fix shutdown-hard from sunstone, delete deprecated cancel action --- src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb | 7 +++++-- src/sunstone/public/app/opennebula/role.js | 2 +- src/sunstone/public/app/opennebula/vm.js | 3 --- .../public/app/tabs/oneflow-services-tab/actions.js | 4 ++-- src/sunstone/public/app/tabs/provision-tab/vms/list.js | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index d555f1c008..07f3f7d9a9 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -43,7 +43,6 @@ module OpenNebulaJSON end rc = case action_hash['perform'] - when "cancel" then self.cancel when "deploy" then self.deploy(action_hash['params']) when "finalize" then self.finalize when "hold" then self.hold @@ -61,7 +60,7 @@ module OpenNebulaJSON when "disk_snapshot_create" then self.disk_snapshot_create(action_hash['params']) when "disk_snapshot_revert" then self.disk_snapshot_revert(action_hash['params']) when "disk_snapshot_delete" then self.disk_snapshot_delete(action_hash['params']) - when "shutdown" then self.shutdown + when "shutdown" then self.shutdown(action_hash['params']) when "reboot" then self.reboot when "poweroff" then self.poweroff(action_hash['params']) when "resubmit" then self.resubmit @@ -98,6 +97,10 @@ module OpenNebulaJSON super(params['hard']) end + def shutdown(params=Hash.new) + super(params['hard']) + end + def poweroff(params=Hash.new) super(params['hard']) end diff --git a/src/sunstone/public/app/opennebula/role.js b/src/sunstone/public/app/opennebula/role.js index 7cf3c066df..b2dbc1ba5b 100644 --- a/src/sunstone/public/app/opennebula/role.js +++ b/src/sunstone/public/app/opennebula/role.js @@ -144,7 +144,7 @@ define(function(require) { generate_batch_action_params(), PATH); }, - "cancel" : function(params) { + "shutdown_hard" : function(params) { OpenNebulaAction.simple_action(params, RESOURCE, "shutdown-hard", diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index f9c62375a0..bd12241115 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -329,9 +329,6 @@ define(function(require) { "stop": function(params) { OpenNebulaAction.simple_action(params, RESOURCE, "stop"); }, - "cancel": function(params) { - OpenNebulaAction.simple_action(params, RESOURCE, "cancel"); - }, "suspend": function(params) { OpenNebulaAction.simple_action(params, RESOURCE, "suspend"); }, diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js index 0d5a198248..6fb756c172 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js @@ -240,7 +240,7 @@ define(function(require) { "Role.shutdown_hard" : { type: "multiple", - call: OpenNebulaRole.cancel, + call: OpenNebulaRole.shutdown_hard, callback: roleCallback, elements: roleElements, error: Notifier.onError, @@ -413,7 +413,7 @@ define(function(require) { "RoleVM.shutdown_hard" : { type: "multiple", - call: OpenNebulaVM.cancel, + call: OpenNebulaVM.shutdown_hard, callback: roleCallback, elements: roleVMElements, error: Notifier.onError, diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/list.js b/src/sunstone/public/app/tabs/provision-tab/vms/list.js index 5e0eb741f7..b0753294fa 100644 --- a/src/sunstone/public/app/tabs/provision-tab/vms/list.js +++ b/src/sunstone/public/app/tabs/provision-tab/vms/list.js @@ -627,7 +627,7 @@ define(function(require) { button.attr("disabled", "disabled"); var vm_id = $(".provision_info_vm", context).attr("vm_id"); - OpenNebula.VM.cancel({ + OpenNebula.VM.shutdown_hard({ data : { id: vm_id },