X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fcommon.git;a=blobdiff_plain;f=osm_common%2Fmsglocal.py;fp=osm_common%2Fmsglocal.py;h=bfa30b77ca5d77bb248b76f42d3eeb0a4a9e0709;hp=c774f8568228a90f83da0ad64fe020697b11df43;hb=3054f783ac759b221233fd0a82424aa105e4ea2e;hpb=5c012612f1292b012dc12b337c611c6f3c083b18 diff --git a/osm_common/msglocal.py b/osm_common/msglocal.py index c774f85..bfa30b7 100644 --- a/osm_common/msglocal.py +++ b/osm_common/msglocal.py @@ -2,18 +2,19 @@ import logging import os import yaml import asyncio -from msgbase import MsgBase, MsgException +from osm_common.msgbase import MsgBase, MsgException from time import sleep __author__ = "Alfonso Tierno " """ This emulated kafka bus by just using a shared file system. Useful for testing or devops. -One file is used per topic. Only one producer and one consumer is allowed per topic. Both consumer and producer +One file is used per topic. Only one producer and one consumer is allowed per topic. Both consumer and producer access to the same file. e.g. same volume if running with docker. One text line per message is used in yaml format. """ + class MsgLocal(MsgBase): def __init__(self, logger_name='msg'): @@ -41,7 +42,7 @@ class MsgLocal(MsgBase): for f in self.files.values(): try: f.close() - except Exception as e: # TODO refine + except Exception: # TODO refine pass def write(self, topic, key, msg): @@ -108,4 +109,3 @@ class MsgLocal(MsgBase): raise except Exception as e: # TODO refine raise MsgException(str(e)) -