Project

General

Profile

Bug #9782

Using media_path in Templates does not resolve properly

Added by Mattias Giese over 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
Difficulty:
Triaged:
Bugzilla link:

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

Related to Foreman - Bug #12791: The architecture is not interpolated for the variable @host.url_for_boot(:initrd) on suse based systemsClosed2015-12-12
Related to Foreman - Refactor #14319: Remove media_path template helper which is no longer usedClosed2016-03-22
Related to Foreman - Bug #15709: SLES doesn't get mediapath set in PXELinux config fileClosed2016-07-15

Associated revisions

Revision 47306918 (diff)
Added by Michael Moll over 5 years ago

refs #9782 - SUSE: usage of mediapath in PXELinux

Revision 7aa342ea (diff)
Added by Michael Moll over 4 years ago

fixes #9782 - implement mediapath for suse/yast

Revision 62b5db1a (diff)
Added by Michael Moll over 4 years ago

refs #9782 - implement mediapath for suse/yast

Revision 0f677011 (diff)
Added by Michael Moll over 4 years ago

fixes #9782 - implement mediapath for suse/yast

(cherry picked from commit 7aa342eabf33f96916f3061db313aecba46b0933)

History

#1 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) set to 28

#2 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) changed from 28 to 50

#3 Updated by Anonymous over 5 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 over 5 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 over 5 years ago

  • Legacy Backlogs Release (now unused) changed from 50 to 56

#6 Updated by Dominic Cleal over 5 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 over 5 years ago

  • Legacy Backlogs Release (now unused) deleted (56)

#8 Updated by Anonymous almost 5 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 4 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 4 years ago

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

#11 Updated by Anonymous over 4 years ago

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

#12 Updated by The Foreman Bot over 4 years ago

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

#13 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 141

#14 Updated by Anonymous over 4 years ago

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

Also available in: Atom PDF