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
This commit is contained in:
parent
3ab7820405
commit
de9449aab1
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user