mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
XenCenter: Handle already uploaded updates
Introduce fails with a Failure if the uploaded update has already been introduced, in that case XenCenter will use the existing Pool_update Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
parent
f4a0f3ae40
commit
7d0c2e9b36
@ -189,6 +189,15 @@ namespace XenAdmin.Actions
|
||||
var poolUpdateRef = Pool_update.introduce(Connection.Session, vdiRef);
|
||||
poolUpdate = Connection.WaitForCache(poolUpdateRef);
|
||||
}
|
||||
catch (Failure ex)
|
||||
{
|
||||
if (ex.ErrorDescription != null && ex.ErrorDescription.Count > 1 && "UPDATE_ALREADY_EXISTS".Equals(ex.ErrorDescription[0], StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
string uuidFound = ex.ErrorDescription[1];
|
||||
|
||||
poolUpdate = Connection.Cache.Pool_updates.FirstOrDefault(pu => string.Equals(pu.uuid, uuidFound, System.StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Upload failed when introducing update from VDI {0} on {1}: {2}", vdi.opaque_ref, Connection, ex.Message);
|
||||
|
Loading…
Reference in New Issue
Block a user