Commit 96168ee
Martin Belanger
fix: adapt to new libnvme Python API (Phase 2 + exception hierarchy)
Update nvme-stas to match the libnvme Python binding changes from
nvme-cli PR #3332 (redesign) and the subsequent exception hierarchy
refactor:
- nvme.global_ctx() → nvme.GlobalCtx()
- nvme.host() → nvme.Host()
- nvme.ctrl() → nvme.Ctrl()
- host.dhchap_key → host.dhchap_host_key
- ctrl.connected() → ctrl.connected (property, not method)
- ctrl.supported_log_pages → ctrl.get_supported_log_pages
(raises NvmeError on failure instead of returning None)
The try/except (TypeError, IndexError) guard around the
dlp_supp_opts extraction is removed: get_supported_log_pages()
always returns a fixed-size list of integers or raises, so neither
exception is structurally possible any more.
Update the TestDc.Ctrl stub in test-controller.py to expose
connected as a @Property instead of a method, matching the new API.
Signed-off-by: Martin Belanger <[email protected]>
Assisted-by: Claude:claude-sonnet-4-6 [Claude Code]1 parent 7c0a4c4 commit 96168ee
3 files changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
| 659 | + | |
663 | 660 | | |
664 | 661 | | |
665 | 662 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments