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 Anonymous about 10 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 Anonymous about 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 7aa342eabf33f96916f3061db313aecba46b0933.