Bug 1243496 - accessing to vm_infra/explorer raises "Error caught: [ArgumentError] comparison of Array with Array failed"
Summary: accessing to vm_infra/explorer raises "Error caught: [ArgumentError] comparis...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.4.0
Hardware: All
OS: All
high
high
Target Milestone: GA
: 5.4.1
Assignee: Harpreet Kataria
QA Contact: Milan Falešník
URL:
Whiteboard:
Depends On: 1242459
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-15 15:16 UTC by Chris Pelland
Modified: 2019-07-11 09:38 UTC (History)
12 users (show)

Fixed In Version: 5.4.1.0
Doc Type: Bug Fix
Doc Text:
In the previous version of CloudForms Management Engine, accessing vm_infra/explorer raised "Error caught: [ArgumentError] comparison of Array with Array failed". This was because array was being sorted by boolean. The code was updated to fix issue in sort_tree method for VMs & Templates tree, and vm_infra/explorer can be accessed without an error.
Clone Of: 1242459
Environment:
Last Closed: 2015-07-30 13:12:47 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1528673 0 None None None Never
Red Hat Product Errata RHBA-2015:1511 0 normal SHIPPED_LIVE CFME 5.4.1 bug fixes, and enhancement update 2015-07-30 17:10:05 UTC

Comment 2 CFME Bot 2015-07-15 19:21:20 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=5192b83373c58ef8f88f6f95978f06b02ce09e83

commit 5192b83373c58ef8f88f6f95978f06b02ce09e83
Author:     Harpreet Kataria <hkataria>
AuthorDate: Wed Jul 15 15:02:47 2015 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Jul 15 15:02:47 2015 -0400

    Fixed issue in sort_tree method for VMs & Templates tree.
    
    - Sorting an array by boolean was blowing up with "comparison of Array with Array failed" error, in this case customer's db had 2 EmsFolders at same level 1 was a datacenter and other one was not a datacenter, so in this case second parameter passed in to sort_by call was a boolean as a fix replaced boolean with 0,1
    Sorting of arrays containing identical boolean values (ALL true or ALL false) works fine, but if 1 value differs sort throws an exception, as an example [false, true].sort fails in irb
    - Added spec test to verify the fix.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1242459
    https://bugzilla.redhat.com/show_bug.cgi?id=1243496

 .../presenters/tree_builder_vms_and_templates.rb   |  2 +-
 .../tree_builder_vms_and_templates_spec.rb         | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 vmdb/spec/presenters/tree_builder_vms_and_templates_spec.rb

Comment 3 CFME Bot 2015-07-15 19:22:06 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=6d08e83bdae38645bcc55daac5dd06e8a1dc4821

commit 6d08e83bdae38645bcc55daac5dd06e8a1dc4821
Merge: 7b686f4 5192b83
Author:     Dan Clarizio <dclarizi>
AuthorDate: Wed Jul 15 15:19:53 2015 -0400
Commit:     Dan Clarizio <dclarizi>
CommitDate: Wed Jul 15 15:19:53 2015 -0400

    Merge branch '54z_bz_1243496' into '5.4.z'
    
    Fixed issue in sort_tree method for VMs & Templates tree.
    
    - Sorting an array by boolean was blowing up with "comparison of Array with Array failed" error, in this case customer's db had 2 EmsFolders at same level 1 was a datacenter and other one was not a datacenter, so in this case second parameter passed in to sort_by call was a boolean as a fix replaced boolean with 0,1
    Sorting of arrays containing identical boolean values (ALL true or ALL false) works fine, but if 1 value differs sort throws an exception, as an example [false, true].sort fails in irb
    - Added spec test to verify the fix.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1242459
    https://bugzilla.redhat.com/show_bug.cgi?id=1243496
    
    @dclarizio please review, applied clean patch from master, original PR: https://github.com/ManageIQ/manageiq/pull/3460
    
    See merge request !182

 .../presenters/tree_builder_vms_and_templates.rb   |  2 +-
 .../tree_builder_vms_and_templates_spec.rb         | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

Comment 5 Milan Falešník 2015-07-24 13:33:43 UTC
Verified in 5.4.1.0. I dumped the database from the lab machine with 5.4.0.5, reimported into a new appliance with 5.4.1.0 and tried to access the Infra/VMs. The original appliance failed, 5.4.1.0 did not \o/

Comment 7 errata-xmlrpc 2015-07-30 13:12:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1511.html


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