pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0094-Fix-ipa-restore-on-systems-without-IPA-installed.patch

e3ffab
From ce55779854e90bb03230dc010092dddf1e9fde67 Mon Sep 17 00:00:00 2001
e3ffab
From: Jan Cholasta <jcholast@redhat.com>
e3ffab
Date: Mon, 12 Jan 2015 17:03:22 +0000
e3ffab
Subject: [PATCH] Fix ipa-restore on systems without IPA installed
e3ffab
e3ffab
https://fedorahosted.org/freeipa/ticket/4824
e3ffab
e3ffab
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
e3ffab
---
e3ffab
 ipaserver/install/ipa_restore.py | 8 ++++++--
e3ffab
 1 file changed, 6 insertions(+), 2 deletions(-)
e3ffab
e3ffab
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
e3ffab
index 3b4cf6a7c05245076abde7a9c13e53bc9636b69a..f3a60fcc7a60c38c0d2ae1e52fc4fe7712411ec1 100644
e3ffab
--- a/ipaserver/install/ipa_restore.py
e3ffab
+++ b/ipaserver/install/ipa_restore.py
e3ffab
@@ -692,8 +692,12 @@ class Restore(admintool.AdminTool):
e3ffab
         cainstance.stop_tracking_certificates(
e3ffab
             dogtag.configured_constants())
e3ffab
         httpinstance.HTTPInstance().stop_tracking_certificates()
e3ffab
-        dsinstance.DsInstance().stop_tracking_certificates(
e3ffab
-            realm_to_serverid(api.env.realm))
e3ffab
+        try:
e3ffab
+            dsinstance.DsInstance().stop_tracking_certificates(
e3ffab
+                realm_to_serverid(api.env.realm))
e3ffab
+        except OSError:
e3ffab
+            # When IPA is not installed, DS NSS DB does not exist
e3ffab
+            pass
e3ffab
 
e3ffab
         for basename in ('cert8.db', 'key3.db', 'secmod.db', 'pwdfile.txt'):
e3ffab
             filename = os.path.join(paths.IPA_NSSDB_DIR, basename)
e3ffab
-- 
e3ffab
2.1.0
e3ffab