From 7ac7414324477627b6735211a0557f60657fbc99 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Feb 2024 11:11:12 +0100 Subject: [PATCH 1/2] Fix include path --- bin/validate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/validate b/bin/validate index e33a0b2..2d582fc 100755 --- a/bin/validate +++ b/bin/validate @@ -9,7 +9,7 @@ if (file_exists($autoload = __DIR__ . '/../vendor/autoload.php')) { require_once __DIR__ . '/../../../autoload.php'; } -require_once 'lib/php/Converter.php'; +require_once __DIR__ . '/../lib/php/Converter.php'; if (count($argv) !== 2) { From 517295c9eea8a90ffd276399e503a9d57b154fce Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Feb 2024 11:11:35 +0100 Subject: [PATCH 2/2] Fix network equipment memory conversion --- lib/php/Converter.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/php/Converter.php b/lib/php/Converter.php index 6e91274..519d221 100644 --- a/lib/php/Converter.php +++ b/lib/php/Converter.php @@ -936,13 +936,12 @@ 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']); - } + $netdev = &$data['content']['network_device']; + if (isset($netdev['memory'])) { + $netdev['memory'] = $this->convertMemory($netdev['memory']); + } + if (isset($netdev['ram'])) { + $netdev['ram'] = $this->convertMemory($netdev['ram']); } }