Mentions légales du service

Skip to content
Snippets Groups Projects
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
Branches
No related tags found
No related merge requests found
...@@ -60,7 +60,8 @@ namespace :deadnodes do ...@@ -60,7 +60,8 @@ namespace :deadnodes do
task :browse do task :browse do
def comment_ok?(comment) def comment_ok?(comment)
comment.nil? or comment == "OK" # comment.nil? or comment == "OK"
comment == "OK"
end end
@api_sites.each do |site| @api_sites.each do |site|
site.status["nodes"].each do |uid,status| site.status["nodes"].each do |uid,status|
...@@ -68,15 +69,15 @@ namespace :deadnodes do ...@@ -68,15 +69,15 @@ namespace :deadnodes do
state = status["hard"].downcase state = status["hard"].downcase
if comment_ok?(comment) if comment_ok?(comment)
if state == "dead" 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 else
# nothing, good state # nothing, good state
end end
else else
if state == "dead" 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 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 end
end end
......
...@@ -43,6 +43,7 @@ module Grid5000 ...@@ -43,6 +43,7 @@ module Grid5000
h['memcore'] = properties['main_memory']['ram_size']/properties['architecture']['smt_size']/MiB 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['memcpu'] = properties['main_memory']['ram_size']/properties['architecture']['smp_size']/MiB
h['memnode'] = properties['main_memory']['ram_size']/MiB h['memnode'] = properties['main_memory']['ram_size']/MiB
h['comment'] = properties['comment'] || "OK"
h h
} }
} }
...@@ -61,4 +62,4 @@ module Grid5000 ...@@ -61,4 +62,4 @@ module Grid5000
end end
end end
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment