Actions
Feature #234
closedPreseed template generates error when media path (URL) contains port
Description
The regular expressions extracting preseed_path
and preseed_server
in lib/family.rb
fail on installation sources which contain a port (e.g. http://example.com:8080/path/
).
Calls to http://localhost:3000/unattended/preseed
generate the following back trace:
Processing UnattendedController#preseed (for 127.0.0.1 at 2010-05-03 10:18:34) [GET] Parameters: {"action"=>"preseed", "controller"=>"unattended", "spoof"=>"127.0.0.1"} Host Load (0.6ms) SELECT * FROM "hosts" WHERE (ip = '127.0.0.1') LIMIT 1 Architecture Load (0.2ms) SELECT * FROM "architectures" WHERE ("architectures"."id" = 1) Media Load (0.2ms) SELECT * FROM "medias" WHERE ("medias"."id" = 3) Operatingsystem Load (0.3ms) SELECT * FROM "operatingsystems" WHERE ("operatingsystems"."id" = 1) Domain Load (0.3ms) SELECT * FROM "domains" WHERE ("domains"."id" = 1) NoMethodError (You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[]): lib/family.rb:24:in `preseed_path' app/controllers/unattended_controller.rb:29:in `preseed' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' Rendered rescues/_trace (25.1ms) Rendered rescues/_request_and_response (1.1ms) Rendering rescues/layout (internal_server_error)
The attached patch file contains a fix for this issue by replacing the regular expressions with the respective calls to the URI class which is part of the Ruby standard library.
Files
Actions