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:
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.
verified in rubygem-ovirt-engine-sdk4-4.0.3-1.el7ev.x86_64