Refactors more snapshot code into vm_utils.

Simplifies vmops a bit while moving logic into vmutils where it better
matches how we've seperated concerns.

Change-Id: Ic6d7559903d0f809f4c90577f4a8c4a0857cae90
This commit is contained in:
Rick Harris
2012-07-06 18:34:33 +00:00
parent aabb0c65f1
commit 05079fed03

View File

@@ -317,7 +317,7 @@ class FakeSessionForVolumeFailedTests(FakeSessionForVolumeTests):
def stub_out_migration_methods(stubs):
def fake_create_snapshot(self, instance):
def fake_create_snapshot(session, instance, vm_ref, label):
return 'vm_ref', dict(image='foo', snap='bar')
def fake_move_disks(self, instance, disk_info):
@@ -347,7 +347,7 @@ def stub_out_migration_methods(stubs):
stubs.Set(vmops.VMOps, '_move_disks', fake_move_disks)
stubs.Set(vm_utils, 'scan_default_sr', fake_sr)
stubs.Set(vm_utils, '_scan_sr', fake_sr)
stubs.Set(vmops.VMOps, '_create_snapshot', fake_create_snapshot)
stubs.Set(vm_utils, 'create_snapshot', fake_create_snapshot)
stubs.Set(vm_utils, 'get_vdi_for_vm_safely', fake_get_vdi)
stubs.Set(vm_utils, 'get_sr_path', fake_get_sr_path)
stubs.Set(vm_utils, 'generate_ephemeral', fake_generate_ephemeral)