Commit 6079b493 authored by Anael Beutot's avatar Anael Beutot
Browse files

Check for ConfigError at startup and exit program if any

parent 95604ea5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ from sjrpc.core import RpcConnection, RpcError
from sjrpc.utils import threadless

from cloudcontrol.common.client.tags import get_tags, RootTagDB
from cloudcontrol.common.client.exc import PluginError
from cloudcontrol.common.client.exc import PluginError, ConfigError


logger = logging.getLogger(__name__)
@@ -376,7 +376,10 @@ class MainLoop(object):
    def __init__(self, config_path):
        self.config_path = config_path
        # load config variables
        try:
            self.load_config()
        except ConfigError as exc:
            sys.exit(exc.message)
        # configure logging
        self.configure_logging()