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

Unified Diff: sitescripts/logs/bin/mergeSubscriptionStats.py

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Patch Set: Created July 4, 2013, 11:23 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/logs/bin/mergeSubscriptionStats.py
===================================================================
--- a/sitescripts/logs/bin/mergeSubscriptionStats.py
+++ b/sitescripts/logs/bin/mergeSubscriptionStats.py
@@ -22,17 +22,17 @@ from StringIO import StringIO
def readStatsFile(path):
result = SafeConfigParser()
match = re.search(r'^ssh://(\w+)@([^/:]+)(?::(\d+))?', path)
if match:
command = ['ssh', '-q', '-o' 'NumberOfPasswordPrompts 0', '-T', '-k', '-l', match.group(1), match.group(2)]
if match.group(3):
command[1:1] = ['-P', match.group(3)]
- (data, dummy) = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()
+ data = subprocess.check_output(command)
result.readfp(StringIO(data))
elif path.startswith('http://') or path.startswith('https://'):
result.readfp(urllib.urlopen(path))
elif os.path.exists(path):
result.read(path)
return result
def getStatsFiles():

Powered by Google App Engine
This is Rietveld