[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 1/7] Remove the anaconda attribute from Platform.



---
 pyanaconda/__init__.py                 |    2 +-
 pyanaconda/platform.py                 |   29 +++++++++++++----------------
 pyanaconda/storage/devicetree.py       |    2 +-
 pyanaconda/storage/formats/biosboot.py |    2 +-
 pyanaconda/storage/formats/fs.py       |    4 ++--
 pyanaconda/storage/formats/prepboot.py |    2 +-
 pyanaconda/storage/partitioning.py     |    6 +++++-
 7 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 5654da5..ff51e31 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -155,7 +155,7 @@ class Anaconda(object):
     def platform(self):
         if not self._platform:
             from pyanaconda import platform
-            self._platform = platform.getPlatform(self)
+            self._platform = platform.getPlatform()
 
         return self._platform
 
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index bbc6082..66a6840 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -59,12 +59,11 @@ class Platform(object):
     _disklabel_types = []
     _non_linux_format_types = []
 
-    def __init__(self, anaconda):
+    def __init__(self):
         """Creates a new Platform object.  This is basically an abstract class.
            You should instead use one of the platform-specific classes as
            returned by getPlatform below.  Not all subclasses need to provide
            all the methods in this class."""
-        self.anaconda = anaconda
 
         if flags.nogpt and "gpt" in self._disklabel_types and \
            len(self._disklabel_types) > 1:
@@ -130,7 +129,6 @@ class Platform(object):
         """Return the default platform-specific partitioning information."""
         from storage.partspec import PartSpec
         return [PartSpec(mountpoint="/boot",
-                         fstype=self.anaconda.storage.defaultBootFSType,
                          size=500, weight=self.weight(mountpoint="/boot"))]
 
     def weight(self, fstype=None, mountpoint=None):
@@ -156,8 +154,8 @@ class X86(Platform):
     # XXX hpfs, if reported by blkid/udev, will end up with a type of None
     _non_linux_format_types = ["vfat", "ntfs", "hpfs"]
 
-    def __init__(self, anaconda):
-        super(X86, self).__init__(anaconda)
+    def __init__(self):
+        super(X86, self).__init__()
         self.blackListGPT()
 
     def setDefaultPartitioning(self):
@@ -283,14 +281,13 @@ class S390(Platform):
     _disklabel_types = ["msdos", "dasd"]
     _boot_stage1_device_types = ["disk", "partition"]
 
-    def __init__(self, anaconda):
-        Platform.__init__(self, anaconda)
+    def __init__(self):
+        Platform.__init__(self)
 
     def setDefaultPartitioning(self):
         """Return the default platform-specific partitioning information."""
         from storage.partspec import PartSpec
         return [PartSpec(mountpoint="/boot", size=500,
-                         fstype=self.anaconda.storage.defaultBootFSType,
                          weight=self.weight(mountpoint="/boot"), asVol=True,
                          singlePV=True)]
 
@@ -315,7 +312,7 @@ class Sparc(Platform):
         start /= long(1024 / disk.device.sectorSize)
         return start+1
 
-def getPlatform(anaconda):
+def getPlatform():
     """Check the architecture of the system and return an instance of a
        Platform subclass to match.  If the architecture could not be determined,
        raise an exception."""
@@ -323,20 +320,20 @@ def getPlatform(anaconda):
         ppcMachine = iutil.getPPCMachine()
 
         if (ppcMachine == "PMac" and iutil.getPPCMacGen() == "NewWorld"):
-            return NewWorldPPC(anaconda)
+            return NewWorldPPC()
         elif ppcMachine in ["iSeries", "pSeries"]:
-            return IPSeriesPPC(anaconda)
+            return IPSeriesPPC()
         elif ppcMachine == "PS3":
-            return PS3(anaconda)
+            return PS3()
         else:
             raise SystemError, "Unsupported PPC machine type"
     elif iutil.isS390():
-        return S390(anaconda)
+        return S390()
     elif iutil.isSparc():
-        return Sparc(anaconda)
+        return Sparc()
     elif iutil.isEfi():
-        return EFI(anaconda)
+        return EFI()
     elif iutil.isX86():
-        return X86(anaconda)
+        return X86()
     else:
         raise SystemError, "Could not determine system architecture."
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index a8c3ac3..dc31302 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -175,7 +175,7 @@ class DeviceTree(object):
         self.dasd = dasd
         self.mpathFriendlyNames = getattr(conf, "mpathFriendlyNames", True)
 
-        self.platform = platform.getPlatform(None)
+        self.platform = platform.getPlatform()
 
         self.diskImages = {}
         images = getattr(conf, "diskImages", {})
diff --git a/pyanaconda/storage/formats/biosboot.py b/pyanaconda/storage/formats/biosboot.py
index 93e1de7..34bd760 100644
--- a/pyanaconda/storage/formats/biosboot.py
+++ b/pyanaconda/storage/formats/biosboot.py
@@ -54,7 +54,7 @@ class BIOSBoot(DeviceFormat):
     @property
     def supported(self):
         from pyanaconda import platform
-        return isinstance(platform.getPlatform(None), platform.X86)
+        return isinstance(platform.getPlatform(), platform.X86)
 
     def writeKS(self, f):
         f.write("biosboot --fstype=%s" % self.type)
diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py
index 3909dc4..0e2f779 100644
--- a/pyanaconda/storage/formats/fs.py
+++ b/pyanaconda/storage/formats/fs.py
@@ -1123,7 +1123,7 @@ class EFIFS(FATFS):
     @property
     def supported(self):
         from pyanaconda import platform
-        p = platform.getPlatform(None)
+        p = platform.getPlatform()
         return (isinstance(p, platform.EFI) and
                 self.utilsAvailable)
 
@@ -1340,7 +1340,7 @@ class AppleBootstrapFS(HFS):
     @property
     def supported(self):
         from pyanaconda import platform
-        return (isinstance(platform.getPlatform(None), platform.NewWorldPPC)
+        return (isinstance(platform.getPlatform(), platform.NewWorldPPC)
                 and self.utilsAvailable)
 
     def writeKS(self, f):
diff --git a/pyanaconda/storage/formats/prepboot.py b/pyanaconda/storage/formats/prepboot.py
index b7d1c60..102d957 100644
--- a/pyanaconda/storage/formats/prepboot.py
+++ b/pyanaconda/storage/formats/prepboot.py
@@ -53,7 +53,7 @@ class PPCPRePBoot(DeviceFormat):
     @property
     def supported(self):
         from pyanaconda import platform
-        return isinstance(platform.getPlatform(None), platform.IPSeriesPPC)
+        return isinstance(platform.getPlatform(), platform.IPSeriesPPC)
 
     def writeKS(self, f):
         f.write("prepboot --fstype=%s" % self.type)
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 487ec81..7dba783 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -115,7 +115,11 @@ def _schedulePartitions(storage, disks):
             continue
 
         if request.fstype is None:
-            request.fstype = storage.defaultFSType
+            if request.mountpoint == "/boot":
+                request.fstype = storage.defaultBootFSType
+            else:
+                request.fstype = storage.defaultFSType
+
         elif request.fstype == "prepboot" and storage.bootLoaderDevice:
             # there should never be a need for more than one of these
             # partitions, so skip them.
-- 
1.7.8.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]