diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-04-27 18:24:52 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-27 19:27:18 +1000 |
commit | 7872efcbc0d02ef5ca79abf08f3274463ff3ec26 (patch) | |
tree | 113053957e2dffbf86d60f1b4d930be58412d5bc /source4/scripting/bin/samba_dnsupdate | |
parent | 1ae9044b8e2347a0c8c948a65a22fae6ec1ef385 (diff) | |
download | samba-7872efcbc0d02ef5ca79abf08f3274463ff3ec26.tar.gz samba-7872efcbc0d02ef5ca79abf08f3274463ff3ec26.tar.bz2 samba-7872efcbc0d02ef5ca79abf08f3274463ff3ec26.zip |
s4-dns: cope better with comments in dns_update_list
Diffstat (limited to 'source4/scripting/bin/samba_dnsupdate')
-rwxr-xr-x | source4/scripting/bin/samba_dnsupdate | 11 |
1 files changed, 4 insertions, 7 deletions
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 |