projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ud-generate: No longer expand $ in dnsZoneEntry data to a \n\t.
[mirror/userdir-ldap.git]
/
ud-generate
diff --git
a/ud-generate
b/ud-generate
index
eb13678
..
27088e9
100755
(executable)
--- a/
ud-generate
+++ b/
ud-generate
@@
-772,16
+772,13
@@
def GenDNS(accounts, File):
for z in a["dnsZoneEntry"]:
Split = z.lower().split()
if Split[1].lower() == 'in':
for z in a["dnsZoneEntry"]:
Split = z.lower().split()
if Split[1].lower() == 'in':
- for y in range(0, len(Split)):
- if Split[y] == "$":
- Split[y] = "\n\t"
Line = " ".join(Split) + "\n"
F.write(Line)
Line = " ".join(Split) + "\n"
F.write(Line)
-
+
Host = Split[0] + DNSZone
if BSMTPCheck.match(Line) != None:
F.write("; Has BSMTP\n")
Host = Split[0] + DNSZone
if BSMTPCheck.match(Line) != None:
F.write("; Has BSMTP\n")
-
+
# Write some identification information
if not RRs.has_key(Host):
if Split[2].lower() in ["a", "aaaa"]:
# Write some identification information
if not RRs.has_key(Host):
if Split[2].lower() in ["a", "aaaa"]:
@@
-793,7
+790,7
@@
def GenDNS(accounts, File):
else:
Line = "; Err %s"%(str(Split))
F.write(Line)
else:
Line = "; Err %s"%(str(Split))
F.write(Line)
-
+
F.write("\n")
except Exception, e:
F.write("; Errors:\n")
F.write("\n")
except Exception, e:
F.write("; Errors:\n")
@@
-1269,11
+1266,15
@@
last = sorted_mods[-1][1]['reqEnd'][0].split('.')[0]
if 'UD_GENERATEDIR' in os.environ:
GenerateDir = os.environ['UD_GENERATEDIR']
if 'UD_GENERATEDIR' in os.environ:
GenerateDir = os.environ['UD_GENERATEDIR']
-cache_last_mod =
[0,0]
+cache_last_mod =
0
try:
fd = open(os.path.join(GenerateDir, "last_update.trace"), "r")
cache_last_mod=fd.read().split()
try:
fd = open(os.path.join(GenerateDir, "last_update.trace"), "r")
cache_last_mod=fd.read().split()
+ try:
+ cache_last_mod = cache_last_mod[0]
+ except IndexError:
+ pass
fd.close()
except IOError, e:
if e.errno == errno.ENOENT:
fd.close()
except IOError, e:
if e.errno == errno.ENOENT:
@@
-1281,7
+1282,7
@@
except IOError, e:
else:
raise e
else:
raise e
-if cache_last_mod
[0]
>= last:
+if cache_last_mod >= last:
fd = open(os.path.join(GenerateDir, "last_update.trace"), "w")
fd.write("%s\n%s\n" % (last, int(time.time())))
fd.close()
fd = open(os.path.join(GenerateDir, "last_update.trace"), "w")
fd.write("%s\n%s\n" % (last, int(time.time())))
fd.close()
@@
-1310,15
+1311,15
@@
try:
sys.stderr.write("Could not acquire lock %s.\n"%(lockf))
sys.exit(1)
sys.stderr.write("Could not acquire lock %s.\n"%(lockf))
sys.exit(1)
+ tracefd = open(os.path.join(GenerateDir, "last_update.trace"), "w")
generate_all(GenerateDir, l)
generate_all(GenerateDir, l)
+ tracefd.write("%s\n%s\n" % (last, int(time.time())))
+ tracefd.close()
finally:
if lock is not None:
lock.release()
finally:
if lock is not None:
lock.release()
-fd = open(os.path.join(GenerateDir, "last_update.trace"), "w")
-fd.write("%s\n%s\n" % (last, int(time.time())))
-fd.close()
# vim:set et:
# vim:set ts=3:
# vim:set et:
# vim:set ts=3: