test-api: fix core pool parse
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
parent
173810ad6d
commit
cc5d796978
@ -76,6 +76,7 @@ def get_cas_devices_dict() -> dict:
|
|||||||
for device in device_list:
|
for device in device_list:
|
||||||
if device["type"] == "cache":
|
if device["type"] == "cache":
|
||||||
cache_id = int(device["id"])
|
cache_id = int(device["id"])
|
||||||
|
core_pool = False
|
||||||
params = [
|
params = [
|
||||||
("id", cache_id),
|
("id", cache_id),
|
||||||
("device_path", device["disk"]),
|
("device_path", device["disk"]),
|
||||||
@ -91,7 +92,7 @@ def get_cas_devices_dict() -> dict:
|
|||||||
]
|
]
|
||||||
if core_pool:
|
if core_pool:
|
||||||
params.append(("core_pool", device))
|
params.append(("core_pool", device))
|
||||||
devices["core_pool"][(cache_id, int(device["id"]))] = dict(
|
devices["core_pool"][device["disk"]] = dict(
|
||||||
[(key, value) for key, value in params]
|
[(key, value) for key, value in params]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -99,6 +100,9 @@ def get_cas_devices_dict() -> dict:
|
|||||||
[(key, value) for key, value in params]
|
[(key, value) for key, value in params]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
elif device["type"] == "core pool":
|
||||||
|
core_pool = True
|
||||||
|
|
||||||
return devices
|
return devices
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user