Bug 1373436

Summary: Reading empty list of elements doesn't work correctly
Product: [oVirt] ovirt-engine-sdk-ruby Reporter: Juan Hernández <juan.hernandez>
Component: CoreAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.1.0.alpha1CC: bugs, lsvaty, movciari
Target Milestone: ovirt-4.0.4Keywords: Regression
Target Release: 4.0.1Flags: juan.hernandez: ovirt-4.0.z?
rule-engine: blocker?
juan.hernandez: planning_ack?
juan.hernandez: devel_ack+
lsvaty: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engines-sdk-4.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:39:08 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 Juan Hernández 2016-09-06 09:37:43 UTC
Description of problem:

Currently when the SDK tries to read an empty list of elements, without a close tag, it fails to detect the end of the list correctly, and it includes the in the list the next elements.

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

4.1.0.alpha


How reproducible:

Always.


Steps to Reproduce:
1. Make sure that at least one cluster has an empty list of required RNG sources.
2. Use the SDK to list the clusters:

---8<---
require 'ovirtsdk4'

connection = OvirtSDK4::Connection.new({
  :url => 'https://engine41.example.com/ovirt-engine/api',
  :username => 'admin@internal',
  :password => 'redhat123',
  :ca_file => 'ca.pem',
})

clusters_service = connection.system_service.clusters_service

clusters = clusters_service.list

clusters.each do |cluster|
  puts "#{cluster.name}: #{cluster.required_rng_sources}"
end

connection.close
---8<---


Actual results:

Default: ["random"]
mycluster: [nil, "legacy", "false", "false", "false", "\n            4\n            1\n        ", "true", nil, nil]

Note that for the cluster that has an empty list of required RNG sources this prints an incorrect list, including values that appear after it, like the 'legacy' switch type.

Expected results:

This should print the list of required RNG sources for each cluster.

Default: ["random"]
mycluster: []

Comment 1 Red Hat Bugzilla Rules Engine 2016-09-06 09:37:49 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.