[pve-devel] [PATCH manager] change ssh-public-keys check in wizard

Dominik Csapak d.csapak at proxmox.com
Thu Nov 24 09:16:34 CET 2016


we changed the ssh public key field to a pvetextfield, which return not
an empty string but null, so the .length check failed with an exception

we do not need to delete the field because it does not exists, when
no key is given

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/lxc/CreateWizard.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/www/manager6/lxc/CreateWizard.js b/www/manager6/lxc/CreateWizard.js
index 31f87c1..ab6c7ac 100644
--- a/www/manager6/lxc/CreateWizard.js
+++ b/www/manager6/lxc/CreateWizard.js
@@ -286,9 +286,7 @@ Ext.define('PVE.lxc.CreateWizard', {
 			delete kv.nodename;
 			delete kv.tmplstorage;
 
-			if (!kv['ssh-public-keys'].length) {
-			    delete kv['ssh-public-keys'];
-			} else if (!kv.password.length) {
+			if (!kv.password.length && kv['ssh-public-keys']) {
 			    delete kv.password;
 			}
 
-- 
2.1.4





More information about the pve-devel mailing list