On Wed, 26 Feb 2014, Martin Kosek wrote:
On 02/25/2014 07:15 PM, Alexander Bokovoy wrote:
On Tue, 25 Feb 2014, Tomas Babej wrote:
Hi,

As a part of a better cleanup procedure in the integration tests,
make sure that winbindd is not running after uninstalling the IPA
server.
Better patch 0140  attached. We simply need to stop and disable winbind in
adtrustinstance.uninstall()

Looks good to me (and a better approach than Tomas' 155 it seems). Since you
are touching this section anyway, can you please also replace bare except with
"except Exception:"?

It will allow admin to CTRL+C the stopping process when needed.
Sure, new patch is attached. There are two potentially long external
processes executed in the uninstall() so I changed to 'except
Exception:' in both.

--
/ Alexander Bokovoy
>From 74b7d5a3ffe77e6430d1b6c0cd175fea708c1855 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <aboko...@redhat.com>
Date: Tue, 25 Feb 2014 20:11:50 +0200
Subject: [PATCH 3/5] adtrustinstance: make sure to stop and disable winbind in
 uninstall()

This makes unnecessary Tomas' patch 0155.
---
 ipaserver/install/adtrustinstance.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/adtrustinstance.py 
b/ipaserver/install/adtrustinstance.py
index 621e3fd..118b2fe 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -889,12 +889,15 @@ class ADTRUSTInstance(service.Service):
         self.restore_state("running")
         self.restore_state("enabled")
 
+        winbind = ipaservices.service("winbind")
         # Always try to stop and disable smb service, since we do not leave
         # working configuration after uninstall
         try:
             self.stop()
             self.disable()
-        except:
+            winbind.stop()
+            winbind.disable()
+        except Exception:
             pass
 
         # Since we do not guarantee restoring back to working samba state,
@@ -907,7 +910,7 @@ class ADTRUSTInstance(service.Service):
                 try:
                     ipautil.run(["/usr/sbin/setsebool",
                                  "-P", var, sebool_state])
-                except:
+                except Exception:
                     self.print_msg(SELINUX_WARNING % dict(var=var))
 
         # Remove samba's credentials cache
-- 
1.8.3.1

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

Reply via email to