Commit 792c432
fix: resolve manufacturer empty string by fetching device-types for manufacturer lookup
In Nautobot 3.x, the brief nested device_type object inside device list
responses does not include a manufacturer sub-object. This caused
mfr_name to always be empty because dt.get("manufacturer") returned None.
Add _build_device_type_manufacturer_map() which pre-fetches all device
types once and returns a {device_type_id: manufacturer_name} map.
get_location_detail() now uses this map as a third-tier fallback:
1. _nested_str(mfr_obj, ...) - direct extraction if mfr is in device_type
2. mfr_map.get(mfr_id) - lookup by manufacturer UUID
3. dt_mfr_map.get(dt_id) - lookup via device type UUID (new, Nautobot 3.x)
All 61 existing tests still pass.
Co-authored-by: Jackass4life <94110786+Jackass4life@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Jackass4life/Nautobot-maps/sessions/8e4cb0a6-fe51-4b98-b12d-dc0ebc01a7c11 parent 753080f commit 792c432
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
84 | 109 | | |
85 | 110 | | |
86 | 111 | | |
| |||
213 | 238 | | |
214 | 239 | | |
215 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
216 | 245 | | |
217 | 246 | | |
218 | 247 | | |
219 | 248 | | |
220 | 249 | | |
221 | 250 | | |
222 | 251 | | |
| 252 | + | |
223 | 253 | | |
224 | 254 | | |
225 | 255 | | |
226 | 256 | | |
227 | 257 | | |
| 258 | + | |
228 | 259 | | |
229 | 260 | | |
230 | 261 | | |
| |||
0 commit comments