[Fedora-livecd-list] imgcreate/creator.py

Brian C. Lane bcl at fedoraproject.org
Fri Oct 10 17:33:40 UTC 2014


 imgcreate/creator.py |   40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 6f8389953fced1da76e4f5576767ab27fe1228b8
Author: Brian C. Lane <bcl at redhat.com>
Date:   Fri Oct 10 09:13:47 2014 -0700

    Move __fstype into ImageCreator class
    
    _write_fstab needs to have it set so it makes more sense to have it in
    the base class.

diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 42faf6f..a06f3df 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -87,6 +87,7 @@ class ImageCreator(object):
 
         self.__builddir = None
         self.__bindmounts = []
+        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")
 
         self.__sanity_check()
 
@@ -138,6 +139,24 @@ class ImageCreator(object):
 
     """
 
+    def __get_fstype(self):
+        return self.__fstype
+    def __set_fstype(self, val):
+        if val not in ("ext2", "ext3", "ext4"):
+            raise CreatorError("Unknown _fstype '%s' supplied" % val)
+        self.__fstype = val
+    _fstype = property(__get_fstype, __set_fstype)
+    """The type of filesystem used for the image.
+
+    This is the filesystem type used when creating the filesystem image.
+    Subclasses may change this if they wish to use something other ext3.
+
+    Note, only ext2, ext3, ext4 are currently supported.
+
+    Note also, this attribute may only be set before calling mount().
+
+    """
+
     #
     # Hooks for subclasses
     #
@@ -802,7 +821,6 @@ class LoopImageCreator(ImageCreator):
 
         self.__minsize_KB = 0
         self.__blocksize = 4096
-        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")
 
         self.__instloop = None
         self.__imgdir = None
@@ -872,24 +890,6 @@ class LoopImageCreator(ImageCreator):
 
     """
 
-    def __get_fstype(self):
-        return self.__fstype
-    def __set_fstype(self, val):
-        if val not in ("ext2", "ext3", "ext4"):
-            raise CreatorError("Unknown _fstype '%s' supplied" % val)
-        self.__fstype = val
-    _fstype = property(__get_fstype, __set_fstype)
-    """The type of filesystem used for the image.
-
-    This is the filesystem type used when creating the filesystem image.
-    Subclasses may change this if they wish to use something other ext3.
-
-    Note, only ext2, ext3, ext4 are currently supported.
-
-    Note also, this attribute may only be set before calling mount().
-
-    """
-
     #
     # Helpers for subclasses
     #
@@ -927,7 +927,7 @@ class LoopImageCreator(ImageCreator):
         self.__instloop = ExtDiskMount(SparseLoopbackDisk(self._image,
                                                           self.__image_size),
                                        self._instroot,
-                                       self.__fstype,
+                                       self._fstype,
                                        self.__blocksize,
                                        self.fslabel,
                                        self.tmpdir)




More information about the livecd mailing list