[scanner] error to stderr and exit when scapy is not available

This commit is contained in:
fnux 2021-04-22 08:55:14 +02:00
parent 1bb696a410
commit acf9bf91f1
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12

View file

@ -20,6 +20,7 @@
#
import logging
import sys
log = logging.getLogger("scan")
@ -31,7 +32,9 @@ def commandline(args):
try:
import cdist.scan.scan as scan
except ModuleNotFoundError:
print('cdist scan requires scapy to be installed')
print('cdist scan requires scapy to be installed! Exiting.',
file=sys.stderr)
sys.exit(1)
processes = []