summaryrefslogtreecommitdiff
path: root/keystoneclient/utils.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-06-29 15:46:35 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-06-30 12:58:55 -0500
commit225832f5913e12f8c86c429193e6ed4531dcc101 (patch)
tree027684e2da81b065047a6a9c51238477d44203df /keystoneclient/utils.py
parent97c2c690d8983fd1d929a4eae3b0d62bbcb2cf6a (diff)
downloadpython-keystoneclient-225832f5913e12f8c86c429193e6ed4531dcc101.tar.gz
Switch from deprecated oslo_utils.timeutils.strtime
The oslo_utils.timeutils.strtime function is deprecated as of oslo_utils 1.7. DeprecationWarning: Using function/method 'oslo_utils.timeutils.strtime()' is deprecated in version '1.6' and will be removed in a future version: use either datetime.datetime.isoformat() or datetime.datetime.strftime() instead Closes-Bug: 1469867 Change-Id: I97897728703547414a621b6687989cff07e01b3e
Diffstat (limited to 'keystoneclient/utils.py')
-rw-r--r--keystoneclient/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py
index 3565565..5017431 100644
--- a/keystoneclient/utils.py
+++ b/keystoneclient/utils.py
@@ -366,3 +366,8 @@ def isotime(at=None, subsecond=False):
tz = at.tzinfo.tzname(None) if at.tzinfo else 'UTC'
st += ('Z' if tz == 'UTC' else tz)
return st
+
+
+def strtime(at=None):
+ at = at or timeutils.utcnow()
+ return at.strftime(timeutils.PERFECT_TIME_FORMAT)