diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-02-15 20:05:01 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-02-15 20:05:01 +0400 |
commit | 3c6690941b56e9af732f4dcf5a95435be0c2794e (patch) | |
tree | a5634d5f3792b582f7be4b7d4bd53c7806b957ec /misc | |
parent | da7e84e50a4f17d5e4ce81badde2cdb1b0d8b084 (diff) |
Fixes #4670, use popen in import_logs.py to run updatetokenfile.php instead of check_output.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/log-analytics/import_logs.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index a31d724226..8e380ba4fa 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -600,11 +600,16 @@ class Configuration(object): '../../misc/cron/updatetoken.php'), ) - process = "php " + updatetokenfile + command = ['php', updatetokenfile] if self.options.enable_testmode: - process = process + " --testmode" + command.append('--testmode') - filename = subprocess.check_output(process, shell=True); + process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + [stdout, stderr] = process.communicate() + if process.returncode != 0: + fatal_error("misc/cron/updatetoken.php failed: " + stderr) + + filename = stdout credentials = open(filename, 'r').readline() credentials = credentials.split('\t') return credentials[1] |