Bug 1149107 - [REGENERATE JAVA SDK] storage_manager element is not validated correctly
Summary: [REGENERATE JAVA SDK] storage_manager element is not validated correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk-java
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Ondra Machacek
URL:
Whiteboard: infra
Depends On: 1146457
Blocks: rhev3.5beta3
TreeView+ depends on / blocked
 
Reported: 2014-10-03 08:50 UTC by Juan Hernández
Modified: 2016-02-10 19:33 UTC (History)
12 users (show)

Fixed In Version: rhevm-sdk-java-3.5.0.5-2.el6ev
Doc Type: Bug Fix
Doc Text:
Clone Of: 1146457
Environment:
Last Closed: 2015-02-11 18:11:16 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch to fix the issue (29.61 KB, patch)
2014-10-06 09:19 UTC, Juan Hernández
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0184 0 normal SHIPPED_LIVE rhevm-sdk-java bug fix and enhancement update 2015-02-11 22:39:22 UTC
oVirt gerrit 33364 0 None None None Never

Description Juan Hernández 2014-10-03 08:50:28 UTC
+++ This bug was initially created as a clone of Bug #1146457 +++

Description of problem:


Version-Release number of selected component (if applicable):
rhevm-cli-3.5.0.4-1.el6ev.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1. run command:
update host 'hostX' --storage_manager-priority 5

Actual results:
send: 'PUT /api/hosts/a5898cff-8836-4d60-ba85-c3219937beae HTTP/1.1\r\nHost: jenkins-vm-10.scl.lab.tlv.redhat.com\r\nAccept-Encoding: identity\r\nContent-Length: 93\r\nSession-TTL: 3600\r\nPrefer: persistent-auth\r\nCorrelation-Id: hosts_update_508dc25b-9098-4eee\r\nAccept: application/xml\r\nFilter: False\r\ncookie: JSESSIONID=EfGmN01Nlx3gddnOyjeyLCeC\r\nContent-type: application/xml\r\nAuthorization: Basic dXNlcnBvcnRhbDFAcWEubGFiLnRsdi5yZWRoYXQuY29tOjEyMzQ1Ng==\r\n\r\n'
send: '<host id="a5898cff-8836-4d60-ba85-c3219937beae">\n    <storage_manager priority="5"/>\n</host>\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Date: Wed, 17 Sep 2014 20:18:34 GMT^M
header: JSESSIONID: EfGmN01Nlx3gddnOyjeyLCeC^M
header: Content-Type: application/xml^M
header: Content-Length: 179^M
header: Vary: Accept-Encoding^M
header: Connection: close^M
^MESC[KESC[?1lESC>ESC[1;31m   ERROR 
  status: 400^M
  reason: Bad Request^M
  detail: Value "" isn't a valid boolean, it should be "true" or "false"
  
ESC[1;m


Expected results:
Update successfully.

Additional info:
Works fine in javasdk.
Worked fine in 3.4 rhevm-cli.

--- Additional comment from Juan Hernández on 2014-09-25 07:05:28 EDT ---

It isn't possible to restore the previous behavior, but we will introduce a new --spm-priority option that will work correctly and with the same meaning.

--- Additional comment from Juan Hernández on 2014-09-25 07:08:35 EDT ---

Note that this needs to be fixed in the engine, then the Python SDK needs to be regenerated.

--- Additional comment from RHEL Product and Program Management on 2014-09-25 07:11:39 EDT ---

This bug report has Keywords: Regression or TestBlocker.

Since no regressions or test blockers are allowed between releases,
it is also being identified as a blocker for this release.

Please resolve ASAP.

Comment 1 Juan Hernández 2014-10-06 09:19:44 UTC
Created attachment 944191 [details]
Proposed patch to fix the issue

Comment 3 Ondra Machacek 2014-10-23 12:11:10 UTC
public static void main(String[] args) throws Exception{
        Api api = new Api(URL, user, password, true, false);
        org.ovirt.engine.sdk.decorators.Host host = api.getHosts().get(host_name);
        System.out.println("Old SPM priority value is: "+ host.getSpm().getPriority());
        SPM spm = new SPM();
        spm.setPriority(5);
        host.setSpm(spm);
        Host h = host.update();
        System.out.println("New SPM priority value is: "+ h.getSpm().getPriority());
        api.shutdown();
    }

# ./run.sh 
Old SPM priority value is: 10
New SPM priority value is: 5

Comment 5 errata-xmlrpc 2015-02-11 18:11:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0184.html


Note You need to log in before you can comment on or make changes to this bug.