Skip to content

Commit 72e0448

Browse files
committed
isoInstaller: fix interactive (no-kickstart) ISO install
Booting the ISO interactively (no ks= boot param, no -c config, no VMware guestinfo.kickstart.*) was broken by two coupled regressions: 1) _load_ks_config_platform()/_load_ks_config_vmware() returned None when no platform kickstart exists; __init__ then crashed at 'if "live" not in install_config' with: TypeError: argument of type 'NoneType' is not a container or iterable Fix: return an empty {} config instead of None. 2) The 'live' block unconditionally stamped install_config['live']=True, making the empty interactive config truthy. installer.configure() only runs the UI configurator when 'not install_config', so the UI was skipped and _check_install_config() raised 'No disk configured'. Fix: only stamp 'live' on a non-empty (kickstart) config; leave the interactive config empty so the UI runs (live then defaults via _add_defaults()). Regression introduced by 9fc8733 on top of 0a72c3a. Co-Authored-By: Daniel Casota <dcasota@gmail.com>
1 parent 9b8e2fe commit 72e0448

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

photon_installer/isoInstaller.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ def __init__(self, options, params={}):
7979
else:
8080
install_config = self._load_ks_config_platform(verify=not insecure_installation)
8181

82-
# 'live' should be True for iso installs
83-
if 'live' not in install_config:
82+
# 'live' should be True for iso installs. Only stamp it on an actual
83+
# (non-empty) kickstart config. For an interactive install the config
84+
# is empty here and must stay falsy, otherwise installer.configure()
85+
# ('if not install_config and ui_config') skips the UI configurator
86+
# and _check_install_config() fails with "No disk configured".
87+
if install_config and 'live' not in install_config:
8488
install_config['live'] = True
8589

8690
if insecure_installation and install_config is not None:
@@ -164,7 +168,10 @@ def _load_ks_config_platform(self, verify=True):
164168
if CommandUtils.is_vmware_virtualization():
165169
return self._load_ks_config_vmware(verify=verify)
166170
else:
167-
return None
171+
# No platform-provided kickstart: fall back to an interactive
172+
# install with an empty config. Returning None here makes the
173+
# caller crash at "if 'live' not in install_config".
174+
return {}
168175

169176
def _load_ks_config_vmware(self, verify=True):
170177
try:
@@ -191,6 +198,10 @@ def _load_ks_config_vmware(self, verify=True):
191198
print(
192199
f"Failed to run vmtoolsd, do you have open-vm-tools installed? Error: {e}"
193200
)
201+
# No guestinfo kickstart (data/url both absent) or vmtoolsd missing:
202+
# fall back to an interactive install with an empty config instead of
203+
# returning None, which would crash at "if 'live' not in install_config".
204+
return {}
194205

195206
def mount_media(self, photon_media, mount_path=Defaults.MOUNT_PATH):
196207
"""Mount the external media"""

0 commit comments

Comments
 (0)