From: "Brian C. Lane" bcl@redhat.com
--- blivet/__init__.py | 4 ++++ blivet/platform.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 2d69eb1..7de454f 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -125,6 +125,10 @@ def storageInitialize(storage, ksdata, protected): from pyanaconda.flags import flags as anaconda_flags flags.update_from_anaconda_flags(anaconda_flags)
+ # Platform class setup depends on flags, re-initialize it. + import platform + platform.reset_platform() + storage.shutdown()
# Before we set up the storage system, we need to know which disks to diff --git a/blivet/platform.py b/blivet/platform.py index 3f7a00c..69005d9 100644 --- a/blivet/platform.py +++ b/blivet/platform.py @@ -405,5 +405,8 @@ def getPlatform(): else: raise SystemError, "Could not determine system architecture."
-global platform -platform = getPlatform() +def reset_platform(): + global platform + platform = getPlatform() + +reset_platform()
This should have a longer commit message.
The problem is that parts of blivet get initialized very early in anaconda, before flags are setup. For this specific bug the gpt flag wasn't getting passed on from anaconda. So we need to be able to reset the platform object after the anaconda flags have been setup.
In general we need to avoid doing things at import time, but that's a larger problem to solve.
On Thu, 2013-05-23 at 17:53 -0700, Brian C. Lane wrote:
This should have a longer commit message.
The problem is that parts of blivet get initialized very early in anaconda, before flags are setup. For this specific bug the gpt flag wasn't getting passed on from anaconda. So we need to be able to reset the platform object after the anaconda flags have been setup.
In general we need to avoid doing things at import time, but that's a larger problem to solve.
Agreed, ACK for this as a solution for now.
anaconda-patches@lists.fedorahosted.org