diff options
author | 2014-11-24 15:22:28 +0100 | |
---|---|---|
committer | 2014-11-24 15:22:28 +0100 | |
commit | 3acb0ce6d38d02915f142f2ec69c9c24fb1ec99c (patch) | |
tree | 7f46063acf8051ebf75ad53c7444fbd76cb76f68 | |
parent | Merge branch 'heroxbd/g-sorcery:master' into dev (diff) | |
download | g-sorcery-3acb0ce6d38d02915f142f2ec69c9c24fb1ec99c.tar.gz g-sorcery-3acb0ce6d38d02915f142f2ec69c9c24fb1ec99c.tar.bz2 g-sorcery-3acb0ce6d38d02915f142f2ec69c9c24fb1ec99c.zip |
[g_sorcery/g_sorcery.py] check backend initialization
-rw-r--r-- | g_sorcery/g_sorcery.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/g_sorcery/g_sorcery.py b/g_sorcery/g_sorcery.py index 76ecf82..b41adfb 100644 --- a/g_sorcery/g_sorcery.py +++ b/g_sorcery/g_sorcery.py @@ -4,9 +4,9 @@ """ g_sorcery.py ~~~~~~~~~~~~ - + the main module - + :copyright: (c) 2013 by Jauhien Piatlicki :license: GPL-2, see LICENSE for more details. """ @@ -46,6 +46,10 @@ def main(): return -1 backend = get_backend(config['package']) + if not backend: + logger.error("backend initialization failed, exiting") + return -1 + config_file = None for path in '.', '~', '/etc/g-sorcery': config_file = os.path.join(path, "g-sorcery.cfg") @@ -57,7 +61,7 @@ def main(): if not config_file: logger.error('no global config file\n') return -1 - + global_config = configparser.ConfigParser() global_config.read(config_file) @@ -74,7 +78,7 @@ def get_backend(package): except ImportError as error: logger.error("error importing backend: " + str(error)) return None - + return module |