Project

General

Profile

Actions

Bug #9782

closed

Using media_path in Templates does not resolve properly

Added by Mattias Giese over 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
Fixed in Releases:
Found in Releases:

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 3 (0 open3 closed)

Related to Foreman - Bug #12791: The architecture is not interpolated for the variable @host.url_for_boot(:initrd) on suse based systemsClosed12/12/2015Actions
Related to Foreman - Refactor #14319: Remove media_path template helper which is no longer usedClosedMarek Hulán03/22/2016Actions
Related to Foreman - Bug #15709: SLES doesn't get mediapath set in PXELinux config fileClosed07/15/2016Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Translation missing: en.field_release set to 28
Actions #2

Updated by Dominic Cleal over 9 years ago

  • Translation missing: en.field_release changed from 28 to 50
Actions #3

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

Actions #4

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 ()
Actions #5

Updated by Dominic Cleal over 9 years ago

  • Translation missing: en.field_release changed from 50 to 56
Actions #6

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)
Actions #7

Updated by Dominic Cleal over 9 years ago

  • Translation missing: en.field_release deleted (56)
Actions #8

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
Actions #9

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
Actions #10

Updated by Anonymous over 8 years ago

  • Related to Refactor #14319: Remove media_path template helper which is no longer used added
Actions #11

Updated by Anonymous over 8 years ago

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

Updated by The Foreman Bot over 8 years ago

  • Pull request https://github.com/theforeman/community-templates/pull/256 added
Actions #13

Updated by Dominic Cleal over 8 years ago

  • Translation missing: en.field_release set to 141
Actions #14

Updated by Anonymous over 8 years ago

  • Related to Bug #15709: SLES doesn't get mediapath set in PXELinux config file added
Actions

Also available in: Atom PDF