--- a/pvl/hosts/dhcp.py Sat Mar 07 13:41:18 2015 +0200
+++ b/pvl/hosts/dhcp.py Sat Mar 07 13:44:59 2015 +0200
@@ -42,11 +42,7 @@
subclass: name - generate a subclass name $ethernet for this host
"""
- if set(host.ethernet) == set([None]) :
- host_fmt = "{host.name}"
- elif host.ethernet :
- host_fmt = "{host.name}-{index}"
- else :
+ if not host.ethernet:
# nothing to be seen here
return
@@ -56,7 +52,11 @@
comment = None
for index, ethernet in host.ethernet.iteritems() :
- name = host_fmt.format(host=host, index=index)
+ if index:
+ name = '{host.name}-{index}'.format(host=host, index=index)
+ else:
+ name = '{host.name}'.format(host=host)
+
items = list(dhcp_host_options(host, ethernet))
yield pvl.dhcp.config.Block(('host', name), items, comment=comment)