[Freeipa-devel] [PATCH] 0126 Guard ipa-server-install from missing trusts support

Alexander Bokovoy abokovoy at redhat.com
Mon Nov 4 15:24:09 UTC 2013


Hi!

Attached patch is needed to cover the case when freeipa-server-trust-ad
package is not installed since FreeIPA 3.3.3 does now import
adtrustinstance to handle ipa-server-install --uninstall.

We need to issue a package update to all releases where FreeIPA 3.3.3
packages are available.


-- 
/ Alexander Bokovoy
-------------- next part --------------
>From 52b021a16cbafc17eb48092bae81976242c53422 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Mon, 4 Nov 2013 17:15:23 +0200
Subject: [PATCH] Guard import of adtrustinstance for case without trusts

https://fedorahosted.org/freeipa/ticket/4011
---
 install/tools/ipa-server-install | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index b3dcf6d..458ebba 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -40,7 +40,12 @@ import pwd
 import textwrap
 from optparse import OptionGroup, OptionValueError
 
-from ipaserver.install import adtrustinstance
+try:
+    from ipaserver.install import adtrustinstance
+    _server_trust_ad_installed = True
+except ImportError:
+    _server_trust_ad_installed = False
+
 from ipaserver.install import dsinstance
 from ipaserver.install import krbinstance
 from ipaserver.install import bindinstance
@@ -493,7 +498,8 @@ def uninstall():
     httpinstance.HTTPInstance(fstore).uninstall()
     krbinstance.KrbInstance(fstore).uninstall()
     dsinstance.DsInstance(fstore=fstore).uninstall()
-    adtrustinstance.ADTRUSTInstance(fstore).uninstall()
+    if _server_trust_ad_installed:
+        adtrustinstance.ADTRUSTInstance(fstore).uninstall()
     memcacheinstance.MemcacheInstance().uninstall()
     otpdinstance.OtpdInstance().uninstall()
     ipaservices.restore_network_configuration(fstore, sstore)
-- 
1.8.3.1



More information about the Freeipa-devel mailing list