# File lib/fission/action/vm/deleter.rb, line 37 def delete unless @vm.exists? return Response.new :code => 1, :message => 'VM does not exist' end running_response = @vm.running? return running_response unless running_response.successful? if running_response.data message = 'The VM must not be running in order to delete it.' return Response.new :code => 1, :message => message end FileUtils.rm_rf @vm.path Metadata.delete_vm_info @vm.path Response.new :code => 0 end