Permalink
Browse files

fix: parallel importing VMs

  • Loading branch information...
1 parent 8dbdfe3 commit e962c84e7432646cf0b0629a9db4037a904e24f1 @avokhmin committed Nov 19, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 plugins/providers/virtualbox/driver/version_4_2.rb
View
5 plugins/providers/virtualbox/driver/version_4_2.rb
@@ -158,7 +158,8 @@ def import(ovf)
output = ""
total = ""
last = 0
- execute("import", ovf) do |type, data|
+ tmp_name = rand(36**20).to_s(36) << '_' << Time.now.to_i.to_s
+ execute("import", ovf, '--vsys', 0, '--vmname', tmp_name) do |type, data|
if type == :stdout
# Keep track of the stdout so that we can get the VM name
output << data
@@ -183,7 +184,7 @@ def import(ovf)
end
# Find the name of the VM name
- if output !~ /Suggested VM name "(.+?)"/
+ if output !~ /VM name specified with "(.+?)"/
@logger.error("Couldn't find VM name in the output.")
return nil
end

0 comments on commit e962c84

Please sign in to comment.