File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -100,17 +100,20 @@ def get_one_lab_data(lab_name: str) -> Lab:
100100 # Off: 0
101101 # Available: 1
102102 # In Use: 2
103- # Out of Service Unknown (just going to use default condition to handle this)
104- # TODO: find out status number for Out of Service
103+ # Out of Service: 3
104+ # https://github.com/pittcsc/PittAPI/issues/192#issuecomment-2323735463
105105 for computer_info in lab_data ["state" ].values ():
106- if computer_info ["up" ] == 0 :
106+ up = computer_info ["up" ]
107+ if up == 0 :
107108 off_computers += 1
108- elif computer_info [ "up" ] == 1 :
109+ elif up == 1 :
109110 available_computers += 1
110- elif computer_info [ "up" ] == 2 :
111+ elif up == 2 :
111112 in_use_computers += 1
112- else :
113+ elif up == 3 :
113114 out_of_service_computers += 1
115+ else :
116+ raise LabAPIError (f"Unknown 'up' value for { computer_info ["addr" ]} in { name } : { up } " )
114117
115118 return Lab (
116119 name ,
You can’t perform that action at this time.
0 commit comments