Add explicit error when config file not found

This commit is contained in:
Michel Oosterhof
2016-11-15 14:18:05 +00:00
parent 9b0be86f20
commit 4172eb858b

View File

@@ -88,6 +88,11 @@ class CowrieServiceMaker(object):
print('WARNING: reading cowrie.cfg from old location. Default is now etc/cowrie.cfg')
cfgfile = 'cowrie.cfg'
# End of backwards compatibility check
if not os.path.isfile(cfgfile):
print("ERROR: Can't find config file {}".format(cfgfile))
sys.exit(1)
cfg = readConfigFile(cfgfile)
# ssh is enabled by default