Commit e98b181 1 parent 273ba31 commit e98b181 Copy full SHA for e98b181
File tree 4 files changed +5
-5
lines changed
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ sub new {
183
183
_format => ' ' ,
184
184
_glpi_version => glpiVersion(' v10' ),
185
185
_required => $params {required } // [],
186
- _itemtype => $params {itemtype } // " Computer" ,
186
+ _itemtype => empty( $params {itemtype }) ? " Computer" : $params { itemtype } ,
187
187
content => {
188
188
HARDWARE => {
189
189
VMSYSTEM => " Physical" # Default value
@@ -294,7 +294,7 @@ sub getContent {
294
294
deviceid => $self -> getDeviceId(),
295
295
content => $self -> {content },
296
296
partial => $self -> isPartial(),
297
- itemtype => $self -> {_itemtype } // " Computer" ,
297
+ itemtype => empty( $self -> {_itemtype }) ? " Computer" : $self -> { _itemtype } ,
298
298
);
299
299
300
300
# Support json file on additional-content with json output
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ sub createInventory {
67
67
logger => $self -> {logger },
68
68
glpi => $glpi_version ,
69
69
tag => $tag ,
70
- itemtype => $self -> {config }-> {' esx-itemtype' } // " Computer" ,
70
+ itemtype => empty( $self -> {config }-> {' esx-itemtype' }) ? " Computer" : $self -> { config } -> { ' esx-itemtype ' } ,
71
71
# deviceid can be set and so reused from previous netscan
72
72
deviceid => $deviceid
73
73
);
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ sub run {
125
125
logger => $self -> {logger },
126
126
glpi => $self -> {target }-> getTaskVersion(' inventory' ),
127
127
required => $self -> {config }-> {' required-category' } // [],
128
- itemtype => $self -> {config }-> {' itemtype' } // " Computer" ,
128
+ itemtype => empty( $self -> {config }-> {' itemtype' }) ? " Computer" : $self -> { config } -> { ' itemtype ' } ,
129
129
tag => $tag
130
130
);
131
131
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ sub run {
54
54
my $remoteinv = GLPI::Agent::Inventory-> new(
55
55
statedir => $self -> {target }-> getStorage()-> getDirectory(),
56
56
logger => $self -> {logger },
57
- itemtype => $self -> {config }-> {' itemtype' } // " Computer" ,
57
+ itemtype => empty( $self -> {config }-> {' itemtype' }) ? " Computer" : $self -> { config } -> { ' itemtype ' } ,
58
58
);
59
59
my $continue = $remoteinv -> canCleanupOldRemoteStateFile();
60
60
if ($continue ) {
You can’t perform that action at this time.
0 commit comments