Skip to content

Instantly share code, notes, and snippets.

@wohali
Last active July 21, 2017 21:07
Show Gist options
  • Save wohali/3d0070de6b4e7989f2303a54713ef8db to your computer and use it in GitHub Desktop.
Save wohali/3d0070de6b4e7989f2303a54713ef8db to your computer and use it in GitHub Desktop.
import requests
import subprocess
import tarfile
req = requests.get("https://couchdb-vm2.apache.org/ci_errorlogs/_all_docs")
alldocs = req.json()
for d in alldocs['rows']:
if '_design' not in d['id']:
foo = requests.get("https://couchdb-vm2.apache.org/ci_errorlogs/" + d['id'] + '/couchlog.tar.gz')
with open('/tmp/foo.tar.gz', 'w') as f:
f.write(foo.content)
tar = tarfile.open('/tmp/foo.tar.gz')
tar.extractall(path='/tmp/pyfoo')
tar.close()
status = subprocess.call("grep -qr \"{nocatch,{mp_parser_died,noproc}}\" /tmp/pyfoo", shell=True)
if status == 0:
print(d['id'])
_ = subprocess.call("rm -rf /tmp/pyfoo/*", shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment