now generates string datetimes as openstack would
This commit is contained in:
parent
6e01a84104
commit
978aafe4dd
@ -1,16 +1,19 @@
|
||||
import datetime
|
||||
|
||||
from notabene import kombu_driver as driver
|
||||
import notigen
|
||||
|
||||
"""Pump simulated OpenStack notificationss into RabbitMQ.
|
||||
|
||||
You need to install rabbitqm-server and
|
||||
pip install librabbitmq
|
||||
pip install notabene
|
||||
pip install --pre notabene
|
||||
pip install --pre notification_utils
|
||||
"""
|
||||
|
||||
|
||||
import datetime
|
||||
|
||||
from notabene import kombu_driver as driver
|
||||
import notification_utils
|
||||
import notigen
|
||||
|
||||
|
||||
connection = driver.create_connection("localhost", 5672, 'guest', 'guest',
|
||||
"librabbitmq", "/")
|
||||
exchange = driver.create_exchange("monitor", "topic")
|
||||
|
@ -269,13 +269,13 @@ class EventGenerator(object):
|
||||
results = []
|
||||
if event[-1] == '*':
|
||||
event = event[0:-1]
|
||||
extra = {'when': now, 'node': node}
|
||||
extra = {'when': str(now), 'node': node}
|
||||
results.append(self._pkg(base, extra, {'event': event + "start"}))
|
||||
now = self._bump_time(now, 0.25, 60.0 * 15.0) # In compute node
|
||||
extra = {'when': now, 'node': node}
|
||||
extra = {'when': str(now), 'node': node}
|
||||
results.append(self._pkg(base, extra, {'event': event + "end"}))
|
||||
else:
|
||||
extra = {'when': now, 'node': node}
|
||||
extra = {'when': str(now), 'node': node}
|
||||
results.append(self._pkg(base, extra, {'event': event}))
|
||||
return results
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user