Skip to content

Commit 1b03496

Browse files
authored
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
1 parent 19d3a70 commit 1b03496

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

debian/changelog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
glustercli (0.7-1) experimental; urgency=medium
1+
glustercli (0.8) unstable; urgency=medium
22

33
[ Caleb St. John ]
44
* initial debian package
55

6-
-- Caleb <[email protected]> Sat, 09 May 2020 08:47:46 -0400
6+
-- Caleb <[email protected]> Wed, 05 May 2021 15:10:00 -0400

glustercli/cli/parsers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,13 @@ def parse_volume_status(status_data, volinfo, group_subvols=False):
304304

305305
for brick in vol["bricks"]:
306306
brick_status_data = tmp_brick_status.get(brick["name"], None)
307-
brick_online = brick_status_data.get("online", False)
308-
if brick_status_data is None or not brick_online:
307+
if brick_status_data is None:
308+
use_default = True
309+
else:
310+
# brick could be offline
311+
use_default = not brick_status_data.get("online", False)
312+
313+
if use_default:
309314
# Default Status
310315
volumes[-1]["bricks"].append({
311316
"name": brick["name"],

0 commit comments

Comments
 (0)