CA-365717: Two corrections on VM import (from XVA):

- Do not suppress failures when polling the import task.
- When the imported VM is suspended, try resuming instead of starting it.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2022-03-28 07:56:51 +01:00 committed by Danilo Del Busso
parent f5672a8645
commit 51a400bf70

View File

@ -215,7 +215,12 @@ namespace XenAdmin.Actions
Description = isTemplate ? Messages.IMPORT_TEMPLATE_IMPORTCOMPLETE : Messages.IMPORTVM_IMPORTCOMPLETE;
if (vm != null && !vm.is_a_template && m_startAutomatically)
new VMStartAction(vm, _warningDelegate, _failureDiagnosisDelegate).RunAsync();
{
if (vm.power_state == vm_power_state.Suspended)
new VMResumeAction(vm, _warningDelegate, _failureDiagnosisDelegate).RunAsync();
else
new VMStartAction(vm, _warningDelegate, _failureDiagnosisDelegate).RunAsync();
}
}
private int VMsWithName(string name)
@ -283,7 +288,7 @@ namespace XenAdmin.Actions
}
catch (Exception e)
{
PollToCompletion(suppressFailures: true);
PollToCompletion();
if (e is CancelledException || e is HTTP.CancelledException || e.InnerException is CancelledException)
throw new CancelledException();
throw;