Skip to content

Commit

Permalink
raise error directly from response
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Ji committed May 6, 2020
1 parent 4716673 commit d9c28e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pubtools/pulplib/_impl/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ def __init__(self, url, **kwargs):
# run an initial auth request to validate url and credentials
# failed response status will raise exception
url = os.path.join(self._url, "pulp/api/v2/actions/login/")
res = self._do_request(method="POST", url=url, json={})
self._unpack_response(res)

response = self._do_request(method="POST", url=url, json={})
response.raise_for_status()

def get_repository(self, repository_id):
"""Get a repository by ID.
Expand Down

0 comments on commit d9c28e1

Please sign in to comment.