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

Code Review gerrit at ovirt.org
Fri Apr 21 07:50:36 UTC 2017


>From Juan Hernandez <juan.hernandez at redhat.com>:

Juan Hernandez 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: I0a41409f985c82452447dcc9f99445338a253b4f
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 16b4932438f8974b9622ea04119bb5cc0bd05068)
---
M sdk/lib/ovirtsdk4/connection.rb
M sdk/lib/ovirtsdk4/service.rb
M sdk/spec/service_spec.rb
M sdk/spec/vm_service_spec.rb
4 files changed, 152 insertions(+), 75 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a41409f985c82452447dcc9f99445338a253b4f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: sdk_4.1
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list