Fixed glusterfs.peered output (#32955)

Fixed 'NoneType' object is not iterable and removed existing peers from newpeers list

Fixes #32954
This commit is contained in:
Adam Tengler 2016-05-03 17:57:35 +02:00 committed by Mike Place
parent 8c70d7a56b
commit 81c0fa4d78

View File

@ -89,7 +89,7 @@ def peered(name):
newpeers = __salt__['glusterfs.list_peers']()
# if newpeers was null, we know something didn't work.
if newpeers and name in newpeers or any([name in newpeers[x] for x in newpeers]):
if newpeers and name in newpeers or newpeers and any([name in newpeers[x] for x in newpeers]):
ret['result'] = True
ret['changes'] = {'new': newpeers, 'old': peers}
# In case the hostname doesn't have any periods in it