From: Dominik Csapak Date: Mon, 25 Jun 2018 10:33:26 +0000 (+0200) Subject: use get_standard_mapping for cipassword_map X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3dba118c89e8beaa88faa23782c6fc5d2a3e7c2b;p=qemu-server.git use get_standard_mapping for cipassword_map Signed-off-by: Dominik Csapak --- diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index c017a597..42b8f2ca 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; - }, '', 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],