def run():
args = parse_args()<EOL>codetools.setup_logging(args.debug)<EOL>git_tag = args.tag<EOL>git_email = codetools.lookup_email(args)<EOL>git_user = codetools.lookup_user(args)<EOL>if not args.manifest_only:<EOL><INDENT>eups_tag = args.eups_tag<EOL>if not eups_tag:<EOL><INDENT>eups_tag = eups.git_tag2eups_tag(git_tag)<EOL><DEDENT>debug("<STR_LIT>".format(eups_tag=eups_tag))<EOL><DEDENT>manifest = args.manifest<EOL>debug("<STR_LIT>".format(manifest=manifest))<EOL>if not args.manifest_only:<EOL><INDENT>message_template = "<STR_LIT>""<STR_LIT>".format(<EOL>eups_tag=eups_tag,<EOL>manifest=manifest,<EOL>)<EOL><DEDENT>else:<EOL><INDENT>message_template = "<STR_LIT>""<STR_LIT>".format(<EOL>manifest=manifest,<EOL>)<EOL><DEDENT>debug("<STR_LIT>".format(msg=message_template))<EOL>tagger = github.InputGitAuthor(<EOL>git_user,<EOL>git_email,<EOL>codetools.current_timestamp(),<EOL>)<EOL>debug("<STR_LIT>".format(tagger=tagger))<EOL>global g<EOL>g = pygithub.login_github(token_path=args.token_path, token=args.token)<EOL>org = g.get_organization(args.org)<EOL>info("<STR_LIT>".format(org=org.login))<EOL>problems = []<EOL>manifest_products = versiondb.Manifest(<EOL>manifest,<EOL>base_url=args.versiondb_base_url).products<EOL>if not args.manifest_only:<EOL><INDENT>eups_products = eups.EupsTag(<EOL>eups_tag,<EOL>base_url=args.eupstag_base_url).products<EOL>products, err = cross_reference_products(<EOL>eups_products,<EOL>manifest_products,<EOL>ignore_manifest_versions=args.ignore_manifest_versions,<EOL>fail_fast=False,<EOL>)<EOL>problems += err<EOL><DEDENT>else:<EOL><INDENT>products = manifest_products<EOL><DEDENT>if args.limit:<EOL><INDENT>products = dict(itertools.islice(products.items(), args.limit))<EOL><DEDENT>products, err = get_repo_for_products(<EOL>org=org,<EOL>products=products,<EOL>allow_teams=args.allow_team,<EOL>ext_teams=args.external_team,<EOL>deny_teams=args.deny_team,<EOL>fail_fast=False,<EOL>)<EOL>problems += err<EOL>products_to_tag, err = check_product_tags(<EOL>products,<EOL>git_tag,<EOL>tag_message_template=message_template,<EOL>tagger=tagger,<EOL>force_tag=args.force_tag,<EOL>fail_fast=False,<EOL>ignore_git_message=args.ignore_git_message,<EOL>ignore_git_tagger=args.ignore_git_tagger,<EOL>)<EOL>problems += err<EOL>if args.verify:<EOL><INDENT>err = identify_products_missing_tags(products_to_tag)<EOL>problems += err<EOL><DEDENT>if problems:<EOL><INDENT>msg = "<STR_LIT>".format(n=len(problems))<EOL>raise codetools.DogpileError(problems, msg)<EOL><DEDENT>tag_products(<EOL>products_to_tag,<EOL>fail_fast=args.fail_fast,<EOL>dry_run=args.dry_run,<EOL>)<EOL>
Create the tag