def main()

in dcrpm/main.py [0:0]


def main():
    # type: () -> int
    args = parse_args()

    # Set up logging
    if args.logging_config_file:
        with open(args.logging_config_file) as f:
            config = json.load(f)
    else:
        config = DEFAULT_LOGGING_CONFIG
    if args.verbose:
        if "handlers" in config:
            for handler in config["handlers"]:
                config["handlers"][handler]["level"] = "DEBUG"
        logging.getLogger().setLevel(logging.DEBUG)

    logging.config.dictConfig(config)

    # Let's go!
    rpmutil = RPMUtil(
        dbpath=args.dbpath,
        rpm_path=args.rpm_path,
        recover_path=args.recover_path,
        verify_path=args.verify_path,
        stat_path=args.stat_path,
        yum_complete_transaction_path=args.yum_complete_transaction_path,
        blacklist=args.blacklist,
        forensic=args.forensic,
    )
    try:
        rc = DcRPM(rpmutil, args).run()
        return int(not (rc))
    except Exception as e:
        msg = "exception: {}".format(e)
        logging.getLogger("status").error("exception")
        logging.getLogger().error(msg)
        return 1