fix(ci): resolve all lint and test failures
- Go: nil-safe profile cache in SNMPCollector, updated test assertion - ESLint: fix conditional useQuery hook in SNMPMetricsSection - ESLint: remove unused CREDENTIAL_TYPE_LABELS, ChevronDown/Right, EmptyState import, advancedOpen state - TypeScript: replace empty interface with type alias Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,12 +68,14 @@ func (c *SNMPCollector) Collect(ctx context.Context, dev store.Device, pub *bus.
|
||||
profileID := ""
|
||||
if dev.SNMPProfileID != nil {
|
||||
profileID = *dev.SNMPProfileID
|
||||
} else {
|
||||
} else if c.profiles != nil {
|
||||
profileID = c.profiles.GetGenericID()
|
||||
if profileID == "" {
|
||||
return fmt.Errorf("device %s: no SNMP profile assigned and no generic-snmp fallback found", dev.ID)
|
||||
}
|
||||
slog.Debug("using generic-snmp fallback profile", "device_id", dev.ID)
|
||||
} else {
|
||||
return fmt.Errorf("device %s: no SNMP profile assigned and profile cache not available", dev.ID)
|
||||
}
|
||||
profile := c.profiles.Get(profileID)
|
||||
if profile == nil {
|
||||
|
||||
Reference in New Issue
Block a user