Skip to content

Commit

Permalink
[SPARK-2627] check that pep8 downloaded fine
Browse files Browse the repository at this point in the history
Don’t just assume curl got the file alright. Check and exit properly if
there were any problems.
  • Loading branch information
nchammas committed Aug 3, 2014
1 parent dffb5dd commit d0a83b9
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions dev/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ PEP8_REPORT_PATH="$SPARK_ROOT_DIR/dev/pep8-report.txt"

cd $SPARK_ROOT_DIR

# See: https://github.com/apache/spark/pull/1744#issuecomment-50982162
# Get pep8 at runtime so that we don't rely on it being installed on the build server.
# TODOs:
# - Dynamically determine latest release version of pep8 and use that.
# - Download this from a more reliable source. (GitHub raw can be flaky, apparently. (?))
#+ See: https://github.com/apache/spark/pull/1744#issuecomment-50982162
#+ TODOs:
#+ - Dynamically determine latest release version of pep8 and use that.
#+ - Download this from a more reliable source. (GitHub raw can be flaky, apparently. (?))
PEP8_SCRIPT_PATH="$SPARK_ROOT_DIR/dev/pep8.py"
curl --silent -o "$PEP8_SCRIPT_PATH" \
"https://raw.githubusercontent.com/jcrocholl/pep8/1.5.7/pep8.py"
PEP8_SCRIPT_REMOTE_PATH="https://raw.githubusercontent.com/jcrocholl/pep8/1.5.7/pep8.py"

curl --silent -o "$PEP8_SCRIPT_PATH" "$PEP8_SCRIPT_REMOTE_PATH"
curl_status=$?

if [ $curl_status -ne 0 ]
then
echo "Failed to download pep8.py from \"$PEP8_SCRIPT_REMOTE_PATH\"."
exit $curl_status
fi


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

0 comments on commit d0a83b9

Please sign in to comment.