Browse files

style: spacing

  • Loading branch information...
1 parent b862f35 commit e3a212839beadb348889f6e5037275665e7764ae @miketheman miketheman committed Dec 14, 2012
Showing with 23 additions and 23 deletions.
  1. +23 −23 Rakefile
View
46 Rakefile
@@ -25,33 +25,33 @@ Rake::TestTask.new do |t|
end
desc 'Verify ISO'
-task :iso, [:template_name] do |t,args|
+task :iso, [:template_name] do |t, args|
require 'net/http'
#if args.to_hash.size!=1
#puts "needs one arguments: rake iso [\"yourname\"]"
#exit
#end
Dir.glob("templates/*").each do |name|
- definition_name=File.basename(name)
+ definition_name = File.basename(name)
puts name
- definition=Veewee::Environment.new(:cwd => ".",:definition_dir => "templates").definitions[definition_name]
- next if definition.nil? || definition.iso_src.nil? || definition.iso_src==""
+ definition = Veewee::Environment.new(:cwd => ".", :definition_dir => "templates").definitions[definition_name]
+ next if definition.nil? || definition.iso_src.nil? || definition.iso_src == ""
begin
- url=definition.iso_src
- found=false
+ url = definition.iso_src
+ found = false
response = nil
- while found==false
- uri=URI.parse(url)
+ while found == false
+ uri = URI.parse(url)
if uri.is_a?(URI::HTTP)
- Net::HTTP.start(uri.host,uri.port) {|http|
+ Net::HTTP.start(uri.host, uri.port) { |http|
response = http.head(uri.path)
}
unless response['location'].nil?
#puts "Redirecting to "+response['location']
- url=response['location']
+ url = response['location']
else
- length=response['content-length']
- found=true
+ length = response['content-length']
+ found = true
end
elsif uri.is_a?(URI::FTP)
require 'net/ftp'
@@ -62,7 +62,7 @@ task :iso, [:template_name] do |t,args|
found = true
rescue Net::FTPReplyError => e
reply = e.message
- err_code = reply[0,3].to_i
+ err_code = reply[0, 3].to_i
unless err_code == 500 || err_code == 502
# other problem, raise
raise "Got ftp site but doesn't support size subcommand"
@@ -75,34 +75,34 @@ task :iso, [:template_name] do |t,args|
if length.to_i < 10000
puts definition.iso_src
puts "Incorrect length #{length.to_i}"
- puts uri.host,uri.port, uri.path,response.code
+ puts uri.host, uri.port, uri.path, response.code
end
rescue Exception => ex
- puts "Error"+ex.to_s+definition.iso_src
+ puts "Error" + ex.to_s + definition.iso_src
end
end
end
desc 'Autobuilds all templates and runs validation.'
-task :autotest, [:pattern] do |t,args|
+task :autotest, [:pattern] do |t, args|
# We overrule all timeouts for tcp and ssh
#ENV['VEEWEE_TIMEOUT']='600'
- ve=Veewee::Environment.new()
- ve.templates.each do |name,template|
+ ve = Veewee::Environment.new
+ ve.templates.each do |name, template|
# If pattern was given, only take the ones that match the pattern
unless args[:pattern].nil?
next unless name.match(args[:pattern])
end
begin
- ve.definitions.define("auto",name, { 'force' => true})
- vd=ve.definitions["auto"]
- box=ve.providers["virtualbox"].get_box("auto")
+ ve.definitions.define("auto", name, { 'force' => true })
+ vd = ve.definitions["auto"]
+ box = ve.providers["virtualbox"].get_box("auto")
puts "AUTO: Building #{name}"
- box.build({"auto" => true,"force" => true, 'nogui' => true })
+ box.build({ "auto" => true, "force" => true, 'nogui' => true })
puts "AUTO: Validating #{name}"
box.validate_vagrant
puts "AUTO: Success #{name}"
@@ -111,7 +111,7 @@ task :autotest, [:pattern] do |t,args|
puts "AUTO: Template #{name} failed - #{ex}"
if box.running?
begin
- screenshot="screenshot-auto-#{name}.png"
+ screenshot = "screenshot-auto-#{name}.png"
puts "AUTO: Taking snapshot #{screenshot}"
box.screenshot(screenshot)
rescue Veewee::Error => ex

0 comments on commit e3a2128

Please sign in to comment.