lib/veewee/provider/virtualbox/box/destroy.rb in veewee-0.3.0.alpha6 vs lib/veewee/provider/virtualbox/box/destroy.rb in veewee-0.3.0.alpha7

- old
+ new

@@ -4,11 +4,11 @@ module BoxCommand def destroy(option={}) unless self.exists? - env.ui.error "Error:: You tried to destroy a non-existing box '#{name}'" + ui.error "Error:: You tried to destroy a non-existing box '#{name}'" exit -1 end # If it has a save state,remove that first @@ -18,12 +18,12 @@ # Wait for it to happen sleep 2 end command="#{@vboxcmd} unregistervm \"#{name}\" --delete" - env.ui.info command - env.ui.info "Deleting vm #{name}" + ui.info command + ui.info "Deleting vm #{name}" #Exec and system stop the execution here shell_exec("#{command}",{:mute => true}) sleep 1 @@ -42,17 +42,17 @@ command="#{@vboxcmd} closemedium disk \"#{location}\" --delete" else command="#{@vboxcmd} closemedium disk \"#{location}\"" end - env.ui.info "Deleting disk #{location}" - env.ui.info "#{command}" + ui.info "Deleting disk #{location}" + ui.info "#{command}" shell_exec("#{command}",{:mute => true}) if File.exists?(location) - env.ui.info "We tried to delete the disk file via virtualbox '#{location} but failed" - env.ui.info "Removing it manually" + ui.info "We tried to delete the disk file via virtualbox '#{location} but failed" + ui.info "Removing it manually" FileUtils.rm(location) exit -1 end break end