Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- ##----------------------------------------------------------------------
- ## Alcatel.AOS.add_ip_interface
- ##----------------------------------------------------------------------
- ## Copyright (C) 2007-2012 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 IAddVIpInterface
- class Script(NOCScript):
- name = "Alcatel.AOS.add_ip_interface"
- implements = [IAddVIpInterface]
- def execute(self, vlan_id, name_interface, ip, mask):
- with self.configure():
- self.cli("ip interface %s address %s mask %s vlan %d" % (name_interface, ip, mask, vlan_id))
- # 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))
- self.save_config()
- return True
Advertisement
Add Comment
Please, Sign In to add comment