Page MenuHomeVyOS Platform

Replace deprecated datetime.utcnow()/utcfromtimestamp() calls
Open, NormalPublic

Description

datetime.utcnow() and datetime.utcfromtimestamp() are deprecated since Python 3.12 and emit a DeprecationWarning on every call. They are used in certificate generation (vyos.pki), the ACME renewal-due check (conf_mode/pki.py) and the scheduled reboot/poweroff display (op_mode/powerctrl.py).

Replace them with timezone-aware equivalents without changing results; compare the certificate expiry as an explicit UTC datetime so it works with both old and new python3-cryptography.

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)