From 2154f50741534a5e53c466cebd8af475257af472 Mon Sep 17 00:00:00 2001 From: Jeroendev <45510403+jeroendev-one@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:48:18 +0100 Subject: [PATCH] Fix distroVersion if unknown version in VMWARE File "/opt/netbox-sync/module/sources/vmware/connection.py", line 2200, in add_virtual_machine detailed_data_dict.get("distroVersion") not in platform: TypeError: 'in ' requires string as left operand, not NoneType Fixes this error, this seemed to be when a OS version is not known in VMWare. --- module/sources/vmware/connection.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/module/sources/vmware/connection.py b/module/sources/vmware/connection.py index 742f54c..5b09bde 100644 --- a/module/sources/vmware/connection.py +++ b/module/sources/vmware/connection.py @@ -2196,9 +2196,14 @@ def add_virtual_machine(self, obj): detailed_data_dict[detailed_data_key] = detailed_data_value.strip("'") if len(detailed_data_dict.get("prettyName","")) > 0: platform = detailed_data_dict.get("prettyName") - if detailed_data_dict.get("familyName", "").lower() == "linux" and \ - detailed_data_dict.get("distroVersion") not in platform: - platform = f'{platform} {detailed_data_dict.get("distroVersion")}' + + distro_version = detailed_data_dict.get("distroVersion") + if detailed_data_dict.get("familyName", "").lower() == "linux" and distro_version: + if distro_version not in platform: + platform = f'{platform} {distro_version}' + if platform is not None: + platform = self.get_object_relation(platform, "vm_platform_relation", fallback=platform) + if platform is not None: platform = self.get_object_relation(platform, "vm_platform_relation", fallback=platform)