Class: Veewee::Transaction

Inherits:
Object show all
Defined in:
lib/veewee/provider/core/provider/transaction.rb

Instance Method Summary collapse

Instance Method Details

#transaction(name, params, &block) ⇒ Object


6
7
# File 'lib/veewee/provider/core/provider/transaction.rb', line 6

def transaction(name,params, &block)
end

#transaction2(name, options = { :checksum => "nochecksum"}, &block) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/veewee/provider/core/provider/transaction.rb', line 9

def transaction2(name,options= { :checksum => "nochecksum"}, &block)
   if snapshot_exists(@vmname,name+"-"+options[:checksum])
      load_snapshot_vmachine(@vmname,name+"-"+options[:checksum])
    else
      if snapshot_version_exists(@vmname,name)
        rollback_snapshot(@vmname,name)
        #rollback to snapshot prior to this one
      end
      yield
      create_snapshot_vmachine(@vmname,name+"-"+options[:checksum])
    end
  #end
end