From 73f1f620da7d10ac985a2a8ceb8ac77dacd4e652 Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Tue, 10 Aug 2021 14:46:34 +0100 Subject: [PATCH] CA-339273: Mention source Host/Pool in VM cross-pool migration and copy actions Also amended connected string resource and removed initial description. Signed-off-by: Danilo Del Busso --- XenModel/Actions/VM/VMCrossPoolMigrateAction.cs | 14 ++++++++------ XenModel/Messages.Designer.cs | 2 +- XenModel/Messages.resx | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/XenModel/Actions/VM/VMCrossPoolMigrateAction.cs b/XenModel/Actions/VM/VMCrossPoolMigrateAction.cs index efb15d9b2..ed57a6fb8 100644 --- a/XenModel/Actions/VM/VMCrossPoolMigrateAction.cs +++ b/XenModel/Actions/VM/VMCrossPoolMigrateAction.cs @@ -55,7 +55,6 @@ namespace XenAdmin.Actions.VMActions : base(vm.Connection, GetTitle(vm, destinationHost, copy)) { Session = vm.Connection.Session; - Description = Messages.ACTION_PREPARING; VM = vm; Host = destinationHost; Pool = Helpers.GetPool(vm.Connection); @@ -80,13 +79,16 @@ namespace XenAdmin.Actions.VMActions public static string GetTitle(VM vm, Host toHost, bool copy) { if (copy) - return string.Format(Messages.ACTION_VM_CROSS_POOL_COPY_TITLE, vm.Name(), toHost.Name()); + return string.Format(Messages.ACTION_VM_CROSS_POOL_COPY_TITLE, + vm.NameWithLocation(), + Helpers.GetPool(vm.Connection)?.Name() ?? vm.Connection.Name, + toHost.NameWithLocation()); Host residentOn = vm.Connection.Resolve(vm.resident_on); - + return residentOn == null - ? string.Format(Messages.ACTION_VM_MIGRATING_NON_RESIDENT, vm.Name(), toHost.Name()) - : string.Format(Messages.ACTION_VM_MIGRATING_RESIDENT, vm.Name(), Helpers.GetName(residentOn), toHost.Name()); + ? string.Format(Messages.ACTION_VM_MIGRATING_NON_RESIDENT, vm.NameWithLocation(), toHost.NameWithLocation()) + : string.Format(Messages.ACTION_VM_MIGRATING_RESIDENT, vm.Name(), residentOn.NameWithLocation(), toHost.NameWithLocation()); } protected override void Run() @@ -114,7 +116,7 @@ namespace XenAdmin.Actions.VMActions Description = string.Format(copy ? Messages.ACTION_VM_CROSS_POOL_COPY_CANCELLED : Messages.ACTION_VM_MIGRATE_CANCELLED, - VM.Name()); + VM.NameWithLocation()); throw; } catch (Failure ex) diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 83bcb7b50..31e99b5db 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -3067,7 +3067,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to Copying VM '{0}' to '{1}'. + /// Looks up a localized string similar to Copying VM '{0}' from '{1}' to '{2}'. /// public static string ACTION_VM_CROSS_POOL_COPY_TITLE { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 5fe154775..95ae0b5dd 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -1141,7 +1141,7 @@ Copying {0} canceled - Copying VM '{0}' to '{1}' + Copying VM '{0}' from '{1}' to '{2}' Deleting snapshots