Commit 9d740d3f authored by Jérémie Gaidamour's avatar Jérémie Gaidamour
Browse files

[dev] run-g5kchecks: force ruby version + exception handling

parent 2448b015
...@@ -11,10 +11,16 @@ require 'pathname' ...@@ -11,10 +11,16 @@ require 'pathname'
require 'yaml' require 'yaml'
require '../lib/hash/hash' require '../lib/hash/hash'
if RUBY_VERSION < "2.1"
puts "This script requires ruby >= 2.1"
exit
end
puts 'Postprocessing of output/. Copying files into ../../input/' puts 'Postprocessing of output/. Copying files into ../../input/'
list_of_yaml_files = Dir['output/*.y*ml'].sort_by { |x| -x.count('/') } list_of_yaml_files = Dir['output/*.y*ml'].sort_by { |x| -x.count('/') }
list_of_yaml_files.each { |filename| list_of_yaml_files.each { |filename|
begin
file = filename.split("/")[1] file = filename.split("/")[1]
node_uid = file.split(".")[0] node_uid = file.split(".")[0]
site_uid = file.split(".")[1] site_uid = file.split(".")[1]
...@@ -46,4 +52,8 @@ list_of_yaml_files.each { |filename| ...@@ -46,4 +52,8 @@ list_of_yaml_files.each { |filename|
file.write("# Generated by g5k-checks (g5k-checks -m api)\n") file.write("# Generated by g5k-checks (g5k-checks -m api)\n")
file.write(contents) file.write(contents)
} }
rescue Exception => e
puts "#{node_uid} - #{e.class}: #{e.message}"
end
} }
...@@ -15,6 +15,11 @@ require 'peach' ...@@ -15,6 +15,11 @@ require 'peach'
require '../lib/input_loader' require '../lib/input_loader'
require 'pp' require 'pp'
if RUBY_VERSION < "2.1"
puts "This script requires ruby >= 2.1"
exit
end
# puts 'Init ruby-cute' # puts 'Init ruby-cute'
$g5k = Cute::G5K::API.new() $g5k = Cute::G5K::API.new()
# puts '...done' # puts '...done'
......
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