Skip to content

Commit d0a83b9

Browse files
committed
[SPARK-2627] check that pep8 downloaded fine
Don’t just assume curl got the file alright. Check and exit properly if there were any problems.
1 parent dffb5dd commit d0a83b9

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

dev/lint-python

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@ PEP8_REPORT_PATH="$SPARK_ROOT_DIR/dev/pep8-report.txt"
2323

2424
cd $SPARK_ROOT_DIR
2525

26-
# See: https://github.com/apache/spark/pull/1744#issuecomment-50982162
2726
# Get pep8 at runtime so that we don't rely on it being installed on the build server.
28-
# TODOs:
29-
# - Dynamically determine latest release version of pep8 and use that.
30-
# - Download this from a more reliable source. (GitHub raw can be flaky, apparently. (?))
27+
#+ See: https://github.com/apache/spark/pull/1744#issuecomment-50982162
28+
#+ TODOs:
29+
#+ - Dynamically determine latest release version of pep8 and use that.
30+
#+ - Download this from a more reliable source. (GitHub raw can be flaky, apparently. (?))
3131
PEP8_SCRIPT_PATH="$SPARK_ROOT_DIR/dev/pep8.py"
32-
curl --silent -o "$PEP8_SCRIPT_PATH" \
33-
"https://raw.githubusercontent.com/jcrocholl/pep8/1.5.7/pep8.py"
32+
PEP8_SCRIPT_REMOTE_PATH="https://raw.githubusercontent.com/jcrocholl/pep8/1.5.7/pep8.py"
33+
34+
curl --silent -o "$PEP8_SCRIPT_PATH" "$PEP8_SCRIPT_REMOTE_PATH"
35+
curl_status=$?
36+
37+
if [ $curl_status -ne 0 ]
38+
then
39+
echo "Failed to download pep8.py from \"$PEP8_SCRIPT_REMOTE_PATH\"."
40+
exit $curl_status
41+
fi
42+
3443

3544
# There is no need to write this output to a file
3645
#+ first, but we do so so that the check status can

0 commit comments

Comments
 (0)