CA-205791: Added detail to the action migrating a VM that's not resident on a host.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2016-09-30 12:39:26 +01:00
parent f1a43abbf0
commit 1acc717417
5 changed files with 25 additions and 25 deletions

View File

@ -63,11 +63,6 @@ namespace XenAdmin.Actions.VMActions
this.copy = copy; this.copy = copy;
} }
public VMCrossPoolMigrateAction(VM vm, Host destinationHost, XenAPI.Network transferNetwork, VmMapping mapping)
: this(vm, destinationHost, transferNetwork, mapping, false)
{
}
public static RbacMethodList StaticRBACDependencies public static RbacMethodList StaticRBACDependencies
{ {
get get
@ -88,13 +83,10 @@ namespace XenAdmin.Actions.VMActions
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.Name, toHost.Name);
Host residentOn = vm.Connection.Resolve(vm.resident_on); Host residentOn = vm.Connection.Resolve(vm.resident_on);
if (residentOn == null)
{
return Messages.ACTION_VM_MIGRATING;
}
return string.Format(Messages.ACTION_VM_MIGRATING_TITLE, vm.Name, Helpers.GetName(residentOn), toHost.Name);
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);
} }
protected override void Run() protected override void Run()

View File

@ -50,15 +50,11 @@ namespace XenAdmin.Actions.VMActions
private static string GetTitle(VM vm, Host toHost) private static string GetTitle(VM vm, Host toHost)
{ {
XenAPI.Host residentOn = vm.Connection.Resolve(vm.resident_on); Host residentOn = vm.Connection.Resolve(vm.resident_on);
if (residentOn == null)
{ return residentOn == null
return Messages.ACTION_VM_MIGRATING; ? 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);
else
{
return string.Format(Messages.ACTION_VM_MIGRATING_TITLE, vm.Name, Helpers.GetName(residentOn), toHost.Name);
}
} }
protected override void Run() protected override void Run()

View File

@ -2886,12 +2886,21 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to Migrating VM &apos;{0}&apos; to &apos;{1}&apos;.
/// </summary>
public static string ACTION_VM_MIGRATING_NON_RESIDENT {
get {
return ResourceManager.GetString("ACTION_VM_MIGRATING_NON_RESIDENT", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Migrating VM &apos;{0}&apos; from &apos;{1}&apos; to &apos;{2}&apos;. /// Looks up a localized string similar to Migrating VM &apos;{0}&apos; from &apos;{1}&apos; to &apos;{2}&apos;.
/// </summary> /// </summary>
public static string ACTION_VM_MIGRATING_TITLE { public static string ACTION_VM_MIGRATING_RESIDENT {
get { get {
return ResourceManager.GetString("ACTION_VM_MIGRATING_TITLE", resourceCulture); return ResourceManager.GetString("ACTION_VM_MIGRATING_RESIDENT", resourceCulture);
} }
} }

View File

@ -1074,7 +1074,10 @@
<data name="ACTION_VM_MIGRATING" xml:space="preserve"> <data name="ACTION_VM_MIGRATING" xml:space="preserve">
<value>Migrating</value> <value>Migrating</value>
</data> </data>
<data name="ACTION_VM_MIGRATING_TITLE" xml:space="preserve"> <data name="ACTION_VM_MIGRATING_NON_RESIDENT" xml:space="preserve">
<value>Migrating VM '{0}' to '{1}'</value>
</data>
<data name="ACTION_VM_MIGRATING_RESIDENT" xml:space="preserve">
<value>Migrating VM '{0}' from '{1}' to '{2}'</value> <value>Migrating VM '{0}' from '{1}' to '{2}'</value>
</data> </data>
<data name="ACTION_VM_MOVING" xml:space="preserve"> <data name="ACTION_VM_MOVING" xml:space="preserve">

View File

@ -81,7 +81,7 @@ namespace XenAPI
// Titles["VM.export"] = ...; // Titles["VM.export"] = ...;
Titles["VM.hard_reboot"] = Messages.ACTION_VM_REBOOTING_TITLE; Titles["VM.hard_reboot"] = Messages.ACTION_VM_REBOOTING_TITLE;
Titles["VM.hard_shutdown"] = Messages.ACTION_VM_SHUTTING_DOWN_TITLE; Titles["VM.hard_shutdown"] = Messages.ACTION_VM_SHUTTING_DOWN_TITLE;
Titles["VM.migrate_send"] = Messages.ACTION_VM_MIGRATING_TITLE; Titles["VM.migrate_send"] = Messages.ACTION_VM_MIGRATING_RESIDENT;
Titles["VM.resume"] = Messages.ACTION_VM_RESUMING_ON_TITLE; Titles["VM.resume"] = Messages.ACTION_VM_RESUMING_ON_TITLE;
Titles["VM.resume_on"] = Messages.ACTION_VM_RESUMING_ON_TITLE; Titles["VM.resume_on"] = Messages.ACTION_VM_RESUMING_ON_TITLE;
Titles["VM.start"] = Messages.ACTION_VM_STARTING_ON_TITLE; Titles["VM.start"] = Messages.ACTION_VM_STARTING_ON_TITLE;