Mount the media ro if --print-sysprep is specified
authorNikos Skalkotos <skalkoto@grnet.gr>
Thu, 18 Oct 2012 08:37:41 +0000 (11:37 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Thu, 18 Oct 2012 08:37:41 +0000 (11:37 +0300)
image_creator/disk.py
image_creator/main.py

index c367efd..70c7f87 100644 (file)
@@ -242,7 +242,8 @@ class DiskDevice(object):
         """Mount all disk partitions in a correct order."""
 
         mount = self.g.mount_ro if readonly else self.g.mount
-        self.out.output("Mounting image...", False)
+        msg = " read-only" if readonly else ""
+        self.out.output("Mounting the media%s..." % msg, False)
         mps = self.g.inspect_get_mountpoints(self.root)
 
         # Sort the keys to mount the fs in a correct order.
index a12d863..f5dc5fe 100644 (file)
@@ -193,7 +193,8 @@ def image_creator():
         dev = disk.get_device(snapshot)
 
         # If no customization is to be applied, the image should be mounted ro
-        readonly = not (options.sysprep or options.shrink)
+        readonly = (not (options.sysprep or options.shrink) or
+                    options.print_sysprep)
         dev.mount(readonly)
 
         cls = os_cls(dev.distro, dev.ostype)