Skip to content

Commit 0db0614

Browse files
committed
fix: fix SessionID WsMan class support
1 parent ef481dd commit 0db0614

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ inventory:
2525
remoteinventory:
2626
* fix RedHat RHN systemid set as WINPRODID
2727
* fix battery inventory on windows
28+
* fix SessionID WsMan class support
2829

2930
netdiscovery/netinventory:
3031
* fix #922: Add Radware Alteon Load Balancer support

lib/GLPI/Agent/SOAP/WsMan/Node.pm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,14 @@ sub _load_class {
8282
my ($class, $namespace) = @_;
8383

8484
unless ($INC{"$class.pm"}) {
85-
if (-e "$wsman_classes_path/$class.pm") {
85+
# SessionID class support is included in SessionId module
86+
if ($class eq "SessionID") {
87+
my $module = "GLPI::Agent::SOAP::WsMan::SessionId";
88+
$module->require();
89+
warn "Failure while loading $class: $EVAL_ERROR\n"
90+
if $EVAL_ERROR;
91+
$INC{"$class.pm"} = $INC{module2file($module)};
92+
} elsif (-e "$wsman_classes_path/$class.pm") {
8693
my $module = "GLPI::Agent::SOAP::WsMan::$class";
8794
$module->require();
8895
warn "Failure while loading $class: $EVAL_ERROR\n"

lib/GLPI/Agent/SOAP/WsMan/SessionId.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,12 @@ sub uuid {
4949
return $self->{_uuid} = $uuid;
5050
}
5151

52+
package
53+
SessionID;
54+
55+
use parent
56+
'Node';
57+
58+
use constant xmlns => 'p';
59+
5260
1;

0 commit comments

Comments
 (0)