Reduce loops and if statements in method discover_files
Reduce loops and if statements in method discover_files

Change-Id: I1681467bfa56968336dcb3aa15752f7973585381

openstack-dev/bashate,openstack-dev/bashate