From c79d93bfbc8a79617a6d3ef4e36fb5de55217d02 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Tue, 5 Jun 2012 09:11:44 +0800 Subject: Keystone should use openstack.common.timeutils Implements blueprint use-common-timeutils 1. Edit openstack-common.conf and import keystone/openstack/common/timeutils.py 2. Replace datetime.utcnow with timeutils.utcnow 3. Replace utils.isotime with timeutils.isotime 4. Remove utils.isotime in common/utils.py and datetime related unittest Change-Id: I4f5a63a368fde8787a0dc0a817c940de685b9ca2 --- keystone/common/utils.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'keystone/common') diff --git a/keystone/common/utils.py b/keystone/common/utils.py index 7f665a59..19749764 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -39,7 +39,6 @@ config.register_int('crypt_strength', default=40000) LOG = logging.getLogger(__name__) -ISO_TIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ' MAX_PASSWORD_LENGTH = 4096 @@ -232,16 +231,6 @@ def git(*args): return check_output(['git'] + list(args)) -def isotime(dt_obj): - """Format datetime object as ISO compliant string. - - :param dt_obj: datetime.datetime object - :returns: string representation of datetime object - - """ - return dt_obj.strftime(ISO_TIME_FORMAT) - - def unixtime(dt_obj): """Format datetime object as unix timestamp -- cgit