]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - PowerDns.hs
make pdnsOut more composable
[pdns-pipe-nmc.git] / PowerDns.hs
index cb685dd4e96fadfb9e83359568365e46c5d7ddde..165b80ed5303681b0c63c0e82f8a2b36b1371ca4 100644 (file)
@@ -63,5 +63,8 @@ pdnsParse ver s =
                                             })
       _                         -> Left $ "Unparseable PDNS Request: " ++ s
 
-pdnsOut :: RRType -> NmcDom -> String
-pdnsOut _ d = show d
+pdnsOut :: Int -> RRType -> Either String NmcDom -> String
+pdnsOut ver _ d =
+  case d of
+    Left  err -> "LOG Error: " ++ err ++ "\nFAIL\n"
+    Right dom -> "DATA\n" ++ (show dom) ++ "\nEND\n" --FIXME