Bug 1063876

Summary: OVIRT-CLI: async parameter counts any value except true as false when it should accept only true/false values
Product: [Retired] oVirt Reporter: Ilia Meerovich <iliam>
Component: ovirt-engine-apiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: bugs <bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.4CC: acathrow, gklein, iheim, oramraz, pstehlik, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-3.5.0-alpha2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-13 07:25:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ilia Meerovich 2014-02-11 15:14:52 UTC
[oVirt shell (connected)]# action host 17fa99f1-a423-43d9-80d7-6940066c7496 activate --async true

async       : True                                                                                                                                                                                                                           
host-id     : 17fa99f1-a423-43d9-80d7-6940066c7496                                                                                                                                                                                           
job-id      : 7d74db65-439a-4336-aad6-51ea6c323288                                                                                                                                                                                           
status-state: complete                                                                                                                                                                                                                       

[oVirt shell (connected)]# action host 17fa99f1-a423-43d9-80d7-6940066c7496 deactivate --async moo

async       : False                                                                                                                                                                                                                          
host-id     : 17fa99f1-a423-43d9-80d7-6940066c7496                                                                                                                                                                                           
status-state: complete                                                                                                                                                                                                                       

[oVirt shell (connected)]#

Comment 1 Juan Hernández 2014-02-11 15:23:46 UTC
This is a behaviour of the server, not of the CLI. The CLI just sends the value to the server, and the server decides what is valid and what isn't. Changing this behavior may break backwards compatibility, as users may be already using values other than "true" and "false". We will review this as part of 3.5.

Comment 2 Juan Hernández 2014-05-20 10:11:16 UTC
The proposed patch adds validation of boolean values in the RESTAPI, so if the CLI or SDK send an incorrect value the request will be rejected, for example:

[oVirt shell (connected)]# action host node1 activate --async junk

  ==================================== ERROR =================================
  status: 400
  reason: Bad Request
  detail: Value "junk" isn't a valid boolean, it should be "true" or "false"

Comment 3 Gil Klein 2014-08-13 07:25:18 UTC
This bug was fixed and is slated to be in the upcoming version. As we
are focusing our testing at this phase on severe bugs, this bug was
closed without going through its verification step. If you think this
bug should be verified by QE, please set its severity to high and move
it back to ON_QA