Commit c04af55
root
Fix AttributeError when progress_bar not initialized in UI mode
The installer crashes with 'AttributeError: Installer object has no
attribute progress_bar' when using kickstart with ui:true if an
exception occurs before the progress_bar is created.
Root cause:
- When ui:true in kickstart, install_config['ui'] is True
- execute() calls curses.wrapper(self._install)
- Inside _install(), progress_bar is created only AFTER curses init
- If exception occurs before progress_bar creation, exit_gracefully()
is called which checks install_config['ui'] and tries to access
progress_bar.hide() - this fails with AttributeError
Fix (surgical - only modifies exit_gracefully):
1. Initialize self.progress_bar = None in __init__()
2. Initialize self.window = None in __init__()
3. In exit_gracefully(), check 'progress_bar is not None' before hide()
4. In exit_gracefully(), check 'window is not None' before addstr()
This is a minimal fix that only affects error handling. Normal installer
flow is unchanged - progress_bar gets created in _install() before any
other code tries to use it.
Signed-off-by: Daniel Casota <daniel.casota@gmail.com>1 parent 8b63bb5 commit c04af55
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
831 | 833 | | |
832 | 834 | | |
833 | 835 | | |
834 | | - | |
| 836 | + | |
835 | 837 | | |
| 838 | + | |
836 | 839 | | |
837 | 840 | | |
838 | 841 | | |
| |||
0 commit comments