Skip to content

Commit 8ad9351

Browse files
committed
storage: fix deprecated UTC naive syntax
1 parent be663a0 commit 8ad9351

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

qubes/storage/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
import os.path
2929
import string
3030
import subprocess
31-
import time
32-
from datetime import datetime
31+
from datetime import datetime, timezone
3332

3433
import asyncio
3534
from typing import Dict, Tuple, Union
@@ -1013,7 +1012,9 @@ def driver_parameters(name):
10131012

10141013
def isodate(seconds):
10151014
''' Helper method which returns an iso date '''
1016-
return datetime.utcfromtimestamp(seconds).isoformat("T")
1015+
return datetime.fromtimestamp(
1016+
seconds, tz=timezone.utc
1017+
).isoformat().replace("+00:00", "")
10171018

10181019
def search_pool_containing_dir(pools, dir_path):
10191020
''' Helper function looking for a pool containing given directory.

0 commit comments

Comments
 (0)