]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: Fix timestamps in APIs 66008/head
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 08:47:22 +0000 (14:17 +0530)
commit9b606ad89683c2f196603fc094eb8d4ae96bb5f2
tree1ff803903b51bc27ea3380d8fb4c7a7b23600c7e
parent1b27ffee1cdd006e79c466f39c7f469a3629943c
mgr/dashboard: Fix timestamps in APIs

- 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>
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