Mentions légales du service

Skip to content
Snippets Groups Projects

Fixes/bug 7485

Merged Pascal Morillon requested to merge fixes/bug_7485 into v0.8.0
1 file
+ 19
1
Compare changes
  • Side-by-side
  • Inline
@@ -144,7 +144,7 @@ class Lanpower::Application::OARlanpower < Lanpower::Application
begin
results[node.host] = node.send('status')
if results[node.host] == 'on'
if (task.retry_count >= (task.times || 100))
if (powerstatus_task.retry_count >= (powerstatus_task.times || 100))
poweroff_task = Lanpower::Task.new :desc => "Power off node #{node.host}"
poweroff_task.define do
begin
@@ -182,11 +182,29 @@ class Lanpower::Application::OARlanpower < Lanpower::Application
wakeup_task.define do
begin
results[node.host] = node.send('on')
powerstatus_task = Lanpower::Task.new :desc => "Power status node #{node.host}"
powerstatus_task.define do
begin
results[node.host] = node.send('status')
if results[node.host] == 'off'
wakeup_task.retryWithDelay(2,5)
end
results[node.host]
rescue Exception => powerStatusException
puts "IPMI power status on node #{node.host} failed" if config[:debug]
puts powerStatusException if config[:debug]
powerstatus_task.retryWithDelay(5, 10)
results[node.host] = 'error'
end
end
powerstatus_task.scheduleWithDelay(10)
rescue Exception => powerOnException
puts "IMPI power on on node #{node.host} failed" if config[:debug]
puts powerOnException if config[:debug]
wakeup_task.retryWithDelay(3,10)
results[node.host] = 'error'
end
results[node.host]
end
wakeup_task.schedule
end
Loading