From 9f2b5a2ec9d379a0f749c7bb7a0bc2d6d74202f1 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Feb 2024 11:11:35 +0100 Subject: [PATCH] Fix network equipment memory conversion --- lib/php/Converter.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/php/Converter.php b/lib/php/Converter.php index 6e91274..e914587 100644 --- a/lib/php/Converter.php +++ b/lib/php/Converter.php @@ -936,13 +936,11 @@ private function convertTo01(array $data): array } } if (isset($data['content']['network_device'])) { - foreach ($data['content']['network_device'] as &$netdev) { - if (isset($netdev['memory'])) { - $netdev['memory'] = $this->convertMemory($netdev['memory']); - } - if (isset($netdev['ram'])) { - $netdev['ram'] = $this->convertMemory($netdev['ram']); - } + if (isset($data['content']['network_device']['memory'])) { + $data['content']['network_device']['memory'] = $this->convertMemory($data['content']['network_device']['memory']); + } + if (isset($data['content']['network_device']['ram'])) { + $data['content']['network_device']['ram'] = $this->convertMemory($data['content']['network_device']['ram']); } }