WIP: Omnishell error xml if YAML::Tiny not installed on agent

This commit is contained in:
Calvo 2023-02-10 15:03:57 +01:00
parent f845cc9478
commit 06442fa6e3

View File

@ -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;
}