Project

General

Profile

Actions

Bug #25107

closed

Cannot render PXEGrub2 template using Build PXE Default button

Added by Jason Gray over 5 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

I have associated the "Kickstart default PXEGrub2" with CentOS 7.5. I want to rebuild the default files after a recent upgrade from 1.15 --> 1.18. However, I receive the error:

"undefined method `#operatingsystem' for NilClass:Jail (NilClass) (PXEGrub2)."

Here is a log snippet:

2018-10-02T10:23:47 [W|app|b6fe2] Cannot render 'Kickstart default PXEGrub2' | Safemode::NoMethodError: undefined method '#operatingsystem' for NilClass::Jail (NilClass) | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode/jail.rb:22:in `method_missing' | Unnamed:55:in `bind' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode.rb:51:in `eval' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode.rb:51:in `eval' | /usr/share/foreman/lib/foreman/renderer.rb:128:in `render_safe' | /usr/share/foreman/app/models/provisioning_template.rb:161:in `block in build_pxe_default' | /usr/share/foreman/app/models/provisioning_template.rb:153:in `each' | /usr/share/foreman/app/models/provisioning_template.rb:153:in `build_pxe_default'

It seems to be failing on the defined variables "mac" and "major".


<%
major = @host.operatingsystem.major.to_i
mac = @host.provision_interface.mac

  1. Tell Anaconda to perform network functions with boot interface
  2. both current and legacy syntax provided
    options = ["network", "ksdevice=bootif", "ks.device=bootif"]
    if mac
    bootif = '00-' + mac.gsub(':', '-')
    options.push("BOOTIF=#{bootif}")
    end
    .....

The @host should tell foreman to request the host's operating system and mac but it seems to fail looking those values up. If I replace the @host.operatingsystem.major.to_i with @osver is seems to get past that but fails on @host.provision_interface.mac. I can seem to find an equivalent replacement for that value.

Any thoughts would be appreciated.

Actions #1

Updated by Jason Gray over 5 years ago

  • Category set to Templates
  • Found in Releases 1.18.1 added
Actions #2

Updated by Jason Gray over 5 years ago

  • Assignee set to Dominic Cleal
Actions #3

Updated by Anonymous over 5 years ago

  • Assignee deleted (Dominic Cleal)

Please don't assign issues to people out of the blue.

Actions #4

Updated by Lukas Zapletal over 5 years ago

  • Status changed from New to Closed

Jason, please use our Discourse forum for technical support. Let's move it there, we will need to pastebin full ERB and full rendered template (Preview). Also state if you changed anything, this usually works out of box.

Actions #5

Updated by Tomer Brisker over 5 years ago

  • Status changed from Closed to Rejected
Actions

Also available in: Atom PDF