summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-11-11 16:41:35 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-11-11 17:06:40 +0000
commit771b8bda2321de5d70b2ffcdbc1e4eaafc792fda (patch)
treec3bf5735f638266e32cf3c0dfd3dedfe91e81ee0
parent13a26e3a1f66c220282e2ce3d0014149a4171eec (diff)
downloadmorph-771b8bda2321de5d70b2ffcdbc1e4eaafc792fda.tar.gz
move out the logic
-rwxr-xr-xmorphlib/exts/rawdisk.write5
-rw-r--r--morphlib/writeexts.py11
2 files changed, 4 insertions, 12 deletions
diff --git a/morphlib/exts/rawdisk.write b/morphlib/exts/rawdisk.write
index 12db4398..51bc0a8b 100755
--- a/morphlib/exts/rawdisk.write
+++ b/morphlib/exts/rawdisk.write
@@ -47,7 +47,10 @@ class RawDiskWriteExtension(morphlib.writeexts.WriteExtension):
self.upgrade_local_system(location, temp_root)
else:
try:
- self.create_local_system(temp_root, location)
+ self.create_filesytem(location)
+ self.format_btrfs(location)
+ self.create_system(temp_root, location)
+
self.status(msg='Disk image has been created at %s' % location)
except Exception:
self.status(msg='Failure to create disk image at %s' %
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py
index cd33045a..f9a0eed1 100644
--- a/morphlib/writeexts.py
+++ b/morphlib/writeexts.py
@@ -145,17 +145,6 @@ class WriteExtension(cliapp.Application):
'Error: Btrfs is required for this deployment, but was not '
'detected in the kernel of the machine that is running Morph.')
- def create_local_system(self, temp_root, raw_disk):
- '''Create a raw system image locally.'''
-
- self.create_filesytem(raw_disk)
- try:
- self.format_btrfs(raw_disk)
- self.create_system(temp_root, raw_disk)
- except BaseException, e:
- os.remove(raw_disk)
- raise
-
def create_filesytem(self, raw_disk):
size = self.get_disk_size()
if not size: