Eduardo Barretto has proposed merging ~ebarretto/ubuntu-qa-tools:esm-checks into ubuntu-qa-tools:master.
Requested reviews: Ubuntu Security Team (ubuntu-security) For more details, see: https://code.launchpad.net/~ebarretto/ubuntu-qa-tools/+git/ubuntu-qa-tools/+merge/400723 Add --esm-apps and --esm-infra flags to unembargo. This code was in embargoed/expanded-esm/lib and should be integrated to UQT. -- Your team Ubuntu Bug Control is subscribed to branch ubuntu-qa-tools:master.
diff --git a/security-tools/unembargo b/security-tools/unembargo index 6a542c4..dd84f08 100755 --- a/security-tools/unembargo +++ b/security-tools/unembargo @@ -30,64 +30,73 @@ UBUNTU_ARCHIVE = "ubuntu" ESM_STAGING_PPA = "ubuntu-security/esm" ESM_PRODUCTION_PPA = "ubuntu-esm/esm" +ESM_APPS_STAGING_PPA = "ubuntu-esm/esm-apps-security-staging" +ESM_APPS_PRODUCTION_PPA = "ubuntu-esm/esm-apps-security" + +ESM_INFRA_STAGING_PPA = "ubuntu-esm/esm-infra-security-staging" +ESM_INFRA_PRODUCTION_PPA = "ubuntu-esm/esm-infra-security" + RELEASE_POCKET = "Release" SECURITY_POCKET = "Security" apt_pkg.init_system() parser = argparse.ArgumentParser() -parser.add_argument("--ppa", help="The PPA to copy from (default: ubuntu-security/ppa)", metavar="GROUP[/PPA]", +parser.add_argument("--ppa", help="The PPA to copy from " + "(default: ubuntu-security/ppa)", metavar="GROUP[/PPA]", action='store', default=None) -parser.add_argument("-d", "--destination", help="The archive to copy to (default: Ubuntu Archive)", - metavar="GROUP[/PPA]", action='store', default=UBUNTU_ARCHIVE) -parser.add_argument("--esm", help="Copy completed ESM packages from the ESM staging PPA to the ESM production PPA " - "(default: None)", action='store_true', default=None) -parser.add_argument("-r", "--release", help="Limit unembargo to a specific set of comma-separate releases", +parser.add_argument("-d", "--destination", help="The archive to copy to " + "(default: Ubuntu Archive)", + metavar="GROUP[/PPA]", action='store', + default=UBUNTU_ARCHIVE) +parser.add_argument("--esm", help="Copy completed ESM packages from the ESM " + "staging PPA to the ESM production PPA " + "(default: None)", action='store_true', default=None) +parser.add_argument("--esm-apps", help="Copy completed ESM packages from the " + "ESM Apps staging PPA to the ESM Apps production PPA " + "(default: None)", action='store_true', + default=None) +parser.add_argument("--esm-infra", help="Copy completed ESM packages from the " + "ESM Infra staging PPA to the ESM Infra production PPA " + "(default: None)", action='store_true', + default=None) +parser.add_argument("-r", "--release", help="Limit unembargo to a specific set " + "of comma-separate releases", metavar="SERIES", action='store', default=None) -parser.add_argument("-n", "--dry-run", help="Do not actually publish", action='store_true') -parser.add_argument("--retries", help="Retry failed sync at most RETRIES times", action='store', metavar="RETRIES", +parser.add_argument("-n", "--dry-run", help="Do not actually publish", + action='store_true') +parser.add_argument("--retries", help="Retry failed sync at most RETRIES times", + action='store', metavar="RETRIES", default=1, type=int) -parser.add_argument("--pocket", help="The destination pocket (default: Security)", metavar="POCKET", action='store', +parser.add_argument("--pocket", help="The destination pocket " + "(default: Security)", metavar="POCKET", action='store', default=SECURITY_POCKET) -parser.add_argument("--source-pocket", help="The pocket to restrict the copy from (default: None)", +parser.add_argument("--source-pocket", help="The pocket to restrict the copy " + "from (default: None)", metavar="SOURCE_POCKET", action='store', default=None) -try: - import private_unembargo_options - private_unembargo_options.add_private_options(parser) -except ImportError: - # If private options could not be imported, just skip them - pass - (opt, args) = parser.parse_known_args() if len(args) < 1: print('Usage: %s [OPTIONS] PKG [PKG...]' % sys.argv[0], file=sys.stderr) sys.exit(1) -# If private options have been successfully imported above, process them -if 'private_unembargo_options' in sys.modules: - if private_unembargo_options.has_private_options(parser, opt): - private_unembargo_options.process_private_options(opt) - -try: - import private_unembargo_checks - import embargoed_errors - private_unembargo_checks.do_private_checks(opt.ppa, opt.destination) -except ImportError: - # If private options could not be imported, just skip them - print('Warning: Import of private checks failed. Skipping...') - pass -except (embargoed_errors.DestinationError, embargoed_errors.VersionError) as ee: - print('Error: %s' % str(ee), file=sys.stderr) - sys.exit(1) - -# If --esm option is provided, the script will move from ESM staging PPA to ESM PROD PPA. So the user should not -# indicate such values. -if opt.esm: +# If --esm, --esm-apps or --esm-infra option is provided, the script will move +# from the respective ESM staging PPA to the respective ESM PROD PPA. So the +# user should not indicate such values. +if opt.esm or opt.esm_apps or opt.esm_infra: if opt.destination != UBUNTU_ARCHIVE or opt.ppa is not None: - parser.error("If --esm option is provided, do not specify values for package origin and destination as this " + parser.error("If an esm option is provided, do not specify values for " + "package origin and destination as this " "script will do that for you.") sys.exit(2) + elif opt.esm_apps: + opt.destination = ESM_APPS_PRODUCTION_PPA + opt.ppa = ESM_APPS_STAGING_PPA + opt.pocket = RELEASE_POCKET + elif opt.esm_infra: + opt.destination = ESM_INFRA_PRODUCTION_PPA + opt.ppa = ESM_INFRA_STAGING_PPA + opt.pocket = RELEASE_POCKET else: opt.destination = ESM_PRODUCTION_PPA opt.ppa = ESM_STAGING_PPA
_______________________________________________ Mailing list: https://launchpad.net/~ubuntu-bugcontrol Post to : ubuntu-bugcontrol@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-bugcontrol More help : https://help.launchpad.net/ListHelp