Index: tools/gformat.py
===================================================================
--- tools/gformat.py	(revision 9283)
+++ tools/gformat.py	(revision 9284)
@@ -351,5 +351,5 @@
 def get_yaml(item):
   """ Get configuration yaml for 'item'"""
-  gfile = NODE_DIR + '/%s/wleiden.yaml' % item
+  gfile = os.path.join(NODE_DIR,item,'wleiden.yaml')
 
   f = open(gfile, 'r')
@@ -361,5 +361,5 @@
 def store_yaml(datadump):
   """ Store configuration yaml for 'item'"""
-  gfile = NODE_DIR + '/%s/wleiden.yaml' % item
+  gfile = os.path.join(NODE_DIR,item,'wleiden.yaml')
 
   f = open(gfile, 'w')
@@ -402,5 +402,5 @@
 def write_yaml(item, datadump):
   """ Write configuration yaml for 'item'"""
-  gfile = NODE_DIR + '/%s/wleiden.yaml' % item
+  gfile = os.path.join(NODE_DIR,item,'wleiden.yaml')
 
   f = open(gfile, 'w')
@@ -550,5 +550,5 @@
 
 
-def make_dns():
+def make_dns(output_dir = 'dns'):
   items = dict()
 
@@ -615,5 +615,5 @@
   ## roomburgh=CNodeRoomburgh1
   ## apkerk1.CNodeVosko=172.17.176.8 ;this as well
-  dns = yaml.load(open('../dns/staticDNS.yaml','r'))
+  dns = yaml.load(open(os.path.join(NODE_DIR,'../dns/staticDNS.yaml'),'r'))
   for comment, block in dns.iteritems():
     for k,v in block.iteritems():
@@ -639,5 +639,5 @@
     os.makedirs('dns')
   details['zone'] = 'wleiden.net'
-  f = open("dns/db." + details['zone'], "w")
+  f = open(os.path.join(output_dir,"db." + details['zone']), "w")
   f.write(dns_header % details)
 
@@ -652,5 +652,5 @@
   for s in range(16,32):
     details['zone'] = '%i.172.in-addr.arpa' % s
-    f = open("dns/db." + details['zone'], "w")
+    f = open(os.path.join(output_dir,"db." + details['zone']), "w")
     f.write(dns_header % details)
 
@@ -668,5 +668,5 @@
   print """Usage: %s <standalone [port] |test [test arguments]|static|dns>
 Examples:
-\tdns                          =  Generate BIND compliant zone files in dns.
+\tdns [outputdir]              =  Generate BIND compliant zone files in dns.
 \tstandalone                   =  Run configurator webserver [default port=8000]
 \tstatic                       =  Generate all config files and store on disk
@@ -734,5 +734,5 @@
           f.close()
     elif sys.argv[1] == "dns":
-      make_dns()
+      make_dns(sys.argv[2] if sys.argv[2] else 'dns')
     elif sys.argv[1] == "cleanup":
       # First generate all datadumps
