Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from noc.inv.models import Interface, InterfaceProfile
- from noc.sa.models import ManagedObject
- pi = InterfaceProfile.objects.get(name="seg_gb_ports").id
- pd = InterfaceProfile.objects.get(name="default").id
- print pi
- print pd
- for mo in ManagedObject.objects.filter(profile_name="Opticin.OS"):
- print str(mo.id)
- ifaces = Interface.objects.filter(managed_object=mo.id, name="Port 25", profile=pd)
- # print ifaces
- for i in ifaces:
- print "Changing profile for %s" % i
- i["profile"] = pi
- i.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement