Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- ##----------------------------------------------------------------------
- ## EdgeCore.ES.add_vlan
- ##----------------------------------------------------------------------
- ## Copyright (C) 2007-2009 The NOC Project
- ## See LICENSE for details
- ##----------------------------------------------------------------------
- ## Python modules
- from __future__ import with_statement
- ## NOC modules
- from noc.sa.script import Script as NOCScript
- from noc.sa.interfaces import IAddVlan
- class Script(NOCScript):
- name = "Alcatel.AOS.add_vlan"
- implements = [IAddVlan]
- def execute(self, vlan_id, name, tagged_ports):
- with self.configure():
- self.cli("vlan %d enable name %s" % (vlan_id, name))
- if tagged_ports:
- for port in tagged_ports:
- self.cli("vlan %d 802.1q 1/%s" % (vlan_id, port))
- return True
Advertisement
Add Comment
Please, Sign In to add comment