--- a/pvl/hosts/dhcp.py Mon Mar 02 13:30:15 2015 +0200
+++ b/pvl/hosts/dhcp.py Mon Mar 02 17:58:24 2015 +0200
@@ -15,24 +15,9 @@
if host.ip:
yield 'fixed-address', str(host.ip)
- if not host.boot:
- next_server = filename = None
- elif host.boot.startswith('/'):
- next_server = None
- filename = host.boot[1:]
- elif host.boot.endswith(':'):
- next_server = host.boot[:-1]
- filename = None
- elif ':' in host.boot :
- next_server, filename = host.boot.split(':', 1)
- else :
- raise HostError(host, "invalid boot={host.boot}".format(host=host))
-
- if next_server:
- yield 'next-server', next_server
-
- if filename:
- yield 'filename', filename
+ for bootopt in ('next-server', 'filename'):
+ if bootopt in host.boot:
+ yield bootopt, host.boot[bootopt]
def dhcp_host (host):
"""