From 64bd2b1093b1cbee79c6d3fe338be23b618b6ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 6 May 2016 12:59:25 +0200 Subject: [PATCH] Feature #3932, #3801: Rename VM shutdown & delete in scheduled actions --- src/scheduler/include/VirtualMachinePoolXML.h | 2 +- src/scheduler/src/pool/VirtualMachineXML.cc | 13 ++++++++----- .../public/app/tabs/vms-tab/panels/actions.js | 6 ++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/scheduler/include/VirtualMachinePoolXML.h b/src/scheduler/include/VirtualMachinePoolXML.h index 1d14725f1f..e73a806bdb 100644 --- a/src/scheduler/include/VirtualMachinePoolXML.h +++ b/src/scheduler/include/VirtualMachinePoolXML.h @@ -129,7 +129,7 @@ public: * Calls one.vm.action * * @param vid The VM id - * @param action Action argument (shutdown, hold, release...) + * @param action Action argument (terminate, hold, release...) * @param error_msg Error reason, if any * * @return 0 on success, -1 otherwise diff --git a/src/scheduler/src/pool/VirtualMachineXML.cc b/src/scheduler/src/pool/VirtualMachineXML.cc index 36ca96f416..d4f9638e03 100644 --- a/src/scheduler/src/pool/VirtualMachineXML.cc +++ b/src/scheduler/src/pool/VirtualMachineXML.cc @@ -374,8 +374,8 @@ int VirtualMachineXML::parse_action_name(string& action_st) { one_util::tolower(action_st); - if ( action_st != "shutdown" - && action_st != "shutdown-hard" + if ( action_st != "terminate" + && action_st != "terminate-hard" && action_st != "undeploy" && action_st != "undeploy-hard" && action_st != "hold" @@ -383,13 +383,16 @@ int VirtualMachineXML::parse_action_name(string& action_st) && action_st != "stop" && action_st != "suspend" && action_st != "resume" - && action_st != "delete" - && action_st != "delete-recreate" && action_st != "reboot" && action_st != "reboot-hard" && action_st != "poweroff" && action_st != "poweroff-hard" - && action_st != "snapshot-create") + && action_st != "snapshot-create" + + // Compatibility with 4.x + && action_st != "shutdown" + && action_st != "shutdown-hard" + && action_st != "delete") { return -1; } diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/actions.js b/src/sunstone/public/app/tabs/vms-tab/panels/actions.js index 6ebd7d8c5c..64e8144a55 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/actions.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/actions.js @@ -90,15 +90,13 @@ define(function(require) { \ \