[Kimchi-devel] [PATCH] [Kimchi 1/3] Update /plugins/kimchi/config API to only return information related to Kimchi

Aline Manera alinefm at linux.vnet.ibm.com
Tue Jan 19 00:29:06 UTC 2016


The server information is configured by Wok server and should be
accessible by a common API (/config)

So remove those kind of information from Kimchi and properly return the
Kimchi version when requested.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 docs/API.md        |  3 +--
 model/config.py    | 10 ++++------
 tests/test_rest.py |  4 ++--
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/docs/API.md b/docs/API.md
index 9593f6b..01ee432 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -693,12 +693,11 @@ A interface represents available interface on host.
 
 **URI:** /plugins/kimchi/config
 
-Contains information about the application environment and configuration.
+Contains information about Kimchi configuration.
 
 **Methods:**
 
 * **GET**: Retrieve configuration information
-    * 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/model/config.py b/model/config.py
index 5a26957..588ad54 100644
--- a/model/config.py
+++ b/model/config.py
@@ -1,7 +1,7 @@
 #
 # Project Kimchi
 #
-# Copyright IBM, Corp. 2014-2015
+# Copyright IBM, Corp. 2014-2016
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -22,11 +22,11 @@ from multiprocessing.pool import ThreadPool
 
 from wok.basemodel import Singleton
 from wok.config import config as kconfig
-from wok.config import get_version
+
 from wok.exception import NotFoundError
 from wok.utils import run_command, wok_log
 
-from wok.plugins.kimchi.config import find_qemu_binary
+from wok.plugins.kimchi.config import find_qemu_binary, get_kimchi_version
 from wok.plugins.kimchi.distroloader import DistroLoader
 from wok.plugins.kimchi.model.featuretests import FeatureTests
 from wok.plugins.kimchi.model.featuretests import FEATURETEST_POOL_NAME
@@ -40,9 +40,7 @@ class ConfigModel(object):
         pass
 
     def lookup(self, name):
-        proxy_port = kconfig.get('display', 'display_proxy_port')
-        return {'display_proxy_port': proxy_port,
-                'version': get_version()}
+        return {'version': get_kimchi_version()}
 
 
 class CapabilitiesModel(object):
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 0305e82..2115e33 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -2,7 +2,7 @@
 #
 # Project Kimchi
 #
-# Copyright IBM, Corp. 2013-2015
+# Copyright IBM, Corp. 2013-2016
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -1226,7 +1226,7 @@ class RestTests(unittest.TestCase):
     def test_config(self):
         resp = self.request('/plugins/kimchi/config').read()
         conf = json.loads(resp)
-        keys = ["display_proxy_port", "version"]
+        keys = ["version"]
         self.assertEquals(keys, sorted(conf.keys()))
 
     def test_capabilities(self):
-- 
2.5.0




More information about the Kimchi-devel mailing list