methods/pk_client.rb
# Check if a packer VirtualBox disk image exists
Check if a packer VirtualBox disk image exists
Check if a packer VirtualBox disk image exists
def check_packer_vbox_disk_exists(options)
  exists   = false
  vdi_file = options['clientdir']+"/packer/"+options['vm']+"/"+options['name']+"/images/"+options['name']+".vdi"
  message  = "Information:\tChecking if VDI file exists for #{options['name']}"
  command  = "#{options['vboxmanage']} list hdds |grep ^Location"
  output   = execute_command(options,message,command)
  if output.match(/#{vdi_file}/)
    puts "got here"
  end
  return exists
end
def check_packer_vbox_disk_exists ( options ) exists = false vdi_file = options [ 'clientdir' ] + "/packer/" + options [ 'vm' ] + "/" + options [ 'name' ] + "/images/" + options [ 'name' ] + ".vdi" message = "Information:\tChecking if VDI file exists for #{options['name']}" command = "#{options['vboxmanage']} list hdds |grep ^Location" output = execute_command ( options , message , command ) if output . match ( / #{ vdi_file } / ) puts "got here" end return exists end
Check if a packer VirtualBox disk image exists
Check if a packer VirtualBox disk image exists
options
<not_specific>