Commit 3dd110eb authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Send ok messages when initializing clients

parent 19b7bce6
......@@ -553,7 +553,9 @@ class LocalfsFileClient(FileClient):
def check_enabled(self):
if not self.settings.localfs_is_enabled():
msg = messaging.LocalfsSyncDisabled(logger=logger)
self.settings.messager.put(msg)
else:
msg = messaging.LocalfsSyncEnabled(logger=logger)
self.settings.messager.put(msg)
def remove_candidates(self, objnames, ident):
with self.probe_candidates.lock() as d:
......
......@@ -179,3 +179,15 @@ class PithosSyncDisabled(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.logger.warning("Pithos sync is disabled")
class LocalfsSyncEnabled(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.logger.info("Localfs sync is enabled")
class PithosSyncEnabled(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.logger.info("Pithos sync is enabled")
......@@ -288,7 +288,9 @@ class PithosFileClient(FileClient):
def check_enabled(self):
if not self.settings.pithos_is_enabled():
msg = messaging.PithosSyncDisabled(logger=logger)
self.settings.messager.put(msg)
else:
msg = messaging.PithosSyncEnabled(logger=logger)
self.settings.messager.put(msg)
def remove_candidates(self, objnames, ident):
with self.probe_candidates.lock() as d:
......
......@@ -104,6 +104,10 @@ class AgkyraTest(unittest.TestCase):
cls.pithos = cls.master.endpoint
cls.pithos.create_container(cls.ID)
cls.db = cls.s.get_db()
m = cls.s.get_next_message(block=True)
assert isinstance(m, messaging.PithosSyncEnabled)
m = cls.s.get_next_message(block=True)
assert isinstance(m, messaging.LocalfsSyncEnabled)
def assert_message(self, mtype):
m = self.s.get_next_message(block=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment