After reinstall the wrong status has been saved, we do care only about service status before first installation.

Patch attached.
From f3f8605cdebdcc67f9cc5b8d7195b76b17794442 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 22 Oct 2015 17:05:27 +0200
Subject: [PATCH] DNSSEC: store status of services only before first install

DNS installer allows to reinstall DNS and DNSSEC, so the status of
services should be stored only for first time.
---
 ipaserver/install/odsexporterinstance.py | 7 ++++---
 ipaserver/install/opendnssecinstance.py  | 6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ipaserver/install/odsexporterinstance.py b/ipaserver/install/odsexporterinstance.py
index e9ba51027eb1386384361e3f0190c40267134e9e..85c64aba4d7b2fb1b5f1f5c6345521458a8388f5 100644
--- a/ipaserver/install/odsexporterinstance.py
+++ b/ipaserver/install/odsexporterinstance.py
@@ -146,9 +146,10 @@ class ODSExporterInstance(service.Service):
 
     def __disable_signerd(self):
         signerd_service = services.knownservices.ods_signerd
-
-        self.backup_state("singerd_running", signerd_service.is_running())
-        self.backup_state("singerd_enabled", signerd_service.is_enabled())
+        if self.get_state("singerd_running") is None:
+            self.backup_state("singerd_running", signerd_service.is_running())
+        if self.get_state("singerd_enabled") is None:
+            self.backup_state("singerd_enabled", signerd_service.is_enabled())
 
         # disable default opendnssec signer daemon
         signerd_service.stop()
diff --git a/ipaserver/install/opendnssecinstance.py b/ipaserver/install/opendnssecinstance.py
index a060e358478663bb37603128c0681883d3aac307..34dce0f32109b6677737199a90832a45c8f30983 100644
--- a/ipaserver/install/opendnssecinstance.py
+++ b/ipaserver/install/opendnssecinstance.py
@@ -93,8 +93,10 @@ class OpenDNSSECInstance(service.Service):
 
     def create_instance(self, fqdn, realm_name, generate_master_key=True,
                         kasp_db_file=None):
-        self.backup_state("enabled", self.is_enabled())
-        self.backup_state("running", self.is_running())
+        if self.get_state("enabled") is None:
+            self.backup_state("enabled", self.is_enabled())
+        if self.get_state("running") is None:
+            self.backup_state("running", self.is_running())
         self.fqdn = fqdn
         self.realm = realm_name
         self.suffix = ipautil.realm_to_suffix(self.realm)
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to