Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: allinone: non-standard ssh port
......................................................................

packaging: setup: allinone: non-standard ssh port

Allow allinone to connect to localhost over non-standard ssh port.
No dialog currently, just checking what port sshd listens on.

Change-Id: Ifd8a4cad5f0b480f04392933cd7c6e1b512c564d
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-setup/all-in-one/sshd.py
M packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
3 files changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/18174/1

diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 32a9b5c..80d2ba8 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -1042,6 +1042,7 @@
         return 'OVESETUP_AIO/storageDomainDir'
 
     STORAGE_DOMAIN_NAME = 'OVESETUP_AIO/storageDomainName'
+    SSHD_PORT = 'OVESETUP_PKI/sshdPort'
 
 
 @util.export
diff --git a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/sshd.py 
b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/sshd.py
index 8594973..4ad4896 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/sshd.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/sshd.py
@@ -46,12 +46,22 @@
         self._enabled = False
 
     @plugin.event(
+        stage=plugin.Stages.STAGE_INIT,
+    )
+    def _init(self):
+        self.environment.setdefault(
+            osetupcons.AIOEnv.SSHD_PORT,
+            None
+        )
+
+    @plugin.event(
         stage=plugin.Stages.STAGE_SETUP,
     )
     def _setup(self):
         self._enabled = not self.environment[
             osetupcons.CoreEnv.DEVELOPER_MODE
         ]
+        self.command.detect('sshd')
 
     @plugin.event(
         stage=plugin.Stages.STAGE_CUSTOMIZATION,
@@ -71,6 +81,19 @@
                 name='sshd',
                 state=True,
             )
+        rc, stdout, stder = self.execute(
+            args=(
+                self.command.get('sshd'),
+                '-T',
+            ),
+        )
+        for line in stdout:
+            words = line.split()
+            if words[0] == 'port':
+                self.environment[
+                    osetupcons.AIOEnv.SSHD_PORT
+                ] = int(words[1])
+                break
 
     @plugin.event(
         stage=plugin.Stages.STAGE_MISC,
diff --git a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py 
b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
index 2f5fc55..e9bf7f5 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
@@ -250,6 +250,7 @@
                 ),
                 ssh=self._ovirtsdk_xml.params.SSH(
                     authentication_method='publickey',
+                    port=self.environment[osetupcons.AIOEnv.SSHD_PORT],
                 ),
             )
         )


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd8a4cad5f0b480f04392933cd7c6e1b512c564d
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