Hello,

masking named service is executed more than once, following patch fixes it.

Patch attached.

--
Martin Basti

From 9ac55b15ff7b418e9ec82efb2cc1070c864ccac9 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Wed, 12 Nov 2014 12:09:27 +0100
Subject: [PATCH] Upgrade fix: masking named should be executed only once

There was error in code, masking was executed more times, even it was
succesful
---
 install/tools/ipa-upgradeconfig | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig
index aa9fcd1e0802911c0f1f389afc99a83fc8052493..63fb7d690187f0d199ceb459f21a40c4b39945ce 100644
--- a/install/tools/ipa-upgradeconfig
+++ b/install/tools/ipa-upgradeconfig
@@ -1141,23 +1141,25 @@ def uninstall_selfsign(ds, http):
 def mask_named_regular():
     """Disable named, we need to run only named-pkcs11, running both named and
     named-pkcs can cause unexpected errors"""
-    if not sysupgrade.get_upgrade_state('dns', 'regular_named_masked'):
-        if bindinstance.named_conf_exists():
-            root_logger.info('[Masking named]')
-            named = services.service('named-regular')
-            try:
-                named.stop()
-            except Exception as e:
-                root_logger.warning('Unable to stop named service (%s)', e)
+    if sysupgrade.get_upgrade_state('dns', 'regular_named_masked'):
+        return
 
-            try:
-                named.mask()
-            except Exception as e:
-                root_logger.warning('Unable to mask named service (%s)', e)
+    sysupgrade.set_upgrade_state('dns', 'regular_named_masked', True)
 
-            return True
+    if bindinstance.named_conf_exists():
+        root_logger.info('[Masking named]')
+        named = services.service('named-regular')
+        try:
+            named.stop()
+        except Exception as e:
+            root_logger.warning('Unable to stop named service (%s)', e)
 
-        sysupgrade.set_upgrade_state('dns', 'regular_named_masked', True)
+        try:
+            named.mask()
+        except Exception as e:
+            root_logger.warning('Unable to mask named service (%s)', e)
+
+        return True
 
     return False
 
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to