Provisioning Templates and @host.location

Hi,

when i add this code
<% if @host.location == "TEST" -%>
lang de_DE.UTF-8
keyboard de
<% end -%>
to the Provisioning Templates then i get the following error

There was an error rendering the KN Kickstart Default template: undefined
method '==' for Safemode::Jail (Location)

But when I print this var, it works!
<%= @host.location %>

Could you help me!.
Ist this a bug?

I'm using Foreman 1.3 on CentOS 6.4
Locations and Organizations is configuerd and enabled

thx

Try doing this:

<% if @host.location.to_s == "TEST" -%>

If that doesn't work or hits the same error, try disabling
"safemode_render" under More>Settings. (Note, this means code execution
protection is disabled in your templates.)

··· On 11/11/13 07:22, PAF wrote: > Hi, > > when i add this code > <% if @host.location == "TEST" -%> > lang de_DE.UTF-8 > keyboard de > <% end -%> > to the Provisioning Templates then i get the following error > > There was an error rendering the KN Kickstart Default template: > undefined method '==' for Safemode::Jail (Location) > > > But when I print this var, it works! > <%= @host.location %> > > Could you help me!. > Ist this a bug? > > I'm using Foreman 1.3 on CentOS 6.4 > Locations and Organizations is configuerd and enabled


Dominic Cleal
Red Hat Engineering

yes, this works

<% if @host.location.to_s == "TEST" -%>

thx

··· Am Montag, 11. November 2013 09:41:49 UTC+1 schrieb Dominic Cleal: > > On 11/11/13 07:22, PAF wrote: > > Hi, > > > > when i add this code > > <% if @host.location == "TEST" -%> > > lang de_DE.UTF-8 > > keyboard de > > <% end -%> > > to the Provisioning Templates then i get the following error > > > > There was an error rendering the KN Kickstart Default template: > > undefined method '==' for Safemode::Jail (Location) > > > > > > But when I print this var, it works! > > <%= @host.location %> > > > > Could you help me!. > > Ist this a bug? > > > > I'm using Foreman 1.3 on CentOS 6.4 > > Locations and Organizations is configuerd and enabled > > Try doing this: > > <% if @host.location.to_s == "TEST" -%> > > If that doesn't work or hits the same error, try disabling > "safemode_render" under More>Settings. (Note, this means code execution > protection is disabled in your templates.) > > -- > Dominic Cleal > Red Hat Engineering >