]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/dashboard: Fix timestamps in APIs
authorAfreen Misbah <afreen@ibm.com>
Tue, 21 Oct 2025 18:20:19 +0000 (23:50 +0530)
committerAfreen Misbah <afreen@ibm.com>
Wed, 22 Oct 2025 15:01:26 +0000 (20:31 +0530)
commit80af40d4e530df776b748b11c59365ab5e1ebc25
treea8d2c01439bf93702c070623a0c2d861a1efd4eb
parentaec84ca9e01f8147a63b9a2f9de8473539b869ef
mgr/dashboard: Fix timestamps in APIs

Resolves: rhbz#2403686

- remove 'Z' from rbd APIs which are returning now `aware` timestamp
- `datetime.utcfromtimestamp` is deprectated so using  `datetime.fromtimestamp(timestamp, tz=tz=timezone.utc)` thereby returning only `aware` timestamp and removing 'Z'.
- similarly `datetime.utcnow()` is deprecated , migrated to `datetime.now(timezone.utc)`

https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow
https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp

Signed-off-by: Afreen Misbah <afreen@ibm.com>
(cherry picked from commit 9b606ad89683c2f196603fc094eb8d4ae96bb5f2)
(cherry picked from commit d6282398de584baa74b7a57e832163f4c8b95521)
src/pybind/mgr/dashboard/controllers/rbd.py
src/pybind/mgr/dashboard/services/progress.py
src/pybind/mgr/dashboard/services/rbd.py
src/pybind/mgr/dashboard/tests/test_rbd_service.py
src/pybind/mgr/dashboard/tools.py