git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
162e7bc
)
s4-dns: use neater python for reading lines
author
Andrew Tridgell
<tridge@samba.org>
Mon, 19 Apr 2010 07:18:20 +0000
(17:18 +1000)
committer
Andrew Tridgell
<tridge@samba.org>
Mon, 19 Apr 2010 08:21:42 +0000
(18:21 +1000)
files are line iterators
source4/scripting/bin/samba_dnsupdate
patch
|
blob
|
history
diff --git
a/source4/scripting/bin/samba_dnsupdate
b/source4/scripting/bin/samba_dnsupdate
index cebfae28710b7ce462da5d545e5f33b20fb61adb..3fe55e2cc552af54efaa7c8129eab7e04772d215 100755
(executable)
--- 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)
-
-