From ee08e06f523df68cc9ab73c30d3afe935620e0be Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Mon, 27 Jun 2016 19:39:49 +0100 Subject: [PATCH] CA-214566: Upload succeeded, but Pool_patch hasn't been found Signed-off-by: Gabor Apati-Nagy --- .../PlanActions/UploadPatchToMasterPlanAction.cs | 7 ++++++- XenModel/Messages.Designer.cs | 9 +++++++++ XenModel/Messages.resx | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToMasterPlanAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToMasterPlanAction.cs index f7940da67..d43c9dfa9 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToMasterPlanAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToMasterPlanAction.cs @@ -79,10 +79,15 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions inProgressAction = uploadPatchAction; uploadPatchAction.RunExternal(session); + // this has to be run again to refresh poolPatches (to get the recently uploaded one as well) + poolPatches = new List(session.Connection.Cache.Pool_patches); + var poolPatch = poolPatches.Find(p => string.Equals(p.uuid, patch.Uuid, StringComparison.OrdinalIgnoreCase)); if (poolPatch == null) { - //error + log.ErrorFormat("Upload finished successfully, but Pool_patch object has not been found for patch (uuid={0}) on host (uuid={1}).", patch.Uuid, session.Connection); + + throw new Exception(Messages.ACTION_UPLOADPATCHTOMASTERPLANACTION_FAILED); } var newMapping = new PoolPatchMapping() diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 78728a6d1..901653a0c 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -2463,6 +2463,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Upload error. The patch was uploaded, but it cannot be found on the host.. + /// + public static string ACTION_UPLOADPATCHTOMASTERPLANACTION_FAILED { + get { + return ResourceManager.GetString("ACTION_UPLOADPATCHTOMASTERPLANACTION_FAILED", resourceCulture); + } + } + /// /// Looks up a localized string similar to Virtual disk created. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 5a07eb289..cb1c1276b 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -909,6 +909,9 @@ Updating integrated GPU passthrough on '{0}' + + Upload error. The patch was uploaded, but it cannot be found on the host. + Upload server status report to [Citrix] Insight Services