Docker: Issueshttps://projects.theforeman.org/https://projects.theforeman.org/favicon.ico?16970236342015-04-29T08:07:19ZForeman
Redmine Bug #10306 (Closed): uninitialized constant DockerContainerWizardStates::Dns::Resolv (NameError)https://projects.theforeman.org/issues/103062015-04-29T08:07:19ZDominic Clealdominic@cleal.org
<p>Seen on a package installation with foreman_docker 1.3.0, when trying to load the web UI.</p>
<pre>
uninitialized constant DockerContainerWizardStates::Dns::Resolv (NameError)
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_docker-1.3.0/app/models/docker_container_wizard_states/dns.rb:14:in `<class:Dns>'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_docker-1.3.0/app/models/docker_container_wizard_states/dns.rb:2:in `<module:DockerContainerWizardStates>'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_docker-1.3.0/app/models/docker_container_wizard_states/dns.rb:1:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application/railties.rb:8:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application/railties.rb:8:in `all'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:434:in `eager_load!'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/share/foreman/config/environment.rb:12:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
config.ru:3:in `block in <main>'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
</pre> Bug #9544 (Closed): downcase_hash_keys function missinghttps://projects.theforeman.org/issues/95442015-02-25T06:28:48ZChristopher Williamsonhome@chrisaw.com
<p>Hi guys,</p>
<p>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.</p>
<p>I have tracked the issue down to the file:</p>
<p>/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_docker-1.2.0/app/models/concerns/fog_extensions/fogdocker/images.rb</p>
<p>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:</p>
<pre><code>def downcase_hash_keys(hash, k = [])<br /> return {k.join('_').gsub(/([a-z])([A-Z])/,'\1_\2').downcase => hash} unless hash.is_a?(Hash)<br /> hash.reduce({}){ |h, v| h.merge! downcase_hash_keys(v[-1], k + [v[0]]) }<br /> end</code></pre>
<p>This is, however, very hacky and should be resolved by including the correct module in my opinion.</p>
<p>Please let me know if you need any further information.</p>