Skip to content

Commit 305b209

Browse files
Martin Belangerigaw
authored andcommitted
python: Don't exit immediately on discovery fail.
In the example, when ctrl.discover() fails, we should not invoke sys.exit() immediately, but instead allow the ctrl.disconnect() to be invoked. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
1 parent c2a6993 commit 305b209

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/discover-loop.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ def disc_supp_str(dlp_supp_opts):
4646
lsp = nvme.NVMF_LOG_DISC_LSP_PLEO if dlp_supp_opts & nvme.NVMF_LOG_DISC_LID_PLEOS else 0
4747
disc_log = ctrl.discover(lsp=lsp)
4848
except Exception as e:
49-
sys.exit(f'Failed to discover: {e}')
49+
print(f'Failed to discover: {e}')
5050
disc_log = []
51-
pass
5251

5352
for dlpe in disc_log:
5453
print(f'log entry {dlpe["portid"]}: {dlpe["subtype"]} {dlpe["subnqn"]}')

0 commit comments

Comments
 (0)