Merge ~ebarretto/ubuntu-qa-tools:esm-checks into ubuntu-qa-tools:master

Proposed by Eduardo Barretto
Status: Merged
Merged at revision: ae400c8b6e5a575e1fda859a3d9900b1ae686565
Proposed branch: ~ebarretto/ubuntu-qa-tools:esm-checks
Merge into: ubuntu-qa-tools:master
Diff against target: 116 lines (+47/-38)
1 file modified
security-tools/unembargo (+47/-38)
Reviewer Review Type Date Requested Status
Emilia Torino Approve
Review via email: mp+400723@code.launchpad.net

Description of the change

Add --esm-apps and --esm-infra flags to unembargo.
This code was in embargoed/expanded-esm/lib and should be integrated to UQT.

To post a comment you must log in.
Revision history for this message
Paulo Flabiano Smorigo (pfsmorigo) wrote :

LGTM

Revision history for this message
Emilia Torino (emitorino) wrote :

LGTM. thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/security-tools/unembargo b/security-tools/unembargo
2index 6a542c4..dd84f08 100755
3--- a/security-tools/unembargo
4+++ b/security-tools/unembargo
5@@ -30,64 +30,73 @@ UBUNTU_ARCHIVE = "ubuntu"
6 ESM_STAGING_PPA = "ubuntu-security/esm"
7 ESM_PRODUCTION_PPA = "ubuntu-esm/esm"
8
9+ESM_APPS_STAGING_PPA = "ubuntu-esm/esm-apps-security-staging"
10+ESM_APPS_PRODUCTION_PPA = "ubuntu-esm/esm-apps-security"
11+
12+ESM_INFRA_STAGING_PPA = "ubuntu-esm/esm-infra-security-staging"
13+ESM_INFRA_PRODUCTION_PPA = "ubuntu-esm/esm-infra-security"
14+
15 RELEASE_POCKET = "Release"
16 SECURITY_POCKET = "Security"
17
18 apt_pkg.init_system()
19
20 parser = argparse.ArgumentParser()
21-parser.add_argument("--ppa", help="The PPA to copy from (default: ubuntu-security/ppa)", metavar="GROUP[/PPA]",
22+parser.add_argument("--ppa", help="The PPA to copy from "
23+ "(default: ubuntu-security/ppa)", metavar="GROUP[/PPA]",
24 action='store', default=None)
25-parser.add_argument("-d", "--destination", help="The archive to copy to (default: Ubuntu Archive)",
26- metavar="GROUP[/PPA]", action='store', default=UBUNTU_ARCHIVE)
27-parser.add_argument("--esm", help="Copy completed ESM packages from the ESM staging PPA to the ESM production PPA "
28- "(default: None)", action='store_true', default=None)
29-parser.add_argument("-r", "--release", help="Limit unembargo to a specific set of comma-separate releases",
30+parser.add_argument("-d", "--destination", help="The archive to copy to "
31+ "(default: Ubuntu Archive)",
32+ metavar="GROUP[/PPA]", action='store',
33+ default=UBUNTU_ARCHIVE)
34+parser.add_argument("--esm", help="Copy completed ESM packages from the ESM "
35+ "staging PPA to the ESM production PPA "
36+ "(default: None)", action='store_true', default=None)
37+parser.add_argument("--esm-apps", help="Copy completed ESM packages from the "
38+ "ESM Apps staging PPA to the ESM Apps production PPA "
39+ "(default: None)", action='store_true',
40+ default=None)
41+parser.add_argument("--esm-infra", help="Copy completed ESM packages from the "
42+ "ESM Infra staging PPA to the ESM Infra production PPA "
43+ "(default: None)", action='store_true',
44+ default=None)
45+parser.add_argument("-r", "--release", help="Limit unembargo to a specific set "
46+ "of comma-separate releases",
47 metavar="SERIES", action='store', default=None)
48-parser.add_argument("-n", "--dry-run", help="Do not actually publish", action='store_true')
49-parser.add_argument("--retries", help="Retry failed sync at most RETRIES times", action='store', metavar="RETRIES",
50+parser.add_argument("-n", "--dry-run", help="Do not actually publish",
51+ action='store_true')
52+parser.add_argument("--retries", help="Retry failed sync at most RETRIES times",
53+ action='store', metavar="RETRIES",
54 default=1, type=int)
55-parser.add_argument("--pocket", help="The destination pocket (default: Security)", metavar="POCKET", action='store',
56+parser.add_argument("--pocket", help="The destination pocket "
57+ "(default: Security)", metavar="POCKET", action='store',
58 default=SECURITY_POCKET)
59-parser.add_argument("--source-pocket", help="The pocket to restrict the copy from (default: None)",
60+parser.add_argument("--source-pocket", help="The pocket to restrict the copy "
61+ "from (default: None)",
62 metavar="SOURCE_POCKET", action='store', default=None)
63
64-try:
65- import private_unembargo_options
66- private_unembargo_options.add_private_options(parser)
67-except ImportError:
68- # If private options could not be imported, just skip them
69- pass
70-
71 (opt, args) = parser.parse_known_args()
72 if len(args) < 1:
73 print('Usage: %s [OPTIONS] PKG [PKG...]' % sys.argv[0], file=sys.stderr)
74 sys.exit(1)
75
76-# If private options have been successfully imported above, process them
77-if 'private_unembargo_options' in sys.modules:
78- if private_unembargo_options.has_private_options(parser, opt):
79- private_unembargo_options.process_private_options(opt)
80-
81-try:
82- import private_unembargo_checks
83- import embargoed_errors
84- private_unembargo_checks.do_private_checks(opt.ppa, opt.destination)
85-except ImportError:
86- # If private options could not be imported, just skip them
87- print('Warning: Import of private checks failed. Skipping...')
88- pass
89-except (embargoed_errors.DestinationError, embargoed_errors.VersionError) as ee:
90- print('Error: %s' % str(ee), file=sys.stderr)
91- sys.exit(1)
92-
93-# If --esm option is provided, the script will move from ESM staging PPA to ESM PROD PPA. So the user should not
94-# indicate such values.
95-if opt.esm:
96+# If --esm, --esm-apps or --esm-infra option is provided, the script will move
97+# from the respective ESM staging PPA to the respective ESM PROD PPA. So the
98+# user should not indicate such values.
99+if opt.esm or opt.esm_apps or opt.esm_infra:
100 if opt.destination != UBUNTU_ARCHIVE or opt.ppa is not None:
101- parser.error("If --esm option is provided, do not specify values for package origin and destination as this "
102+ parser.error("If an esm option is provided, do not specify values for "
103+ "package origin and destination as this "
104 "script will do that for you.")
105 sys.exit(2)
106+ elif opt.esm_apps:
107+ opt.destination = ESM_APPS_PRODUCTION_PPA
108+ opt.ppa = ESM_APPS_STAGING_PPA
109+ opt.pocket = RELEASE_POCKET
110+ elif opt.esm_infra:
111+ opt.destination = ESM_INFRA_PRODUCTION_PPA
112+ opt.ppa = ESM_INFRA_STAGING_PPA
113+ opt.pocket = RELEASE_POCKET
114 else:
115 opt.destination = ESM_PRODUCTION_PPA
116 opt.ppa = ESM_STAGING_PPA

Subscribers

People subscribed via source and target branches