Bug #16025
closed
Import subnets from proxy returns 500
Added by Daniel Lobato Garcia over 8 years ago.
Updated over 6 years ago.
Description
Currently trying to import IPv4 subnets is broken, as the view calls `.to_s` which in turn calls `.name` on subnets that are not yet created.
We should not call `.to_s` and just use the `.network_address` representation which is always available at that stage when importing subnets.
- Related to Bug #5785: Override class parameter by subnet no longer works since 1.5 added
- Status changed from New to Assigned
- Translation missing: en.field_release set to 160
- Status changed from Assigned to New
- Translation missing: en.field_release deleted (
160)
There seem to be some problems submitting the form as well due to strong_params, I'll fix that in this ticket too
- Status changed from New to Assigned
- Translation missing: en.field_release set to 160
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3716 added
- Target version set to 1.7.1
- Target version changed from 1.7.1 to 1.6.2
14:51:20 rails.1 | | ActionView::Template::Error (undefined method `gsub' for nil:NilClass):
14:51:20 rails.1 | | 6: <% display_all = !minimal?(@subnets) %>
14:51:20 rails.1 | | 7: <div class="accordion" id='accordion1'>
14:51:20 rails.1 | | 8: <% @subnets.each do |subnet| %>
14:51:20 rails.1 | | 9: <% id = 'subnet_fields_'+subnet.to_s.gsub('/','_').gsub('.','_') %>
14:51:20 rails.1 | | 10: <div class="accordion-group">
14:51:20 rails.1 | | 11: <div class="accordion-heading" >
14:51:20 rails.1 | | 12: <a class="accordion-toggle" data-toggle="collapse" data-parent='#accordion1' href="<%= '#'+id %>" data-original-title='review' rel='twipsy' > <%= subnet %> </a>
14:51:20 rails.1 | | app/views/subnets/import.html.erb:9:in `block (2 levels) in _app_views_subnets_import_html_erb__4256384505841870065_70124028260720'
14:51:20 rails.1 | | app/views/subnets/import.html.erb:8:in `each'
14:51:20 rails.1 | | app/views/subnets/import.html.erb:8:in `block in _app_views_subnets_import_html_erb__4256384505841870065_70124028260720'
14:51:20 rails.1 | | app/helpers/form_helper.rb:257:in `form_for'
14:51:20 rails.1 | | app/views/subnets/import.html.erb:5:in `_app_views_subnets_import_html_erb__4256384505841870065_70124028260720'
14:51:20 rails.1 | | app/controllers/concerns/application_shared.rb:14:in `set_timezone'
14:51:20 rails.1 | | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
14:51:20 rails.1 | | lib/middleware/catch_json_parse_errors.rb:9:in `call'
14:51:20 rails.1 | | lib/middleware/tagged_logging.rb:18:in `call'
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF