]> git.proxmox.com Git - pve-client.git/commitdiff
update files from pve-common
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Jun 2018 07:13:50 +0000 (09:13 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Jun 2018 07:16:02 +0000 (09:16 +0200)
Includes some changes which are still not applied.

PVE/APIClient/CLIHandler.pm
PVE/APIClient/PTY.pm
PVE/APIClient/RESTHandler.pm
PVE/APIClient/SectionConfig.pm

index a1cd5281c3d2c59a570f65441761e8bcb6dac50b..a5017f6f8cf934cef0aedcfa93d5f70e70935cc7 100644 (file)
@@ -4,7 +4,6 @@ use strict;
 use warnings;
 
 use PVE::APIClient::SafeSyslog;
-use PVE::APIClient::Exception qw(raise raise_param_exc);
 use PVE::APIClient::RESTHandler;
 
 
@@ -132,7 +131,7 @@ sub generate_usage_str {
        $cli_handler_class->can('string_param_file_mapping');
 
     my ($subcmd, $def, undef, undef, $cmdstr) = resolve_cmd($cmd);
-    die "no such command '$cmd->[0]'\n" if !defined($def) && ref($cmd) eq 'ARRAY';
+    $abort->("unknown command '$cmdstr'") if !defined($def) && ref($cmd) eq 'ARRAY';
 
     my $generate;
     $generate = sub {
@@ -314,7 +313,7 @@ my $print_bash_completion = sub {
     shift @$args; # no need for program name
     my $print_result = sub {
        foreach my $p (@_) {
-           print "$p\n" if $p =~ m/^$cur/;
+           print "$p\n" if $p =~ m/^\Q$cur\E/;
        }
     };
 
index 00010df705f1ba3b3ed804cf2dc5e02698da829e..ee5010c6a737f472f1447b4ae2f8d3b598821536 100644 (file)
@@ -228,6 +228,13 @@ sub read_password($;$$) {
     return $password;
 }
 
+sub get_confirmed_password {
+    my $pw1 = read_password('Enter new password: ');
+    my $pw2 = read_password('Retype new password: ');
+    die "passwords do not match\n" if $pw1 ne $pw2;
+    return $pw1;
+}
+
 # Class functions
 
 sub new {
index ef30ba9744048a085a004d37bb42f7bece9a3bd0..c16f42f16ac60cf31405e81ac67ee6cd02235c14 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 no strict 'refs'; # our autoload requires this
 use warnings;
 use PVE::APIClient::SafeSyslog;
-use PVE::APIClient::Exception qw(raise raise_param_exc);
+use PVE::APIClient::Exception qw(raise);
 use PVE::APIClient::JSONSchema;
 use PVE::APIClient::Tools;
 use HTTP::Status qw(:constants :is status_message);
index 28224e816af934ff8e3cbf64a79ca6a20fd05333..bd428eb03c799f62bceaa6b2ba8d0918ad506087 100644 (file)
@@ -3,7 +3,6 @@ package PVE::APIClient::SectionConfig;
 use strict;
 use warnings;
 use Digest::SHA;
-use PVE::APIClient::Exception qw(raise_param_exc);
 use PVE::APIClient::JSONSchema qw(get_standard_option);
 
 use Data::Dumper;