Returns an error when user has a VC configured without the master selected.

This commit is contained in:
Twan K 2022-09-08 21:36:11 +02:00
parent c2525a1122
commit 66ceaffb11

View File

@ -242,6 +242,11 @@ class NetworkDevice():
f"not part of a cluster.") f"not part of a cluster.")
logger.warning(e) logger.warning(e)
raise SyncInventoryError(e) raise SyncInventoryError(e)
elif(not self.nb.virtual_chassis.master):
e = (f"{self.name} is part of a Netbox virtual chassis which does "
"not have a master configured. Skipping for this reason.")
logger.error(e)
raise SyncInventoryError(e)
else: else:
return self.nb.virtual_chassis.master.id return self.nb.virtual_chassis.master.id