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

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

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Patch Set: Fixed wrong argument format Created July 4, 2013, 1:01 p.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/updateSubscriptionDownloads.py
===================================================================
--- a/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py
+++ b/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py
@@ -30,18 +30,18 @@ if __name__ == '__main__':
sourceTemp = {}
destTemp = None
try:
destTemp = tempfile.mkdtemp()
for repoName, repoDir in sourceRepos.iteritems():
tempDir = tempfile.mkdtemp()
sourceTemp[repoName] = tempDir
- subprocess.Popen(['hg', 'archive', '-R', repoDir, '-r', 'default', tempDir]).communicate()
- subprocess.Popen(['rsync', '-a', '--delete', destDir + '/', destTemp]).communicate()
+ subprocess.check_call(['hg', 'archive', '-R', repoDir, '-r', 'default', tempDir])
+ subprocess.check_call(['rsync', '-a', '--delete', destDir + '/', destTemp])
Sebastian Noack 2013/07/04 13:57:51 There is no need to hard-code path separators. Use
Wladimir Palant 2013/07/05 11:24:33 os.path.join() won't help here - rsync requires th
combineSubscriptions(sourceTemp, destTemp)
- subprocess.Popen(['rsync', '-au', '--delete', destTemp + '/', destDir]).communicate()
+ subprocess.check_call(['rsync', '-au', '--delete', destTemp + '/', destDir])
Sebastian Noack 2013/07/04 13:57:51 See above.
finally:
for tempDir in sourceTemp.itervalues():
if os.path.exists(tempDir):
shutil.rmtree(tempDir, True)
if destTemp and os.path.exists(destTemp):
shutil.rmtree(destTemp, True)

Powered by Google App Engine
This is Rietveld