1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from Hardware import Hardware
16
17 from AccessControl import ClassSecurityInfo
18 from Globals import DTMLFile
19 from Globals import InitializeClass
20 from Acquisition import aq_base
21 from DateTime import DateTime
22
23 from AccessControl import Permissions as permissions
24
25 from Products.ZenUtils.Utils import convToUnits
26 from Products.ZenRelations.RelSchema import *
27
28 from Exceptions import *
29
30
32
33 meta_type = "DeviceHW"
34
35 totalMemory = 0L
36
37 _properties = Hardware._properties + (
38 {'id':'totalMemory', 'type':'long', 'mode':'w'},
39 )
40
41 _relations = Hardware._relations + (
42 ("cpus", ToManyCont(ToOne, "Products.ZenModel.CPU", "hw")),
43 ("cards", ToManyCont(ToOne, "Products.ZenModel.ExpansionCard", "hw")),
44 ("harddisks", ToManyCont(ToOne, "Products.ZenModel.HardDisk", "hw")),
45 )
46
47 security = ClassSecurityInfo()
48
52
53
55 pp = self.getPrimaryParent()
56 screen = getattr(pp, "deviceHardwareDetail", False)
57 if not screen: return pp()
58 return screen()
59
62
64 """Return our Device object for DeviceResultInt.
65 """
66 return self.getPrimaryParent()
67
68
69
70 InitializeClass(DeviceHW)
71