server/mirrormanager/controllers.py | 7 ++++---
server/mirrormanager/zonecreator.py | 11 +++++++----
2 files changed, 11 insertions(+), 7 deletions(-)
New commits:
commit a1a5e009fec3d35e656bbe9c8844f3daeb2cd3c3
Author: Matt Domsch <Matt_Domsch(a)dell.com>
Date: Tue Jan 18 10:17:57 2011 -0600
fix CategoryController.create
diff --git a/server/mirrormanager/controllers.py b/server/mirrormanager/controllers.py
index b387a84..b636b52 100644
--- a/server/mirrormanager/controllers.py
+++ b/server/mirrormanager/controllers.py
@@ -880,11 +880,12 @@ class CategoryController(SimpleDbObjectController):
@validate(form=category_form)
@error_handler(SimpleDbObjectController.new)
def create(self, **kwargs):
- topdirPath.strip('/')
+ topdir = kwargs['topdirPath']
+ topdir.strip('/')
try:
- d = Directory.byName(kwargs['topdirPath'])
+ d = Directory.byName(topdir)
except SQLObjectNotFound:
- d = Directory(kwargs['topdirPath'])
+ d = Directory(name=topdir)
del kwargs['topdirPath']
kwargs['topdir'] = d
commit 184c7d2a7649de3f71a10aef5b2dc750058ba3a1
Author: Matt Domsch <Matt_Domsch(a)dell.com>
Date: Tue Jan 18 10:17:19 2011 -0600
fix zonecreator to not crash
diff --git a/server/mirrormanager/zonecreator.py b/server/mirrormanager/zonecreator.py
index 3cf195d..4372c83 100644
--- a/server/mirrormanager/zonecreator.py
+++ b/server/mirrormanager/zonecreator.py
@@ -1,6 +1,8 @@
import os
import re
+import errno
import dns.zone
+import dns.name
import dns.rdtypes.ANY.CNAME
from dns.exception import DNSException
from dns.rdataclass import *
@@ -18,20 +20,21 @@ def generateZoneFiles(directory):
for c in Category.select():
if c.GeoDNSDomain is None: continue
- hcs = HostCategory.selectBy(category=c)
- hosts = [ hc.host for hc in hcs if hc.host.dnsCountryHost ]
+ hosts = [ hc.host for hc in c.hostCategories if hc.host.dnsCountryHost ]
for h in hosts:
if h.country in zones:
z = zones[h.country]['zone']
else:
domainname = domainTemplateToName(c.GeoDNSDomain, h.country)
- z = dns.zone.Zone(domainname)
+ n = dns.name.from_text(domainname)
+ z = dns.zone.Zone(n)
zones[h.country] = {}
zones[h.country]['zone'] = z
zones[h.country]['name'] = domainname
rdataset = z.find_rdataset('@', rdtype=CNAME, create=True)
- rdata = dns.rdtypes.ANY.CNAME.CNAME(IN, CNAME, h.name)
+ n = dns.name.from_text(h.name)
+ rdata = dns.rdtypes.ANY.CNAME.CNAME(IN, CNAME, n)
rdataset.add(rdata, ttl=default_ttl)
for country, z in zones.iteritems():
Show replies by date