From cfd8eea0c05da92340c43b9dc37538cfc7735357 Mon Sep 17 00:00:00 2001 From: Jan Musial Date: Mon, 13 Jun 2022 12:12:27 +0200 Subject: [PATCH] pyocf: fix cache device references Signed-off-by: Jan Musial --- tests/functional/pyocf/types/cache.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/functional/pyocf/types/cache.py b/tests/functional/pyocf/types/cache.py index 1f32d3d..435aba2 100644 --- a/tests/functional/pyocf/types/cache.py +++ b/tests/functional/pyocf/types/cache.py @@ -304,6 +304,7 @@ class Cache: raise OcfError("Failed to detach failover cache device", c.results["error"]) def standby_activate(self, device, open_cores=True): + self.device = device device_cfg = self.alloc_device_config(device) activate_cfg = CacheStandbyActivateConfig( @@ -322,6 +323,7 @@ class Cache: self.free_device_config(device_cfg) if c.results["error"]: + self.device = None raise OcfError("Failed to activate standby cache", c.results["error"]) def change_cache_mode(self, cache_mode: CacheMode): @@ -661,6 +663,7 @@ class Cache: self.free_device_config(device_config) if c.results["error"]: + self.device = None raise OcfError("Loading standby cache device failed", c.results["error"]) def detach_device(self): @@ -701,6 +704,7 @@ class Cache: self.free_device_config(device_config) if c.results["error"]: + self.device = None raise OcfError("Loading cache device failed", c.results["error"]) @classmethod