e3ffab
From 318a05f1564e95ae3516d7cfdb6cd7c03a87b87d Mon Sep 17 00:00:00 2001
e3ffab
From: Jan Cholasta <jcholast@redhat.com>
e3ffab
Date: Thu, 20 Nov 2014 13:57:46 +0000
e3ffab
Subject: [PATCH] Stop tracking certificates before restoring them in
e3ffab
 ipa-restore
e3ffab
e3ffab
https://fedorahosted.org/freeipa/ticket/4727
e3ffab
e3ffab
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
e3ffab
---
e3ffab
 ipaserver/install/ipa_restore.py | 12 ++++++++++--
e3ffab
 1 file changed, 10 insertions(+), 2 deletions(-)
e3ffab
e3ffab
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
e3ffab
index f290bae4dc6455bb22c4e726e72efe98205d970e..9cb978a516f4f85307735b7428f6053461061022 100644
e3ffab
--- a/ipaserver/install/ipa_restore.py
e3ffab
+++ b/ipaserver/install/ipa_restore.py
e3ffab
@@ -26,7 +26,7 @@ import pwd
e3ffab
 from ConfigParser import SafeConfigParser
e3ffab
 
e3ffab
 from ipalib import api, errors
e3ffab
-from ipapython import version, ipautil, certdb
e3ffab
+from ipapython import version, ipautil, certdb, dogtag
e3ffab
 from ipapython.ipautil import run, user_input
e3ffab
 from ipapython import admintool
e3ffab
 from ipapython.dn import DN
e3ffab
@@ -36,7 +36,7 @@ from ipaserver.install.cainstance import PKI_USER, create_ca_user
e3ffab
 from ipaserver.install.replication import (wait_for_task, ReplicationManager,
e3ffab
                                            get_cs_replication_manager)
e3ffab
 from ipaserver.install import installutils
e3ffab
-from ipaserver.install import httpinstance
e3ffab
+from ipaserver.install import dsinstance, httpinstance, cainstance
e3ffab
 from ipapython import ipaldap
e3ffab
 import ipapython.errors
e3ffab
 from ipaplatform.tasks import tasks
e3ffab
@@ -676,6 +676,12 @@ class Restore(admintool.AdminTool):
e3ffab
             self.log.error('%s', e)
e3ffab
 
e3ffab
     def cert_restore_prepare(self):
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
+
e3ffab
         for basename in ('cert8.db', 'key3.db', 'secmod.db', 'pwdfile.txt'):
e3ffab
             filename = os.path.join(paths.IPA_NSSDB_DIR, basename)
e3ffab
             try:
e3ffab
@@ -705,3 +711,5 @@ class Restore(admintool.AdminTool):
e3ffab
                             (nickname, paths.IPA_NSSDB_DIR, e))
e3ffab
 
e3ffab
         tasks.reload_systemwide_ca_store()
e3ffab
+
e3ffab
+        services.knownservices.certmonger.restart()
e3ffab
-- 
e3ffab
2.1.0
e3ffab