1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Return devicenodes as empty list if no LUN's

got connected. It is possible for an intiator to successfully connect to a
target, whilst getting no LUN's back. If no devicenodes get detected, it makes
more sense to return an empty list than plainly None.

This potentially avoids further tasks to have to check if devicenodes is
iterable.
This commit is contained in:
Serge van Ginderachter 2015-07-29 16:13:02 +02:00 committed by Matt Clay
parent 3acb084902
commit 21720f6bee

View file

@ -206,9 +206,6 @@ def target_device_node(module, target):
# a given target... # a given target...
devices = glob.glob('/dev/disk/by-path/*%s*' % target) devices = glob.glob('/dev/disk/by-path/*%s*' % target)
if len(devices) == 0:
return None
else:
devdisks = [] devdisks = []
for dev in devices: for dev in devices:
# exclude partitions # exclude partitions