[GH-ISSUE #367] infrastructure, the ssh connection is inactive #271

Closed
opened 2026-02-27 16:38:41 +03:00 by kerem · 0 comments
Owner

Originally created by @yorks on GitHub (Jul 18, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/367

this can be fixed like the server_list method.

diff --git a/servers/views.py b/servers/views.py
index ecda4a9..b261f12 100644
--- a/servers/views.py
+++ b/servers/views.py
@@ -143,14 +143,22 @@ def infrastructure(request):
             socket_host = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             socket_host.settimeout(1)
             if host.type == CONN_SSH:
-                socket_host.connect((host.hostname, SSH_PORT))
+                if ':' in host.hostname:
+                    LIBVIRT_HOST, PORT = (host.hostname).split(":")
+                    PORT = int(PORT)
+                else:
+                    PORT = SSH_PORT
+                    LIBVIRT_HOST = host.hostname
+                socket_host.connect((LIBVIRT_HOST, PORT))
+                #socket_host.connect((host.hostname, SSH_PORT))
             if host.type == CONN_TCP:
Originally created by @yorks on GitHub (Jul 18, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/367 this can be fixed like the server_list method. ``` diff --git a/servers/views.py b/servers/views.py index ecda4a9..b261f12 100644 --- a/servers/views.py +++ b/servers/views.py @@ -143,14 +143,22 @@ def infrastructure(request): socket_host = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket_host.settimeout(1) if host.type == CONN_SSH: - socket_host.connect((host.hostname, SSH_PORT)) + if ':' in host.hostname: + LIBVIRT_HOST, PORT = (host.hostname).split(":") + PORT = int(PORT) + else: + PORT = SSH_PORT + LIBVIRT_HOST = host.hostname + socket_host.connect((LIBVIRT_HOST, PORT)) + #socket_host.connect((host.hostname, SSH_PORT)) if host.type == CONN_TCP: ```
kerem closed this issue 2026-02-27 16:38:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#271
No description provided.