mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
wintest: avoid adding a blank line to resolv.conf on each run
Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Sat Nov 27 01:47:48 CET 2010 on sn-devel-104
This commit is contained in:
parent
3bc6145143
commit
353cdd006a
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user