pvl.dhcp-conf: whitelist set of attributes to quote
authorTero Marttila <terom@paivola.fi>
Sun, 02 Mar 2014 13:22:08 +0200
changeset 376 31d9ae0c1dab
parent 375 df3bf49634a1
child 377 f7e1e93a65f9
pvl.dhcp-conf: whitelist set of attributes to quote
bin/pvl.dhcp-conf
--- a/bin/pvl.dhcp-conf	Tue Jan 14 23:15:36 2014 +0200
+++ b/bin/pvl.dhcp-conf	Sun Mar 02 13:22:08 2014 +0200
@@ -21,6 +21,10 @@
     file = pvl.args.apply_file(conf, 'r')
     return pvl.dhcp.config.DHCPConfigParser.load(file)
 
+QUOTE_ITEMS = set((
+    'filename',
+))
+
 def process_dhcp_items (options, block, items) :
     """
         Yield items for output from given input items
@@ -39,6 +43,10 @@
                 log.info("include: %s", include)
 
             yield 'include', '"{include}"'.format(include=include)
+
+        elif name in QUOTE_ITEMS :
+            yield name, ' '.join('"{arg}"'.format(arg=arg) for arg in args)
+
         else :
             yield item