Commit 4712e497 authored by Gaetan SIMO's avatar Gaetan SIMO
Browse files

[Rakefile] Adding '-p comment=OK' for all new node, via 'rake oar:generate' task

parent eee9b1ab
......@@ -60,7 +60,8 @@ namespace :deadnodes do
task :browse do
def comment_ok?(comment)
comment.nil? or comment == "OK"
# comment.nil? or comment == "OK"
comment == "OK"
end
@api_sites.each do |site|
site.status["nodes"].each do |uid,status|
......@@ -68,15 +69,15 @@ namespace :deadnodes do
state = status["hard"].downcase
if comment_ok?(comment)
if state == "dead"
@logger.error "Node '#{uid}' has comment 'OK', so its state should not be 'Dead' " if @tofix
@logger.error "Node '#{uid}' of state '#{state}' should not have comment '#{comment.inspect}'" if @tofix
else
# nothing, good state
end
else
if state == "dead"
@logger.info "Node '#{uid}' is dead because '#{comment}'" if @reasons
@logger.info "Node '#{uid}' is dead because '#{comment.inspect}'" if @reasons
else
@logger.error "Node '#{uid}' has comment not 'OK'. so its state should be 'Dead'. Instead its state is '#{state}'" if @tofix
@logger.error "Node '#{uid}' should have the not-dead-comment 'OK', since its state is '#{state}'. Instead, it has comment '#{comment.inspect}'." if @tofix
end
end
end
......
......@@ -43,6 +43,7 @@ module Grid5000
h['memcore'] = properties['main_memory']['ram_size']/properties['architecture']['smt_size']/MiB
h['memcpu'] = properties['main_memory']['ram_size']/properties['architecture']['smp_size']/MiB
h['memnode'] = properties['main_memory']['ram_size']/MiB
h['comment'] = properties['comment'] || "OK"
h
}
}
......@@ -61,4 +62,4 @@ module Grid5000
end
end
end
\ No newline at end of file
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment