def pyocf_ctx(): c = OcfCtx.with_defaults(DefaultLogger(LogLevel.WARN)) c.register_volume_type(RamVolume) c.register_volume_type(ErrorDevice) c.register_volume_type(CacheVolume) c.register_volume_type(CoreVolume) c.register_volume_type(ReplicatedVolume) yield c c.exit() gc.collect()
def pyocf_ctx_log_buffer(): logger = BufferLogger(LogLevel.DEBUG) c = OcfCtx.with_defaults(logger) c.register_volume_type(RamVolume) c.register_volume_type(ErrorDevice) c.register_volume_type(CacheVolume) c.register_volume_type(CoreVolume) c.register_volume_type(ReplicatedVolume) yield logger c.exit() gc.collect()