Merge "Utils: fix usage of strtime"
This commit is contained in:
commit
a99a9ae69e
@ -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),
|
||||
})
|
||||
|
@ -26,7 +26,6 @@ from croniter import croniter
|
||||
from jsonschema import validators
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import strutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
@ -65,7 +64,6 @@ class Struct(dict):
|
||||
generate_uuid = uuidutils.generate_uuid
|
||||
is_uuid_like = uuidutils.is_uuid_like
|
||||
is_int_like = strutils.is_int_like
|
||||
strtime = timeutils.strtime
|
||||
|
||||
|
||||
def is_cron_like(value):
|
||||
|
@ -829,8 +829,10 @@ class TestDelete(api_base.FunctionalTest):
|
||||
self.context.show_deleted = True
|
||||
audit = objects.Audit.get_by_uuid(self.context, self.audit.uuid)
|
||||
|
||||
return_deleted_at = timeutils.strtime(audit['deleted_at'])
|
||||
self.assertEqual(timeutils.strtime(test_time), return_deleted_at)
|
||||
return_deleted_at = \
|
||||
audit['deleted_at'].strftime('%Y-%m-%dT%H:%M:%S.%f')
|
||||
self.assertEqual(test_time.strftime('%Y-%m-%dT%H:%M:%S.%f'),
|
||||
return_deleted_at)
|
||||
self.assertEqual(objects.audit.State.DELETED, audit['state'])
|
||||
|
||||
def test_delete_audit_not_found(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user