From 1f0e4a06e7a66a2da55801e403b0110c0fdb4d35 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 28 Oct 2022 15:56:43 -0400 Subject: [PATCH] cephadm: fix list_networks set -> list conversion When there were multiple interfaces for a network subset it was only returning the last interface rather than all of them Signed-off-by: Adam King --- src/cephadm/cephadm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 1365f5aa4cb..6bbb6662103 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -4392,10 +4392,11 @@ WantedBy=ceph-{fsid}.target # part of the networks info is returned as a set which is not JSON # serializable. The set must be converted to a list networks = list_networks(self.ctx) - networks_list = {} + networks_list: Dict[str, Dict[str, List[str]]] = {} for key in networks.keys(): + networks_list[key] = {} for k, v in networks[key].items(): - networks_list[key] = {k: list(v)} + networks_list[key][k] = list(v) data = json.dumps({'host': self.host, 'ls': (self.ls_gatherer.data if self.ack == self.ls_gatherer.ack -- 2.47.3