From 152220567d24a940107913c283908a5c15432be7 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sat, 17 Jan 2009 11:14:40 +0000 Subject: [PATCH] * requestsync: Catch credentials error to hide traceback. --- common.py | 1 + debian/changelog | 1 + requestsync | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/common.py b/common.py index ba67284..1ab9094 100644 --- a/common.py +++ b/common.py @@ -290,6 +290,7 @@ def find_credentials(consumer, files, level=None): continue if cred.consumer.key == consumer: return cred + raise IOError("No credentials found for '%s', please see the " \ "manage-credentials manpage for help on how to create " \ "one for this consumer." % consumer) diff --git a/debian/changelog b/debian/changelog index 22c72e8..8978bd7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ ubuntu-dev-tools (0.56) UNRELEASED; urgency=low folder world unreadable. * common.py: Improved no credentials found error message to show which consumer token is needed. + * requestsync: Catch credentials error to hide traceback. -- Jonathan Davies Thu, 15 Jan 2009 12:35:12 +0000 diff --git a/requestsync b/requestsync index cd2f954..fff62d8 100755 --- a/requestsync +++ b/requestsync @@ -104,6 +104,10 @@ def checkExistingReports(package): "manually check at:" print "- https://bugs.launchpad.net/ubuntu/+source/%s" % package return False + except IOError, msg: + # No credentials found. + print msg + sys.exit(1) # Fetch the package's bug list from Launchpad. pkg = launchpad.distributions["ubuntu"].getSourcePackage(name=package) @@ -343,6 +347,10 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext): except ImportError: print >> sys.stderr, 'Importing launchpadlib failed. Is python-launchpadlib installed?' return False + except IOError, msg: + # No credentials found. + print msg + sys.exit(1) if source_package: product_url = "%subuntu/+source/%s" %(launchpad._root_uri, source_package)