from launchpadlib.launchpad import Launchpad
LP = Launchpad.login_anonymously('metrics', 'production', version='devel')
repo = LP.git_repositories.getByPath(path='cloud-init')
>>> repo.rescan()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 609, in __call__
extra_headers=extra_headers)
File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 426, in _request
raise error
lazr.restfulclient.errors.Unauthorized: HTTP Error 401: Unauthorized
Response headers:
---
-content-encoding: gzip
content-length: 98
content-type: text/plain
date: Tue, 30 May 2017 19:13:43 GMT
server: zope.server.http (HTTP)
status: 401
strict-transport-security: max-age=15552000
vary: Accept,Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: 18391
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-xss-protection: 1; mode=block
---
Response body:
---
b"(<GitRepository u'~cloud-init-dev/cloud-init/+git/cloud-init' (6520)>, 'rescan', 'launchpad.Edit')"
---