Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from noc.inv.models import *
- uni_id = InterfaceProfile.objects.get(name="UNI").id
- nni_id = InterfaceProfile.objects.get(name="NNI").id
- default_id = InterfaceProfile.objects.get(name="default").id
- interface = Interface.objects.filter(type="physical")
- for i in interface:
- if i.link:
- i.profile = nni_id
- i.save()
- continue
- elif not i.description:
- i.profile = default_id
- i.save()
- continue
- elif i.profile.name == InterfaceProfile.objects.get(name="default").name:
- i.profile = uni_id
- i.save()
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement