On 05/22/2010 01:11 AM, Brian C. Lane wrote:
This sets the initial UTC setting when anaconda.timezone is initialized
instead of every time the timezone UI is entered.
---
anaconda | 9 ++++++++-
iw/timezone_gui.py | 4 ----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/anaconda b/anaconda
index 0f54d65..d16abd8 100755
--- a/anaconda
+++ b/anaconda
@@ -588,8 +588,15 @@ class Anaconda(object):
def timezone(self):
if not self._timezone:
import timezone
+ from bootloader import hasWindows
+
self._timezone = timezone.Timezone()
- self._timezone.setTimezoneInfo(self.instLanguage.getDefaultTimeZone(self.rootPath))
+ tz = self.instLanguage.getDefaultTimeZone(self.rootPath)
+ if not self.ksdata:
+ utc = not hasWindows(anaconda.bootloader)
+ else:
+ utc = 0
+ self._timezone.setTimezoneInfo(tz, utc)
return self._timezone
diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py
index c5ecd88..1a821b7 100644
--- a/iw/timezone_gui.py
+++ b/iw/timezone_gui.py
@@ -30,7 +30,6 @@ import sys
from timezone_map_gui import TimezoneMap, Enum
from iw_gui import *
from booty.bootloaderInfo import dosFilesystems
-from bootloader import hasWindows
from constants import *
import gettext
@@ -104,9 +103,6 @@ class TimezoneWindow(InstallWindow):
self.tz.setCurrent(self.zonetab.findEntryByTZ(self.default))
self.utcCheckbox.set_active(asUTC)
- if not anaconda.ksdata:
- self.utcCheckbox.set_active(not hasWindows(anaconda.bootloader))
-
self.notebook.remove(self.vbox)
return self.vbox
Hi Brian,
you'll need to revert this patch and come up with another fix. The
problem is that on rawhide the timezone property is referenced as early
as anaconda:855, that is before the storage.storageInitialized()
function was called (it is normally called as a dispatch step see
dispatch.py). The hasWindows() method in bootloader.py that the property
calls depends on the anconda.storage object to be initialized already so
it can inspect the existing partitions in the system.
Hans and me thought it would be reasonable to do this instead:
<hansg> timezone_gui.py needs to keep track if its called the first time
or not and depepending on that re-use the old value or call hasWindows()
Contrary to what I originally thought, your patch doesn't cause the
traceback in 592860. But that's a similar initialization order issue,
I'll post a patch for that soon.
Thanks.
Ales
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list