runtests.py: Fix IndexError in --from-filenames

This commit is contained in:
Erik Johnson 2018-10-16 08:08:09 -05:00
parent 25097f9933
commit 85612cfc8f
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -424,9 +424,14 @@ class SaltTestingParser(optparse.OptionParser):
# State matches for execution modules of the same name
# (e.g. unit.states.test_archive if
# unit.modules.test_archive is being run)
if comps[-2] == 'modules':
comps[-2] = 'states'
_add(comps)
try:
if comps[-2] == 'modules':
comps[-2] = 'states'
_add(comps)
except IndexError:
# Not an execution module. This is either directly in
# the salt/ directory, or salt/something/__init__.py
pass
# Make sure to run a test module if it's been modified
elif match.group(1).startswith('tests/'):