Esempio n. 1
0
 def read_config(self, sys_args):
     if not hasattr(sys_args, 'config'):
         return None
     if not sys_args.config:
         config_path = './etc/config.yaml'
     else:
         config_path = sys_args.config
     try:
         with open(config_path) as f:
             return yaml.load(f)
     except yaml.scanner.ScannerError as ex:
         LOG.error("Yaml file corrupt. Try putting spaces after the "
                   "colons.")
         raise ex
Esempio n. 2
0
 def start(self):
     try:
         self._run()
     except Exception as ex:
         LOG.error(ex.message)
         LOG.error(traceback.format_exc())
         LOG.error("For more logs check: %(log_path)s" %
                   {'log_path': LOG_PATH})
         sys.exit(1)