wintest: avoid adding a blank line to resolv.conf on each run
authorAndrew Tridgell <tridge@samba.org>
Fri, 26 Nov 2010 23:28:15 +0000 (10:28 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 27 Nov 2010 00:47:48 +0000 (01:47 +0100)
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sat Nov 27 01:47:48 CET 2010 on sn-devel-104

wintest/test-s4-howto.py

index c05d084dc5b112fd9489bca0c408353f8bf51843..3d4b5e0511b06d81e3f5378b2adb71a986b52aed 100755 (executable)
@@ -105,13 +105,12 @@ def set_nameserver(t, nameserver):
 nameserver %s
 
 # your original resolv.conf appears below:
-
 ''' % t.substitute(nameserver))
     child = t.pexpect_spawn("cat /etc/resolv.conf", crlf=False)
     i = child.expect(['your original resolv.conf appears below:', pexpect.EOF])
     if i == 0:
         child.expect(pexpect.EOF)
-    contents = child.before.replace('\r', '')
+    contents = child.before.lstrip().replace('\r', '')
     t.write_file('/etc/resolv.conf.wintest', contents, mode='a')
     t.write_file('/etc/resolv.conf.wintest-bak', contents)
     t.run_cmd("mv -f /etc/resolv.conf.wintest /etc/resolv.conf")