From 8b3f1e02b6c5e1d69e34b1b924681f8c408bae54 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Sun, 9 Nov 2014 22:20:15 +0000 Subject: Don't create rawdisk image if deploying to a device --- morphlib/exts/rawdisk.write | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/morphlib/exts/rawdisk.write b/morphlib/exts/rawdisk.write index 7d0ebaee..0e9453fb 100755 --- a/morphlib/exts/rawdisk.write +++ b/morphlib/exts/rawdisk.write @@ -43,11 +43,15 @@ class RawDiskWriteExtension(morphlib.writeexts.WriteExtension): raise cliapp.AppException('Wrong number of command line args') temp_root, location = args - if os.path.isfile(location): + # If the location exists and is a file, then try to upgrade it. + # The 'isfile' call should fail also if the location is a device, + # and the 'is_device' check shouldn't be needed here. + if os.path.isfile(location) and not self.is_device(location): self.upgrade_local_system(location, temp_root) else: try: - self.create_raw_disk_image(location) + if not self.is_device(location): + self.create_raw_disk_image(location) self.create_local_system(temp_root, location) self.status(msg='Disk image has been created at %s' % location) except Exception: -- cgit v1.2.1