Remove deprecated datetime.utcnow()

Python 3.12 deprecates the use of datetime.utcnow()[1].

This patch moves diskimage-builder to use datetime.now(datetime.timezone.utc).

[1] https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow

Change-Id: I7b2430248e1709e7fb7631bd7dd2e828a3a5d7d5
This commit is contained in:
Michael Johnson
2025-04-01 00:54:14 +00:00
parent bbfdfcecfc
commit 20031dd5f0

View File

@@ -62,7 +62,7 @@ def main():
if skip_line(line):
continue
now = datetime.datetime.utcnow()
now = datetime.datetime.now(datetime.timezone.utc)
ts_line = ("%s | %s" % (
now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3],
line))