Blame SOURCES/pki-core-FixDeploymentDescriptor-upgrade-scriptlet.patch

3fd438
From 09b673f3f4bbc5e9b70722bbe240e0347e3dd3fc Mon Sep 17 00:00:00 2001
3fd438
From: Fraser Tweedale <ftweedal@redhat.com>
3fd438
Date: Fri, 11 Aug 2017 15:17:09 +1000
3fd438
Subject: [PATCH] Fix FixDeploymentDescriptor upgrade script if source file is
3fd438
 missing
3fd438
3fd438
On RHEL, the pki#admin.xml file may be absent, causing the
3fd438
FixDeploymentDescriptor to break (and subsequent upgrade scriptlets
3fd438
to not be executed).  Add a check that the source file exists.
3fd438
3fd438
Fixes: https://pagure.io/dogtagpki/issue/2789
3fd438
Change-Id: I686e8fae534f8044cb1ce40b31e2462c4f0ac988
3fd438
(cherry picked from commit d0a861923a27672d8633c87e21fb8596080e84af)
3fd438
---
3fd438
 base/server/upgrade/10.3.5/02-FixDeploymentDescriptor | 3 +++
3fd438
 1 file changed, 3 insertions(+)
3fd438
3fd438
diff --git a/base/server/upgrade/10.3.5/02-FixDeploymentDescriptor b/base/server/upgrade/10.3.5/02-FixDeploymentDescriptor
3fd438
index 27c895980..858dbed43 100644
3fd438
--- a/base/server/upgrade/10.3.5/02-FixDeploymentDescriptor
3fd438
+++ b/base/server/upgrade/10.3.5/02-FixDeploymentDescriptor
3fd438
@@ -46,6 +46,9 @@ class FixDeploymentDescriptor(pki.server.upgrade.PKIServerUpgradeScriptlet):
3fd438
         source_xml = pki.SHARE_DIR + '/server/conf/Catalina/localhost/' + context_xml
3fd438
         target_xml = instance.conf_dir + '/Catalina/localhost/' + context_xml
3fd438
 
3fd438
+        if not os.path.exists(source_xml):
3fd438
+            return
3fd438
+
3fd438
         # if deployment descriptor doesn't exist, install the default
3fd438
         if not os.path.exists(target_xml):
3fd438
             self.copy_file(instance, source_xml, target_xml)
3fd438
-- 
3fd438
2.13.5
3fd438