Log syncpackage LP auth errors before halting

This commit is contained in:
Athos Ribeiro 2023-06-01 12:29:30 -03:00 committed by Gianfranco Costamagna
parent 9a4cc312f4
commit 6bc59d789e
2 changed files with 7 additions and 3 deletions

3
debian/changelog vendored
View File

@ -2,6 +2,9 @@ ubuntu-dev-tools (0.200) UNRELEASED; urgency=medium
* Add support to see currently running autopkgtests (running-autopkgtests)
[ Athos Ribeiro ]
* syncpackage: log LP authentication errors before halting.
-- Chris Peterson <chris.peterson@canonical.com> Wed, 14 Feb 2024 14:58:30 -0800
ubuntu-dev-tools (0.199) unstable; urgency=medium

View File

@ -652,14 +652,15 @@ def main():
if args.lpinstance is None:
args.lpinstance = config.get_value("LPINSTANCE")
# devel for copyPackage and changelogUrl
kwargs = {"service": args.lpinstance, "api_version": "devel"}
try:
# devel for copyPackage and changelogUrl
kwargs = {"service": args.lpinstance, "api_version": "devel"}
if args.lp and not args.simulate:
Launchpad.login(**kwargs)
else:
Launchpad.login_anonymously(**kwargs)
except IOError:
except IOError as e:
Logger.error("Could not authenticate to LP: %s", str(e))
sys.exit(1)
if args.release is None: