From 7872efcbc0d02ef5ca79abf08f3274463ff3ec26 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 27 Apr 2010 18:24:52 +1000 Subject: s4-dns: cope better with comments in dns_update_list --- source4/scripting/bin/samba_dnsupdate | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source4') diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 3fe55e2cc5..70fec25933 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -150,7 +150,7 @@ def check_dns_name(d): for line in dns_file: line = line.strip() - if line[0] == "#": + if line == '' or line[0] == "#": continue if line.lower() == str(d).lower(): return True @@ -253,15 +253,12 @@ update_list = [] dns_list = [] # read each line, and check that the DNS name exists -line = file.readline() -while line: - line = line.rstrip().lstrip() - if line[0] == "#": - line = file.readline() +for line in file: + line = line.strip() + if line == '' or line[0] == "#": continue d = parse_dns_line(line, sub_vars) dns_list.append(d) - line = file.readline() # now expand the entries, if any are A record with ip set to $IP # then replace with multiple entries, one for each interface IP -- cgit