TheTorProject/ooni-probe — pull request #301 by olafmk (2014-04-11 16:33:14+00:00)
Title: Fixes Issue 300 Endless recursion 'Configuration file does not exist'

This fix resolves issue #300.

The problem is, that (when run via sudo) expanduser(os.path.join('~', '.ooni', 'ooniprobe.conf')) is producing the string "/home/vagrant/.ooni/ooniprobe.conf", while os.path.join(os.path.join(expanduser('~'+self.current_user), '.ooni'), 'ooniprobe.conf') is producing the string "/root/.ooni/ooniprobe.conf".

Or to say it in other words: self.ooni_home and self.config_file are pointing to different users' directories.

The fix to solve the concrete bug is pretty straight forward and simple. It just replaces the creation of the configfile's path (of the method, that creates a new config file) with the usage of self.config_file, that is already defined at this point.

Still I'm not sure if the fact, that self.ooni_home and self.config_file are pointing to different users' home folders (when ooniprobe is run via sudo) is an intended behaviour. What do you think about it?