Skip to content

Commit

Permalink
Single vlan handling fix
Browse files Browse the repository at this point in the history
  • Loading branch information
po1vo committed Nov 22, 2023
1 parent 233ee5d commit b4a676a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/php/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1409,9 +1409,10 @@ public function convertNetworkInventory(array $data): array
//check for arrays
foreach ($data['content']['network_ports'] as &$netport) {
if (isset($netport['vlans'])) {
$netport['vlans'] = array_is_list($netport['vlans']['vlan']) ?
$netport['vlans']['vlan'] :
[$netport['vlans']['vlan']];
$netport['vlans'] = is_array($netport['vlans']['vlan'])
&& array_is_list($netport['vlans']['vlan'])
? $netport['vlans']['vlan']
: [$netport['vlans']['vlan']];
}
if (isset($netport['connections']['cdp'])) {
$netport['lldp'] = (bool)$netport['connections']['cdp'];
Expand Down

0 comments on commit b4a676a

Please sign in to comment.