Commit f9987521 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

Make all files requirable

parent a239da1b
......@@ -58,20 +58,22 @@ class CPUParametersGenerator < WikiGenerator
end
end
generator = CPUParametersGenerator.new("Generated/CPUParameters")
if __FILE__ == $0
generator = CPUParametersGenerator.new("Generated/CPUParameters")
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
end
end
end
......@@ -62,20 +62,23 @@ class DiskReservationGenerator < WikiGenerator
end
end
generator = DiskReservationGenerator.new("Generated/DiskReservation")
if __FILE__ == $0
generator = DiskReservationGenerator.new("Generated/DiskReservation")
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
options = WikiGenerator::parse_options
pp options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
end
end
end
......@@ -270,21 +270,23 @@ class G5KHardwareGenerator < WikiGenerator
end
end
generator = G5KHardwareGenerator.new("Hardware")
if __FILE__ == $0
generator = G5KHardwareGenerator.new("Hardware")
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts "Error with node: #{generator.instance_variable_get(:@node)}"
puts e, e.backtrace
ret = 4
ensure
exit(ret)
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts "Error with node: #{generator.instance_variable_get(:@node)}"
puts e, e.backtrace
ret = 4
ensure
exit(ret)
end
end
end
......@@ -222,21 +222,22 @@ class OarPropertiesGenerator < WikiGenerator
end
end
generator = OarPropertiesGenerator.new("Generated/OAR_Properties")
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
if __FILE__ == $0
generator = OarPropertiesGenerator.new("Generated/OAR_Properties")
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = generator.exec(options)
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
end
end
end
......@@ -29,23 +29,25 @@ class SiteNetworkGenerator < WikiGenerator
end
end
options = WikiGenerator::parse_options
if __FILE__ == $0
options = WikiGenerator::parse_options
if (options)
ret = 2
begin
ret = true
generators = options[:sites].map{ |site| SiteNetworkGenerator.new('Generated/' + site.capitalize + 'Network', site) }
generators.each{ |generator|
ret &= generator.exec(options)
}
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
if (options)
ret = 2
begin
ret = true
generators = options[:sites].map{ |site| SiteNetworkGenerator.new('Generated/' + site.capitalize + 'Network', site) }
generators.each{ |generator|
ret &= generator.exec(options)
}
rescue MediawikiApi::ApiError => e
puts e, e.backtrace
ret = 3
rescue StandardError => e
puts e, e.backtrace
ret = 4
ensure
exit(ret)
end
end
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