Skip to content

Commit 74a626e

Browse files
authored
Refactor utcnow usage in dstool (#4021)
1 parent 86ec152 commit 74a626e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ydb/apps/dstool/lib/dstool_cmd_cluster_workload_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import random
44
import subprocess
55
import ydb.apps.dstool.lib.grouptool as grouptool
6-
from datetime import datetime, timedelta
6+
from datetime import datetime, timedelta, timezone
77
from collections import defaultdict
88
import sys
99

@@ -215,7 +215,7 @@ def do_kill_blob_depot():
215215

216216
################################################################################################################
217217

218-
now = datetime.utcnow()
218+
now = datetime.now(timezone.utc)
219219
while recent_restarts and recent_restarts[0] + timedelta(minutes=1) < now:
220220
recent_restarts.pop(0)
221221

@@ -283,7 +283,7 @@ def pick(v):
283283
################################################################################################################
284284

285285
action_name, action = random.choice(possible_actions)
286-
print('%s %s' % (action_name, datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S')))
286+
print('%s %s' % (action_name, datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')))
287287

288288
try:
289289
action[0](*action[1:])

0 commit comments

Comments
 (0)