Bug 1204916 - downcase_hash_keys function missing
Summary: downcase_hash_keys function missing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Container Management
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: Dmitri Dolguikh
QA Contact: Og Maciel
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-23 18:27 UTC by Mike McCune
Modified: 2019-04-01 20:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:30:29 UTC
Target Upstream Version:


Attachments (Terms of Use)
Fog error while searching for Docker Hub container image (302.09 KB, image/png)
2015-03-23 18:30 UTC, Og Maciel
no flags Details
stacktrace (185.07 KB, text/plain)
2015-03-23 18:41 UTC, Og Maciel
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 9544 0 None None None 2016-04-22 16:46:03 UTC
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Description Mike McCune 2015-03-23 18:27:43 UTC
Hi guys,

I recently confirmed a bug (9242) which has since been resolved but the resolution has brought another bug to my attention preventing the image search from completing on foreman for me at this time.

I have tracked the issue down to the file:

/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_docker-1.2.0/app/models/concerns/fog_extensions/fogdocker/images.rb

It looks like the module necessary to provide 'downcase_hash_keys' has not been included in this module sadly. I have managed to workaround this by adding the following:

      def downcase_hash_keys(hash, k = [])
        return {k.join('_').gsub(/([a-z])([A-Z])/,'\1_\2').downcase => hash} unless hash.is_a?(Hash)
        hash.reduce({}){ |h, v| h.merge! downcase_hash_keys(v[-1], k + [v[0]]) }
      end

This is, however, very hacky and should be resolved by including the correct module in my opinion.

Please let me know if you need any further information.

Comment 1 Mike McCune 2015-03-23 18:27:44 UTC
Created from redmine issue http://projects.theforeman.org/issues/9544

Comment 2 Og Maciel 2015-03-23 18:30:59 UTC
Created attachment 1005552 [details]
Fog error while searching for Docker Hub container image

Comment 4 Og Maciel 2015-03-23 18:39:39 UTC
Here's how I came across the error shown on the attached file from comment #2:

* Create a new Docker container
  * Select your docker compute resource
  * Select the Docker Hub tab
  * Search for a docker container image that you know is not present in the compute resource

Comment 5 Og Maciel 2015-03-23 18:41:41 UTC
Created attachment 1005553 [details]
stacktrace

Comment 6 Bryan Kearney 2015-03-23 20:05:38 UTC
Upstream bug assigned to ddolguik@redhat.com

Comment 7 Bryan Kearney 2015-03-23 20:05:39 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9544 has been closed
-------------
Anonymous
Applied in changeset commit:foreman-docker|10216d79d016e5a1408d1ceb6141d7b75139e518.

Comment 10 Og Maciel 2015-03-26 16:00:36 UTC
Verified by QE using Satellite-6.1.0-RHEL-7-20150324.0 build. This issue is no longer happening.

Comment 11 Bryan Kearney 2015-08-11 13:36:03 UTC
This bug is slated to be released with Satellite 6.1.

Comment 12 errata-xmlrpc 2015-08-12 05:30:29 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://access.redhat.com/errata/RHSA-2015:1592


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