Seagate / cortx-hare

CORTX Hare configures Motr object store, starts/stops Motr services, and notifies Motr of service and device faults.
https://github.com/Seagate/cortx
Apache License 2.0
13 stars 80 forks source link

CORTX-27881: Hare-HA: Implement outgoing HA message and reporting mechanism #2042

Closed SwapnilGaonkar7 closed 2 years ago

SwapnilGaonkar7 commented 2 years ago

Added EventProducer class which can be used to send events to message bus

Test: Tested by following code and events are generated in message bus, confirmed by running consumer

import inject
import time
from hax.ha.events import Event, EventListener, EventProducer
from hax.common import HaxGlobalState, di_configuration
inject.configure(di_configuration)

# import pdb; pdb.set_trace()
p = EventProducer()
p = EventProducer.get_instance()
event = p.create_node_event('node', 'machine-id', 'online', 'localhost')
p.publish(event)
time.sleep(4)
SwapnilGaonkar7 commented 2 years ago

@mssawant I have replied to your query. Please have a look.

SwapnilGaonkar7 commented 2 years ago

@mssawant I have addressed review comments, please have a look.

vaibhavparatwar commented 2 years ago

@Shreya-18 please review

vaibhavparatwar commented 2 years ago

@SwapnilGaonkar7 lets merge this PR and close the JIRA ticket.