File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,22 @@ def reload(self):
58
58
59
59
if 'Dhcp4' in self .config :
60
60
self .dhcp_version = DHCPVersion .DHCP4
61
- subnets = self .config ['Dhcp4' ]['subnet4' ]
61
+ subnet_type = 'subnet4'
62
+ subnets = self .config ['Dhcp4' ]['subnet4' ] if 'subnet4' in self .config ['Dhcp4' ] else None
63
+ shared_networks = self .config ['Dhcp4' ]['shared-networks' ] if 'shared-networks' in self .config ['Dhcp4' ] else None
62
64
elif 'Dhcp6' in self .config :
63
65
self .dhcp_version = DHCPVersion .DHCP6
64
- subnets = self .config ['Dhcp6' ]['subnet6' ]
66
+ subnet_type = 'subnet6'
67
+ subnets = self .config ['Dhcp6' ]['subnet6' ] if 'subnet6' in self .config ['Dhcp6' ] else None
68
+ shared_networks = self .config ['Dhcp6' ]['shared-networks' ] if 'shared-networks' in self .config ['Dhcp6' ] else None
65
69
else :
66
70
click .echo (f'Socket { self .sock_path } has no supported configuration' , file = sys .stderr )
67
71
sys .exit (1 )
68
72
69
73
# create subnet map
70
- self .subnets = {subnet ['id' ]: subnet for subnet in subnets }
74
+ self .subnets = {}
75
+ self .subnets |= {subnet ['id' ]: subnet for subnet in subnets } if subnets != None else {}
76
+ self .subnets |= {subnet ['id' ]: subnet for shared_network in shared_networks for subnet in shared_network [subnet_type ]} if shared_networks != None else {}
71
77
72
78
73
79
class KeaExporter :
You can’t perform that action at this time.
0 commit comments