6Uses Option Contoller to find index
11import isystem.connect
as ic
14def test_getDeviceIndex():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18 optCtrl = ic.COptionController(connMgr, ic.CStorageDeviceFactory.DEVICES_OPT_URL)
20 index = optCtrl.index_of(
"Name", devName)
21 print(f
"Device with name {devName} index: {index}")
23 index = optCtrl.index_of(
"Name",
'unknown device')
24 print(f
"Device with name 'unknown device', does not exist, exception not raised: {index}")
27if __name__ ==
"__main__":