summaryrefslogtreecommitdiff
path: root/source4/scripting/bin
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-19 17:18:20 +1000
committerAndrew Tridgell <tridge@samba.org>2010-04-19 18:21:42 +1000
commit43ca57d0887495fdbf2e8dd8c7afb9d521f220f3 (patch)
tree74c307ac88d62e27733ecb1e5d66907b6c5591e7 /source4/scripting/bin
parent162e7bc5b4679ab9be66730ea6b36ed3d25f0643 (diff)
downloadsamba-43ca57d0887495fdbf2e8dd8c7afb9d521f220f3.tar.gz
samba-43ca57d0887495fdbf2e8dd8c7afb9d521f220f3.tar.bz2
samba-43ca57d0887495fdbf2e8dd8c7afb9d521f220f3.zip
s4-dns: use neater python for reading lines
files are line iterators
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-xsource4/scripting/bin/samba_dnsupdate9
1 files changed, 2 insertions, 7 deletions
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)
-
-