Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/subscriptions/bin/updateMalwareDomainsList.py

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Patch Set: Addressed issues Created July 5, 2013, 11:22 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/subscriptions/bin/updateMalwareDomainsList.py
===================================================================
--- a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
+++ b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
@@ -42,14 +42,13 @@ if __name__ == '__main__':
zip = zipfile.ZipFile(StringIO(data), 'r')
info = zip.infolist()[0]
for line in str(zip.read(info.filename)).splitlines():
if not line:
continue
print >>file, '||%s^' % line.strip().decode('iso-8859-1')
file.close();
- subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgbot', '-m', 'Updated malwaredomains.com data'])
-
- # Don't check the result of this call, it will be 1 if nothing needs pushing
- subprocess.call(['hg', '-q', 'push', '-R', tempdir])
+ if subprocess.check_output(['hg', 'stat', '-R', tempdir]) != '':
+ subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgbot', '-m', 'Updated malwaredomains.com data'])
+ subprocess.call(['hg', '-q', 'push', '-R', tempdir])
Sebastian Noack 2013/07/05 22:06:08 If I understand it correctly, you check with hg st
finally:
shutil.rmtree(tempdir, ignore_errors=True)
« no previous file with comments | « sitescripts/management/bin/updateExternalFiles.py ('k') | sitescripts/subscriptions/bin/updateSubscriptionDownloads.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld