more tabprune interface checking
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5631 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
d5a488523a
commit
d051f10988
@ -593,8 +593,8 @@ sub tabprune
|
||||
push @{$rsp{data}}, " tabprune [eventlog | auditlog] -n [# of records]";
|
||||
push @{$rsp{data}}, " tabprune [eventlog | auditlog] -i [recid]";
|
||||
push @{$rsp{data}}, " tabprune [eventlog | auditlog] -p [percentage]";
|
||||
push @{$rsp{data}}, " tabprune [-?|-h|--help]";
|
||||
push @{$rsp{data}}, " tabprune [-?|-v|--version]";
|
||||
push @{$rsp{data}}, " tabprune [-h|--help]";
|
||||
push @{$rsp{data}}, " tabprune [-v|--version]";
|
||||
if ($exitcode) { $rsp{errorcode} = $exitcode; }
|
||||
$cb->(\%rsp);
|
||||
};
|
||||
@ -622,12 +622,28 @@ sub tabprune
|
||||
}
|
||||
if (scalar(@ARGV)>1) { $tabprune_usage->(1); return; }
|
||||
my $table = $ARGV[0];
|
||||
|
||||
if (!(defined $table)) {
|
||||
my %rsp;
|
||||
$rsp{data}->[0] = "Table name eventlog or auditlog required.";
|
||||
$rsp{errorcode} = 1;
|
||||
$cb->(\%rsp);
|
||||
return 1;
|
||||
|
||||
}
|
||||
$table=~ s/\s*//g; # remove blanks
|
||||
if (($table ne "eventlog") && ($table ne "auditlog")){
|
||||
my %rsp;
|
||||
$rsp{data}->[0] = "Table name eventlog or auditlog required.";
|
||||
$rsp{errorcode} = 1;
|
||||
$cb->(\%rsp);
|
||||
return 1;
|
||||
|
||||
}
|
||||
my %rsp;
|
||||
push @{$rsp{data}}, "tabprune $table complete";
|
||||
push @{$rsp{data}}, "tabprune of $table complete.";
|
||||
$rsp{errorcode} = 0;
|
||||
$cb->(\%rsp);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub getTableColumn {
|
||||
|
Loading…
Reference in New Issue
Block a user