[Kimchi-devel] [PATCH 3/3] config version API support in backend.
shaohef at linux.vnet.ibm.com
shaohef at linux.vnet.ibm.com
Fri Apr 11 15:50:32 UTC 2014
From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
update API.md, mockmodel, model and API.md
Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
docs/API.md | 1 +
src/kimchi/mockmodel.py | 3 ++-
src/kimchi/model/config.py | 5 +++--
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index 143c70c..fbcc597 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -557,6 +557,7 @@ Contains information about the application environment and configuration.
* **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*
**Actions (POST):**
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 98fb080..de4da04 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -831,7 +831,8 @@ class MockModel(object):
def config_lookup(self, name):
return {'http_port': cherrypy.server.socket_port,
'display_proxy_port':
- kconfig.get('display', 'display_proxy_port')}
+ kconfig.get('display', 'display_proxy_port'),
+ 'version': config.get_version()}
def packagesupdate_get_list(self):
return self._mock_swupdate.getUpdates()
diff --git a/src/kimchi/model/config.py b/src/kimchi/model/config.py
index a6d00ab..7081373 100644
--- a/src/kimchi/model/config.py
+++ b/src/kimchi/model/config.py
@@ -23,7 +23,7 @@ import cherrypy
from kimchi.basemodel import Singleton
from kimchi.config import config as kconfig
-from kimchi.config import find_qemu_binary
+from kimchi.config import find_qemu_binary, get_version
from kimchi.distroloader import DistroLoader
from kimchi.exception import NotFoundError
from kimchi.featuretests import FeatureTests
@@ -41,7 +41,8 @@ class ConfigModel(object):
def lookup(self, name):
proxy_port = kconfig.get('display', 'display_proxy_port')
return {'http_port': cherrypy.server.socket_port,
- 'display_proxy_port': proxy_port}
+ 'display_proxy_port': proxy_port,
+ 'version': get_version()}
class CapabilitiesModel(object):
--
1.8.5.3
More information about the Kimchi-devel
mailing list