~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/tests/fake_imagebackend.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    def __init__(self, use_cow):
26
26
        pass
27
27
 
28
 
    def image(self, instance, name, suffix='', image_type=''):
 
28
    def image(self, instance, name, image_type=''):
29
29
        class FakeImage(imagebackend.Image):
30
 
            def __init__(self, instance, name, suffix=''):
31
 
                self.path = os.path.join(instance, name + suffix)
 
30
            def __init__(self, instance, name):
 
31
                self.path = os.path.join(instance, name)
32
32
 
33
33
            def create_image(self, prepare_template, base,
34
34
                              size, *args, **kwargs):
37
37
            def cache(self, fn, fname, size=None, *args, **kwargs):
38
38
                pass
39
39
 
40
 
            def libvirt_info(self, device_type):
 
40
            def libvirt_info(self, disk_bus, disk_dev,
 
41
                             device_type, cache_mode):
41
42
                info = config.LibvirtConfigGuestDisk()
42
43
                info.source_type = 'file'
43
44
                info.source_device = device_type
 
45
                info.target_bus = disk_bus
 
46
                info.target_dev = disk_dev
 
47
                info.driver_cache = cache_mode
44
48
                info.driver_format = 'raw'
45
49
                info.source_path = self.path
46
50
                return info
47
51
 
48
 
        return FakeImage(instance, name, suffix)
 
52
        return FakeImage(instance, name)