]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - PowerDns.hs
SRV hack part 2
[pdns-pipe-nmc.git] / PowerDns.hs
index 696b9b57af6c06fd3bd4d85349f4185a65af3a04..8962e94c9de37fe7f08e39f68c8607af0814317b 100644 (file)
@@ -5,7 +5,7 @@ module PowerDns ( RRType(..)
                 , pdnsOut
                 ) where
 
-import NmcJson
+import NmcDom
 
 data RRType = RRTypeSRV   | RRTypeA   | RRTypeAAAA | RRTypeCNAME
             | RRTypeDNAME | RRTypeSOA | RRTypeRP   | RRTypeLOC
@@ -71,7 +71,7 @@ pdnsReport err =
 pdnsOut :: Int -> String -> String -> RRType -> Either String NmcDom -> String
 pdnsOut ver id name rrtype edom =
   case edom of
-    Left  err -> pdnsReport err
+    Left  err -> pdnsReport $ err ++ " in a query for " ++ name
     Right dom -> foldr addLine "END\n" $ nmc2pdns name rrtype dom
       where
         addLine (nm, ty, dt) accum =
@@ -92,7 +92,7 @@ nmc2pdns name RRTypeA     dom = mapto name "A" $ domIp dom
 nmc2pdns name RRTypeAAAA  dom = mapto name "AAAA" $ domIp6 dom
 nmc2pdns name RRTypeCNAME dom = takejust name "CNAME" $ domAlias dom
 nmc2pdns name RRTypeDNAME dom = takejust name "DNAME" $ domTranslate dom
-nmc2pdns name RRTypeSOA   dom =
+nmc2pdns name RRTypeSOA   dom = -- FIXME generate only for top domain
   if dom == emptyNmcDom then []
   else
     let