Alex Lourie has uploaded a new change for review.

Change subject: packaging: Updated otopi for fully automated execution
......................................................................

packaging: Updated otopi for fully automated execution

This patch updates an otopi engine-setup plugin to allow
a completely automated setup execution with the additional
config file provided on command line.

This patch allows a flow similar to one using an "answerfile"
in the legacy setup.

Change-Id: Ia327a4be9e1f5498e6aedc7dfb66663dd861fc26
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-setup/apache/root.py
M packaging/setup/plugins/ovirt-engine-setup/apache/ssl.py
M packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
M packaging/setup/plugins/ovirt-engine-setup/dialog/preview.py
5 files changed, 35 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/14985/1

diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index de05d4d..b6b2a19 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -514,8 +514,13 @@
 
 @util.export
 @util.codegen
+@osetupattrsclass
 class DialogEnv(object):
-    CONFIRM_SETTINGS = 'OVESETUP_DIALOG/confirmSettings'
+    @osetupattrs(
+        answerfile=True,
+    )
+    def CONFIRM_SETTINGS(self):
+        return 'OVESETUP_DIALOG/confirmSettings'
 
 
 @util.export
diff --git a/packaging/setup/plugins/ovirt-engine-setup/apache/root.py 
b/packaging/setup/plugins/ovirt-engine-setup/apache/root.py
index 7031677..dca9748 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/apache/root.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/apache/root.py
@@ -102,6 +102,10 @@
                 ],
             )
 
+            self.environment[
+                osetupcons.ApacheEnv.CONFIGURE_ROOT_REDIRECTION
+            ] = self._enabled
+
     @plugin.event(
         stage=plugin.Stages.STAGE_MISC,
         condition=lambda self: self._enabled,
diff --git a/packaging/setup/plugins/ovirt-engine-setup/apache/ssl.py 
b/packaging/setup/plugins/ovirt-engine-setup/apache/ssl.py
index 6c961e9..9735d22 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/apache/ssl.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/apache/ssl.py
@@ -147,6 +147,9 @@
                 false=_('Manual'),
                 default=True,
             )
+            self.environment[
+                osetupcons.ApacheEnv.CONFIGURE_SSL
+            ] = self._enabled
         else:
             self._enabled = self.environment[
                 osetupcons.ApacheEnv.CONFIGURE_SSL
diff --git a/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py 
b/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
index f7fba9a..f6d7127 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
@@ -252,23 +252,26 @@
         validDomain = False
         while not validDomain:
             try:
-                default_mount_point = self.environment[
-                    osetupcons.ConfigEnv.ISO_DOMAIN_DEFAULT_NFS_MOUNT_POINT
-                ]
-                if os.path.exists(default_mount_point):
-                    default_mount_point += '-%s' % (
-                        datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
-                    )
-
-                self.environment[
+                if self.environment[
                     osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT
-                ] = self.dialog.queryString(
-                    name='NFS_MOUNT_POINT',
-                    note=_('Local ISO domain path [@DEFAULT@]: '),
-                    prompt=True,
-                    caseSensitive=True,
-                    default=default_mount_point,
-                )
+                ] is None:
+                    default_mount_point = self.environment[
+                        osetupcons.ConfigEnv.ISO_DOMAIN_DEFAULT_NFS_MOUNT_POINT
+                    ]
+                    if os.path.exists(default_mount_point):
+                        default_mount_point += '-%s' % (
+                            datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
+                        )
+
+                    self.environment[
+                        osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT
+                    ] = self.dialog.queryString(
+                        name='NFS_MOUNT_POINT',
+                        note=_('Local ISO domain path [@DEFAULT@]: '),
+                        prompt=True,
+                        caseSensitive=True,
+                        default=default_mount_point,
+                    )
 
                 self.environment[
                     osetupcons.ConfigEnv.ISO_DOMAIN_SD_UUID
diff --git a/packaging/setup/plugins/ovirt-engine-setup/dialog/preview.py 
b/packaging/setup/plugins/ovirt-engine-setup/dialog/preview.py
index 51523e9..7afe93c 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/dialog/preview.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/dialog/preview.py
@@ -91,6 +91,9 @@
                 false=_('Cancel'),
                 default=True,
             )
+            self.environment[
+                osetupcons.DialogEnv.CONFIRM_SETTINGS
+            ] = confirmed
         if not confirmed:
             raise RuntimeError(_('Configuration was rejected by user'))
 


--
To view, visit http://gerrit.ovirt.org/14985
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia327a4be9e1f5498e6aedc7dfb66663dd861fc26
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to