Bug 1373436 - Reading empty list of elements doesn't work correctly
Summary: Reading empty list of elements doesn't work correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.1.0.alpha1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.0.4
: 4.0.1
Assignee: Juan Hernández
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-06 09:37 UTC by Juan Hernández
Modified: 2016-09-26 12:39 UTC (History)
3 users (show)

Fixed In Version: ovirt-engines-sdk-4.0.1
Clone Of:
Environment:
Last Closed: 2016-09-26 12:39:08 UTC
oVirt Team: Infra
Embargoed:
juan.hernandez: ovirt-4.0.z?
rule-engine: blocker?
juan.hernandez: planning_ack?
juan.hernandez: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 63389 0 master MERGED Fix reading of lists of elements 2016-09-06 10:26:28 UTC
oVirt gerrit 63393 0 sdk_4.0 MERGED Fix reading of lists of elements 2016-09-06 10:25:01 UTC

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.


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