SeattleTestbed / softwareupdater

Software updater daemon
MIT License
1 stars 6 forks source link

software updater will stop trying to restart under some conditions #30

Closed choksi81 closed 10 years ago

choksi81 commented 10 years ago

The software updater recognizes when it needs to restart and sets the restartme variable that is local to main(). The problem is that some exceptions can be passed up from main to the loop that exists in global scope in the if __name__ == '__main__': block. That loop that's in the global scope catches all exceptions and calls main() again.

The problem is that, in the unfortunate event of such an exception occurring between the time of recognizing that a restart needs to be done and a successful restart happening, the software updater forgets that it wanted to restart itself because the restartme variable was local to main.

The solution would seem to be to make restartme global.

Note to self: don't forget the global keyword when fixing this.

choksi81 commented 10 years ago

Author: jsamuel Fixed in r3220.