wintest: fixed cleanup of /etc/resolv.conf
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 Nov 2010 05:42:43 +0000 (16:42 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 Nov 2010 06:29:49 +0000 (07:29 +0100)
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov 24 07:29:49 CET 2010 on sn-devel-104

wintest/test-s4-howto.py

index dd79e04be1d8d993440599ac7961bba73e946c93..67c98e951c8e8c1f6667fd3fd3bd84e29f751652 100755 (executable)
@@ -104,6 +104,7 @@ nameserver %s
 def restore_resolv_conf(t):
     '''restore the /etc/resolv.conf after testing is complete'''
     if getattr(t, 'resolv_conf_backup', False):
+        t.info("restoring /etc/resolv.conf")
         t.run_cmd("mv -f %s /etc/resolv.conf" % t.resolv_conf_backup)
 
 def rndc_cmd(t, cmd, checkfail=True):
@@ -703,6 +704,7 @@ def test_howto(t):
 
 def test_cleanup(t):
     '''cleanup after tests'''
+    t.info("Cleaning up ...")
     restore_resolv_conf(t)
     if getattr(t, 'bind_child', False):
         t.bind_child.kill()
@@ -750,7 +752,7 @@ if __name__ == '__main__':
 
     try:
         test_howto(t)
-    except Exception, str:
+    except:
         if not opts.nocleanup:
             test_cleanup(t)
         raise