]> git.proxmox.com Git - pve-client.git/commitdiff
correctly use PVE::APIClient::PTY
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Jun 2018 10:19:38 +0000 (12:19 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Jun 2018 10:19:38 +0000 (12:19 +0200)
PVE/APIClient/Commands/lxc.pm
PVE/APIClient/Commands/remote.pm

index 601f86f208faaf16597ddcf9620c0df5352bb910..9e73b45f16df1b2c39a7fe44ca29d7d492ae3801 100644 (file)
@@ -247,12 +247,12 @@ __PACKAGE__->register_method ({
        $full_write->($web_socket, $frame);
 
        # Send resize command
-       my ($columns, $rows) = PVE::PTY::tcgetsize(*STDIN);
+       my ($columns, $rows) = PVE::APIClient::PTY::tcgetsize(*STDIN);
        $frame = $create_websockt_frame->("1:$columns:$rows:");
        $full_write->($web_socket, $frame);
 
        # Set STDIN to "raw -echo" mode
-       my $old_termios = PVE::PTY::tcgetattr(*STDIN);
+       my $old_termios = PVE::APIClient::PTY::tcgetattr(*STDIN);
        my $raw_termios = {%$old_termios};
 
        my $read_select = IO::Select->new;
@@ -264,8 +264,8 @@ __PACKAGE__->register_method ({
        eval {
            $SIG{TERM} = $SIG{INT} = $SIG{KILL} = sub { die "received interrupt\n"; };
 
-           PVE::PTY::cfmakeraw($raw_termios);
-           PVE::PTY::tcsetattr(*STDIN, $raw_termios);
+           PVE::APIClient::PTY::cfmakeraw($raw_termios);
+           PVE::APIClient::PTY::tcsetattr(*STDIN, $raw_termios);
 
            # And set it to non-blocking so we can every char with IO::Select.
            STDIN->blocking(0);
@@ -283,7 +283,7 @@ __PACKAGE__->register_method ({
            $SIG{WINCH} = sub { $winch_received = 1; };
 
            my $check_terminal_size = sub {
-               my ($ncols, $nrows) = PVE::PTY::tcgetsize(*STDIN);
+               my ($ncols, $nrows) = PVE::APIClient::PTY::tcgetsize(*STDIN);
                if ($ncols != $columns or $nrows != $rows) {
                    $columns = $ncols;
                    $rows = $nrows;
@@ -406,7 +406,7 @@ __PACKAGE__->register_method ({
            $full_write->(\*STDOUT, $output_buffer);
            $output_buffer = '';
 
-           PVE::PTY::tcsetattr(*STDIN, $old_termios);
+           PVE::APIClient::PTY::tcsetattr(*STDIN, $old_termios);
        };
        warn $@ if $@; # show cleanup errors
 
index 8deac33dc61849c4cc42e707ae30a40780086e8a..090672ee2cd1bca6bc53bbcee815e7a9f7893cba 100644 (file)
@@ -15,7 +15,7 @@ use PVE::APIClient::PTY;
 use base qw(PVE::APIClient::CLIHandler);
 
 sub read_password {
-   return PVE::PTY::read_password("Remote password: ")
+   return PVE::APIClient::PTY::read_password("Remote password: ")
 }
 
 __PACKAGE__->register_method ({
@@ -64,7 +64,7 @@ __PACKAGE__->register_method ({
 
        my $password = $param->{password};
        if (!defined($password)) {
-           $password = PVE::PTY::read_password("Remote password: ");
+           $password = PVE::APIClient::PTY::read_password("Remote password: ");
        }
 
        my $setup = {