755e00368b22 — Peter Sanchez 14 years ago
Appears to have fully working Zone and Host templates
2 files changed, 8 insertions(+), 4 deletions(-)

M zerigodns/__init__.py
M zerigodns/api.py
M zerigodns/__init__.py +1 -1
@@ 2,4 2,4 @@ 
     See BSD-LICENSE for license information.
 '''
 from api import ZerigoError, ZerigoNotFound, NSZone, NSHost, \
-                NSZoneTemplate
+                NSZoneTemplate, NSHostTemplate
  No newline at end of file

          
M zerigodns/api.py +7 -3
@@ 222,7 222,11 @@ class ZerigoDNS(object):
             # Create new instance
             result = self.send_request(method='POST', request=data)
             if not self.has_errors():
-                self.load(self.parse(result)[self.element[:-1]])
+                self.load(
+                    self.parse(result)[
+                        self.element[:-1].replace('_', '-')
+                    ]
+                )
                 loc = self.response_headers.get('Location', None)
                 if loc is not None:
                     p = urlparse.urlparse(loc)

          
@@ 603,8 607,8 @@ class NSHostTemplate(ZerigoDNS):
         return self.templates(opts=opts)
 
     def templates(self, opts={}):
-        if not opts.has_key('zone_id'):
-            opts['zone_template_id'] = self.zone_id
+        if not opts.has_key('zone_template_id'):
+            opts['zone_template_id'] = self.zone_template_id
         else:
             opts['zone_template_id'] = \
                     self._get_zone_template_id(opts['zone_template_id'])