set dummy value if a host device vendor/model cannot be retrieved

This commit is contained in:
Gregory Storme
2021-02-03 00:50:38 +01:00
parent af47bf8a97
commit b43b719d43
+6
View File
@@ -1450,6 +1450,12 @@ class VMWareHandler:
product_version = get_string_or_none(grab(obj, "summary.config.product.version"))
platform = f"{product_name} {product_version}"
# if the device vendor/model cannot be retrieved (due to problem on the host), set a dummy value so the host still gets synced
if manufacturer is None:
manufacturer = "ErrorCouldNotRetrieveVendor"
if model is None:
model = "ErrorCouldNotRetrieveModel"
# get status
status = "offline"
if get_string_or_none(grab(obj, "summary.runtime.connectionState")) == "connected":