Skip to content

Commit 2633475

Browse files
authored
Merge pull request #45 from dcasota/upstream/isoinstaller-interactive-fix
isoInstaller: fix interactive (no-kickstart) ISO install
2 parents 7f42f0d + 72e0448 commit 2633475

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)