[Kimchi-devel] [PATCH] issue#383: Only allow one type of parameter when adding vm storage

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Thu Jun 26 07:35:32 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

When adding vm storage, volume and path cannot be specified
at the same time. Fix it.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 src/kimchi/model/vmstorages.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index 8c51716..093b9ee 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -154,6 +154,8 @@ class VMStoragesModel(object):
         # Path will never be blank due to API.json verification.
         # There is no need to cover this case here.
         params['format'] = 'raw'
+        if 'vol' in params and 'path' in params:
+            raise InvalidParameter("KCHVMSTOR0012E")
         if params.get('vol'):
             try:
                 pool = params['pool']
-- 
1.8.3.2




More information about the Kimchi-devel mailing list