def run_rpc_differ():
args = parse_arguments()<EOL>if args.debug:<EOL><INDENT>log.setLevel(logging.DEBUG)<EOL><DEDENT>elif args.verbose:<EOL><INDENT>log.setLevel(logging.INFO)<EOL><DEDENT>try:<EOL><INDENT>storage_directory = osa_differ.prepare_storage_dir(args.directory)<EOL><DEDENT>except OSError:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(args.directory))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>rpc_repo_url = args.rpc_repo_url<EOL>rpc_repo_dir = "<STR_LIT>".format(storage_directory)<EOL>osa_differ.update_repo(rpc_repo_dir, rpc_repo_url, args.update)<EOL>rpc_old_commit = validate_rpc_sha(rpc_repo_dir, args.old_commit[<NUM_LIT:0>])<EOL>rpc_new_commit = validate_rpc_sha(rpc_repo_dir, args.new_commit[<NUM_LIT:0>])<EOL>report_rst = make_rpc_report(rpc_repo_dir,<EOL>rpc_old_commit,<EOL>rpc_new_commit,<EOL>args)<EOL>try:<EOL><INDENT>role_yaml = osa_differ.get_roles(<EOL>rpc_repo_dir,<EOL>rpc_old_commit,<EOL>args.role_requirements_old_commit<EOL>)<EOL><DEDENT>except IOError:<EOL><INDENT>role_yaml = osa_differ.get_roles(<EOL>rpc_repo_dir,<EOL>rpc_old_commit,<EOL>ROLE_REQ_FILE<EOL>)<EOL><DEDENT>try:<EOL><INDENT>role_yaml_latest = osa_differ.get_roles(<EOL>rpc_repo_dir,<EOL>rpc_new_commit,<EOL>args.role_requirements<EOL>)<EOL><DEDENT>except IOError:<EOL><INDENT>role_yaml_latest = osa_differ.get_roles(<EOL>rpc_repo_dir,<EOL>rpc_new_commit,<EOL>ROLE_REQ_FILE<EOL>)<EOL><DEDENT>report_rst += ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>report_rst += osa_differ.make_report(storage_directory,<EOL>role_yaml,<EOL>role_yaml_latest,<EOL>args.update,<EOL>args.version_mappings)<EOL>report_rst += "<STR_LIT:\n>"<EOL>repo = Repo(rpc_repo_dir)<EOL>osa_old_commit = get_osa_commit(repo,<EOL>rpc_old_commit,<EOL>rpc_product=args.rpc_product_old_commit)<EOL>osa_new_commit = get_osa_commit(repo,<EOL>rpc_new_commit,<EOL>rpc_product=args.rpc_product)<EOL>log.debug("<STR_LIT>".format(old=osa_old_commit,<EOL>new=osa_new_commit))<EOL>osa_repo_dir = "<STR_LIT>".format(storage_directory)<EOL>try:<EOL><INDENT>report_rst += osa_differ.make_osa_report(osa_repo_dir,<EOL>osa_old_commit,<EOL>osa_new_commit,<EOL>args)<EOL><DEDENT>except exceptions.InvalidCommitRangeException:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>role_yaml = osa_differ.get_roles(osa_repo_dir,<EOL>osa_old_commit,<EOL>args.role_requirements_old_commit)<EOL><DEDENT>except IOError:<EOL><INDENT>role_yaml = osa_differ.get_roles(osa_repo_dir,<EOL>osa_old_commit,<EOL>ROLE_REQ_FILE)<EOL><DEDENT>try:<EOL><INDENT>role_yaml_latest = osa_differ.get_roles(osa_repo_dir,<EOL>osa_new_commit,<EOL>args.role_requirements)<EOL><DEDENT>except IOError:<EOL><INDENT>role_yaml_latest = osa_differ.get_roles(osa_repo_dir,<EOL>osa_new_commit,<EOL>ROLE_REQ_FILE)<EOL><DEDENT>report_rst += ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>report_rst += osa_differ.make_report(storage_directory,<EOL>role_yaml,<EOL>role_yaml_latest,<EOL>args.update,<EOL>args.version_mappings)<EOL>project_yaml = osa_differ.get_projects(osa_repo_dir,<EOL>osa_old_commit)<EOL>project_yaml_latest = osa_differ.get_projects(osa_repo_dir,<EOL>osa_new_commit)<EOL>report_rst += ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>report_rst += osa_differ.make_report(storage_directory,<EOL>project_yaml,<EOL>project_yaml_latest,<EOL>args.update,<EOL>args.version_mappings)<EOL>output = publish_report(report_rst,<EOL>args,<EOL>rpc_old_commit,<EOL>rpc_new_commit)<EOL>print(output)<EOL>
The script starts here.