diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2015-06-07 11:20:44 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2015-06-30 12:58:55 -0500 |
commit | 97c2c690d8983fd1d929a4eae3b0d62bbcb2cf6a (patch) | |
tree | 1d21dbde7b1e77c839c749e3a658d461332385d7 /keystoneclient/contrib | |
parent | aa9e413a6def86c58b19495ac6ac439e61d04a8b (diff) | |
download | python-keystoneclient-97c2c690d8983fd1d929a4eae3b0d62bbcb2cf6a.tar.gz |
Switch from deprecated isotime
oslo_utils.timeutils.isotime() is deprecated as of 1.6 so we need
to stop using it.
The deprecation message says to use datetime.datetime.isoformat()
instead, but the format of the string generated by isoformat isn't
the same as the format of the string generated by isotime. The string
is used in tokens and other public APIs and we can't change it
without potentially breaking clients.
So the workaround is to copy the current implementation from
oslo_utils.timeutils.isotime() to keystone.common.utils.isotime().
Change-Id: I34b12b96de3ea21beaf935ed8a9f6bae2fe0d0bc
Closes-Bug: 1461251
Diffstat (limited to 'keystoneclient/contrib')
-rw-r--r-- | keystoneclient/contrib/revoke/model.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/keystoneclient/contrib/revoke/model.py b/keystoneclient/contrib/revoke/model.py index bb62840..5c17680 100644 --- a/keystoneclient/contrib/revoke/model.py +++ b/keystoneclient/contrib/revoke/model.py @@ -12,6 +12,9 @@ from oslo_utils import timeutils +from keystoneclient import utils + + # The set of attributes common between the RevokeEvent # and the dictionaries created from the token Data. _NAMES = ['trust_id', @@ -75,11 +78,11 @@ class RevokeEvent(object): if self.consumer_id is not None: event['OS-OAUTH1:access_token_id'] = self.access_token_id if self.expires_at is not None: - event['expires_at'] = timeutils.isotime(self.expires_at, - subsecond=True) + event['expires_at'] = utils.isotime(self.expires_at, + subsecond=True) if self.issued_before is not None: - event['issued_before'] = timeutils.isotime(self.issued_before, - subsecond=True) + event['issued_before'] = utils.isotime(self.issued_before, + subsecond=True) return event def key_for_name(self, name): |