[Kimchi-devel] [PATCH] Add missing error message when updating template

Crístian Viana vianac at linux.vnet.ibm.com
Fri May 9 19:16:54 UTC 2014


The template update command (as well as the other ones) should return an
error message when any of its property values is empty/wrong. The error
message should describe what happened.
When leaving the disk size empty during the template update command, no
error message is returned and the server an exception is raised.

Update the API JSON file so there is an error message assigned to the
template disk property.

Signed-off-by: Crístian Viana <vianac at linux.vnet.ibm.com>
---
 src/kimchi/API.json | 3 ++-
 src/kimchi/i18n.py  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index b9d371a..92e9720 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -549,7 +549,8 @@
                             "size": {
                                 "description": "Size (GB) of the disk",
                                 "type": "number",
-                                "minimum": 1
+                                "minimum": 1,
+                                "error": "KCHTMPL0022E"
                             }
                         }
                     },
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 25b703f..4beb29d 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 an integer greater than 0"),
 
     "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