pyocf: Load standby from device
Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
parent
d87bdc3a43
commit
83a28825d2
@ -703,6 +703,22 @@ class Cache:
|
|||||||
if c.results["error"]:
|
if c.results["error"]:
|
||||||
raise OcfError("Loading cache device failed", c.results["error"])
|
raise OcfError("Loading cache device failed", c.results["error"])
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def load_standby_from_device(cls, device, owner=None, name="cache", cache_line_size=None):
|
||||||
|
if owner is None:
|
||||||
|
owner = OcfCtx.get_default()
|
||||||
|
|
||||||
|
c = cls(name=name, owner=owner, cache_line_size=cache_line_size)
|
||||||
|
|
||||||
|
c.start_cache()
|
||||||
|
try:
|
||||||
|
c.standby_load(device)
|
||||||
|
except: # noqa E722
|
||||||
|
c.stop()
|
||||||
|
raise
|
||||||
|
|
||||||
|
return c
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_from_device(
|
def load_from_device(
|
||||||
cls, device, owner=None, name="cache", open_cores=True, disable_cleaner=False
|
cls, device, owner=None, name="cache", open_cores=True, disable_cleaner=False
|
||||||
|
Loading…
Reference in New Issue
Block a user