Search code examples
pythongerrit

Rest api of gerrit gives the response but Python-gerrit-api package for fetching revisions gives status 404


Documentation: https://python-gerrit-api.readthedocs.io/en/latest/

Code

gerrit = GerritClient(base_url="https://gerrit.xx.com",username='xxx',password='xxx')

change = gerrit.changes.get("xxx")

ab=change.get_revision("32423")

print(ab.get_commit().list_change_files())

Question

For some endpoints, I am able to send get responses from the rest api but via this package I get this error(gerrit.utils.exceptions.NotFoundError: 404 Client Error). I am able to get response from Get Rest api for this url: gerrit.xx.xx.com/a/projects/xxxx/commits/xxxx/files via postman. But error with above code.


Solution

  • Looks like this is a bug, I have fixed it and made a pull request. See: https://github.com/shijl0925/python-gerrit-api/pull/5