Skip to content

Commit

Permalink
Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomozart authored Jan 20, 2025
1 parent 591ae0c commit c1f7943
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/GLPI/Agent/Task/NetInventory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,21 @@ sub _sendMessage {
# Load GLPI::Agent::XML::Query as late as possible
return unless GLPI::Agent::XML::Query->require();

my $message = GLPI::Agent::XML::Query->new(
deviceid => $self->{deviceid} || 'foo',
query => 'SNMPQUERY',
tag => $self->{config}->{'tag'},
content => $content
);
my $message;
if (defined($self->{config}->{tag}) && length($self->{config}->{tag})) {
$message = GLPI::Agent::XML::Query->new(
deviceid => $self->{deviceid} || 'foo',
query => 'SNMPQUERY',
tag => $self->{config}->{'tag'},
content => $content
);
} else {
$message = GLPI::Agent::XML::Query->new(
deviceid => $self->{deviceid} || 'foo',
query => 'SNMPQUERY',
content => $content
);
}

if ($self->{target}->isType('local')) {
my ($handle, $file);
Expand Down

0 comments on commit c1f7943

Please sign in to comment.