[pve-devel] [PATCH qemu-server 1/1] use get_standard_mapping for cipassword_map
Dominik Csapak
d.csapak at proxmox.com
Fri Jun 15 15:28:50 CEST 2018
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
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..a90aa75 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 => 'password' });
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