From 08b9e18d4f80a0164b8d5c52ec6a0dade64be5f3 Mon Sep 17 00:00:00 2001 From: Sachidananda Urs Date: Fri, 26 Jul 2019 16:45:11 +0530 Subject: [PATCH] Call remove-brick only if no. of bricks > 0 (#56781) (#58635) --- lib/ansible/modules/storage/glusterfs/gluster_volume.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/storage/glusterfs/gluster_volume.py b/lib/ansible/modules/storage/glusterfs/gluster_volume.py index fee9df787bd..30611e723bd 100644 --- a/lib/ansible/modules/storage/glusterfs/gluster_volume.py +++ b/lib/ansible/modules/storage/glusterfs/gluster_volume.py @@ -548,7 +548,8 @@ def main(): if brick not in bricks_in_volume: new_bricks.append(brick) - if not new_bricks and len(all_bricks) < len(bricks_in_volume): + if not new_bricks and len(all_bricks) > 0 and \ + len(all_bricks) < len(bricks_in_volume): for brick in bricks_in_volume: if brick not in all_bricks: removed_bricks.append(brick)