[pve-devel] [PATCH manager 07/12] api: nodes: remove deprecated upgrade parameter for vncshell

Fabian Ebner f.ebner at proxmox.com
Fri Jun 4 15:49:41 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Depends on novnc-pve patch (and clearing the browser cache ;)

 PVE/API2/Nodes.pm | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 7feb5662..369c911c 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -906,12 +906,6 @@ __PACKAGE__->register_method ({
 	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
-	    upgrade => {
-		type => 'boolean',
-		description => "Deprecated, use the 'cmd' property instead! Run 'apt-get dist-upgrade' instead of normal shell.",
-		optional => 1,
-		default => 0,
-	    },
 	    cmd => {
 		type => 'string',
 		description => "Run specific command or default to login.",
@@ -964,7 +958,10 @@ __PACKAGE__->register_method ({
 	my ($user, undef, $realm) = PVE::AccessControl::verify_username($rpcenv->get_user());
 
 	raise_perm_exc("realm != pam") if $realm ne 'pam';
-	raise_perm_exc('user != root at pam') if $param->{upgrade} && $user ne 'root at pam';
+
+	if (defined($param->{cmd}) && $param->{cmd} eq 'upgrade' && $user ne 'root at pam') {
+	    raise_perm_exc('user != root at pam');
+	}
 
 	my $node = $param->{node};
 
@@ -976,10 +973,6 @@ __PACKAGE__->register_method ({
 
 	my ($port, $remcmd) = $get_vnc_connection_info->($node);
 
-	# FIXME: remove with 6.0
-	if ($param->{upgrade}) {
-	    $param->{cmd} = 'upgrade';
-	}
 	my $shcmd = get_shell_command($user, $param->{cmd}, $param->{'cmd-opts'});
 
 	my $timeout = 10;
-- 
2.30.2






More information about the pve-devel mailing list