I've tested the patch and found issues when creating VM with templates
using '/'
Creating a VM with a template named 'slash/' :
KCHOBJST0001E: Unable to find slash in datastore
If I create a template named '/', when creating the VM:
KCHOBJST0001E: Unable to find in datastore
Using a template named '/////' (5 slashes):
KCHOBJST0001E: Unable to find //// in datastore (4 slashes)
It seems that either the VM creation or the template creation is
omitting one slash of the original template name.
On 03/11/2015 04:28 PM, Rodrigo Trujillo wrote:
Users are allowed to create or update template names with
"slash",
this generates an error when he tries to create a guest with that
template because the guest paramters validation prohibits slashes
in templates names. This patch fixes this problem.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 0cfa20c..f507251 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -233,7 +233,7 @@
"template": {
"description": "The URI of a template to use when
building a VM",
"type": "string",
- "pattern": "^/templates/[^/]+/?$",
+ "pattern": "^/templates/(.*?)/?$",
"required": true,
"error": "KCHVM0012E"
},