mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 08:31:49 +00:00
partially revert "api/nodes journal: add and enforce parameter conflicts"
This partially reverts commitf9b08743a5
as we had some wrong assumptions about lastentries and the other params, so just note conflicts in the description but let the tool itself make the checks This reverts commitf9b08743a5
. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d3abac4335
commit
a03cb8b89e
@ -725,7 +725,7 @@ __PACKAGE__->register_method({
|
|||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
lastentries => {
|
lastentries => {
|
||||||
description => "Limit to the last X lines. Conflicts with any cursor or time range parameters.",
|
description => "Limit to the last X lines. Conflicts with a range.",
|
||||||
type => 'integer',
|
type => 'integer',
|
||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
@ -754,24 +754,11 @@ __PACKAGE__->register_method({
|
|||||||
my $user = $rpcenv->get_user();
|
my $user = $rpcenv->get_user();
|
||||||
|
|
||||||
my $cmd = ["/usr/bin/mini-journalreader"];
|
my $cmd = ["/usr/bin/mini-journalreader"];
|
||||||
|
push @$cmd, '-n', $param->{lastentries} if $param->{lastentries};
|
||||||
my $add_to_cmd = sub {
|
push @$cmd, '-b', $param->{since} if $param->{since};
|
||||||
my ($opt, $p, @conflicts) = @_;
|
push @$cmd, '-e', $param->{until} if $param->{until};
|
||||||
return if !defined($param->{$p});
|
push @$cmd, '-f', $param->{startcursor} if $param->{startcursor};
|
||||||
|
push @$cmd, '-t', $param->{endcursor} if $param->{endcursor};
|
||||||
for my $c (@conflicts) {
|
|
||||||
die "parameters '$p' and '$c' conflict with each other!\n"
|
|
||||||
if defined($param->{$c});
|
|
||||||
}
|
|
||||||
|
|
||||||
push @$cmd, $opt, $param->{$p};
|
|
||||||
};
|
|
||||||
|
|
||||||
$add_to_cmd->('-b', 'since', 'startcursor', 'lastentries');
|
|
||||||
$add_to_cmd->('-e', 'until', 'endcursor', 'lastentries');
|
|
||||||
$add_to_cmd->('-f', 'startcursor', 'lastentries');
|
|
||||||
$add_to_cmd->('-t', 'endcursor', 'lastentries');
|
|
||||||
$add_to_cmd->('-n', 'lastentries');
|
|
||||||
|
|
||||||
my $lines = [];
|
my $lines = [];
|
||||||
my $parser = sub { push @$lines, shift };
|
my $parser = sub { push @$lines, shift };
|
||||||
|
Loading…
Reference in New Issue
Block a user