diff options
author | Chris Lumens <clumens@redhat.com> | 2013-02-12 10:50:54 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2013-02-13 10:41:16 -0500 |
commit | 3b13641079a0801c3d7eeb6b8462b7f5ccbd611b (patch) | |
tree | b2e38325a1625b7bfe13c8b609336ef8b9e43a15 | |
parent | b59ad380f3037971202c4a9bd90e40ec0c781d44 (diff) | |
download | anaconda-3b13641079a0801c3d7eeb6b8462b7f5ccbd611b.tar.gz anaconda-3b13641079a0801c3d7eeb6b8462b7f5ccbd611b.tar.xz anaconda-3b13641079a0801c3d7eeb6b8462b7f5ccbd611b.zip |
Restore support for partial kickstart files (#887254).
-rw-r--r-- | pyanaconda/kickstart.py | 4 | ||||
-rw-r--r-- | pyanaconda/packaging/yumpayload.py | 6 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/datetime_spoke.py | 18 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/keyboard.py | 9 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/software.py | 20 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/source.py | 9 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/storage.py | 24 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/welcome.py | 6 | ||||
-rw-r--r-- | pyanaconda/ui/tui/spokes/storage.py | 5 |
9 files changed, 67 insertions, 34 deletions
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index cd7ac0f8a..b9cc1b930 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -577,9 +577,9 @@ class IscsiName(commands.iscsiname.FC6_IscsiName): class Lang(commands.lang.FC3_Lang): def __init__(self, *args, **kwargs): commands.lang.FC3_Lang.__init__(self, *args, **kwargs) - if not self.lang: + if not self.lang and not flags.automatedInstall: self.lang = DEFAULT_LANG - + def execute(self, *args, **kwargs): localization.write_language_configuration(self, ROOT_PATH) diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py index 6ca2f3b3f..1f1017601 100644 --- a/pyanaconda/packaging/yumpayload.py +++ b/pyanaconda/packaging/yumpayload.py @@ -415,10 +415,12 @@ reposdir=%s # start with a fresh YumBase instance self.reset(root=root) - # If askmethod was given on the command line, we don't want to do + # If this is a kickstart install and no method has been set up, or + # askmethod was given on the command line, we don't want to do # anything. Just disable all repos and return. This should avoid # metadata fetching. - if flags.askmethod: + if (not self.data.method.method and flags.automatedInstall) or \ + flags.askmethod: with _yum_lock: for repo in self._yum.repos.repos.values(): self.disableRepo(repo.id) diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index 457cac686..0a0b6868b 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -366,14 +366,15 @@ class DatetimeSpoke(NormalSpoke): self._update_datetime_timer_id = None if timezone.is_valid_timezone(self.data.timezone.timezone): self._tzmap.set_timezone(self.data.timezone.timezone) - else: + elif not flags.flags.automatedInstall: log.warning("%s is not a valid timezone, falling back to default "\ "(%s)" % (self.data.timezone.timezone, DEFAULT_TZ)) self._tzmap.set_timezone(DEFAULT_TZ) self.data.timezone.timezone = DEFAULT_TZ - if not flags.can_touch_runtime_system("modify system time and date"): - self._set_date_time_setting_sensitive(False) + if self.data.timezone.timezone: + if not flags.can_touch_runtime_system("modify system time and date"): + self._set_date_time_setting_sensitive(False) self._config_dialog = NTPconfigDialog(self.data) self._config_dialog.initialize() @@ -385,9 +386,10 @@ class DatetimeSpoke(NormalSpoke): return _("%s timezone") % self.data.timezone.timezone else: return _("Invalid timezone") - - else: + elif self._tzmap.get_timezone(): return _("%s timezone") % self._tzmap.get_timezone() + else: + return _("Nothing selected") def apply(self): GLib.source_remove(self._update_datetime_timer_id) @@ -403,6 +405,7 @@ class DatetimeSpoke(NormalSpoke): new_tz = region + "/" + city self.data.timezone.timezone = new_tz + self.data.timezone.seen = True if self._ntpSwitch.get_active(): # turned ON @@ -430,7 +433,10 @@ class DatetimeSpoke(NormalSpoke): @property def completed(self): - return timezone.is_valid_timezone(self.data.timezone.timezone) + if flags.flags.automatedInstall and not self.data.timezone.seen: + return False + else: + return timezone.is_valid_timezone(self.data.timezone.timezone) @property def mandatory(self): diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 082702ce7..c2a9de5ff 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -269,15 +269,18 @@ class KeyboardSpoke(NormalSpoke): def apply(self): # Clear and repopulate self.data with actual values self.data.keyboard.x_layouts = list() + self.data.keyboard.seen = True + for row in self._store: self.data.keyboard.x_layouts.append(row[0]) # FIXME: Set the keyboard layout here, too. @property def completed(self): - # The keyboard spoke is always completed, as it does not require you do - # anything. There's always a default selected. - return True + if flags.flags.automatedInstall and not self.data.keyboard.seen: + return False + else: + return True @property def status(self): diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 3493d0c2f..cec03846a 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -68,10 +68,7 @@ class SoftwareSelectionSpoke(NormalSpoke): self._origAddons = [] self._origEnvironment = None - def apply(self): - # NOTE: Other apply methods work directly with the ksdata, but this - # one does not. However, selectGroup/deselectGroup modifies ksdata as - # part of its operation. So this is fine. + def _apply(self): row = self._get_selected_environment() if not row: return @@ -100,6 +97,10 @@ class SoftwareSelectionSpoke(NormalSpoke): threadMgr.add(AnacondaThread(name="AnaCheckSoftwareThread", target=self.checkSoftwareSelection)) + def apply(self): + self._apply() + self.data.packages.seen = True + def checkSoftwareSelection(self): from pyanaconda.packaging import DependencyError communication.send_message(self.__class__.__name__, @@ -123,15 +124,15 @@ class SoftwareSelectionSpoke(NormalSpoke): processingDone = not threadMgr.get("AnaCheckSoftwareThread") and \ not self._errorMsgs and self.txid_valid - if flags.automatedInstall and self.data.packages.seen: - return processingDone + if flags.automatedInstall: + return processingDone and self.data.packages.seen else: return self._get_selected_environment() is not None and processingDone @property def mandatory(self): return True - + @property def ready(self): # By default, the software selection spoke is not ready. We have to @@ -184,8 +185,7 @@ class SoftwareSelectionSpoke(NormalSpoke): # we have no way to select environments with kickstart right now # so don't try. if flags.automatedInstall and self.data.packages.seen: - # We don't want to do a full refresh, just - # join the metadata thread + # We don't want to do a full refresh, just join the metadata thread threadMgr.wait("AnaPayloadMDThread") else: if not self._first_refresh(): @@ -196,7 +196,7 @@ class SoftwareSelectionSpoke(NormalSpoke): # If packages were provided by an input kickstart file (or some other means), # we should do dependency solving here. - self.apply() + self._apply() @gtk_thread_wait def _first_refresh(self): diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 5751ca0ff..43c49282b 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -602,12 +602,15 @@ class SourceSpoke(NormalSpoke): @property def completed(self): - return not self._error and self.status and self.status != _("Nothing selected") + if flags.automatedInstall and not self.data.method.method: + return False + else: + return not self._error and self.status and self.status != _("Nothing selected") @property def mandatory(self): return True - + @property def ready(self): from pyanaconda.threads import threadMgr @@ -702,7 +705,7 @@ class SourceSpoke(NormalSpoke): if self.data.method.method == "cdrom": cdrom = self.payload.install_device chosen = True - else: + elif not flags.automatedInstall: cdrom = opticalInstallMedia(self.storage.devicetree) if cdrom: diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index a3d31ff27..0fc064f5a 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -436,12 +436,15 @@ class StorageSpoke(NormalSpoke, StorageChecker): @property def completed(self): - return (threadMgr.get("AnaExecuteStorageThread") is None and - threadMgr.get("AnaCheckStorageThread") is None and - (self.data.ignoredisk.onlyuse != [] or - flags.automatedInstall) and - self.storage.rootDevice is not None and - not self.errors) + retval = (threadMgr.get("AnaExecuteStorageThread") is None and + threadMgr.get("AnaCheckStorageThread") is None and + self.storage.rootDevice is not None and + not self.errors) + + if flags.automatedInstall: + return retval and self.data.bootloader.seen + else: + return retval @property def ready(self): @@ -457,7 +460,12 @@ class StorageSpoke(NormalSpoke, StorageChecker): def status(self): """ A short string describing the current status of storage setup. """ msg = _("No disks selected") - if self.data.ignoredisk.onlyuse: + + if flags.automatedInstall and not self.storage.rootDevice: + return msg + elif flags.automatedInstall and not self.data.bootloader.seen: + msg = _("No bootloader configured") + elif self.data.ignoredisk.onlyuse: msg = P_(("%d disk selected"), ("%d disks selected"), len(self.data.ignoredisk.onlyuse)) % len(self.data.ignoredisk.onlyuse) @@ -643,6 +651,8 @@ class StorageSpoke(NormalSpoke, StorageChecker): self._update_summary() + self.data.bootloader.seen = True + if self.data.bootloader.location == "none": self.set_warning(_("You have chosen to skip bootloader installation. Your system may not be bootable.")) self.window.show_all() diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py index 80bf7acce..d4f8e1598 100644 --- a/pyanaconda/ui/gui/spokes/welcome.py +++ b/pyanaconda/ui/gui/spokes/welcome.py @@ -60,6 +60,12 @@ class LanguageMixIn(object): self.language.select_translation(lang) self.data.lang.lang = lang + # Skip timezone and keyboard default setting for kickstart installs. + # The user may have provided these values via kickstart and if not, we + # need to prompt for them. + if flags.flags.automatedInstall: + return + #TODO: better use GeoIP data once it is available if self.language.territory and not self.data.timezone.timezone: lang_timezone = timezone.get_preferred_timezone(self.language.territory) diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 80e309400..58428fcc3 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -127,7 +127,10 @@ class StorageSpoke(NormalTUISpoke): def status(self): """ A short string describing the current status of storage setup. """ msg = _("No disks selected") - if self.data.ignoredisk.onlyuse: + + if flags.automatedInstall and not self.storage.rootDevice: + return msg + elif self.data.ignoredisk.onlyuse: msg = P_(("%d disk selected"), ("%d disks selected"), len(self.data.ignoredisk.onlyuse)) % len(self.data.ignoredisk.onlyuse) |