--- a/dhcp_conf.py Thu Apr 02 21:11:01 2009 +0300
+++ b/dhcp_conf.py Thu Apr 02 22:52:26 2009 +0300
@@ -115,13 +115,13 @@
DEFAULT_NAME = "dhcpd.conf"
DEFAULT_PATH = "/etc/dhcp3/dhcpd.conf"
- def __init__ (self, name=DEFAULT_NAME, path=DEFAULT_PATH, params=None, decls=None) :
+ def __init__ (self, name=DEFAULT_NAME, path=DEFAULT_PATH, params=None, decls=None, comment=None) :
"""
Initialize the dhcpd config file, but don't open it yet.
"""
conf.File.__init__(self, name, path)
- Section.__init__(self, params, decls)
+ Section.__init__(self, params, decls, comment)
class Statement (Object) :
"""
@@ -270,14 +270,12 @@
}
"""
- def __init__ (self, name, params=[], decls=[]) :
+ def __init__ (self, name, *args, **kwargs) :
"""
@param name the name of the shared-subnet
- @param params optional parameters
- @param decls the iterable of subnets or other declarations in the shared network
"""
- super(SharedNetwork, self).__init__("shared-network", [name], params, decls)
+ super(SharedNetwork, self).__init__("shared-network", [name], *args, **kwargs)
class Subnet (Declaration) :
"""
@@ -290,14 +288,12 @@
}
"""
- def __init__ (self, network, params=None, decls=None) :
+ def __init__ (self, network, *args, **kwargs) :
"""
@param network the addr.Network for the subnet
- @param params optional parameters
- @param decls optional decls, e.g. subnets
"""
- super(Subnet, self).__init__("subnet", [network.net(), "netmask", network.netmask()], params, decls)
+ super(Subnet, self).__init__("subnet", [network.net(), "netmask", network.netmask()], *args, **kwargs)
class Group (Declaration) :
"""
@@ -309,8 +305,8 @@
}
"""
- def __init__ (self, params=None, decls=None) :
- super(Group, self).__init__("group", [], params, decls)
+ def __init__ (self, *args, **kwargs) :
+ super(Group, self).__init__("group", [], *args, **kwargs)
class Host (Declaration) :
@@ -328,18 +324,18 @@
}
"""
- def __init__ (self, hostname, params=None, decls=None) :
- super(Host, self).__init__("host", [hostname], params, decls)
+ def __init__ (self, hostname, *args, **kwargs) :
+ super(Host, self).__init__("host", [hostname], *args, **kwargs)
class Option (Parameter) :
"""
A generic 'option' parameter for a dhcpd.conf file
"""
- def __init__ (self, name, *args) :
+ def __init__ (self, name, *args, **kwargs) :
"""
Formatted as a Satement with a name of "option <name>".
"""
- super(Option, self).__init__("option %s" % name, *args)
+ super(Option, self).__init__("option %s" % name, *args, **kwargs)