[Kimchi-devel] [PATCH] Github issue #300: hardcoded server port fix

Daniel Barboza danielhb at linux.vnet.ibm.com
Thu Jan 9 01:51:09 UTC 2014


From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>

When executing kimchi using a port different than 8000, the "Remote ISO Image" will always be disabled.

The issue is caused by functions in featuretests.py that uses the port 8000 hardcoded, instead of getting the actual used port to launch the server.

As of now I haven't found any other occurrence of the "8000" hardcoded port anywhere in the code.

Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
---
 src/kimchi/featuretests.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index 1ca3567..d9409ae 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -20,6 +20,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
+import cherrypy
 import libvirt
 import os
 import subprocess
@@ -70,18 +71,17 @@ class FeatureTests(object):
 
     @staticmethod
     def qemu_supports_iso_stream():
-        cmd = "qemu-io http://127.0.0.1:8000/images/icon-fedora.png \
-              -c 'read -v 0 512'"
+        cmd = "qemu-io http://127.0.0.1:%d/images/icon-fedora.png \
+              -c 'read -v 0 512'" % cherrypy.server.socket_port
         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE, shell=True)
         stdout, stderr = proc.communicate()
-
         return len(stderr) == 0
 
     @staticmethod
     def qemu_iso_stream_dns():
-        cmd = ["qemu-io", "http://localhost:8000/images/icon-fedora.png", "-c",
-               "'read -v 0 512'"]
+        cmd = ["qemu-io", "http://localhost:%d/images/icon-fedora.png" %
+               cherrypy.server.socket_port, "-c", "'read -v 0 512'"]
         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
         thread = threading.Thread(target=proc.communicate)
-- 
1.8.3.1




More information about the Kimchi-devel mailing list