pyocf: extend OcfCompletion
1. add optional timeout and return value to wait() 2. add method to check whether completion was triggered Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
e2ea2b41e6
commit
81396681f4
@ -103,8 +103,11 @@ class OcfCompletion:
|
|||||||
|
|
||||||
return complete
|
return complete
|
||||||
|
|
||||||
def wait(self):
|
def wait(self, timeout=None):
|
||||||
self.e.wait()
|
return self.e.wait(timeout=timeout)
|
||||||
|
|
||||||
|
def completed(self):
|
||||||
|
return self.e.is_set()
|
||||||
|
|
||||||
|
|
||||||
class OcfError(BaseException):
|
class OcfError(BaseException):
|
||||||
|
Loading…
Reference in New Issue
Block a user