From 6c9f558b624f713093b1e868ab48051de2d04cb6 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 6 Jun 2022 18:44:22 +0200 Subject: [PATCH] pyocf: manage volume.opened in s_open Signed-off-by: Adam Rutkowski --- tests/functional/pyocf/types/volume.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/functional/pyocf/types/volume.py b/tests/functional/pyocf/types/volume.py index 30eb174..d82ed1c 100644 --- a/tests/functional/pyocf/types/volume.py +++ b/tests/functional/pyocf/types/volume.py @@ -187,7 +187,11 @@ class Volume: Volume._instances_[ref] = volume volume.handle = ref - return volume.do_open() + ret = volume.do_open() + if ret == 0: + volume.opened = True + + return ret @classmethod def get_io_ops(cls): @@ -255,7 +259,6 @@ class Volume: self.opened = False def do_open(self): - self.opened = True return 0 def close(self):