improve parser by skipping all lines containing a '{' or a '}'. fix unecessary []byte cast (linter issue).
This commit is contained in:
parent
7201ce9248
commit
f0612e4688
|
@ -462,7 +462,7 @@ func (d *VmwareDriver) PotentialGuestIP(state multistep.StateBag) ([]string, err
|
||||||
available_lease_entries := make([]appleDhcpLeaseEntry, 0)
|
available_lease_entries := make([]appleDhcpLeaseEntry, 0)
|
||||||
for _, entry := range leaseEntries {
|
for _, entry := range leaseEntries {
|
||||||
// Next check for any where the hardware address matches.
|
// Next check for any where the hardware address matches.
|
||||||
if bytes.Equal(hwaddr, []byte(entry.hwAddress)) {
|
if bytes.Equal(hwaddr, entry.hwAddress) {
|
||||||
available_lease_entries = append(available_lease_entries, entry)
|
available_lease_entries = append(available_lease_entries, entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2462,7 +2462,7 @@ func readAppleDhcpdLeaseEntry(in chan byte) (entry *appleDhcpLeaseEntry, err err
|
||||||
if !ok {
|
if !ok {
|
||||||
insideBraces = false
|
insideBraces = false
|
||||||
}
|
}
|
||||||
if item_s == "{" || item_s == "}" {
|
if strings.Contains(item_s, "{") || strings.Contains(item_s, "}") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
splittedLine := strings.Split(item_s, "=")
|
splittedLine := strings.Split(item_s, "=")
|
||||||
|
|
Loading…
Reference in New Issue