Sandro Bonazzola has uploaded a new change for review. Change subject: packaging: setup: boot from disk on additional hosts ......................................................................
packaging: setup: boot from disk on additional hosts On additional hosts the VM will always boot from disk because there is no reason for providing an install media since the VM has been already installed on first host. Change-Id: Iba6ee40c08379ca3713fef3b5e7f10a190268880 Signed-off-by: Sandro Bonazzola <[email protected]> --- M src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py 1 file changed, 39 insertions(+), 38 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup refs/changes/75/17875/1 diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py index ca09bde..df32612 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py @@ -81,49 +81,50 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, name=ohostedcons.Stages.CONFIG_BOOT_DEVICE, - condition=lambda self: not self.environment[ - ohostedcons.CoreEnv.IS_ADDITIONAL_HOST - ], ) def _customization(self): - interactive = self.environment[ - ohostedcons.VMEnv.BOOT - ] is None - valid = False - while not valid: - if interactive: - self.environment[ - ohostedcons.VMEnv.BOOT - ] = self.dialog.queryString( - name='OVEHOSTED_VMENV_BOOT', - note=_( - 'Please specify the device to boot the VM ' - 'from (@VALUES@) [@DEFAULT@]: ' - ), - prompt=True, - caseSensitive=True, - validValues=list(self.BOOT_DEVICE.keys()), - default=ohostedcons.Defaults.DEFAULT_BOOT, - ) - - if self.environment[ + if self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST]: + # VM has been installed, will boot from disk. + self.environment[ohostedcons.VMEnv.BOOT] = 'disk' + else: + interactive = self.environment[ ohostedcons.VMEnv.BOOT - ] in self.BOOT_DEVICE.keys(): - valid = True - elif interactive: - self.logger.error( - _( - 'The provided boot type is not supported. ' - 'Please try again' + ] is None + valid = False + while not valid: + if interactive: + self.environment[ + ohostedcons.VMEnv.BOOT + ] = self.dialog.queryString( + name='OVEHOSTED_VMENV_BOOT', + note=_( + 'Please specify the device to boot the VM ' + 'from (@VALUES@) [@DEFAULT@]: ' + ), + prompt=True, + caseSensitive=True, + validValues=list(self.BOOT_DEVICE.keys()), + default=ohostedcons.Defaults.DEFAULT_BOOT, ) - ) - else: - raise RuntimeError( - _( - 'The provided boot type is not supported. ' - 'Please try again' + + if self.environment[ + ohostedcons.VMEnv.BOOT + ] in self.BOOT_DEVICE.keys(): + valid = True + elif interactive: + self.logger.error( + _( + 'The provided boot type is not supported. ' + 'Please try again' + ) ) - ) + else: + raise RuntimeError( + _( + 'The provided boot type is not supported. ' + 'Please try again' + ) + ) @plugin.event( stage=plugin.Stages.STAGE_MISC, -- To view, visit http://gerrit.ovirt.org/17875 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba6ee40c08379ca3713fef3b5e7f10a190268880 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-setup Gerrit-Branch: master Gerrit-Owner: Sandro Bonazzola <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
