Skip to content

Commit 396317a

Browse files
trashercedric-anne
authored andcommitted
Hability to handle opearating systems from virtual machines
1 parent 5ffd658 commit 396317a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Inventory/Asset/VirtualMachine.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,19 @@ protected function createVmComputer()
339339
$this->handlePorts('Computer', $computers_vm_id);
340340
}
341341

342+
//manage operating system
343+
if (property_exists($vm, 'operatingsystem')) {
344+
$os = new OperatingSystem($computervm, (array)$vm->operatingsystem);
345+
if ($os->checkConf($this->conf)) {
346+
$os->setAgent($this->getAgent());
347+
$os->setExtraData($this->data);
348+
$os->setEntityID($computervm->getEntityID());
349+
$os->prepare();
350+
$os->handleLinks();
351+
$os->handle();
352+
}
353+
}
354+
342355
//manage extra components created form hosts information
343356
if ($this->conf->vm_components) {
344357
foreach ($this->vmcomponents as $key => $assetitem) {

0 commit comments

Comments
 (0)