Outside-diff CodeRabbit finding on PR #87; the code is develop-owned (multi-server librenms_id introduced pre-stack), so tracking here for a develop fix.
File: netbox_librenms_plugin/import_utils/device_operations.py (VM branch ~L409-413, Device branch ~L452-456)
The librenms_id_needs_migration flag is only set for top-level legacy scalars (42 / "42"):
_vm_cf_id = existing_vm.custom_field_data.get("librenms_id")
if (isinstance(_vm_cf_id, int) and not isinstance(_vm_cf_id, bool)) or (isinstance(_vm_cf_id, str) and _vm_cf_id.isdigit()):
result["librenms_id_needs_migration"] = True
But _describe_existing_librenms_link() also treats the server-scoped form {server_key: 42} / {server_key: "42"} as a legacy link (it unwraps cf_value.get(server_key) and coerces a scalar entry to host_id). So such records match as legacy-linked rows yet librenms_id_needs_migration stays False, and the migration path is never offered for them.
Fix: unwrap the current server_key entry before the scalar test, in both the VM and Device branches, so server-scoped scalar storage is flagged consistently.
Outside-diff CodeRabbit finding on PR #87; the code is develop-owned (multi-server librenms_id introduced pre-stack), so tracking here for a develop fix.
File:
netbox_librenms_plugin/import_utils/device_operations.py(VM branch ~L409-413, Device branch ~L452-456)The
librenms_id_needs_migrationflag is only set for top-level legacy scalars (42/"42"):But
_describe_existing_librenms_link()also treats the server-scoped form{server_key: 42}/{server_key: "42"}as a legacy link (it unwrapscf_value.get(server_key)and coerces a scalar entry tohost_id). So such records match as legacy-linked rows yetlibrenms_id_needs_migrationstaysFalse, and the migration path is never offered for them.Fix: unwrap the current
server_keyentry before the scalar test, in both the VM and Device branches, so server-scoped scalar storage is flagged consistently.