Bug 1378113

Summary: sdk should raise an exception when unknown parameter is used
Product: [oVirt] ovirt-engine-sdk-ruby Reporter: movciari
Component: CoreAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hrazdil <rhrazdil>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, juan.hernandez, lsvaty, mgoldboi, mperina, oourfali
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
lsvaty: testing_ack+
Target Release: 4.2.0.alpha4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.0.alpha4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 10:55:43 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:
Embargoed:

Description movciari 2016-09-21 13:48:58 UTC
Description of problem:
templates_service.add(tmpl, broken: true)
This will create template and silently ignore the broken parameter - it should raise an exception on unknown params

Version-Release number of selected component (if applicable):
ovirt-engine-sdk-4.0.1

How reproducible:
always

Steps to Reproduce:
equire "ovirtsdk4"
connection = OvirtSDK4::Connection.new({
    :url => 'https://hostname/ovirt-engine/api',
    :username => 'admin@internal',
    :password => 'password',
    :insecure => true,
})
system_service = connection.system_service
vms_service = system_service.vms_service
templates_service = system_service.templates_service
cluster = system_service.clusters_service.list[0]
vm = vms_service.list[0]

tmpl = OvirtSDK4::Template.new({
    :name => "template",
    :vm => {
      :id => vm.id,
    },
    :cluster => {
      :id => cluster.id,
    },
  })

templates_service.add(tmpl, broken: true)

Actual results:
ignores the parameter

Expected results:
should raise an exception

Additional info:
in python sdk it raises an exception

Comment 1 Oved Ourfali 2016-11-09 09:26:37 UTC
Juan - when should we fix this?
4.1?

Comment 2 Juan Hernández 2016-11-09 17:55:29 UTC
Yes, 4.1.

Comment 3 Juan Hernández 2017-02-13 14:57:59 UTC
It has been impossible to fix this for 4.1, I am re-targeting to 4.2.

Comment 4 Radim Hrazdil 2017-11-16 14:23:43 UTC
Verified that running given example raises an exception.
SDK version 4.2.0alpha4, engine 4.2.0-0.0.master.20171108151837.gita7de53e.el7.centos.

Comment 5 Sandro Bonazzola 2017-12-20 10:55:43 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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