From 6ef6dd4d692ce28ca65a8f823daf92da34d22088 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 13 Nov 2015 15:35:40 +0100 Subject: [PATCH] bug #4056: return correct action in disk snap revert (cherry picked from commit ea53ff904b4dbab80cbf7e77a0cbc8f05b26b51d) --- src/vmm_mad/exec/one_vmm_exec.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 6f010a151f..62a24b97a8 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -895,7 +895,8 @@ class ExecDriver < VirtualMachineDriver # DISKSNAPSHOTCREATE action, takes a snapshot of a disk # def disk_snapshot_create(id, drv_message) - snap_action = prepare_snap_action(id, drv_message, ACTION[:disk_snapshot_create]) + snap_action = prepare_snap_action(id, drv_message, + :disk_snapshot_create) action = snap_action[:action] strategy = snap_action[:strategy] drv_message = snap_action[:drv_message] @@ -1016,7 +1017,8 @@ class ExecDriver < VirtualMachineDriver # DISKSNAPSHOTREVERT action, takes a snapshot of a disk # def disk_snapshot_revert(id, drv_message) - snap_action = prepare_snap_action(id, drv_message, ACTION[:disk_snapshot_revert]) + snap_action = prepare_snap_action(id, drv_message, + :disk_snapshot_revert) action = snap_action[:action] strategy = @options[:snapshots_strategy] drv_message = snap_action[:drv_message] @@ -1122,7 +1124,8 @@ private # Make sure disk target has been defined target_xpath = "VM/TEMPLATE/DISK[DISK_SNAPSHOT_ACTIVE='YES']/TARGET" - target = ensure_xpath(xml_data, id, action, target_xpath) || return + target = ensure_xpath(xml_data, id, ACTION[action], + target_xpath) || return target_index = target.downcase[-1..-1].unpack('c').first - 97 # Always send ATTACH='YES' for the selected target in case it will end @@ -1134,7 +1137,7 @@ private disk.add(attach) drv_message = Base64.encode64(xml_data.to_s) - action = VmmAction.new(self, id, :disk_snapshot_create, drv_message) + action = VmmAction.new(self, id, action, drv_message) # Determine the strategy vmm_driver_path = 'VM/HISTORY_RECORDS/HISTORY/VMMMAD'