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 = {