Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: improoving cloud-init config UX
......................................................................

packaging: setup: improoving cloud-init config UX

- asking about appliance location just after disk/cdrom/pxe
- asking about appliance root password only if generating
  cloud-init UX
- adding a warning if the user is not configuring the
  appliance root password (there is no default one!)

Change-Id: I8fc500e6324a81414e2a18047045ee0b4e3ff5e0
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py
1 file changed, 49 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/46/42446/1

diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py 
b/src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py
index 99439a4..f6ea907 100644
--- a/src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py
+++ b/src/plugins/ovirt-hosted-engine-setup/vm/cloud_init.py
@@ -402,7 +402,7 @@
         stage=plugin.Stages.STAGE_CUSTOMIZATION,
         after=(
             ohostedcons.Stages.DIALOG_TITLES_S_VM,
-            ohostedcons.Stages.CONFIG_BOOT_DEVICE,
+            ohostedcons.Stages.CONFIG_OVF_IMPORT,
         ),
         before=(
             ohostedcons.Stages.DIALOG_TITLES_E_VM,
@@ -503,6 +503,40 @@
                     default=_('Yes')
                 ) == _('Yes').lower()
 
+                while self.environment[
+                    ohostedcons.CloudInit.ROOTPWD
+                ] is None:
+                    password = self.dialog.queryString(
+                        name='CI_ROOT_PASSWORD',
+                        note=_(
+                            "Enter root password that "
+                            'will be used for the engine appliance '
+                            '(leave it empty to skip): '
+                        ),
+                        prompt=True,
+                        hidden=True,
+                        default='',
+                    )
+                    if password:
+                        password_check = self.dialog.queryString(
+                            name='CI_ROOT_PASSWORD',
+                            note=_(
+                                "Confirm appliance root password: "
+                            ),
+                            prompt=True,
+                            hidden=True,
+                        )
+                        if password == password_check:
+                            self.environment[
+                                ohostedcons.CloudInit.ROOTPWD
+                            ] = password
+                        else:
+                            self.logger.error(_('Passwords do not match'))
+                    else:
+                        self.environment[
+                            ohostedcons.CloudInit.ROOTPWD
+                        ] = False
+
         if self.environment[
             ohostedcons.CloudInit.EXECUTE_ESETUP
         ] and self.environment[
@@ -522,40 +556,6 @@
                 caseSensitive=False,
                 default=_('Yes')
             ) == _('Yes').lower()
-
-        while self.environment[
-            ohostedcons.CloudInit.ROOTPWD
-        ] is None:
-            password = self.dialog.queryString(
-                name='CI_ROOT_PASSWORD',
-                note=_(
-                    "Enter root password that "
-                    'will be used for the engine appliance '
-                    '(leave it empty to skip): '
-                ),
-                prompt=True,
-                hidden=True,
-                default='',
-            )
-            if password:
-                password_check = self.dialog.queryString(
-                    name='CI_ROOT_PASSWORD',
-                    note=_(
-                        "Confirm appliance root password: "
-                    ),
-                    prompt=True,
-                    hidden=True,
-                )
-                if password == password_check:
-                    self.environment[
-                        ohostedcons.CloudInit.ROOTPWD
-                    ] = password
-                else:
-                    self.logger.error(_('Passwords do not match'))
-            else:
-                self.environment[
-                    ohostedcons.CloudInit.ROOTPWD
-                ] = False
 
         if (
             self.environment[
@@ -607,6 +607,20 @@
             ] = ohostedcons.Const.CLOUD_INIT_GENERATE
             self._enable = True
 
+        if (
+            self.environment[
+                ohostedcons.CloudInit.GENERATE_ISO
+            ] != ohostedcons.Const.CLOUD_INIT_GENERATE or
+            not self.environment[
+                ohostedcons.CloudInit.ROOTPWD
+            ]
+        ):
+            self.logger.warning(_(
+                'The oVirt engine appliance is not configured with a '
+                'default password, please consider configuring it '
+                'via cloud-init'
+            ))
+
     # TODO: ask about synchronizing with the host timezone
 
     @plugin.event(


-- 
To view, visit https://gerrit.ovirt.org/42446
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fc500e6324a81414e2a18047045ee0b4e3ff5e0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to