summaryrefslogtreecommitdiff
path: root/ironic/api/method.py
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2020-07-17 13:12:13 +1200
committerSteve Baker <sbaker@redhat.com>2020-11-16 10:49:56 +1300
commit6a906a9d8f86c081da89871f26ade2b16e4ebd94 (patch)
tree9601f7aa7142e61490c6572ba466420efa1a11be /ironic/api/method.py
parent284e22bc086ddaffbd4473b23b04a6165dca9c44 (diff)
downloadironic-6a906a9d8f86c081da89871f26ade2b16e4ebd94.tar.gz
Convert drivers endpoint to plain JSON
Change-Id: If8d9ee3c98e21d3428336a2eec2b704bb109c4ac Story: 1651346 Task: 10551
Diffstat (limited to 'ironic/api/method.py')
-rw-r--r--ironic/api/method.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ironic/api/method.py b/ironic/api/method.py
index 48bd8caa0..6afdb1622 100644
--- a/ironic/api/method.py
+++ b/ironic/api/method.py
@@ -91,7 +91,10 @@ def body(body_arg):
@functools.wraps(function)
def inner_body(*args, **kwargs):
- data = pecan.request.json
+ if pecan.request.body:
+ data = pecan.request.json
+ else:
+ data = {}
if isinstance(data, dict):
# remove any keyword arguments which pecan has
# extracted from the body