Bug 1662326 - Status code from the API for Invalid time zone for given OS type is 400 (bad request) instead of 409 (conflict)
Summary: Status code from the API for Invalid time zone for given OS type is 400 (bad ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.3.0
Hardware: x86_64
OS: Unspecified
medium
medium vote
Target Milestone: ovirt-4.4.0
: ---
Assignee: Lucia Jelinkova
QA Contact: Liran Rotenberg
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-27 17:36 UTC by Elad
Modified: 2019-05-06 13:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-06 13:56:12 UTC
oVirt Team: Virt
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)
logs with API calls and engine.log (953.16 KB, application/gzip)
2018-12-27 17:36 UTC, Elad
no flags Details

Description Elad 2018-12-27 17:36:47 UTC
Created attachment 1517098 [details]
logs with API calls and engine.log

Description of problem:
When creating a VM with os type as windows_2008R2x64 and GMT Standard Time we get a 400 Bad request instead of 409 conflict:

2018-12-27 18:58:26,459 - MainThread - api_utils - ERROR - Failed to create element NOT as expected:
        Status: 400
        Reason: Bad Request
        Detail: [Cannot add VM. Invalid time zone for given OS type., Attribute: vmStatic]



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create a VM with os type as windows_2008R2x64 and GMT Standard Time


Actual results:
400 bad request in response body from the API


Expected results:
409 conflict


This bug fix is important for negative testing in RHV automation. 


Additional info:
logs with API calls and engine.log

Comment 1 Elad 2018-12-27 17:37:52 UTC
Version:
ovirt-engine-4.3.0-0.6.alpha2.el7.noarch

Comment 2 Ryan Barry 2019-01-21 14:53:59 UTC
Re-targeting to 4.3.1 since it is missing a patch, an acked blocker flag, or both

Comment 3 Lucia Jelinkova 2019-05-06 12:57:21 UTC
So to sum it up: when you create VM with os type windows_2008R2x64 and some unsupported time zone, you propose to change the response code from 400 (Bad request) to 409 (Conflict). 

I think that 400 (Bad request) is more appropriate, since the request parameters are not correct. I do not see how it could be a conflict since there is no existing state of the VM. I suggest that we keep the response as it is now (400 Bad request).

Comment 4 Ryan Barry 2019-05-06 13:49:06 UTC
I agree, Lucia -

Elad, can we adjust the automation to match this?

Comment 5 Elad 2019-05-06 13:55:23 UTC
Yes, we can adjust the automation for that

Comment 6 Ryan Barry 2019-05-06 13:56:12 UTC
Great :)

Closing


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