[Kimchi-devel] [PATCH] VM template: add disk size error message

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Thu May 15 02:52:13 UTC 2014


The schema checker needs to report an error message when the disk size
is less than 1GB. Currently this message is missing, so it reports an
KeyError. This patch adds the error message.

Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
 src/kimchi/API.json | 6 ++++--
 src/kimchi/i18n.py  | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index b9d371a..d2a834c 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -384,7 +384,8 @@
                         }
                     },
                     "minItems": 1,
-                    "uniqueItems": true
+                    "uniqueItems": true,
+                    "error": "KCHTMPL0022E"
                 },
                 "storagepool": {
                     "description": "Location of the storage pool",
@@ -554,7 +555,8 @@
                         }
                     },
                     "minItems": 1,
-                    "uniqueItems": true
+                    "uniqueItems": true,
+                    "error": "KCHTMPL0022E"
                 },
                 "storagepool": {
                     "description": "Location of the storage pool",
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 25b703f..e105e50 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -119,6 +119,7 @@ messages = {
     "KCHTMPL0019E": _("The volume: %(volume)s in not in storage pool %(pool)s"),
     "KCHTMPL0020E": _("Unable to create template due error: %(err)s"),
     "KCHTMPL0021E": _("Unable to delete template due error: %(err)s"),
+    "KCHTMPL0022E": _("Disk size must be greater than 1GB."),
 
     "KCHPOOL0001E": _("Storage pool %(name)s already exists"),
     "KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
-- 
1.9.0




More information about the Kimchi-devel mailing list