Commit 5c0f98dd authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Move error reporting on ethernet case to util. Make splitting work on any...

Move error reporting on ethernet case to util. Make splitting work on any separator not in the expected set of ethernet address characters
parent 872d25e9
......@@ -267,8 +267,6 @@ def emit_hosts(tree, options, networks, pxeboot=False):
for ethernet in util.ethernets(ip.ethernet[0:]):
if pxeboot == 'only' and not bool(ip._pxeboot_):
continue
if ethernet.lower() != ethernet:
raise util.HostinfoException('%s not lower-case' % ethernet)
if ip.never[0]:
if match(util.address(ip.never[0])):
if not ethernet in never:
......
......@@ -174,8 +174,6 @@ def emit_hosts(tree, options, networks):
for ip in tree._host_._interface_._ipv6_:
# Find all hosts that associated with this network
for ethernet in util.ethernets(ip.ethernet[0:]):
if ethernet.lower() != ethernet:
raise util.HostinfoException('%s not lower-case' % ethernet)
if ip.never[0]:
if match(util.address(ip.never[0])):
if not ethernet in never:
......
......@@ -2,6 +2,7 @@ import ipaddr
import itertools
import types
import hostinfo.parser
import re
def network(s):
if s.network[0] and s.netmask[0]:
......@@ -32,7 +33,9 @@ def subnet(tree, addr):
def ethernets(ether):
if ether == None:
return []
return ether.split(',')
if ether.lower() != ether:
raise HostinfoException('%s not lower-case' % ether)
return re.split('[^:0-9a-fA-F]+', ether)
def aton(addr):
result = long(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment