Skip to content

Commit f9ee248

Browse files
authored
Merge pull request #40 from khaddict/master
Add exceptions on action.py
2 parents aa81a24 + 385bece commit f9ee248

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 3.0.6
4+
5+
- Add exceptions on action.py
6+
37
## 3.0.5
48

59
- Bug fix: Tags fields need additional translation when modifying

actions/lib/action.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,9 @@ def make_request(self, endpoint_uri, http_action, **kwargs):
7373
)
7474

7575
if r:
76-
return {"raw": r.json(), "status": r.status_code}
76+
try:
77+
raw = r.json()
78+
except ValueError:
79+
raw = r.text
80+
return {"raw": raw, "status": r.status_code}
7781
return {"raw": {}, "status": 404}

pack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords:
66
- networking
77
- ipam
88
- dcim
9-
version: 3.0.5
9+
version: 3.0.6
1010
author: John Anderson, Jefferson White
1111
1212
python_versions:

0 commit comments

Comments
 (0)