From 1b03496dbecafe0e95ab6fce5b1d22261acb7b5e Mon Sep 17 00:00:00 2001 From: "Caleb St. John" <30729806+yocalebo@users.noreply.github.com> Date: Tue, 17 May 2022 05:26:23 -0400 Subject: [PATCH] brick_status_data.get() could fail if the variable is None (#48) * brick_status_data.get() could fail if the variable is None * update debian/changelog to git release --- debian/changelog | 4 ++-- glustercli/cli/parsers.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index b53e7e1..b96c7a2 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -glustercli (0.7-1) experimental; urgency=medium +glustercli (0.8) unstable; urgency=medium [ Caleb St. John ] * initial debian package - -- Caleb Sat, 09 May 2020 08:47:46 -0400 + -- Caleb Wed, 05 May 2021 15:10:00 -0400 diff --git a/glustercli/cli/parsers.py b/glustercli/cli/parsers.py index b7751ff..9f847b0 100644 --- a/glustercli/cli/parsers.py +++ b/glustercli/cli/parsers.py @@ -304,8 +304,13 @@ def parse_volume_status(status_data, volinfo, group_subvols=False): for brick in vol["bricks"]: brick_status_data = tmp_brick_status.get(brick["name"], None) - brick_online = brick_status_data.get("online", False) - if brick_status_data is None or not brick_online: + if brick_status_data is None: + use_default = True + else: + # brick could be offline + use_default = not brick_status_data.get("online", False) + + if use_default: # Default Status volumes[-1]["bricks"].append({ "name": brick["name"],