Bug 1378113 - sdk should raise an exception when unknown parameter is used
Summary: sdk should raise an exception when unknown parameter is used
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.0
: 4.2.0.alpha4
Assignee: Juan Hernández
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-21 13:48 UTC by movciari
Modified: 2017-12-20 10:55 UTC (History)
6 users (show)

Fixed In Version: 4.2.0.alpha4
Clone Of:
Environment:
Last Closed: 2017-12-20 10:55:43 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 82063 0 master MERGED Check service method parameters 2017-09-27 10:20:31 UTC

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.


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