Bug #9782
closedUsing 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>
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release set to 28
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release changed from 28 to 50
Updated by Anonymous over 9 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
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2393 added
- Pull request deleted (
)
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release changed from 50 to 56
Updated by Dominic Cleal over 9 years ago
- Status changed from Ready For Testing to New
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman/pull/2393)
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release deleted (
56)
Updated by Anonymous almost 9 years ago
- Related to Bug #12791: The architecture is not interpolated for the variable @host.url_for_boot(:initrd) on suse based systems added
Updated by The Foreman Bot over 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Anonymous
- Pull request https://github.com/theforeman/foreman/pull/3347 added
Updated by Anonymous over 8 years ago
- Related to Refactor #14319: Remove media_path template helper which is no longer used added
Updated by Anonymous over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 7aa342eabf33f96916f3061db313aecba46b0933.
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/theforeman/community-templates/pull/256 added
Updated by Dominic Cleal over 8 years ago
- Translation missing: en.field_release set to 141
Updated by Anonymous over 8 years ago
- Related to Bug #15709: SLES doesn't get mediapath set in PXELinux config file added