]> git.proxmox.com Git - pmg-api.git/commitdiff
api: nodes: drop deprecated 'upgrade' option of termproxy
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 8 Jun 2021 16:06:50 +0000 (16:06 +0000)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 11 Jun 2021 14:53:45 +0000 (14:53 +0000)
The termproxy api was adapted to the changes from PVE and PBS
in d9e79ff4b7f0f9b2c49f06484091546353980c5e
We can now drop the 'upgrade' option kept for backwards compatibility

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/API2/Nodes.pm

index 8cdf935150a913275ecb5e9e359239cbebeb6b89..f9ccfaecbb6f91b3237cf5b0b432f0febe5a79e7 100644 (file)
@@ -389,12 +389,6 @@ __PACKAGE__->register_method ({
        additionalProperties => 0,
        properties => {
            node => get_standard_option('pve-node'),
-           upgrade => {
-               type => 'boolean',
-               description => "Run 'apt-get dist-upgrade' instead of normal shell.",
-               optional => 1,
-               default => 0,
-           },
            cmd => {
                type => 'string',
                description => "Run specific command or default to login.",
@@ -434,17 +428,13 @@ __PACKAGE__->register_method ({
        my $restenv = PMG::RESTEnvironment->get();
        my $user = $restenv->get_user();
 
-       raise_perm_exc('user != root@pam') if $param->{upgrade} && $user ne 'root@pam';
+       raise_perm_exc('user != root@pam') if $param->{cmd} eq 'upgrade' && $user ne 'root@pam';
 
        my $ticket = PMG::Ticket::assemble_vnc_ticket($user, $authpath);
 
        my $family = PVE::Tools::get_host_address_family($node);
        my $port = PVE::Tools::next_vnc_port($family);
 
-       # FIXME: remove with 7.0 (check if all works before!!)
-       if ($param->{upgrade}) {
-           $param->{cmd} = 'upgrade';
-       }
        my $shcmd = get_shell_command($user, $param->{cmd}, $param->{'cmd-opts'});
 
        my $cmd = ['/usr/bin/termproxy', $port, '--path', $authpath, '--', @$shcmd];