@@ -18,6 +18,8 @@ class Psu(PsuBase):
18
18
def __init__ (self , index ):
19
19
PsuBase .__init__ (self )
20
20
self .__index = index
21
+ # STUB IMPLEMENTATION
22
+ self .color = ""
21
23
22
24
'''
23
25
Units of returned info object values:
@@ -95,16 +97,85 @@ def psu_present_get(client):
95
97
status = thrift_try (psu_present_get )
96
98
return status
97
99
100
+ def set_status_led (self , color ):
101
+ """
102
+ Sets the state of the PSU status LED
103
+
104
+ Args:
105
+ color: A string representing the color with which to set the
106
+ PSU status LED
107
+
108
+ Returns:
109
+ bool: True if status LED state is set successfully, False if not
110
+ """
111
+ # STUB IMPLEMENTATION
112
+ self .color = color
113
+ return True
114
+
115
+ def get_status_led (self ):
116
+ """
117
+ Gets the state of the PSU status LED
118
+
119
+ Returns:
120
+ A string, one of the predefined STATUS_LED_COLOR_* strings above
121
+ """
122
+ # STUB IMPLEMENTATION
123
+ return self .color
124
+
98
125
# DeviceBase iface:
99
126
def get_serial (self ):
127
+ """
128
+ Retrieves the serial number of the device
129
+
130
+ Returns:
131
+ string: Serial number of device
132
+ """
100
133
return self .__info_get ().serial
101
134
102
135
def get_model (self ):
136
+ """
137
+ Retrieves the model number (or part number) of the device
138
+
139
+ Returns:
140
+ string: Model/part number of device
141
+ """
103
142
return self .__info_get ().model
104
143
105
144
def is_replaceable (self ):
145
+ """
146
+ Indicate whether this device is replaceable.
147
+ Returns:
148
+ bool: True if it is replaceable.
149
+ """
106
150
return True
107
151
152
+ def get_revision (self ):
153
+ """
154
+ Retrieves the hardware revision of the device
155
+
156
+ Returns:
157
+ string: Revision value of device
158
+ """
159
+ return self .__info_get ().rev
160
+
161
+ def get_status (self ):
162
+ """
163
+ Retrieves the operational status of the device
164
+
165
+ Returns:
166
+ A boolean value, True if device is operating properly, False if not
167
+ """
168
+ return self .get_powergood_status ()
169
+
170
+ def get_position_in_parent (self ):
171
+ """
172
+ Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position
173
+ for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned
174
+ Returns:
175
+ integer: The 1-based relative physical position in parent device or -1 if cannot determine the position
176
+ """
177
+ return self .__index
178
+
108
179
def psu_list_get ():
109
180
psu_list = []
110
181
for i in range (1 , Psu .get_num_psus () + 1 ):
0 commit comments