Bug 1378066 - undefined method end_element
Summary: undefined method end_element
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.5
: 4.0.2
Assignee: Juan Hernández
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks: 1366548
TreeView+ depends on / blocked
 
Reported: 2016-09-21 12:34 UTC by movciari
Modified: 2017-01-18 07:38 UTC (History)
1 user (show)

Fixed In Version: rubygem-ovirt-engine-sdk-4.0.2-1
Clone Of:
Environment:
Last Closed: 2017-01-18 07:38:45 UTC
oVirt Team: Infra
Embargoed:
juan.hernandez: ovirt-4.0.z?
rule-engine: planning_ack?
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 64245 0 master MERGED Write correctly lists of enum values 2016-09-21 15:00:47 UTC
oVirt gerrit 64250 0 sdk_4.0 MERGED Write correctly lists of enum values 2016-09-21 15:28:03 UTC

Description movciari 2016-09-21 12:34:14 UTC
Description of problem:
when trying to add a new template using ruby sdk:
NoMethodError: undefined method `end_element' for #<OvirtSDK4::XmlWriter:0x00000002c34c48>
from /usr/share/gems/gems/ovirt-engine-sdk-4.0.1/lib/ovirtsdk4/writers.rb:564:in `write_one'

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

How reproducible:
always

Steps to Reproduce:
require "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 => vm,
    :cluster => cluster
})
templates_service.add(tmpl)

Actual results:


Expected results:


Additional info:

Comment 1 Juan Hernández 2016-09-21 13:02:26 UTC
This is an error in the code generator, that affects writing lists of enum values. It is fixed by the proposed patch. It is triggered by the fact that you are sending the complete representations of the virtual machine and the cluster, when only the identifiers are required. Consider replacing your code with this:

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

The fix will be included in version 4.0.2 of the SDK.

Comment 2 Lukas Svaty 2016-10-18 14:08:34 UTC
verified in rubygem-ovirt-engine-sdk4-4.0.3-1.el7ev.x86_64


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