Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 14 __doc__="""UBRRouter 15 16 UBRRouter class represents a Ubr Router 17 18 $Id: UBRRouter.py,v 1.12 2004/04/12 16:20:44 edahl Exp $""" 19 20 __version__ = "$Revision: 1.12 $"[11:-2] 21 22 from AccessControl import ClassSecurityInfo 23 from Globals import DTMLFile 24 from Globals import InitializeClass 25 26 from AccessControl import Permissions as permissions 27 28 from Products.ZenRelations.RelSchema import * 29 30 from IpAddress import findIpAddress 31 from Device import Device 3234 """make a device""" 35 serv = UBRRouter(id, title) 36 context._setObject(serv.id, serv) 37 38 if REQUEST is not None: 39 REQUEST['RESPONSE'].redirect(context.absolute_url() 40 +'/manage_main')41 42 43 addUBRRouter = DTMLFile('dtml/addUBRRouter',globals()) 44 4547 """UBRRouter object""" 48 portal_type = meta_type = 'UBRRouter' 49 50 _relations = Device._relations + ( 51 ("dhcpservers", ToMany(ToMany, "Products.ZenModel.Device", "dhcpubrclients")), 52 ) 53 54 55 security = ClassSecurityInfo() 5674 75 76 InitializeClass(UBRRouter) 7758 dhcpservers = self.dhcpservers.objectValuesAll() 59 sys = self.systems() 60 if len(sys): sys = sys[0] 61 else: sys = None 62 for ip in ips: 63 dip = findIpAddress(self, ip) 64 if not dip: continue 65 dserv = dip.getDevice() 66 if dserv in dhcpservers: 67 dhcpservers.remove(dserv) 68 continue 69 if sys: dserv.addRelation("systems", sys) 70 self.addRelation("dhcpservers", dserv) 71 for dserv in dhcpservers: 72 dserv.removeRelation("systems", sys) 73 self.removeRelation("dhcpservers", dserv)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu Oct 25 16:28:29 2007 | http://epydoc.sourceforge.net |