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