[tor-commits] [ooni-probe/master] change again command report structure for ProcessTest
commit 6e1cc4bb698d361154bf20bc82e44a86754b7c93 Author: juga0 Date: Thu Dec 24 13:28:38 2015 + change again command report structure for ProcessTest * Change report structure as commented in https://github.com/TheTorProject/ooni-probe/pull/445#issuecomment-166981539 --- ooni/templates/process.py | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ooni/templates/process.py b/ooni/templates/process.py index b7dafdd..82457dc 100644 --- a/ooni/templates/process.py +++ b/ooni/templates/process.py @@ -103,10 +103,14 @@ class ProcessTest(NetTestCase): def processEnded(self, result, command): log.debug("Finished %s: %s" % (command, result)) -self.report['command_name'] = ' '.join(command) -self.report['command_stdout'] = result['stdout'] -self.report['command_stderr'] = result['stderr'] -self.report['command_exit_reason'] = result['exit_reason'] +if not isinstance(self.report.get('commands'), list): +self.report['commands'] = [] +self.report['commands'].append({ +'command_name': ' '.join(command), +'command_stdout': result['stdout'], +'command_stderr': result['stderr'], +'command_exit_reason': result['exit_reason'], +}) return result def run(self, command, finished=None, env={}, path=None, usePTY=0): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [ooni-probe/master] change again command report structure for ProcessTest
commit e5a532658904a06e9167d89a9291896cc3c1b620 Author: juga0 Date: Thu Dec 24 13:28:38 2015 + change again command report structure for ProcessTest * Change report structure as commented in https://github.com/TheTorProject/ooni-probe/pull/445#issuecomment-166981539 --- ooni/templates/process.py | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ooni/templates/process.py b/ooni/templates/process.py index b7dafdd..82457dc 100644 --- a/ooni/templates/process.py +++ b/ooni/templates/process.py @@ -103,10 +103,14 @@ class ProcessTest(NetTestCase): def processEnded(self, result, command): log.debug("Finished %s: %s" % (command, result)) -self.report['command_name'] = ' '.join(command) -self.report['command_stdout'] = result['stdout'] -self.report['command_stderr'] = result['stderr'] -self.report['command_exit_reason'] = result['exit_reason'] +if not isinstance(self.report.get('commands'), list): +self.report['commands'] = [] +self.report['commands'].append({ +'command_name': ' '.join(command), +'command_stdout': result['stdout'], +'command_stderr': result['stderr'], +'command_exit_reason': result['exit_reason'], +}) return result def run(self, command, finished=None, env={}, path=None, usePTY=0): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits