From f8b3a290b010c4dee6fdde63545c4f97a79f93c9 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Tue, 15 Nov 2016 14:18:05 +0000 Subject: [PATCH] Add explicit error when config file not found --- twisted/plugins/cowrie_plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/twisted/plugins/cowrie_plugin.py b/twisted/plugins/cowrie_plugin.py index a0ba818..03665a0 100644 --- a/twisted/plugins/cowrie_plugin.py +++ b/twisted/plugins/cowrie_plugin.py @@ -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