Change in ovirt-engine-sdk[master]: Check content type only when really needed

Code Review gerrit at ovirt.org
Thu May 4 13:32:04 UTC 2017


>From Ondra Machacek <omachace at redhat.com>:

Ondra Machacek has submitted this change and it was merged.

Change subject: Check content type only when really needed
......................................................................


Check content type only when really needed

Currently the SDK checks the content type of all responses, even of
responses where the content type doesn't need to be provided. For
example, when a 404 error code is generated by the application server,
or by the web server, the content type may not be present, or may be
HTML. In these situations the SDK is not reacting correctly, as the
message that explains that the content type isn't correct is hiding
other more important messages, like the HTTP result code. To avoid that
this patch changes the SDK so that it will check the content type only
when it really tries to parse the response body. In addition, the patch
also changes the generated messages, so that the HTTP details, including
the HTTP error code, will appear in the message in all cases.

Change-Id: I005460365bce78acb020200cac770073427b617e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1440292
Related-To: https://bugzilla.redhat.com/show_bug.cgi?id=1444016
Signed-off-by: Ondra Machacek <omachace at redhat.com>
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/python/ServicesGenerator.java
M sdk/lib/ovirtsdk4/__init__.py
M sdk/lib/ovirtsdk4/reader.py
M sdk/lib/ovirtsdk4/service.py
M sdk/tests/test_vm_service.py
5 files changed, 204 insertions(+), 226 deletions(-)

Approvals:
  Ondra Machacek: Verified; Looks good to me, approved
  Juan Hernandez: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/75755
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I005460365bce78acb020200cac770073427b617e
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list