1
2
3
4
5
6
7
8
9
10
11 from Hardware import Hardware
12
13 from AccessControl import ClassSecurityInfo
14 from Globals import InitializeClass
15
16 from Products.ZenUtils.Utils import convToUnits
17 from Products.ZenRelations.RelSchema import *
18
19 from Exceptions import *
20
21
23
24 __pychecker__='no-override'
25
26 meta_type = "DeviceHW"
27
28 totalMemory = 0L
29
30 _properties = Hardware._properties + (
31 {'id':'totalMemory', 'type':'long', 'mode':'w'},
32 )
33
34 _relations = Hardware._relations + (
35 ("cpus", ToManyCont(ToOne, "Products.ZenModel.CPU", "hw")),
36 ("cards", ToManyCont(ToOne, "Products.ZenModel.ExpansionCard", "hw")),
37 ("harddisks", ToManyCont(ToOne, "Products.ZenModel.HardDisk", "hw")),
38 ("fans", ToManyCont(ToOne, "Products.ZenModel.Fan", "hw")),
39 ("powersupplies", ToManyCont(ToOne, "Products.ZenModel.PowerSupply",
40 "hw")),
41 ("temperaturesensors", ToManyCont(ToOne,
42 "Products.ZenModel.TemperatureSensor", "hw")),
43 )
44
45 security = ClassSecurityInfo()
46
50
51
53 pp = self.getPrimaryParent()
54 screen = getattr(pp, "deviceHardwareDetail", False)
55 if not screen: return pp()
56 return screen()
57
60
62 """Return our Device object for DeviceResultInt.
63 """
64 return self.getPrimaryParent()
65
66
67
68 InitializeClass(DeviceHW)
69