Reviewed-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
On 04/14/2014 12:38 PM, shaohef(a)linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
update API.md, mockmodel, model and API.md
Signed-off-by: ShaoHe Feng <shaohef(a)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 489f062..6da5822 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -560,6 +560,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 69eee3c..5ee4c16 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -835,7 +835,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):