pyocf: register composite volume type id in ctx
@@ -14,7 +14,9 @@ from pyocf.types.volume import RamVolume, ErrorDevice
from pyocf.types.volume_cache import CacheVolume
from pyocf.types.volume_core import CoreVolume
from pyocf.types.volume_replicated import ReplicatedVolume
+from pyocf.types.cvolume import CVolume
from pyocf.types.ctx import OcfCtx
+from pyocf.helpers import get_composite_volume_type_id
default_registered_volumes = [RamVolume, ErrorDevice, CacheVolume, CoreVolume, ReplicatedVolume]
@@ -28,6 +30,7 @@ def pyocf_ctx():
c = OcfCtx.with_defaults(DefaultLogger(LogLevel.WARN))
for vol_type in default_registered_volumes:
c.register_volume_type(vol_type)
+ c.register_internal_volume_type_id(CVolume, get_composite_volume_type_id())
yield c
c.exit()
gc.collect()
@@ -39,6 +42,7 @@ def pyocf_ctx_log_buffer():
c = OcfCtx.with_defaults(logger)
for vol_type in default_registered_volumes:
c.register_volume_type(vol_type)
+ c.register_internal_volume_type_id(CVolume, get_composite_volume_type_id())
yield logger
c.exit()
gc.collect()
@@ -51,6 +55,8 @@ def pyocf_2_ctx():
for vol_type in default_registered_volumes:
c1.register_volume_type(vol_type)
c2.register_volume_type(vol_type)
+ c1.register_internal_volume_type_id(CVolume, get_composite_volume_type_id())
+ c2.register_internal_volume_type_id(CVolume, get_composite_volume_type_id())
yield [c1, c2]
c1.exit()
c2.exit()
