Added some verbosity to the error message in case of missing packages

This commit is contained in:
parallax 2016-08-22 18:11:59 +01:00
parent c7a836a372
commit 91ca27ae04

View File

@ -33,12 +33,16 @@ import textwrap
try:
import gitlab
import jxmlease
# path to docbuilder installation (needs the module)
sys.path.append('/usr/local/bin')
# Path of this script. The validate_report module is on the same path.
import validate_report
except ImportError:
print('[-] This script needs gitlab, jxmlease and validate_report library',
file=sys.stderr)
except ImportError as e:
print('[-] This script needs python-gitlab, jxmlease and validate_report library', file=sys.stderr)
print("validate_report is part of the pentext framework", file=sys.stderr)
print("Install python-gitlab with: sudo pip install python-gitlab", file=sys.stderr)
print("Install pjxmlease with: sudo pip install jxmlease", file=sys.stderr)
print("", file=sys.stderr)
print("Currently missing: " + e.message,file=sys.stderr)
sys.exit(-1)