Also modify grab-attachments, hugdaylist, update-maintainer to bail on no creds

This commit is contained in:
Iain Lane 2009-11-07 19:34:59 +00:00
parent 6db05720f3
commit 1973bde3e0
4 changed files with 40 additions and 20 deletions

7
debian/changelog vendored
View File

@ -7,10 +7,11 @@ ubuntu-dev-tools (0.83) UNRELEASED; urgency=low
default release if we aren't using it. (LP: #477670)
* pull-lp-source: Detect more failure conditions and give a nice error
instead of a trace
* buildd, requestsync: Detect & bail if we don't have credentials and need
them. These scripts cannot continue under those circumstances.
* buildd, requestsync, grab-attachments, hugdaylist, update-maintainer:
Detect & bail if we don't have credentials and need them. These scripts
cannot continue under those circumstances.
-- Iain Lane <laney@ubuntu.com> Sat, 07 Nov 2009 19:18:27 +0000
-- Iain Lane <laney@ubuntu.com> Sat, 07 Nov 2009 19:34:25 +0000
ubuntu-dev-tools (0.82) lucid; urgency=low

View File

@ -33,23 +33,30 @@ def main():
print USAGE
sys.exit(0)
launchpad = get_launchpad("ubuntu-dev-tools")
for arg in sys.argv[1:]:
try:
number = int(arg)
except:
print >> sys.stderr, "'%s' is not a valid bug number." % arg
sys.exit(1)
try:
launchpad = get_launchpad("ubuntu-dev-tools")
b = launchpad.bugs[number]
for a in b.attachments:
f = a.data.open()
filename = os.path.join(os.getcwd(), f.filename)
local_file = open(filename, "w")
local_file.write(f.read())
f.close()
local_file.close()
for arg in sys.argv[1:]:
try:
number = int(arg)
except:
print >> sys.stderr, "'%s' is not a valid bug number." % arg
sys.exit(1)
b = launchpad.bugs[number]
for a in b.attachments:
f = a.data.open()
filename = os.path.join(os.getcwd(), f.filename)
local_file = open(filename, "w")
local_file.write(f.read())
f.close()
local_file.close()
# no LP credentials
except IOError, e:
print e
sys.exit(1)
if __name__ == '__main__':
main()

View File

@ -88,7 +88,13 @@ def main():
print >> sys.stderr, "Options in url are not supported, url: %s" %url
sys.exit(1)
launchpad = get_launchpad("ubuntu-dev-tools")
launchpad = None
try:
launchpad = get_launchpad("ubuntu-dev-tools")
except IOError, e:
print e
sys.exit(1)
api_url = translate_web_api(url, launchpad)
try:
product = launchpad.load(api_url)

View File

@ -31,6 +31,12 @@ import re
import sys
import ubuntutools.packages
# Cannot work without LP credentials
try:
Launchpad.login()
except IOError:
sys.exit(1)
valid_locations = ["debian/control.in", "control.in", "debian/control", "control"]
control_file_found = False