示例#1
0
 def _f():
     compile_config()
     client.set_up_logging()
     if config['debug']:
         logger.info("Core path: %s", os.path.dirname(__file__))
     try_auto_configuration()
     try:
         func()
     except Exception:
         logger.exception("Fatal error")
         sys.exit(1)
     else:
         sys.exit()  # Exit gracefully
示例#2
0
 def _f():
     try:
         compile_config()
     except ValueError as e:
         sys.stderr.write('ERROR:' + e)
         sys.exit(constants.sig_kill_bad)
     client.set_up_logging()
     if config['debug']:
         logger.info("Core path: %s", os.path.dirname(__file__))
     try_auto_configuration()
     try:
         func()
     except Exception:
         logger.exception("Fatal error")
         sys.exit(1)
     else:
         sys.exit()  # Exit gracefully
示例#3
0
def main():
    compile_config()
    set_up_logging()
    v = handle_startup()
    if v is not None:
        if type(v) != bool:
            print(v)
        return
    else:
        client = InsightsClient()
        client.update_rules()
        tar = client.collect(check_timestamp=False,
                             image_id=(config["image_id"] or config["only"]),
                             tar_file=config["tar_file"],
                             mountpoint=config["mountpoint"])
        if not config['no_upload']:
            client.upload(tar)
        else:
            print('Archive saved to ' + tar)