1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s4-dns: use neater python for reading lines

files are line iterators
This commit is contained in:
Andrew Tridgell 2010-04-19 17:18:20 +10:00
parent 162e7bc5b4
commit 43ca57d088

View File

@ -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)