Project

General

Profile

Actions

Bug #940

closed

Error trying to set a subnet on a host

Added by Jeffrey Ollie over 13 years ago. Updated almost 13 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Getting the following error trying to set a subnet on a host. Using 0.3rc2 but happened on 0.2 as well.

Processing HostsController#update (for 161.210.45.73 at 2011-05-24 13:52:32) [PUT]
  Parameters: {"commit"=>"Submit", "action"=>"update", "_method"=>"put", "authenticity_token"=>"rqu16sU+q4ArO97tXF2SYTFPC1OftXKN9gi9J6Gq7/0=", "id"=>"ap
p02.dmacc.net", "controller"=>"hosts", "host"=>{"comment"=>"", "serial"=>"", "architecture_id"=>"1", "subnet_id"=>"1", "managed"=>"t", "name"=>"app02", 
"puppetmaster_name"=>"puppet.dmacc.net", "mac"=>"00:50:56:95:6d:f0", "domain_id"=>"1", "enabled"=>"1", "root_pass"=>"[FILTERED]", "medium_id"=>"5", "hos
tgroup_id"=>"", "is_owned_by"=>"1-Users", "ptable_id"=>"1", "ip"=>"161.210.221.101", "environment_id"=>"1", "model_id"=>"", "disk"=>"", "puppetclass_ids"=>[""], "operatingsystem_id"=>"2"}}
Add the TFTP configuration for app02.dmacc.net

SyntaxError (compile error
(erb):13: syntax error, unexpected ';'
;  for profile in @profiles -; _erbout.concat "\nLABEL " 
                              ^
(erb):16: syntax error, unexpected ';'
...eratingsystem.is_a?(Redhat) -; _erbout.concat "\n     append...
                              ^
(erb):18: syntax error, unexpected kELSE, expecting $end
;  else -; _erbout.concat "\n     append initrd=" 
       ^):
  (erb):18:in `generate_pxe_template'
  app/models/orchestration/tftp.rb:84:in `generate_pxe_template'
  app/models/orchestration/tftp.rb:33:in `setTFTP'
  app/models/orchestration.rb:129:in `send'
  app/models/orchestration.rb:129:in `execute'
  app/models/orchestration.rb:85:in `process'
  app/models/orchestration.rb:80:in `each'
  app/models/orchestration.rb:80:in `process'
  app/models/orchestration.rb:31:in `on_save'
  app/controllers/hosts_controller.rb:101:in `update'
  /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'

Rendering /usr/share/foreman/public/500.html (500 Internal Server Error)

Actions #1

Updated by Ohad Levy over 13 years ago

  • Status changed from New to Duplicate
  • Assignee set to Ohad Levy
  • Target version set to 0.3

this is actually 887, the reason is that you have a trailing - in the closing erb
.e.g

<% something -%>

we will fix it as part of #887

Actions #2

Updated by Ohad Levy over 13 years ago

for yet another quick workaround simply change app/models/orchestration/tftp.rb at line 84 to:

      ERB.new(pxe, nil, '-').result(binding)
Actions #3

Updated by Jeffrey Ollie over 13 years ago

The quick fix gives me the following error:

1 error prohibited this host from being saved

There were problems with the following fields:

    Failed to generate PXELinux template: undefined method `each' for nil:NilClass
Actions #4

Updated by Ohad Levy over 13 years ago

Jeffrey Ollie wrote:

The quick fix gives me the following error:

I'm not sure what your template is doing, but it was complaining about empty value..

are you by any chance assigning the default pxe menu template as your host template? you should be using the os specific template....

Actions

Also available in: Atom PDF