Skip to content

Commit

Permalink
Reviewed request with error on auton client.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Delle Cave committed Oct 31, 2019
1 parent b61a5ed commit 57887fa
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
auton (0.2.4) unstable; urgency=medium

* Reviewed request with error on auton client.

-- Adrien DELLE CAVE <adrien.delle.cave@commandersact.com> Thu, 31 Oct 2019 16:14:30 +0100

auton (0.2.3) unstable; urgency=medium

* Raise if request error on auton client.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.3
0.2.4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.3
0.2.4
24 changes: 17 additions & 7 deletions bin/auton
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
"""auton"""

__version__ = '0.2.3'
__version__ = '0.2.4'

import argparse
import os
Expand Down Expand Up @@ -279,11 +279,16 @@ class AutonClient(object): # pylint: disable=useless-object-inheritance
if not self.uri:
raise exceptions.ConnectionError("unable to connect autond")

req.raise_for_status()

if not req.text:
return self._check_results()
return self._check_results(req.json())

try:
rs = req.json()
except ValueError:
req.raise_for_status()
return self._check_results()

return self._check_results(rs)
finally:
if req:
req.close()
Expand All @@ -309,11 +314,16 @@ class AutonClient(object): # pylint: disable=useless-object-inheritance
auth = self._auth,
headers = self._build_headers())

req.raise_for_status()

if not req.text:
return self._check_results()
return self._check_results(req.json())

try:
rs = req.json()
except ValueError:
req.raise_for_status()
return self._check_results()

return self._check_results(rs)
finally:
if req:
req.close()
Expand Down
2 changes: 1 addition & 1 deletion bin/autond
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
"""autond"""

__version__ = '0.2.3'
__version__ = '0.2.4'

import argparse
import logging
Expand Down
4 changes: 2 additions & 2 deletions setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
author: Adrien Delle Cave
author_email: pypi@doowan.net
copyright: '2019 fjord-technologies'
release: '0.2.3'
version: '0.2.3'
release: '0.2.4'
version: '0.2.4'
license: License GPL-3
url: https://github.com/decryptus/auton
python_requires:
Expand Down

0 comments on commit 57887fa

Please sign in to comment.