CA-339273: Mention source SR in VDI actions Description

Also changed description to reflect the status of the action

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-08-09 15:24:15 +01:00
parent f7d808ee8a
commit a78b1541e7
5 changed files with 8 additions and 21 deletions

View File

@ -44,16 +44,15 @@ namespace XenAdmin.Actions
private readonly VDI vdi;
public MigrateVirtualDiskAction(IXenConnection connection, VDI vdi, SR sr)
: base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(sr)))
: base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(connection.Resolve(vdi.SR)), Helpers.GetName(sr)))
{
Description = Messages.ACTION_PREPARING;
this.vdi = vdi;
SR = sr;
}
protected override void Run()
{
Description = string.Format(Messages.ACTION_MOVING_VDI, Helpers.GetName(vdi));
Description = Messages.MOVING;
RelatedTask = VDI.async_pool_migrate(Session, vdi.opaque_ref, SR.opaque_ref, new Dictionary<string, string>());
PollToCompletion();
Description = Messages.MOVED;

View File

@ -44,8 +44,8 @@ namespace XenAdmin.Actions
private VDI vdi;
public MoveVirtualDiskAction(IXenConnection connection, XenAPI.VDI vdi, SR sr)
: base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(sr)))
public MoveVirtualDiskAction(IXenConnection connection, VDI vdi, SR sr)
: base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(connection.Resolve(vdi.SR)), Helpers.GetName(sr)))
{
this.vdi = vdi;
SR = sr;
@ -61,7 +61,7 @@ namespace XenAdmin.Actions
protected override void Run()
{
Description = string.Format(Messages.ACTION_MOVING_VDI, Helpers.GetName(vdi));
Description = Messages.MOVING;
PercentComplete = 10;
log.DebugFormat("Moving VDI '{0}'", Helpers.GetName(vdi));
RelatedTask = VDI.async_copy(Session, vdi.opaque_ref, SR.opaque_ref);

View File

@ -126,7 +126,7 @@ namespace XenAdmin.Actions.VMActions
continue;
Description = string.Format(Messages.ACTION_MOVING_VDI_TO_SR,
Helpers.GetName(curVdi), Helpers.GetName(sr));
Helpers.GetName(curVdi), Helpers.GetName(Connection.Resolve(curVdi.SR)), Helpers.GetName(sr));
RelatedTask = VDI.async_copy(Session, oldVBD.VDI.opaque_ref, sr.opaque_ref);
PollToCompletion(PercentComplete, PercentComplete + halfstep);

View File

@ -1555,16 +1555,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Moving virtual disk &apos;{0}&apos;....
/// </summary>
public static string ACTION_MOVING_VDI {
get {
return ResourceManager.GetString("ACTION_MOVING_VDI", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Moving Virtual Disk &apos;{0}&apos; to SR &apos;{1}&apos;.
/// Looks up a localized string similar to Moving Virtual Disk &apos;{0}&apos; from SR &apos;{1}&apos; to SR &apos;{2}&apos;.
/// </summary>
public static string ACTION_MOVING_VDI_TO_SR {
get {

View File

@ -615,11 +615,8 @@
<data name="ACTION_MIGRATING_X_VDIS_STARTED" xml:space="preserve">
<value>Started migrating virtual disks</value>
</data>
<data name="ACTION_MOVING_VDI" xml:space="preserve">
<value>Moving virtual disk '{0}'...</value>
</data>
<data name="ACTION_MOVING_VDI_TO_SR" xml:space="preserve">
<value>Moving Virtual Disk '{0}' to SR '{1}'</value>
<value>Moving Virtual Disk '{0}' from SR '{1}' to SR '{2}'</value>
</data>
<data name="ACTION_MOVING_X_VDIS" xml:space="preserve">
<value>Moving {0} virtual disks to {1}</value>