On Mon, Nov 23, 2009 at 3:41 PM, Christopher Johnston wrote:
> Yes it prints 4 directly into the file, but I cant put processorcount into
> the loop. Works fine in ruby but erb fails. Any ideas here on how to do
> this? I need to be able to determine the number of processors on the
> systems so
On 23 Nov 2009, at 7:33 AM, Christopher Johnston wrote:
> Its definitely there.. I even put a <%= processorcount %> to make
> sure the variable is set.
>
> <% processorcount.to_i-1 %>
> <% for cpu in (0..processorcount) %>
Try:
<% for cpu in (0 .. processorcount.to_i) %>
--
Ian Ward C
On 23 Nov 2009, at 3:41 PM, Christopher Johnston wrote:
> Yes it prints 4 directly into the file, but I cant put
> processorcount into the loop. Works fine in ruby but erb fails.
> Any ideas here on how to do this? I need to be able to determine
> the number of processors on the systems so
Ignore me, I had a typo. I had put the parentheses around
(0..(processorcount.to_i-1) but I forgot the closing ')'
-Chris
On Wed, Nov 25, 2009 at 11:30 AM, Peter Meier wrote:
> > ah! I am still learning ruby here so appreciate the time spent to show
> me
> > this.
> >
> > Shouldn't this also
> ah! I am still learning ruby here so appreciate the time spent to show me
> this.
>
> Shouldn't this also work to subtract (1) from the integer? Works in a ruby
> script but not here.
>
> 19 <% processorcount.to_i - 1 %>
> 20 <% for cpu in (0..processorcount.to_i) %>
you mean it still counts u
ah! I am still learning ruby here so appreciate the time spent to show me
this.
Shouldn't this also work to subtract (1) from the integer? Works in a ruby
script but not here.
19 <% processorcount.to_i - 1 %>
20 <% for cpu in (0..processorcount.to_i) %>
On Mon, Nov 23, 2009 at 9:17 PM, Ohad
your problems is that processorcount is a string, here are some examples
that works:
<% processorcount.each do |cpu| -%>
<%= cpu.to_i * 100 %>
<%# more stuff -%>
<% end %>
<% for cpu in (0..processorcount.to_i) %>
<%= cpu %>
<%end%>
<% processorcount.to_i.times do |cpu| %>
<%= cpu %>
<%e
Christopher Johnston wrote:
> Yes it prints 4 directly into the file, but I cant put processorcount
> into the loop. Works fine in ruby but erb fails. Any ideas here on how
> to do this? I need to be able to determine the number of processors on
> the systems so I can generate a configuration
Yes it prints 4 directly into the file, but I cant put processorcount into
the loop. Works fine in ruby but erb fails. Any ideas here on how to do
this? I need to be able to determine the number of processors on the
systems so I can generate a configuration file (loop through each processor
numb
2009/11/23 Christopher Johnston :
> Its definitely there.. I even put a <%= processorcount %> to make sure the
> variable is set.
> <% processorcount.to_i-1 %>
> <% for cpu in (0..processorcount) %>
> Facter version is 1.52
> # facter | grep proc
> processor0 => Intel(R) Xeon(R) CPU X557
Its definitely there.. I even put a <%= processorcount %> to make sure the
variable is set.
<% processorcount.to_i-1 %>
<% for cpu in (0..processorcount) %>
Facter version is 1.52
# facter | grep proc
processor0 => Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
processor1 => Intel(R) Xeon(R) C
2009/11/19 Christopher Johnston :
> How come this doesnt work? I write this in a normal ruby script it
> works just fine.
>
> <% for cpu in (0..processorcount) %>
>
> I want to loop through the number of processor so a specific action
> can be taken to generate content for a file. I get an error o
12 matches
Mail list logo