fix: create poweroutlet with unambiguous powerport

This commit is contained in:
ndom91 2020-10-10 21:12:53 +02:00
parent c6bc1fbbc8
commit 16b922b383

View File

@ -185,9 +185,12 @@ def createPowerOutlets(poweroutlets, deviceType, nb):
poweroutlet["device_type"] = deviceType
poSuccess = nb.dcim.power_outlet_templates.create(poweroutlet)
print(f'Power Outlet Created: {poSuccess.name} - {poSuccess.type} - {poSuccess.device_type.id} - {poSuccess.id}')
counter.update({'updated':1})
counter.update({'updated':1})
except:
print(f'Error assining Power Port to Power Outlet in Outlet: {poweroutlet["name"]}')
poweroutlet["device_type"] = deviceType
poSuccess = nb.dcim.power_outlet_templates.create(poweroutlet)
print(f'Power Outlet Created: {poSuccess.name} - {poSuccess.type} - {poSuccess.device_type.id} - {poSuccess.id}')
counter.update({'updated':1})
except pynetbox.RequestError as e:
print(e.error)