From 3614440c72ad99945641e1ec988583ed35044936 Mon Sep 17 00:00:00 2001 Message-Id: <3614440c72ad99945641e1ec988583ed35044936.1418286603.git.hahn@univention.de> From: Philipp Hahn Date: Thu, 11 Dec 2014 09:27:26 +0100 Subject: [PATCH] Bug #36105 UVMM: Fix VNC running on localhost only. Organization: Univention GmbH, Bremen, Germany Handle the case where VNC is running on the localhost only and UVMMd and the noVNC proxy are running on the same host as the VM. --- .../debian/changelog | 6 ++++++ .../src/univention/uvmm/node.py | 12 ++++++++---- .../test/urlparser.py | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/debian/changelog b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/debian/changelog index 6d6c0e7..5e1b40d 100644 --- a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/debian/changelog +++ b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/debian/changelog @@ -1,3 +1,9 @@ +univention-virtual-machine-manager-daemon (4.0.20-8) unstable; urgency=low + + * Bug #36105: Fix VNC running on localhost only. + + -- Philipp Hahn Thu, 11 Dec 2014 09:26:54 +0100 + univention-virtual-machine-manager-daemon (4.0.20-7) unstable; urgency=low * Bug #36380: Add progressbar while waiting for changed instance state diff --git a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py index eee688c..72e8b0a 100644 --- a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py +++ b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py @@ -40,7 +40,7 @@ import logging from xml.dom.minidom import parseString from xml.parsers.expat import ExpatError import math -from helpers import TranslatableException, ms, tuple2version, N_ as _, uri_encode +from helpers import TranslatableException, ms, tuple2version, N_ as _, uri_encode, FQDN from uvmm_ldap import ldap_annotation, LdapError, LdapConnectionError, ldap_modify import univention.admin.uexceptions import threading @@ -748,11 +748,15 @@ class Node(PersistentCached): continue if gfx.type != Graphic.TYPE_VNC: continue - if gfx.listen != '0.0.0.0': - continue if gfx.port <= 0: continue - print >> tmp_file, '%s: %s:%d' % (uuid, self.pd.name, gfx.port) + if gfx.listen == '0.0.0.0': + vnc_addr = self.pd.name + elif gfx.listen is None and self.pd.name == FQDN: + vnc_addr = '127.0.0.1' + else: + continue + print >> tmp_file, '%s: %s:%d' % (uuid, vnc_addr, gfx.port) os.rename(tmp_file.name, path) def wait_update(self, domain, state_key, timeout=10): diff --git a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/test/urlparser.py b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/test/urlparser.py index 6365ed1..b4a7455 100644 --- a/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/test/urlparser.py +++ b/branches/ucs-4.0/ucs-4.0-0/virtualization/univention-virtual-machine-manager-daemon/test/urlparser.py @@ -30,6 +30,7 @@ # License with the Debian GNU/Linux or Univention distribution in file # /usr/share/common-licenses/AGPL-3; if not, see # . +from univention.uvmm.helpers import urlparse def __test(): URIS = filter(None, map(lambda u: u.lstrip(), """\ -- 1.9.1