Hello Yedidyah Bar David,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18317
to review the following change.
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.
Bug-Url: https://bugzilla.redhat.com/994219
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, 31 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/18317/1
diff --git a/packaging/setup/ovirt_engine_setup/constants.py
b/packaging/setup/ovirt_engine_setup/constants.py
index 544e70b..7493bb9 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -1050,6 +1050,8 @@
return 'OVESETUP_AIO/storageDomainDir'
STORAGE_DOMAIN_NAME = 'OVESETUP_AIO/storageDomainName'
+ SSHD_PORT = 'OVESETUP_AIO/sshdPort'
+ DEFAULT_SSH_PORT = 22
@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 fff24c2..cdd16ab 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,24 @@
name='sshd',
state=True,
)
+ if self.environment[osetupcons.AIOEnv.SSHD_PORT] is None:
+ rc, stdout, stderr = 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
+ self.environment.setdefault(
+ osetupcons.AIOEnv.SSHD_PORT,
+ osetupcons.AIOEnv.DEFAULT_SSH_PORT
+ )
@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 780496e..248b001 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
@@ -248,6 +248,7 @@
),
ssh=self._ovirtsdk_xml.params.SSH(
authentication_method='publickey',
+ port=self.environment[osetupcons.AIOEnv.SSHD_PORT],
),
)
)
--
To view, visit http://gerrit.ovirt.org/18317
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd8a4cad5f0b480f04392933cd7c6e1b512c564d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches