More unit tests and rabbit hooks
This commit is contained in:
@@ -13,12 +13,25 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
|
||||
import nova.context
|
||||
|
||||
from nova import flags
|
||||
from nova import rpc
|
||||
|
||||
FLAGS = flags.FLAGS
|
||||
|
||||
flags.DEFINE_string('notification_topic', 'notifications',
|
||||
'RabbitMQ topic used for Nova notifications')
|
||||
|
||||
class RabbitNotifier(object):
|
||||
"""Sends notifications to a specific RabbitMQ server and topic"""
|
||||
pass
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def notify(self, model):
|
||||
def notify(self, event_name, model):
|
||||
"""Sends a notification to the RabbitMQ"""
|
||||
pass
|
||||
context = nova.context.get_admin_context()
|
||||
topic = FLAGS.notification_topic
|
||||
msg = { 'event_name': event_name, 'model': model.__dict__ }
|
||||
rpc.cast(context, topic, json.dumps(msg))
|
||||
|
||||
Reference in New Issue
Block a user