On 05/12/14 10:23, David Kupka wrote:
On 11/12/2014 01:43 PM, Martin Basti wrote:
Hello,
masking named service is executed more than once, following patch
fixes it.
Patch attached.
_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel
Works as expected but:
0) mask_named_regular() returns True, False and None. None evaluates
as False so why not use False directly?
1) missing link to ticket in commit message.
Updated patch attached
--
Martin Basti
From 79ca4ffdabd59814311c9f0db81018bfeb984044 Mon Sep 17 00:00:00 2001
From: Martin Basti <[email protected]>
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
https://fedorahosted.org/freeipa/ticket/4755
---
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 815fe0465348e175a4e54b6898409ee4f963a56d..44b58d2aca640daf2f7640ce58687549d98978c5 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 False
- 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
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel