You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated it this way by managing the shared networks with id only.
diff --git a/kea_exporter/kea.py b/kea_exporter/kea.py
index 6821585..bad8fbc 100644
--- a/kea_exporter/kea.py
+++ b/kea_exporter/kea.py
@@ -58,10 +58,22 @@ class KeaSocket:
if 'Dhcp4' in self.config:
self.dhcp_version = DHCPVersion.DHCP4
- subnets = self.config['Dhcp4']['subnet4']
+ subnets = []
+ if "shared-networks" in self.config['Dhcp4']:
+ for j in range(len(self.config['Dhcp4']["shared-networks"])):
+ for k in range(len(self.config['Dhcp4']["shared-networks"][j]['subnet4'])):
+ subnets.append(self.config['Dhcp4']["shared-networks"][j]['subnet4'][k])
+ if len(self.config['Dhcp4']["subnet4"])>0:
+ subnets.append(self.config['Dhcp4']['subnet4'])
elif 'Dhcp6' in self.config:
self.dhcp_version = DHCPVersion.DHCP6
- subnets = self.config['Dhcp6']['subnet6']
+ subnets = []
+ if "shared-networks" in self.config['Dhcp6']:
+ for j in range(len(self.config['Dhcp6']["shared-networks"])):
+ for k in range(len(self.config['Dhcp6']["shared-networks"][j]['subnet6'])):
+ subnets.append(self.config['Dhcp6']["shared-networks"][j]['subnet6'][k])
+ if len(self.config['Dhcp6']["subnet6"])>0:
+ subnets.append(self.config['Dhcp6']['subnet6'])
else:
click.echo(f'Socket {self.sock_path} has no supported configuration', file=sys.stderr)
sys.exit(1)
str4nd
pushed a commit
to str4nd/kea-exporter
that referenced
this issue
Jun 13, 2023
Found a patch on a downstream fork, let's check if it satisfies our understanding of shared networks and integrate it.
via masem@ab7475a
The text was updated successfully, but these errors were encountered: