ApmeM

al6850_add_vlan

Jun 11th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. ##----------------------------------------------------------------------
  3. ## EdgeCore.ES.add_vlan
  4. ##----------------------------------------------------------------------
  5. ## Copyright (C) 2007-2009 The NOC Project
  6. ## See LICENSE for details
  7. ##----------------------------------------------------------------------
  8.  
  9. ## Python modules
  10. from __future__ import with_statement
  11. ## NOC modules
  12. from noc.sa.script import Script as NOCScript
  13. from noc.sa.interfaces import IAddVlan
  14.  
  15.  
  16. class Script(NOCScript):
  17. name = "Alcatel.AOS.add_vlan"
  18. implements = [IAddVlan]
  19.  
  20. def execute(self, vlan_id, name, tagged_ports):
  21. with self.configure():
  22. self.cli("vlan %d enable name %s" % (vlan_id, name))
  23. if tagged_ports:
  24. for port in tagged_ports:
  25. self.cli("vlan %d 802.1q 1/%s" % (vlan_id, port))
  26. return True
Advertisement
Add Comment
Please, Sign In to add comment