[Kimchi-devel] [PATCH 2/6] Delete http_port from /config API as it is not in use anymore

Aline Manera alinefm at linux.vnet.ibm.com
Wed Aug 27 01:16:44 UTC 2014


http_port information was used to display the guest console
But since we have changed how to redirect user to guest console by adding
the ui/pages/websockify/console.html it is not in use anymore.
So remove it.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 docs/API.md                | 1 -
 src/kimchi/mockmodel.py    | 5 ++---
 src/kimchi/model/config.py | 3 +--
 src/kimchi/server.py       | 1 -
 tests/test_rest.py         | 3 ++-
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/docs/API.md b/docs/API.md
index ebb6e61..be2fd84 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -596,7 +596,6 @@ Contains information about the application environment and configuration.
 **Methods:**
 
 * **GET**: Retrieve configuration information
-    * http_port: The port number on which the server is listening
     * display_proxy_port: Port for vnc and spice's websocket proxy to listen on
     * version: The version of the kimchi service
 * **POST**: *See Configuration Actions*
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index fc474de..57a58d7 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -918,9 +918,8 @@ class MockModel(object):
         return disks.get_partition_details(name)
 
     def config_lookup(self, name):
-        return {'http_port': cherrypy.config.nginx_port,
-                'display_proxy_port':
-                kconfig.get('display', 'display_proxy_port'),
+        return {'display_proxy_port': kconfig.get('display',
+                                                  'display_proxy_port'),
                 'version': config.get_version()}
 
     def packagesupdate_get_list(self):
diff --git a/src/kimchi/model/config.py b/src/kimchi/model/config.py
index 0466f6f..90bb923 100644
--- a/src/kimchi/model/config.py
+++ b/src/kimchi/model/config.py
@@ -40,8 +40,7 @@ class ConfigModel(object):
 
     def lookup(self, name):
         proxy_port = kconfig.get('display', 'display_proxy_port')
-        return {'http_port': cherrypy.config.nginx_port,
-                'display_proxy_port': proxy_port,
+        return {'display_proxy_port': proxy_port,
                 'version': get_version()}
 
 
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index bca2147..10f5dff 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -87,7 +87,6 @@ class Server(object):
         # directly. You must go through the proxy.
         cherrypy.server.socket_host = '127.0.0.1'
         cherrypy.server.socket_port = options.cherrypy_port
-        cherrypy.config.nginx_port = options.port
 
         cherrypy.log.screen = True
         cherrypy.log.access_file = options.access_log
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 2117399..9066857 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -1525,7 +1525,8 @@ class RestTests(unittest.TestCase):
     def test_config(self):
         resp = self.request('/config').read()
         conf = json.loads(resp)
-        self.assertEquals(port, conf['http_port'])
+        keys = ["display_proxy_port", "version"]
+        self.assertEquals(keys, sorted(conf.keys()))
 
     def test_capabilities(self):
         resp = self.request('/config/capabilities').read()
-- 
1.9.3




More information about the Kimchi-devel mailing list