Change datetime.now() to timeutils.utcnow() from oslo_utils

We use an UTC time to avoid the difference with time zones.

Change-Id: I15aa3b5d3337b90ccdcc6c4ac5d3c7d78108fe21
Related-Bug: #1288979
This commit is contained in:
Yuriy Nesenenko
2015-02-27 16:06:03 +02:00
parent 171c22f761
commit 931c34d38b
18 changed files with 58 additions and 33 deletions

View File

@@ -3571,7 +3571,7 @@ def purge_deleted_rows(context, age_in_days):
LOG.info(_LI('Purging deleted rows older than age=%(age)d days '
'from table=%(table)s'), {'age': age_in_days,
'table': table})
deleted_age = dt.datetime.now() - dt.timedelta(days=age_in_days)
deleted_age = timeutils.utcnow() - dt.timedelta(days=age_in_days)
try:
with session.begin():
result = session.execute(