Project

General

Profile

Bug #21172

Unknown Variables in partition tables <%= @osver %>

Added by Ivan Necas 12 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
TFTP
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1459290

Description of problem: After provisioning a Host when Partition table template is unlocked and a kickstart specific variable @osver is used instead of @host.operatingsystem.major variable the @osver variable is not able to process causing the statements of a particular block of code.

According to the "Host configuration Guide in the 'A.3. Satellite Specific Functions and Variables - Table A.4. Kickstart Specific Variables' the table state that @osver is the same as @host.operatingsystem.major.

==================================================================
@osver The operating system major version number, same as @host.operatingsystem.major. ==================================================================

Version-Release number of selected component (if applicable): satellite-6.2.9-7

How reproducible: 100%

Steps to Reproduce:

1. Go to the "Hosts" - "Partition Tables" - select the "clone" - unlock for the specific Template.
2. Access the template by click it and add the following block of code:

<% if @host.operatingsystem.major.to_i 6 ->
modprobe -r qla2xxx
modprobe -r lpfc
partprobe
<
end -%>

3. Go back to the preview page of the partition template opened before and refresh the page. the 3 lines should be printed there.
4. Now go back to the Partition tables edition page and change the variable @host.operatingsystem to @osver.to_i

<% if @osver.to_i 6 ->
modprobe -r qla2xxx
modprobe -r lpfc
partprobe
<
end -%>

5. Go back to the preview page and refresh. Now you none of the lines were executed.
6. Change the @osver.to_i to @osver

<% if @osver 6 ->
modprobe -r qla2xxx
modprobe -r lpfc
partprobe
<
end -%>

7. Go back to the preview page and refresh. Now you none of the lines were executed.

Actual results:
The block of code defined between the <% if @osver 6 -> and < end -> and < if @osver.to_i == 6 -> and < end -%> are not being evaluated.

Expected results:
both variables @host.operatingsystem.major and @osver should be processed successful.


Related issues

Related to Foreman - Bug #1341: Unknown Variables in partition tablesClosed2011-11-19
Related to Foreman - Bug #24931: @dynamic kickstart variable stopped working in Foreman 1.19.0New

Associated revisions

Revision 1f32612a (diff)
Added by Ivan Necas 2 months ago

Fixes #21172 - load template variables to partition tables

Revision e399441b (diff)
Added by Ivan Necas 2 months ago

Fixes #21172 - address comments

History

#1 Updated by The Foreman Bot 12 months ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ivan Necas
  • Pull request https://github.com/theforeman/foreman/pull/4883 added

#2 Updated by Ivan Necas 12 months ago

  • Related to Bug #1341: Unknown Variables in partition tables added

#3 Updated by Tomer Brisker 2 months ago

  • Triaged set to Yes
  • Target version set to 1.19.0
  • Subject changed from Unknown Variables in partition tables <%= @osver %> to Unknown Variables in partition tables <%= @osver %>
  • Fixed in Releases 1.19.0 added

#4 Updated by Ivan Necas 2 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#5 Updated by Tomer Brisker 7 days ago

  • Related to Bug #24931: @dynamic kickstart variable stopped working in Foreman 1.19.0 added

Also available in: Atom PDF