Revision e22aa3a9 image_creator/disk.py

b/image_creator/disk.py
93 93
            job, args = self._cleanup_jobs.pop()
94 94
            job(*args)
95 95

  
96
    def get_device(self):
97
        """Returns a newly created DiskDevice instance.
98

  
99
        This instance is a snapshot of the original source media of
100
        the Disk instance.
96
    def snapshot(self):
97
        """Creates a snapshot of the original source media of the Disk
98
        instance.
101 99
        """
102 100

  
103 101
        output("Examining source media `%s'..." % self.source, False)
......
141 139
        finally:
142 140
            os.unlink(table)
143 141
        success('done')
144
        new_device = DiskDevice("/dev/mapper/%s" % snapshot)
142
        return "/dev/mapper/%s" % snapshot
143

  
144
    def get_device(self, media):
145
        """Returns a newly created DiskDevice instance."""
146

  
147
        new_device = DiskDevice(media)
145 148
        self._devices.append(new_device)
146 149
        new_device.enable()
147 150
        return new_device

Also available in: Unified diff