internal/clientinfo: add kea-dhcp4 to readLeaseFile

While at it, also removing duplicated characters in cutset of
strings.Trim function.
This commit is contained in:
Cuong Manh Le
2024-01-22 23:51:52 +07:00
committed by Cuong Manh Le
parent e42554f892
commit 6d3c86c0be
2 changed files with 3 additions and 1 deletions

View File

@@ -188,6 +188,8 @@ func (d *dhcp) readLeaseFile(name string, format ctrld.LeaseFileFormat) error {
return d.dnsmasqReadClientInfoFile(name)
case ctrld.IscDhcpd:
return d.iscDHCPReadClientInfoFile(name)
case ctrld.KeaDHCP4:
return d.keaDhcp4ReadClientInfoFile(name)
}
return fmt.Errorf("unsupported format: %s, file: %s", format, name)
}

View File

@@ -167,7 +167,7 @@ func parseHostEntriesConfFromReader(r io.Reader) map[string][]string {
after = strings.TrimSpace(after)
fields := strings.Fields(after)
if len(fields) > 1 {
localZone = strings.Trim(fields[0], `""`)
localZone = strings.Trim(fields[0], `"`)
}
continue
}