From 43ca57d0887495fdbf2e8dd8c7afb9d521f220f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Apr 2010 17:18:20 +1000 Subject: s4-dns: use neater python for reading lines files are line iterators --- source4/scripting/bin/samba_dnsupdate | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source4') diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index cebfae2871..3fe55e2cc5 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -148,15 +148,12 @@ def check_dns_name(d): except IOError: return False - line = dns_file.readline() - while line: - line = line.rstrip().lstrip() + for line in dns_file: + line = line.strip() if line[0] == "#": - line = dns_file.readline() continue if line.lower() == str(d).lower(): return True - line = dns_file.readline() return False try: @@ -296,5 +293,3 @@ for d in update_list: # delete the ccache if we created it if ccachename is not None: os.unlink(ccachename) - - -- cgit