Add priority based queues to notifications.
Remove duplicate json encoding in notifier (rpc.cast does encoding... ) make no_op_notifier match rabbit one for signature on notify()
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
|
||||
import nova.context
|
||||
|
||||
@@ -28,10 +27,12 @@ flags.DEFINE_string('notification_topic', 'notifications',
|
||||
|
||||
class RabbitNotifier(object):
|
||||
"""Sends notifications to a specific RabbitMQ server and topic"""
|
||||
pass
|
||||
|
||||
def notify(self, payload):
|
||||
"""Sends a notification to the RabbitMQ"""
|
||||
context = nova.context.get_admin_context()
|
||||
topic = FLAGS.notification_topic
|
||||
priority = payload.get('priority',
|
||||
FLAGS.default_notification_level)
|
||||
priority = priority.lower()
|
||||
topic = '%s.%s' % (FLAGS.notification_topic, priority)
|
||||
rpc.cast(context, topic, payload)
|
||||
|
||||
Reference in New Issue
Block a user