1
2
3
4
5
6
7
8
9
10
11
12
13
14 from zope.interface import implements
15
16 from Products.ZenModel.interfaces import IIndexed
17 from ZenModelRM import ZenModelRM
18 from ZenPackable import ZenPackable
19
20 -class MibBase(ZenModelRM, ZenPackable):
21 implements(IIndexed)
22 default_catalog = 'mibSearch'
23
24 _relations = ZenPackable._relations[:]
25
26 moduleName = ""
27 nodetype = ""
28 oid = ""
29 status = ""
30 description = ""
31
32 _properties = (
33 {'id':'moduleName', 'type':'string', 'mode':'w'},
34 {'id':'nodetype', 'type':'string', 'mode':'w'},
35 {'id':'oid', 'type':'string', 'mode':'w'},
36 {'id':'status', 'type':'string', 'mode':'w'},
37 {'id':'description', 'type':'string', 'mode':'w'},
38 )
39
40
41 - def __init__(self, id, title="", **kwargs):
46
47
49 """Return full value name in form MODULE::attribute.
50 """
51 return "%s::%s" % (self.moduleName, self.id)
52
53
55 """Return summary string for Mib objects.
56 """
57 return [str(getattr(self, p)) for p in self.propertyIds() \
58 if str(getattr(self, p))]
59