diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-07-10 16:42:41 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-07-10 16:42:41 -0400 |
commit | 944cd04f4f15d0f52dd760ee36bc9462d427076f (patch) | |
tree | 29e36bbe0bd260d3842c7b9ae060741cfa678e5a /module | |
parent | 832ce2533fcbf9173703b95f01141e583351d56e (diff) | |
download | phosphor-rest-server-944cd04f4f15d0f52dd760ee36bc9462d427076f.tar.gz phosphor-rest-server-944cd04f4f15d0f52dd760ee36bc9462d427076f.zip |
Allow json response plugin to be suppressed
Add a static class member suppress_json_resp that when
set to True will prevent the JsonApiResp plugin from
responding with a json wrapper.
Change-Id: I43aadb6b59bb21ef53e5252e4878157c8e13935e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'module')
-rw-r--r-- | module/obmc/wsgi/apps/rest_dbus.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py index 43d1f03..8cbbabc 100644 --- a/module/obmc/wsgi/apps/rest_dbus.py +++ b/module/obmc/wsgi/apps/rest_dbus.py @@ -713,6 +713,7 @@ class DownloadDumpHandler(RouteHandler): content_type = 'application/octet-stream' ''' TODO openbmc/issues #1795, Change dump path''' dump_loc = '/tmp/dumps' + suppress_json_resp = True def __init__(self, app, bus): super(DownloadDumpHandler, self).__init__( @@ -934,9 +935,9 @@ class JsonApiResponsePlugin(object): app.install_error_callback(self.error_callback) def apply(self, callback, route): - content_type = getattr( - route.get_undecorated_callback(), '_content_type', None) - if self.json_type != content_type: + skip = getattr( + route.get_undecorated_callback(), 'suppress_json_resp', None) + if skip: return callback def wrap(*a, **kw): |