Bug #9782
Using media_path in Templates does not resolve properly
Description
Using <%= media_path %> in provisioning templates always resolves to '/media'.
From the IRC:
<snip>
14:08:29 Dominic | lowercase: yeah, I can reproduce that, I guess something is leaking in from Rails as it has a "media_path" that
| would link to our installation media page - I suppose that's the result you're getting. Could you file that
| please?
[...]
14:11:05 Dominic | as a workaround you can use: <%= @host.os.medium_uri(@host) %>
14:11:18 Dominic | (that's what the media_path helper calls)
14:12:10 Dominic | or <%= @mediapath %> actually, I think that's also the same, it's what we use in the kickstarts
</snip>
Related issues
Associated revisions
fixes #9782 - implement mediapath for suse/yast
refs #9782 - implement mediapath for suse/yast
fixes #9782 - implement mediapath for suse/yast
(cherry picked from commit 7aa342eabf33f96916f3061db313aecba46b0933)
History
#1
Updated by Dominic Cleal over 7 years ago
- Legacy Backlogs Release (now unused) set to 28
#2
Updated by Dominic Cleal over 7 years ago
- Legacy Backlogs Release (now unused) changed from 28 to 50
#3
Updated by Anonymous about 7 years ago
I tried to get @mediapath working for SUSE, but didn't succeed, maybe somebondy else can spot something, I was missing here:
diff --git a/app/controllers/unattended_controller.rb b/app/controllers/unattended_controller.rb index da7eb0c..9cffe3b 100644 --- a/app/controllers/unattended_controller.rb +++ b/app/controllers/unattended_controller.rb @@ -236,6 +236,7 @@ class UnattendedController < ApplicationController end def yast_attributes + @mediapath = @host.operatingsystem.mediumpath @host end def coreos_attributes diff --git a/app/models/operatingsystems/suse.rb b/app/models/operatingsystems/suse.rb index 1f8487f..cfcf8f5 100644 --- a/app/models/operatingsystems/suse.rb +++ b/app/models/operatingsystems/suse.rb @@ -1,6 +1,11 @@ class Suse < Operatingsystem PXEFILES = {:kernel => "linux", :initrd => "initrd"} + # Simple output of the media url + def mediumpath(host) + medium_uri(host).to_s + end + def pxe_type "yast" end
#4
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2393 added
- Pull request deleted (
)
#5
Updated by Dominic Cleal about 7 years ago
- Legacy Backlogs Release (now unused) changed from 50 to 56
#6
Updated by Dominic Cleal about 7 years ago
- Status changed from Ready For Testing to New
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman/pull/2393)
#7
Updated by Dominic Cleal about 7 years ago
- Legacy Backlogs Release (now unused) deleted (
56)
#8
Updated by Anonymous over 6 years ago
- Related to Bug #12791: The architecture is not interpolated for the variable @host.url_for_boot(:initrd) on suse based systems added
#9
Updated by The Foreman Bot over 6 years ago
- Assignee set to Anonymous
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3347 added
#10
Updated by Anonymous over 6 years ago
- Related to Refactor #14319: Remove media_path template helper which is no longer used added
#11
Updated by Anonymous over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 7aa342eabf33f96916f3061db313aecba46b0933.
#12
Updated by The Foreman Bot over 6 years ago
- Pull request https://github.com/theforeman/community-templates/pull/256 added
#13
Updated by Dominic Cleal over 6 years ago
- Legacy Backlogs Release (now unused) set to 141
#14
Updated by Anonymous about 6 years ago
- Related to Bug #15709: SLES doesn't get mediapath set in PXELinux config file added
refs #9782 - SUSE: usage of mediapath in PXELinux