lnls-sirius / bbb-daemon

BeagleBone Black management services
0 stars 0 forks source link

Local variable 'ps_model' referenced before assignment #26

Closed carneirofc closed 5 years ago

carneirofc commented 5 years ago

Bug when the pins are set for a power supply but no message is returned.

jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]: 15/07/2019 17:46:49 Something wrong happened !
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]: Traceback (most recent call last):
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]:   File "./whoami.py", line 46, in <module>
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]:     power_supply_pru()
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]:   File "/root/bbb-daemon/host/function/scripts/devices.py", line 87, in power_supply_pru
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]:     persist_info(Type.POWER_SUPPLY, 6000000, PRU_POWER_SUPPLY, 'PS model {}. Connected: {}'.for
jul 15 17:46:49 PA-RaPSD04--CO-PSCtrl-SI1 bash[1019]: UnboundLocalError: local variable 'ps_model' referenced before assignment
carneirofc commented 5 years ago

The local variable ps_model is now initialized at the beginning of the for loop