test-api: fix core pool init
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
parent
3606472e60
commit
1b52345732
@ -41,16 +41,21 @@ class Core(Device):
|
|||||||
|
|
||||||
def __get_core_info(self) -> dict | None:
|
def __get_core_info(self) -> dict | None:
|
||||||
core_dicts = get_cas_devices_dict()["cores"].values()
|
core_dicts = get_cas_devices_dict()["cores"].values()
|
||||||
return next(
|
# for core
|
||||||
iter(
|
core_device = [
|
||||||
[
|
|
||||||
core
|
core
|
||||||
for core in core_dicts
|
for core in core_dicts
|
||||||
if core["cache_id"] == self.cache_id
|
if core["cache_id"] == self.cache_id and core["device_path"] == self.core_device.path
|
||||||
and core["device_path"] == self.core_device.path
|
|
||||||
]
|
]
|
||||||
)
|
if core_device:
|
||||||
)
|
return core_device[0]
|
||||||
|
|
||||||
|
# for core pool
|
||||||
|
core_pool_dicts = get_cas_devices_dict()["core_pool"].values()
|
||||||
|
core_pool_device = [
|
||||||
|
core for core in core_pool_dicts if core["device_path"] == self.core_device.path
|
||||||
|
]
|
||||||
|
return core_pool_device[0]
|
||||||
|
|
||||||
def create_filesystem(self, fs_type: Filesystem, force=True, blocksize=None):
|
def create_filesystem(self, fs_type: Filesystem, force=True, blocksize=None):
|
||||||
super().create_filesystem(fs_type, force, blocksize)
|
super().create_filesystem(fs_type, force, blocksize)
|
||||||
|
Loading…
Reference in New Issue
Block a user