bundles/dhcpd: catch keyerrors for nodes which do dhcp in unmanaged networks
This commit is contained in:
parent
2d42e5f7dd
commit
fb42f9e667
1 changed files with 7 additions and 4 deletions
|
@ -18,10 +18,13 @@ def get_static_allocations(metadata):
|
|||
|
||||
for identifier, interface in rnode.metadata.get('interfaces', {}).items():
|
||||
if interface.get('dhcp', False):
|
||||
allocations[rnode.name] = {
|
||||
'ipv4': sorted(interface['ips'])[0],
|
||||
'mac': interface['mac'],
|
||||
}
|
||||
try:
|
||||
allocations[rnode.name] = {
|
||||
'ipv4': sorted(interface['ips'])[0],
|
||||
'mac': interface['mac'],
|
||||
}
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
return {
|
||||
'dhcpd': {
|
||||
|
|
Loading…
Reference in a new issue