Utils: fix usage of strtime

As oslo_utils.timeutils.strtime() is deprecated in
version '1.6', and will be removed in a future version.

For more informations:
https://docs.openstack.org/oslo.utils/latest/reference/timeutils.html

Change-Id: I1aca257fbe8b08c3478c5da9639835033b19144a
Partial-Bug: #1715325
This commit is contained in:
chenghuiyu
2017-09-07 11:36:23 +08:00
parent e74095da1f
commit 3a7fc7a8e5
3 changed files with 5 additions and 7 deletions

View File

@@ -15,8 +15,6 @@ from oslo_log import log as logging
from oslo_utils import timeutils
import six
from watcher.common import utils
LOG = logging.getLogger(__name__)
@@ -102,7 +100,7 @@ class RequestContext(context.RequestContext):
'domain_name': getattr(self, 'domain_name', None),
'auth_token_info': getattr(self, 'auth_token_info', None),
'is_admin': getattr(self, 'is_admin', None),
'timestamp': utils.strtime(self.timestamp) if hasattr(
'timestamp': self.timestamp.isoformat() if hasattr(
self, 'timestamp') else None,
'request_id': getattr(self, 'request_id', None),
})