Make Trove exists events notifs be emitted in current audit period

Following the guidelines in https://wiki.openstack.org/wiki/NotificationEventExamples,
we should make sure that the exists notifications are emitted
with a current audit period instead of the future audit period
we are currently using.

Change-Id: I4e19d47ec8827709dbd4b22569877ef2c7c9ea77
Closes-Bug: #1469860
This commit is contained in:
Victoria Martinez de la Cruz 2016-01-19 17:31:32 -03:00
parent ed9609f1f4
commit 4d5e887140
1 changed files with 3 additions and 3 deletions

View File

@ -188,11 +188,11 @@ class NotificationTransformer(object):
@staticmethod
def _get_audit_period():
now = datetime.datetime.now()
audit_start = utils.isotime(now, subsecond=True)
audit_end = utils.isotime(
now + datetime.timedelta(
audit_start = utils.isotime(
now - datetime.timedelta(
seconds=CONF.exists_notification_interval),
subsecond=True)
audit_end = utils.isotime(now, subsecond=True)
return audit_start, audit_end
def _get_service_id(self, datastore_manager, id_map):