From 236f55b95570a16db5f17d1ff367282fcc2760ee Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 25 Mar 2014 13:05:22 +0100 Subject: [PATCH] ignor eadditional arguments when moveto is set --- src/PVE/API2/Firewall/Groups.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PVE/API2/Firewall/Groups.pm b/src/PVE/API2/Firewall/Groups.pm index 9ce6ce7..5c2f63c 100644 --- a/src/PVE/API2/Firewall/Groups.pm +++ b/src/PVE/API2/Firewall/Groups.pm @@ -200,7 +200,7 @@ __PACKAGE__->register_method({ type => 'string', }, moveto => { - description => "Move rule to new position .", + description => "Move rule to new position . Other arguments are ignored.", type => 'integer', minimum => 0, optional => 1, @@ -223,8 +223,6 @@ __PACKAGE__->register_method({ my $rule = $rules->[$param->{pos}]; - PVE::Firewall::copy_rule_data($rule, $param); - my $moveto = $param->{moveto}; if (defined($moveto) && $moveto != $param->{pos}) { my $newrules = []; @@ -238,7 +236,9 @@ __PACKAGE__->register_method({ push @$newrules, $rule if $moveto >= scalar(@$rules); $groups_conf->{rules}->{$param->{group}} = $newrules; - } + } else { + PVE::Firewall::copy_rule_data($rule, $param); + } PVE::Firewall::save_security_groups($groups_conf); -- 2.39.2