When a list of targets is provided (-T), skip empty lines.

This commit is contained in:
Joe Testa 2020-07-16 10:19:36 -04:00
parent cf815a6652
commit 8051078524

View File

@ -573,8 +573,8 @@ class AuditConf:
with open(aconf.target_file, 'r') as f:
aconf.target_list = f.readlines()
# Strip out whitespace from each line in target file.
aconf.target_list = [target.strip() for target in aconf.target_list]
# Strip out whitespace from each line in target file, and skip empty lines.
aconf.target_list = [target.strip() for target in aconf.target_list if target not in ("", "\n")]
# If a policy file was provided, validate it.
if (aconf.policy_file is not None) and (aconf.make_policy is False):