<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><br>
Reviewed-by: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@linux.vnet.ibm.com"><alinefm@linux.vnet.ibm.com></a><br>
<br>
I am wondering if it does not apply to all resources: vms,
networks and so.<br>
<br>
We also need to scape the strings we put in the xml. <br>
Otherwise we will have problems while creating resources.<br>
<br>
<font face="sans-serif"><code><span class="pun">>>></span><span
class="pln"> </span><span class="kwd">import</span><span
class="pln"> cgi</span></code><br>
<code><span class="pln"></span><span class="pun">>>></span><span
class="pln"> cgi</span><span class="pun">.</span><span
class="pln">escape</span><span class="pun">(</span><span
class="str">"< & >"</span><span class="pun">)</span><span
class="pln"></span></code><br>
<code><span class="pln"></span><span class="str">'&lt;
&amp; &gt;'</span></code></font><br>
<br>
On 02/23/2014 11:58 PM, <a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a> wrote:<br>
</div>
<blockquote
cite="mid:1393210726-31265-2-git-send-email-shaohef@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
Libvirt only does not allow "/" in storagepool name.
For it will create a storagepool xml by this name.
For example, if we create a name with "pool/name"
Libvirt will try to create the follow storagepool configure file:
/etc/libvirt/storage/pool/name.xml
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
---
po/en_US.po | 4 +---
po/kimchi.pot | 4 +---
po/pt_BR.po | 4 +---
po/zh_CN.po | 6 ++----
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 2 +-
6 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/po/en_US.po b/po/en_US.po
index 8ac59c7..36971b6 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -281,9 +281,7 @@ msgstr ""
msgid "NFS server mount path can not be blank."
msgstr "NFS server mount path can not be blank."
-msgid ""
-"Invalid storage pool name. It may only contain letters, numbers, "
-"underscores, and hyphens."
+msgid "Invalid storage pool name. It should not contain '/'."
msgstr ""
msgid "Invalid NFS mount path."
diff --git a/po/kimchi.pot b/po/kimchi.pot
index f7b33ee..167911c 100755
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -273,9 +273,7 @@ msgstr ""
msgid "NFS server mount path can not be blank."
msgstr ""
-msgid ""
-"Invalid storage pool name. It may only contain letters, numbers, "
-"underscores, and hyphens."
+msgid "Invalid storage pool name. It should not contain '/'."
msgstr ""
msgid "Invalid NFS mount path."
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 0d924e3..502624a 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -299,9 +299,7 @@ msgstr ""
msgid "NFS server mount path can not be blank."
msgstr "Caminho de montagem do servidor de NFS não pode ficar em branco."
-msgid ""
-"Invalid storage pool name. It may only contain letters, numbers, "
-"underscores, and hyphens."
+msgid "Invalid storage pool name. It should not contain '/'."
msgstr ""
msgid "Invalid NFS mount path."
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 361c11a..5cf9f2e 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -289,10 +289,8 @@ msgstr ""
msgid "NFS server mount path can not be blank."
msgstr "NFS服务器挂载路径不能为空"
-msgid ""
-"Invalid storage pool name. It may only contain letters, numbers, "
-"underscores, and hyphens."
-msgstr ""
+msgid "Invalid storage pool name. It should not contain '/'."
+msgstr "无效的存储池的名字。名字不能包含‘/’。"
msgid "Invalid NFS mount path."
msgstr ""
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index b634ca6..203a3f5 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -144,7 +144,7 @@ kimchi.validateForm = function() {
kimchi.message.error.code('KCHPOOL6001E');
return false;
}
- if (!/^[\w-]+$/.test(name)) {
+ if (name.contains("/")) {
kimchi.message.error.code('KCHPOOL6004E');
return false;
}
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 098a0a9..60d2c28 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -109,7 +109,7 @@ var i18n = {
'KCHPOOL6001E': "$_("The storage pool name can not be blank.")",
'KCHPOOL6002E': "$_("The storage pool path can not be blank.")",
'KCHPOOL6003E': "$_("NFS server mount path can not be blank.")",
- 'KCHPOOL6004E': "$_("Invalid storage pool name. It may only contain letters, numbers, underscores, and hyphens.")",
+ 'KCHPOOL6004E': "$_("Invalid storage pool name. It should not contain '/'.")",
'KCHPOOL6005E': "$_("Invalid NFS mount path.")",
'KCHPOOL6006E': "$_("No logical device selected.")",
'KCHPOOL6007E': "$_("The iSCSI target can not be blank.")",
</pre>
</blockquote>
<br>
</body>
</html>