Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: modify AIA port when upgrade from legacy
......................................................................

packaging: setup: modify AIA port when upgrade from legacy

in case of moving configuration from jboss as web server and apache as
web server we need to modify AIA extension URL.

this will not effect past certificate, only new certificate.

the engine rename script may be used to refresh the engine certificate.

Change-Id: I6d955b34497e3256528180938dc67575d7812646
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py
1 file changed, 42 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/87/18687/1

diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py 
b/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py
index b5fb0c4..b4ff130 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py
@@ -24,8 +24,10 @@
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
 
 
+from otopi import constants as otopicons
 from otopi import util
 from otopi import plugin
+from otopi import filetransaction
 
 
 from ovirt_engine_setup import constants as osetupcons
@@ -44,7 +46,45 @@
             self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY]
         ),
     )
-    def _misc(self):
+    def _updateAIA(self):
+        replace = {
+            'from': ':%s/' % self.environment[
+                osetupcons.ConfigEnv.JBOSS_DIRECT_HTTP_PORT
+            ],
+            'to': ':%s/' % self.environment[
+                osetupcons.ConfigEnv.PUBLIC_HTTP_PORT
+            ],
+        }
+        for name in (
+            osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_TEMPLATE[
+                :-len('.in')
+            ],
+            osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_CERT_CONF,
+            osetupcons.FileLocations.OVIRT_ENGINE_PKI_CERT_TEMPLATE[
+                :-len('.in')
+            ],
+            osetupcons.FileLocations.OVIRT_ENGINE_PKI_CERT_CONF,
+        ):
+            with open(name, 'r') as f:
+                self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
+                    filetransaction.FileTransaction(
+                        name=name,
+                        content=f.read().replace(
+                            replace['from'], replace['to']
+                        ).splitlines(),
+                        modifiedList=self.environment[
+                            otopicons.CoreEnv.MODIFIED_FILES
+                        ],
+                    )
+                )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_MISC,
+        condition=lambda self: (
+            self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY]
+        ),
+    )
+    def _uninstall(self):
         uninstall_files = []
         for name in (
             osetupcons.FileLocations.
@@ -79,4 +119,5 @@
             fileList=uninstall_files,
         )
 
+
 # vim: expandtab tabstop=4 shiftwidth=4


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d955b34497e3256528180938dc67575d7812646
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to