On a provisioning template the following does not work:
<% if @host.architecture == 'x86_64' -%>
foo
<% end -%>
Where the following prints: x86_64
<%= @host.architecture %>
What am I doing wrong here ?
On a provisioning template the following does not work:
<% if @host.architecture == 'x86_64' -%>
foo
<% end -%>
Where the following prints: x86_64
<%= @host.architecture %>
What am I doing wrong here ?
Use: if @host.architecture.to_s == 'x86_64'
–
Dominic Cleal
dominic@cleal.org
Yes I found that finally and also .name is possible instead of .to_s.
Why is this ?
@host.architecture is an object (a model) which is not directly equal to
a string ("x86_64"). .name or .to_s return the string containing the
name of the architecture.
–
Dominic Cleal
dominic@cleal.org