From 9235187c6fc74488768873d119db27ae9f65d4b4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 10 Dec 2023 22:24:38 -0500 Subject: [PATCH] Port Ceph functions to read_many Only ports getOSDInformation, as all the others feature 3 or less reads which is acceptable sequentially. --- daemon-common/ceph.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/daemon-common/ceph.py b/daemon-common/ceph.py index 4fd0b0b0..1888b56e 100644 --- a/daemon-common/ceph.py +++ b/daemon-common/ceph.py @@ -215,14 +215,26 @@ def getClusterOSDList(zkhandler): def getOSDInformation(zkhandler, osd_id): - # Get the devices - osd_fsid = zkhandler.read(("osd.ofsid", osd_id)) - osd_node = zkhandler.read(("osd.node", osd_id)) - osd_device = zkhandler.read(("osd.device", osd_id)) - osd_is_split = bool(strtobool(zkhandler.read(("osd.is_split", osd_id)))) - osd_db_device = zkhandler.read(("osd.db_device", osd_id)) + ( + osd_fsid, + osd_node, + osd_device, + _osd_is_split, + osd_db_device, + osd_stats_raw, + ) = zkhandler.read_many( + [ + ("osd.ofsid", osd_id), + ("osd.node", osd_id), + ("osd.device", osd_id), + ("osd.is_split", osd_id), + ("osd.db_device", osd_id), + ("osd.stats", osd_id), + ] + ) + + osd_is_split = bool(strtobool(_osd_is_split)) # Parse the stats data - osd_stats_raw = zkhandler.read(("osd.stats", osd_id)) osd_stats = dict(json.loads(osd_stats_raw)) osd_information = {