I am adding tenant and sites, to link a site to tenant i used to get tenant id. But something has changed in the new version and below code gives error AttributeError: 'NoneType' object has no attribute 'id'. It looks like ndev_tenant.id has no .id attribute. What should i use instead of id?
my code:
for [tenant,site,descr,descrSite] in f:
try:
ndev_tenant = nb.tenancy.tenants.get(slug=tenant)
tenant_id=ndev_tenant.id
nb.dcim.sites.create (
name = site,
slug = site,
tenant = tenant_id,
description = descrSite,
)
--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/d05498a2-5bc5-4b83-872f-7f757b8c9385n%40googlegroups.com.