[pve-devel] [PATCH qemu-server v2] use get_standard_mapping for cipassword_map

Dominik Csapak d.csapak at proxmox.com
Mon Jun 25 12:33:26 CEST 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* use correct 'cipassword' not 'password'
 PVE/CLI/qm.pm | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index c017a59..42b8f2c 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -671,15 +671,7 @@ sub param_mapping {
     my $ssh_key_map = ['sshkeys', sub {
 	return URI::Escape::uri_escape(PVE::Tools::file_get_contents($_[0]));
     }];
-    my $cipassword_map = ['cipassword', sub {
-	my ($value) = @_;
-	return $value if $value;
-
-	my $pw = PVE::PTY::read_password('New cloud-init user password: ');
-	my $pw2 = PVE::PTY::read_password('Repeat password: ');
-	die "passwords do not match\n" if $pw ne $pw2;
-	return $pw;
-    }, '<password>', 1];
+    my $cipassword_map = PVE::CLIHandler::get_standard_mapping('pve-password', { name => 'cipassword' });
     my $mapping = {
 	'update_vm' => [$ssh_key_map, $cipassword_map],
 	'create_vm' => [$ssh_key_map, $cipassword_map],
-- 
2.11.0





More information about the pve-devel mailing list