Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: sharpen the test for engine enabled
......................................................................

packaging: setup: sharpen the test for engine enabled

Without this change:
1. install and setup engine on machine A
2. install and setup other components (dwh, reports, wsp) on machine B
3. install engine on machine B
4. Run engine-setup - will silently enable the engine

This was done for upgrades from 3.4 that need to enable the engine in
the environment, because in 3.4 it was always enabled and there was no
environment for that.

This change also checks the engine FQDN in engine config files and
compares that with our FQDN. We enable if exists and equal.

Change-Id: Ie58fcaff0925f3b5ac16fc5159a3eda4498f0b6e
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/misc.py
1 file changed, 19 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/36217/1

diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/misc.py 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/misc.py
index 718ad75..28d4786 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/misc.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/misc.py
@@ -39,12 +39,24 @@
 
     def __init__(self, context):
         super(Plugin, self).__init__(context=context)
+        self._engine_fqdn = None
 
     @plugin.event(
         stage=plugin.Stages.STAGE_INIT,
     )
     def _init(self):
         self.environment.setdefault(oenginecons.CoreEnv.ENABLE, None)
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_SETUP,
+    )
+    def _setup(self):
+        config = configfile.ConfigFile([
+            oenginecons.FileLocations.OVIRT_ENGINE_SERVICE_CONFIG_DEFAULTS,
+            oenginecons.FileLocations.OVIRT_ENGINE_SERVICE_CONFIG
+        ])
+        if config.get('ENGINE_FQDN'):
+            self._engine_fqdn = config.get('ENGINE_FQDN')
 
     @plugin.event(
         stage=plugin.Stages.STAGE_CUSTOMIZATION,
@@ -58,7 +70,13 @@
     )
     def _customization(self):
         if self.environment[oenginecons.CoreEnv.ENABLE] is None:
-            if not self.environment[oenginecons.EngineDBEnv.NEW_DATABASE]:
+            if (
+                not self.environment[oenginecons.EngineDBEnv.NEW_DATABASE]
+                and self._engine_fqdn is not None
+                and self._engine_fqdn == self.environment[
+                    osetupcons.ConfigEnv.FQDN
+                ]
+            ):
                 # we are upgrading from 3.4 that doesn't ask about it
                 # but we need to upgrade the engine cause has been configured
                 # in the past


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

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

Reply via email to