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():
|
for identifier, interface in rnode.metadata.get('interfaces', {}).items():
|
||||||
if interface.get('dhcp', False):
|
if interface.get('dhcp', False):
|
||||||
|
try:
|
||||||
allocations[rnode.name] = {
|
allocations[rnode.name] = {
|
||||||
'ipv4': sorted(interface['ips'])[0],
|
'ipv4': sorted(interface['ips'])[0],
|
||||||
'mac': interface['mac'],
|
'mac': interface['mac'],
|
||||||
}
|
}
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'dhcpd': {
|
'dhcpd': {
|
||||||
|
|
Loading…
Reference in a new issue