mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
WIP: Omnishell error xml if YAML::Tiny not installed on agent
This commit is contained in:
parent
f845cc9478
commit
06442fa6e3
@ -556,10 +556,19 @@ BEGIN {
|
||||
sub runCommand {
|
||||
my ($self, $ref, $output_mode) = @_;
|
||||
|
||||
my $result;
|
||||
if($self->load_libraries()) {
|
||||
# Functionality possible.
|
||||
my $command = $self->{'commands'}->{$ref};
|
||||
my $result = $self->evaluate_command($ref);
|
||||
$result = $self->evaluate_command($ref);
|
||||
} else {
|
||||
$result = {
|
||||
'stderr' => 'Cannot use commands without YAML dependency, please install it.',
|
||||
'name' => 'YAML::Tiny',
|
||||
'error_level' => 2,
|
||||
};
|
||||
}
|
||||
|
||||
if (ref($result) eq "HASH") {
|
||||
# Process command result.
|
||||
if (defined($output_mode) && $output_mode eq 'xml') {
|
||||
@ -580,7 +589,6 @@ BEGIN {
|
||||
} else {
|
||||
$self->set_last_error('Failed to process ['.$ref.']: '.$result);
|
||||
}
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user