Merge ~phd/ubuntu-archive-tools:phd-LP_CREDENTIALS_FILE into ubuntu-archive-tools:main

Proposed by Piotr Henryk Dabrowski
Status: Rejected
Rejected by: Steve Langasek
Proposed branch: ~phd/ubuntu-archive-tools:phd-LP_CREDENTIALS_FILE
Merge into: ubuntu-archive-tools:main
Diff against target: 810 lines (+125/-49)
41 files modified
auto-sync (+2/-1)
bootstrap-package (+3/-1)
branch-livefses (+3/-1)
branch-seeds (+2/-1)
change-override (+3/-2)
close-EOL-bugs (+3/-1)
copy-build-scheduler (+6/-1)
copy-package (+3/-1)
copy-proposed-kernel (+3/-1)
copy-report (+2/-1)
demote-to-proposed (+3/-1)
derive-distribution (+2/-1)
edit-acl (+3/-1)
get-distro-update-metrics (+6/-1)
import-blacklist (+3/-1)
kernel-overrides (+2/-1)
kernel-sru-release (+3/-1)
kernel-sru-review (+2/-1)
manage-builders (+3/-1)
manage-chroot (+6/-4)
mark-suite-dirty (+3/-1)
move-milestoned-bugs (+3/-1)
new-binary-debian-universe (+2/-1)
package-subscribers (+3/-1)
packageset-report (+3/-1)
permissions-report (+3/-1)
phased-updater (+2/-1)
pocket-mismatches (+2/-1)
process-removals (+2/-1)
promote-to-release (+3/-1)
queue (+2/-1)
regression-proposed-bug-search (+3/-1)
remove-package (+3/-1)
rescore-ppa-builds (+4/-1)
sru-accept (+4/-1)
sru-release (+2/-1)
sru-remove (+4/-2)
sru-review (+3/-2)
sync-blacklist (+4/-1)
unsubscribe-team (+3/-1)
update-i386-whitelist (+4/-3)
Reviewer Review Type Date Requested Status
Steve Langasek Disapprove
Review via email: mp+414208@code.launchpad.net
To post a comment you must log in.
33e0409... by Piotr Henryk Dabrowski

use LP_CREDENTIALS_FILE environment variable in login_with()

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

Support for LP_CREDENTIALS_FILE environment variable is available naively in launchpadlib since 1.10.16.
But since this version is only available in 22.04 Jammy [1],
it might be useful to implement it here as well,
until launchpadlib 1.10.16 is widely adopted (at least in 20.04 LTS).

[1] https://packages.ubuntu.com/search?keywords=python3-launchpadlib

Revision history for this message
Steve Langasek (vorlon) wrote :

This adds complexity to the code for backwards-compatibility with an older Ubuntu release that none of the users of these tools (i.e.: Ubuntu developers) should be running in their development environment.

review: Disapprove

Unmerged commits

33e0409... by Piotr Henryk Dabrowski

use LP_CREDENTIALS_FILE environment variable in login_with()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/auto-sync b/auto-sync
2index 7a992d5..e1a1bb4 100755
3--- a/auto-sync
4+++ b/auto-sync
5@@ -761,7 +761,8 @@ def main():
6
7 apt_pkg.init()
8 options.launchpad = Launchpad.login_with(
9- CONSUMER_KEY, options.launchpad_instance, version="devel")
10+ CONSUMER_KEY, options.launchpad_instance, version="devel",
11+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
12
13 if options.log_directory is not None:
14 now = time.gmtime()
15diff --git a/bootstrap-package b/bootstrap-package
16index 2c623c5..e48a50b 100755
17--- a/bootstrap-package
18+++ b/bootstrap-package
19@@ -17,6 +17,7 @@
20
21 """Bootstrap a package build using injected build-dependencies."""
22
23+import os
24 import sys
25
26 from optparse import (
27@@ -79,7 +80,8 @@ def main():
28 options, args = parser.parse_args()
29
30 options.launchpad = Launchpad.login_with(
31- "bootstrap-package", options.launchpad_instance, version="devel")
32+ "bootstrap-package", options.launchpad_instance, version="devel",
33+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
34 lputils.setup_location(options, default_pocket="Proposed")
35
36 if not args:
37diff --git a/branch-livefses b/branch-livefses
38index 8bb9f63..d8df88c 100755
39--- a/branch-livefses
40+++ b/branch-livefses
41@@ -20,6 +20,7 @@
42 from __future__ import print_function
43
44 import argparse
45+import os
46
47 from launchpadlib.launchpad import Launchpad
48 import lazr.restfulclient.errors
49@@ -67,7 +68,8 @@ def main():
50 args = parser.parse_args()
51
52 args.launchpad = Launchpad.login_with(
53- "branch-livefses", args.launchpad_instance, version="devel")
54+ "branch-livefses", args.launchpad_instance, version="devel",
55+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
56
57 distro = args.launchpad.distributions[args.distribution]
58 if args.source_series is None:
59diff --git a/branch-seeds b/branch-seeds
60index c152438..b1e7d44 100755
61--- a/branch-seeds
62+++ b/branch-seeds
63@@ -190,7 +190,8 @@ def main():
64 parser.error("You must specify at least one seed collection.")
65
66 options.launchpad = Launchpad.login_with(
67- "branch-seeds", options.launchpad_instance, version="devel")
68+ "branch-seeds", options.launchpad_instance, version="devel",
69+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
70
71 distro = options.launchpad.distributions["ubuntu"]
72 if options.source_series is None:
73diff --git a/change-override b/change-override
74index b4308aa..d7e099e 100755
75--- a/change-override
76+++ b/change-override
77@@ -26,7 +26,7 @@ from launchpadlib.launchpad import Launchpad
78 from ubuntutools.question import YesNoQuestion
79
80 import lputils
81-
82+import os
83
84 def find_publications(options, packages):
85 for package in packages:
86@@ -221,7 +221,8 @@ def main():
87 "priority, and percentage.")
88
89 options.launchpad = Launchpad.login_with(
90- "change-override", options.launchpad_instance, version="devel")
91+ "change-override", options.launchpad_instance, version="devel",
92+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
93 lputils.setup_location(options)
94
95 change_overrides(options, args)
96diff --git a/close-EOL-bugs b/close-EOL-bugs
97index e467d2a..10ef0f2 100755
98--- a/close-EOL-bugs
99+++ b/close-EOL-bugs
100@@ -19,6 +19,7 @@
101
102 import argparse
103 from launchpadlib.launchpad import Launchpad
104+import os
105 import sys
106
107 CONSUMER_KEY = "close-EOL-bugs"
108@@ -55,7 +56,8 @@ if __name__ == '__main__':
109 args = parser.parse_args()
110
111 launchpad = Launchpad.login_with(
112- CONSUMER_KEY, args.launchpad_instance, version="devel")
113+ CONSUMER_KEY, args.launchpad_instance, version="devel",
114+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
115 distro = launchpad.distributions["ubuntu"]
116 series = distro.getSeries(name_or_version=args.series)
117
118diff --git a/copy-build-scheduler b/copy-build-scheduler
119index 4c9cbca..451c2f4 100755
120--- a/copy-build-scheduler
121+++ b/copy-build-scheduler
122@@ -33,6 +33,7 @@
123 import argparse
124 from collections import defaultdict
125 import logging
126+import os
127 import time
128
129 from launchpadlib.launchpad import Launchpad
130@@ -122,9 +123,13 @@ def main():
131 if not args.processors:
132 args.processors = ['amd64', 'i386']
133
134+ credentials = args.credentials
135+ if credentials is None:
136+ credentials = os.environ.get('LP_CREDENTIALS_FILE')
137+
138 lp = Launchpad.login_with(
139 API_NAME, args.lp_instance,
140- credentials_file=args.credentials,
141+ credentials_file=credentials,
142 version='devel')
143
144 try:
145diff --git a/copy-package b/copy-package
146index db9db20..5a72306 100755
147--- a/copy-package
148+++ b/copy-package
149@@ -20,6 +20,7 @@
150 from __future__ import print_function
151
152 import argparse
153+import os
154 import sys
155
156 from launchpadlib.errors import HTTPError
157@@ -180,7 +181,8 @@ def main():
158 args = parser.parse_args()
159
160 args.launchpad = Launchpad.login_with(
161- "copy-package", args.launchpad_instance, version="devel")
162+ "copy-package", args.launchpad_instance, version="devel",
163+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
164 args.destination = argparse.Namespace()
165 args.destination.launchpad = args.launchpad
166 args.destination.suite = args.to_suite or args.suite
167diff --git a/copy-proposed-kernel b/copy-proposed-kernel
168index c751493..1e665ea 100755
169--- a/copy-proposed-kernel
170+++ b/copy-proposed-kernel
171@@ -27,6 +27,7 @@ import argparse
172 from contextlib import contextmanager
173 from copy import copy
174 from io import StringIO
175+import os
176 import sys
177 import unittest
178
179@@ -544,7 +545,8 @@ release = args.series
180 ks = KernelSeries()
181
182 launchpad = Launchpad.login_with(
183- 'ubuntu-archive-tools', 'production', version='devel')
184+ 'ubuntu-archive-tools', 'production', version='devel',
185+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
186 ubuntu = launchpad.distributions['ubuntu']
187 distro_series = ubuntu.getSeries(name_or_version=release)
188
189diff --git a/copy-report b/copy-report
190index 5764e38..cace964 100755
191--- a/copy-report
192+++ b/copy-report
193@@ -232,7 +232,8 @@ def main():
194 options, args = parser.parse_args()
195
196 options.launchpad = Launchpad.login_with(
197- "copy-report", options.launchpad_instance, version="devel")
198+ "copy-report", options.launchpad_instance, version="devel",
199+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
200 options.distro = options.launchpad.distributions["ubuntu"]
201 options.archive = options.distro.main_archive
202 options.mirrors = options.mirrors.split(":")
203diff --git a/demote-to-proposed b/demote-to-proposed
204index 4264b91..6b8ab77 100755
205--- a/demote-to-proposed
206+++ b/demote-to-proposed
207@@ -29,6 +29,7 @@ This is analogous to removing a package from Debian testing.
208 from __future__ import print_function
209
210 from optparse import OptionParser
211+import os
212 import sys
213
214 from launchpadlib.launchpad import Launchpad
215@@ -100,7 +101,8 @@ def main():
216 options, args = parser.parse_args()
217
218 options.launchpad = Launchpad.login_with(
219- "demote-to-proposed", options.launchpad_instance, version="devel")
220+ "demote-to-proposed", options.launchpad_instance, version="devel",
221+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
222 lputils.setup_location(options)
223
224 if options.comment is None:
225diff --git a/derive-distribution b/derive-distribution
226index 65d62b3..8048c88 100755
227--- a/derive-distribution
228+++ b/derive-distribution
229@@ -488,7 +488,8 @@ def main():
230 # Work around old service root in some versions of launchpadlib.
231 options.launchpad_instance = "https://api.dogfood.paddev.net/"
232 options.launchpad = Launchpad.login_with(
233- "derive-distribution", options.launchpad_instance, version="devel")
234+ "derive-distribution", options.launchpad_instance, version="devel",
235+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
236 lputils.setup_location(options)
237 options.destination = Values()
238 options.destination.launchpad = options.launchpad
239diff --git a/edit-acl b/edit-acl
240index 5c840ab..5c18617 100755
241--- a/edit-acl
242+++ b/edit-acl
243@@ -25,6 +25,7 @@
244 from __future__ import print_function
245
246 import argparse
247+import os
248 import sys
249
250 import launchpadlib.errors
251@@ -702,7 +703,8 @@ if __name__ == '__main__':
252 CONSUMER_KEY, args.launchpad_instance, version="devel")
253 else:
254 launchpad = Launchpad.login_with(
255- CONSUMER_KEY, args.launchpad_instance, version="devel")
256+ CONSUMER_KEY, args.launchpad_instance, version="devel",
257+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
258
259 args.archive = get_archive(args, launchpad)
260 args.distro = args.archive.distribution
261diff --git a/get-distro-update-metrics b/get-distro-update-metrics
262index 4ff099a..d1ed6c4 100755
263--- a/get-distro-update-metrics
264+++ b/get-distro-update-metrics
265@@ -9,6 +9,7 @@ from collections import defaultdict
266 import csv
267 import logging
268 from optparse import OptionParser
269+import os
270 import sys
271
272 from launchpadlib.launchpad import Launchpad
273@@ -64,8 +65,12 @@ def main(argv):
274 log_level = logging.WARNING
275 logging.basicConfig(level=log_level)
276
277+ credentials = options.credentials
278+ if credentials is None:
279+ credentials = os.environ.get('LP_CREDENTIALS_FILE')
280+
281 lp = Launchpad.login_with(
282- API_NAME, options.lp_instance, credentials_file=options.credentials,
283+ API_NAME, options.lp_instance, credentials_file=credentials,
284 version='devel')
285
286 try:
287diff --git a/import-blacklist b/import-blacklist
288index 1d47707..6195c17 100755
289--- a/import-blacklist
290+++ b/import-blacklist
291@@ -16,6 +16,7 @@
292 # along with this program. If not, see <http://www.gnu.org/licenses/>.
293
294 from optparse import OptionParser
295+import os
296 import re
297
298 from launchpadlib.launchpad import Launchpad
299@@ -51,7 +52,8 @@ def main():
300 blacklist = args[0]
301
302 lp = Launchpad.login_with(
303- 'sync-blacklist', options.launchpad_instance, version='devel')
304+ 'sync-blacklist', options.launchpad_instance, version='devel',
305+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
306 ubuntu = lp.distributions['ubuntu']
307 debian = lp.distributions['debian']
308
309diff --git a/kernel-overrides b/kernel-overrides
310index fbfc3c6..47304b3 100755
311--- a/kernel-overrides
312+++ b/kernel-overrides
313@@ -224,7 +224,8 @@ def main():
314 newabi = args[0]
315
316 options.launchpad = Launchpad.login_with(
317- CONSUMER_KEY, options.launchpad_instance, version="devel")
318+ CONSUMER_KEY, options.launchpad_instance, version="devel",
319+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
320
321 if options.suite is None:
322 distribution = options.launchpad.distributions[options.distribution]
323diff --git a/kernel-sru-release b/kernel-sru-release
324index a324837..111f562 100755
325--- a/kernel-sru-release
326+++ b/kernel-sru-release
327@@ -24,6 +24,7 @@ USAGE:
328 kernel-sru-release <bug> [<bug> ...]
329 """
330
331+import os
332 import re
333 import subprocess
334 from optparse import OptionParser
335@@ -96,6 +97,7 @@ if __name__ == '__main__':
336 options, bugs = parser.parse_args()
337
338 launchpad = Launchpad.login_with(
339- 'ubuntu-archive-tools', options.launchpad_instance, version='devel')
340+ 'ubuntu-archive-tools', options.launchpad_instance, version='devel',
341+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
342
343 process_sru_bugs(launchpad, bugs)
344diff --git a/kernel-sru-review b/kernel-sru-review
345index 6eef909..1b63e3d 100755
346--- a/kernel-sru-review
347+++ b/kernel-sru-review
348@@ -462,7 +462,8 @@ if __name__ == '__main__':
349 'Invalid tarball directory specified (%s)' % tardir)
350
351 launchpad = Launchpad.login_with(
352- 'ubuntu-archive-tools', opts.launchpad_instance, version='devel')
353+ 'ubuntu-archive-tools', opts.launchpad_instance, version='devel',
354+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
355
356 ubuntu = launchpad.distributions['ubuntu']
357 # for ESM (precise) we use special PPAs for CKT testing, -proposed and
358diff --git a/manage-builders b/manage-builders
359index 445515a..7cf0bd6 100755
360--- a/manage-builders
361+++ b/manage-builders
362@@ -24,6 +24,7 @@ from datetime import (
363 timedelta,
364 )
365 from itertools import groupby
366+import os
367 import re
368 from textwrap import dedent
369
370@@ -164,7 +165,8 @@ if args.set_vm_host is not None:
371 changes['vm_host'] = args.set_vm_host or None
372
373 lp = Launchpad.login_with(
374- 'manage-builders', args.lp_instance, version='devel')
375+ 'manage-builders', args.lp_instance, version='devel',
376+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
377
378 processor_names = {p.self_link: p.name for p in lp.processors}
379
380diff --git a/manage-chroot b/manage-chroot
381index 51fb45c..93861d8 100755
382--- a/manage-chroot
383+++ b/manage-chroot
384@@ -25,6 +25,7 @@ import argparse
385 from collections import OrderedDict
386 import hashlib
387 import subprocess
388+import os
389 import sys
390
391 from launchpadlib.launchpad import Launchpad
392@@ -317,11 +318,12 @@ def main():
393 parser.error("Unknown image type '%s'." % args.image_type)
394
395 if args.command in ("get", "info"):
396- login_method = Launchpad.login_anonymously
397+ args.launchpad = Launchpad.login_anonymously(
398+ "manage-chroot", args.launchpad_instance, version="devel")
399 else:
400- login_method = Launchpad.login_with
401- args.launchpad = login_method(
402- "manage-chroot", args.launchpad_instance, version="devel")
403+ args.launchpad = Launchpad.login_with(
404+ "manage-chroot", args.launchpad_instance, version="devel",
405+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
406 lputils.setup_location(args)
407
408 if args.command == "set":
409diff --git a/mark-suite-dirty b/mark-suite-dirty
410index 2f8e652..becd016 100755
411--- a/mark-suite-dirty
412+++ b/mark-suite-dirty
413@@ -24,6 +24,7 @@ republish a suite even though it isn't itself aware of a reason to do so.
414 from __future__ import print_function
415
416 from optparse import OptionParser
417+import os
418 import sys
419
420 from launchpadlib.launchpad import Launchpad
421@@ -57,7 +58,8 @@ def main():
422
423 options.distribution = "ubuntu"
424 options.launchpad = Launchpad.login_with(
425- "mark-suite-dirty", options.launchpad_instance, version="devel")
426+ "mark-suite-dirty", options.launchpad_instance, version="devel",
427+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
428 lputils.setup_location(options)
429
430 mark_suite_dirty(options)
431diff --git a/move-milestoned-bugs b/move-milestoned-bugs
432index 669db77..672605f 100755
433--- a/move-milestoned-bugs
434+++ b/move-milestoned-bugs
435@@ -19,6 +19,7 @@
436 # the milestone was released.
437
438 import optparse
439+import os
440 import sys
441
442 from launchpadlib.launchpad import Launchpad
443@@ -52,7 +53,8 @@ if __name__ == '__main__':
444 (options, (from_ms, to_ms)) = parse_args()
445
446 launchpad = Launchpad.login_with(
447- 'ubuntu-archive-tools', options.launchpad_instance)
448+ 'ubuntu-archive-tools', options.launchpad_instance,
449+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
450 ubuntu = launchpad.distributions['ubuntu']
451 if options.series:
452 distro_series = ubuntu.getSeries(name_or_version=options.series)
453diff --git a/new-binary-debian-universe b/new-binary-debian-universe
454index 821b1eb..9fcf426 100755
455--- a/new-binary-debian-universe
456+++ b/new-binary-debian-universe
457@@ -152,7 +152,8 @@ def main():
458 options, _ = parser.parse_args()
459
460 options.launchpad = Launchpad.login_with(
461- CONSUMER_KEY, options.launchpad_instance, version="devel")
462+ CONSUMER_KEY, options.launchpad_instance, version="devel",
463+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
464 explicit_suite = options.suite is not None
465 lputils.setup_location(options)
466
467diff --git a/package-subscribers b/package-subscribers
468index 4925119..4c6da0c 100755
469--- a/package-subscribers
470+++ b/package-subscribers
471@@ -8,6 +8,7 @@ import lzma
472 from optparse import OptionParser
473 import requests
474 import shutil
475+import os
476 import sys
477 import tempfile
478
479@@ -90,7 +91,8 @@ def main():
480 options.suite = None
481 options.distribution = "ubuntu"
482 options.launchpad = Launchpad.login_with(
483- "unsubscribed-packages", options.launchpad_instance)
484+ "unsubscribed-packages", options.launchpad_instance,
485+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
486 launchpad = options.launchpad
487 ubuntu = launchpad.distributions[options.distribution]
488 options.suites = []
489diff --git a/packageset-report b/packageset-report
490index b8b51ef..8d81916 100755
491--- a/packageset-report
492+++ b/packageset-report
493@@ -33,7 +33,9 @@ args = parser.parse_args()
494
495 # Authenticated login to Launchpad as anonymous
496 # doesn't let us list the uploaders
497-lp = Launchpad.login_with('package_sets_report', 'production')
498+lp = Launchpad.login_with(
499+ 'package_sets_report', 'production',
500+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
501
502 ubuntu = lp.distributions['ubuntu']
503
504diff --git a/permissions-report b/permissions-report
505index 7ca9c4f..230f2b0 100755
506--- a/permissions-report
507+++ b/permissions-report
508@@ -30,7 +30,9 @@ args = parser.parse_args()
509 if not os.path.exists(args.target):
510 os.makedirs(args.target)
511
512-lp = Launchpad.login_with('permissions', 'production', version="devel")
513+lp = Launchpad.login_with(
514+ 'permissions', 'production', version="devel",
515+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
516
517 entries = {"teams": {}, "individuals": {}}
518
519diff --git a/phased-updater b/phased-updater
520index cdd945c..fe570bc 100755
521--- a/phased-updater
522+++ b/phased-updater
523@@ -791,7 +791,8 @@ if __name__ == '__main__':
524 parser.error("Sending emails and fully phased updates are mutually \
525 exclusive.")
526 launchpad = Launchpad.login_with(
527- 'phased-updater', options.launchpad_instance, version='devel')
528+ 'phased-updater', options.launchpad_instance, version='devel',
529+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
530 logging.basicConfig(filename='phased-updates.log',
531 format='%(asctime)s - %(levelname)s - %(message)s',
532 level=logging.INFO)
533diff --git a/pocket-mismatches b/pocket-mismatches
534index d2027e9..47c1e16 100755
535--- a/pocket-mismatches
536+++ b/pocket-mismatches
537@@ -171,7 +171,8 @@ def main():
538 options, args = parser.parse_args()
539
540 launchpad = Launchpad.login_with(
541- "pocket-mismatches", options.launchpad_instance)
542+ "pocket-mismatches", options.launchpad_instance,
543+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
544 if options.series is not None:
545 all_series = options.series.split(',')
546 else:
547diff --git a/process-removals b/process-removals
548index e0c704a..fd503a6 100755
549--- a/process-removals
550+++ b/process-removals
551@@ -410,7 +410,8 @@ def main():
552 CONSUMER_KEY, options.launchpad_instance)
553 else:
554 options.launchpad = Launchpad.login_with(
555- CONSUMER_KEY, options.launchpad_instance)
556+ CONSUMER_KEY, options.launchpad_instance,
557+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
558
559 options.distribution = options.launchpad.distributions["ubuntu"]
560 options.series = options.distribution.current_series
561diff --git a/promote-to-release b/promote-to-release
562index 496c665..aa07da9 100755
563--- a/promote-to-release
564+++ b/promote-to-release
565@@ -18,6 +18,7 @@
566 """Promote packages to release pocket based on britney output."""
567
568 from optparse import OptionParser
569+import os
570 import sys
571
572 from launchpadlib.errors import HTTPError
573@@ -150,7 +151,8 @@ def main():
574 options.pocket)
575
576 options.launchpad = Launchpad.login_with(
577- "promote-to-release", options.launchpad_instance, version="devel")
578+ "promote-to-release", options.launchpad_instance, version="devel",
579+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
580 lputils.setup_location(options)
581 options.dases = {}
582 for das in options.series.architectures:
583diff --git a/queue b/queue
584index cdde30d..0c237d6 100755
585--- a/queue
586+++ b/queue
587@@ -483,7 +483,8 @@ def main():
588 parser.error("rejections must supply a rejection comment")
589
590 options.launchpad = Launchpad.login_with(
591- CONSUMER_KEY, options.launchpad_instance, version="devel")
592+ CONSUMER_KEY, options.launchpad_instance, version="devel",
593+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
594
595 options.queue = options.queue.title()
596 lputils.setup_location(options, default_pocket="Proposed")
597diff --git a/regression-proposed-bug-search b/regression-proposed-bug-search
598index d4abb69..6324abe 100755
599--- a/regression-proposed-bug-search
600+++ b/regression-proposed-bug-search
601@@ -21,6 +21,7 @@
602 # tagged bugs that contain the version of the package from -proposed
603
604 import optparse
605+import os
606
607 from launchpadlib.launchpad import Launchpad
608
609@@ -59,7 +60,8 @@ if __name__ == '__main__':
610 )
611
612 lp = Launchpad.login_with(
613- 'ubuntu-archive-tools', 'production', version='devel')
614+ 'ubuntu-archive-tools', 'production', version='devel',
615+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
616
617 ubuntu = lp.distributions['ubuntu']
618 archive = ubuntu.getArchive(name='primary')
619diff --git a/remove-package b/remove-package
620index 1f44a37..8a8106d 100755
621--- a/remove-package
622+++ b/remove-package
623@@ -20,6 +20,7 @@
624 from __future__ import print_function
625
626 from optparse import OptionParser, SUPPRESS_HELP
627+import os
628 import sys
629
630 from launchpadlib.launchpad import Launchpad
631@@ -132,7 +133,8 @@ def main():
632 options, args = parser.parse_args()
633
634 options.launchpad = Launchpad.login_with(
635- "remove-package", options.launchpad_instance, version="devel")
636+ "remove-package", options.launchpad_instance, version="devel",
637+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
638 lputils.setup_location(options)
639
640 if options.removal_comment is None:
641diff --git a/rescore-ppa-builds b/rescore-ppa-builds
642index 173b5ac..452c657 100755
643--- a/rescore-ppa-builds
644+++ b/rescore-ppa-builds
645@@ -16,6 +16,8 @@
646 # You should have received a copy of the GNU General Public License
647 # along with this program. If not, see <http://www.gnu.org/licenses/>.
648
649+import os
650+
651 from optparse import OptionParser
652
653 from launchpadlib.launchpad import Launchpad
654@@ -31,7 +33,8 @@ if len(args) != 2:
655 owner, name = args
656
657 launchpad = Launchpad.login_with(
658- 'rescore-ppa-builds', options.launchpad_instance)
659+ 'rescore-ppa-builds', options.launchpad_instance,
660+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
661 ppa = launchpad.people[owner].getPPAByName(name=name)
662
663 for build in ppa.getBuildRecords(build_state='Needs building'):
664diff --git a/sru-accept b/sru-accept
665index 71bc888..c9045b4 100755
666--- a/sru-accept
667+++ b/sru-accept
668@@ -17,6 +17,7 @@
669 """Adjust SRU bugs after accepting the corresponding update."""
670
671 from optparse import OptionParser
672+import os
673 import re
674 import sys
675
676@@ -60,7 +61,9 @@ if __name__ == '__main__':
677 print('A package version (-v) was not provided.')
678 sys.exit(1)
679
680- launchpad = Launchpad.login_with(CONSUMER_KEY, options.launchpad_instance)
681+ launchpad = Launchpad.login_with(
682+ CONSUMER_KEY, options.launchpad_instance,
683+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
684 if not options.targets:
685 options.targets = [[
686 series.name for series in launchpad.distributions["ubuntu"].series
687diff --git a/sru-release b/sru-release
688index a72eef3..9708f4f 100755
689--- a/sru-release
690+++ b/sru-release
691@@ -479,7 +479,8 @@ if __name__ == '__main__':
692 os.makedirs(options.cache)
693
694 launchpad = Launchpad.login_with(
695- 'ubuntu-archive-tools', options.launchpad_instance, version='devel')
696+ 'ubuntu-archive-tools', options.launchpad_instance, version='devel',
697+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
698 ubuntu = launchpad.distributions['ubuntu']
699 series = ubuntu.getSeries(name_or_version=release)
700 devel_series = ubuntu.current_series
701diff --git a/sru-remove b/sru-remove
702index 815dd8d..a8131b5 100755
703--- a/sru-remove
704+++ b/sru-remove
705@@ -28,6 +28,7 @@ USAGE:
706 from __future__ import print_function
707
708 import optparse
709+import os
710 import re
711 import subprocess
712 import sys
713@@ -147,8 +148,9 @@ if __name__ == '__main__':
714 removal_comment = ('The package was removed due to its SRU bug(s) '
715 'not being verified in a timely fashion.')
716
717- launchpad = Launchpad.login_with('sru-remove', opts.launchpad_instance,
718- version="devel")
719+ launchpad = Launchpad.login_with(
720+ 'sru-remove', opts.launchpad_instance, version="devel",
721+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
722 ubuntu = launchpad.distributions['ubuntu']
723 # determine series for which we issue SRUs
724 supported_series = []
725diff --git a/sru-review b/sru-review
726index c6650c0..081734f 100755
727--- a/sru-review
728+++ b/sru-review
729@@ -345,8 +345,9 @@ if __name__ == '__main__':
730
731 (opts, sourcepkg) = parse_options()
732
733- launchpad = Launchpad.login_with('sru-review', opts.launchpad_instance,
734- version="devel")
735+ launchpad = Launchpad.login_with(
736+ 'sru-review', opts.launchpad_instance, version="devel",
737+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
738 ubuntu = launchpad.distributions['ubuntu']
739 series = ubuntu.getSeries(name_or_version=opts.release)
740 archive = ubuntu.main_archive
741diff --git a/sync-blacklist b/sync-blacklist
742index 2fd94dc..2f59523 100755
743--- a/sync-blacklist
744+++ b/sync-blacklist
745@@ -15,6 +15,8 @@
746 # You should have received a copy of the GNU General Public License
747 # along with this program. If not, see <http://www.gnu.org/licenses/>.
748
749+import os
750+
751 from optparse import OptionParser
752
753 from launchpadlib.launchpad import Launchpad
754@@ -30,7 +32,8 @@ def main():
755 output = args[0]
756
757 lp = Launchpad.login_with(
758- 'sync-blacklist', options.launchpad_instance, version='devel')
759+ 'sync-blacklist', options.launchpad_instance, version='devel',
760+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
761 ubuntu = lp.distributions['ubuntu']
762
763 devel_series = ubuntu.current_series
764diff --git a/unsubscribe-team b/unsubscribe-team
765index 24638dd..b4be0d7 100755
766--- a/unsubscribe-team
767+++ b/unsubscribe-team
768@@ -5,6 +5,7 @@
769
770 from launchpadlib.launchpad import Launchpad
771 import optparse
772+import os
773 import sys
774 from urllib.request import urlopen
775 from package_subscribers import source_names
776@@ -76,7 +77,8 @@ def main(argv):
777 'You must specify at least one user, see --help')
778
779 lp = Launchpad.login_with(
780- "unsubscribe-team", options.lp_instance, version='devel')
781+ "unsubscribe-team", options.lp_instance, version='devel',
782+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
783
784 ubuntu = lp.distributions['ubuntu']
785
786diff --git a/update-i386-whitelist b/update-i386-whitelist
787index 7032f23..2b6d9b8 100755
788--- a/update-i386-whitelist
789+++ b/update-i386-whitelist
790@@ -25,6 +25,7 @@ USAGE:
791 from launchpadlib.launchpad import Launchpad
792 import optparse
793 from urllib.request import urlopen
794+import os
795 import sys
796 import glob
797
798@@ -70,9 +71,9 @@ if __name__ == '__main__':
799
800 (opts, url) = parse_options()
801
802- launchpad = Launchpad.login_with('update-i386-whitelist',
803- 'production',
804- version="devel")
805+ launchpad = Launchpad.login_with(
806+ 'update-i386-whitelist', 'production', version="devel",
807+ credentials_file=os.environ.get('LP_CREDENTIALS_FILE'))
808 ubuntu = launchpad.distributions['ubuntu']
809 series = ubuntu.getSeries(name_or_version=opts.release)
810 archive = ubuntu.main_archive

Subscribers

People subscribed via source and target branches