Commit 07394e4
authored
Improve NetBox sync lock error handling to prevent blocking (#1852)
This change improves error handling when NetBox sync operations fail to
acquire locks. Previously, lock acquisition timeouts would block the entire
sync and continue without proper tracking. Now:
1. NetBox functions (set_maintenance, set_provision_state, set_power_state)
return True/False based on lock acquisition success
2. sync_netbox_from_ironic tracks failed devices and reports them at the end
3. Sync continues with remaining devices when individual devices fail
4. Failed devices are reported with a clear warning message
This prevents silent failures and provides better visibility into which
devices failed to sync due to lock timeouts, while allowing the sync
operation to continue for other devices.
AI-assisted: Claude Code
Signed-off-by: Christian Berendt <[email protected]>1 parent 884f29a commit 07394e4
2 files changed
+39
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
608 | 609 | | |
609 | 610 | | |
610 | 611 | | |
| |||
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
619 | 623 | | |
620 | 624 | | |
621 | 625 | | |
622 | | - | |
| 626 | + | |
623 | 627 | | |
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
627 | | - | |
628 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
629 | 635 | | |
630 | 636 | | |
631 | 637 | | |
632 | 638 | | |
633 | | - | |
634 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
635 | 643 | | |
636 | 644 | | |
637 | 645 | | |
638 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
639 | 658 | | |
640 | 659 | | |
641 | 660 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
| 186 | + | |
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
| |||
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
| |||
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
| 256 | + | |
248 | 257 | | |
249 | 258 | | |
| 259 | + | |
250 | 260 | | |
251 | 261 | | |
252 | 262 | | |
| |||
263 | 273 | | |
264 | 274 | | |
265 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
266 | 279 | | |
267 | 280 | | |
268 | 281 | | |
| |||
317 | 330 | | |
318 | 331 | | |
319 | 332 | | |
| 333 | + | |
320 | 334 | | |
321 | 335 | | |
| 336 | + | |
322 | 337 | | |
323 | 338 | | |
324 | 339 | | |
| |||
0 commit comments