Skip to content

Commit

Permalink
brick_status_data.get() could fail if the variable is None (#48)
Browse files Browse the repository at this point in the history
* brick_status_data.get() could fail if the variable is None
* update debian/changelog to git release
  • Loading branch information
yocalebo committed May 17, 2022
1 parent 19d3a70 commit 1b03496
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 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 <yocalebo@gmail.com> Sat, 09 May 2020 08:47:46 -0400
-- Caleb <yocalebo@gmail.com> Wed, 05 May 2021 15:10:00 -0400
9 changes: 7 additions & 2 deletions glustercli/cli/parsers.py
Expand Up @@ -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"],
Expand Down

0 comments on commit 1b03496

Please sign in to comment.