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

From Ondra Machacek <omachace@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@redhat.com> Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com> (cherry picked from commit ef55570ea8b0e77f972b095608148b6368899a7d) --- 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 Jenkins CI: Passed CI tests -- To view, visit https://gerrit.ovirt.org/76460 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I005460365bce78acb020200cac770073427b617e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: sdk_4.1 Gerrit-Owner: Ondra Machacek <omachace@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Ondra Machacek <omachace@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>
participants (1)
-
Code Review