From de9449aab1f5dc191d7cf1c0d18a530e670e87f9 Mon Sep 17 00:00:00 2001 From: Javeme Date: Thu, 17 Dec 2015 16:23:40 +0800 Subject: [PATCH] replace deprecated iso8601_from_timestamp use datetime.utcfromtimestamp() and datetime.isoformat() instead of the deprecated oslo.timeutils.iso8601_from_timestamp(). ref: https://github.com/openstack/oslo.utils/blob/master/oslo_utils/timeutils.py#L192 Change-Id: Ife656079e332789235829ab138e8df057d91172f --- openstack_dashboard/api/swift.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openstack_dashboard/api/swift.py b/openstack_dashboard/api/swift.py index fac4e581b8..118546b9da 100644 --- a/openstack_dashboard/api/swift.py +++ b/openstack_dashboard/api/swift.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_utils import timeutils +from datetime import datetime import six.moves.urllib.parse as urlparse import swiftclient @@ -164,7 +164,7 @@ def swift_get_container(request, container_name, with_data=True): parameters = urlparse.quote(container_name.encode('utf8')) public_url = swift_endpoint + '/' + parameters ts_float = float(headers.get('x-timestamp')) - timestamp = timeutils.iso8601_from_timestamp(ts_float) + timestamp = datetime.utcfromtimestamp(ts_float).isoformat() except Exception: pass container_info = { @@ -342,7 +342,7 @@ def swift_get_object(request, container_name, object_name, with_data=True, timestamp = None try: ts_float = float(headers.get('x-timestamp')) - timestamp = timeutils.iso8601_from_timestamp(ts_float) + timestamp = datetime.utcfromtimestamp(ts_float).isoformat() except Exception: pass obj_info = {