projects
/
snf-image-creator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Seperate snapshoting from get_device in Disk class
[snf-image-creator]
/
image_creator
/
disk.py
diff --git
a/image_creator/disk.py
b/image_creator/disk.py
index
01ff41d
..
ef53799
100644
(file)
--- a/
image_creator/disk.py
+++ b/
image_creator/disk.py
@@
-93,11
+93,9
@@
class Disk(object):
job, args = self._cleanup_jobs.pop()
job(*args)
job, args = self._cleanup_jobs.pop()
job(*args)
- def get_device(self):
- """Returns a newly created DiskDevice instance.
-
- This instance is a snapshot of the original source media of
- the Disk instance.
+ def snapshot(self):
+ """Creates a snapshot of the original source media of the Disk
+ instance.
"""
output("Examining source media `%s'..." % self.source, False)
"""
output("Examining source media `%s'..." % self.source, False)
@@
-141,7
+139,12
@@
class Disk(object):
finally:
os.unlink(table)
success('done')
finally:
os.unlink(table)
success('done')
- new_device = DiskDevice("/dev/mapper/%s" % snapshot)
+ return "/dev/mapper/%s" % snapshot
+
+ def get_device(self, media):
+ """Returns a newly created DiskDevice instance."""
+
+ new_device = DiskDevice(media)
self._devices.append(new_device)
new_device.enable()
return new_device
self._devices.append(new_device)
new_device.enable()
return new_device