]> git.llucax.com Git - software/pymin.git/blobdiff - services/dhcp/__init__.py
Move common validation code to new pymin.validation module (refs #20)
[software/pymin.git] / services / dhcp / __init__.py
index d493b1c53ba373d08d71934e9a6867d31df820dd..8f9581f239e7020c2b7778f9be4e5128209fab03 100644 (file)
@@ -1,7 +1,17 @@
 # vim: set encoding=utf-8 et sw=4 sts=4 :
 
+from formencode import validators as V
+from pymin.config import Option
 from handler import DhcpHandler
 
+def setup_service(options, config):
+    options.add_group('dhcp', 'DHCP service', [
+        Option('pickle_dir', V.String, metavar='DIR',
+               help='store persistent data in DIR directory'),
+        Option('config_dir', V.String, metavar='DIR',
+               help='write config file in DIR directory'),
+    ])
+
 def get_service(config):
     return DhcpHandler(config.dhcp.pickle_dir, config.dhcp.config_dir)