Don't run sudo commands on module import

Change the PIL installation logic to only run commands that require
root in situations where we're actuallying trying to install PIL.

BUG=None
TEST=from autotest_lib.utils import external_packages no longer
   tries to mutate my machine's file system.
TEST=`./utils/build_externals.py imaginglibrary` still prompts for sudo

Change-Id: If80b12b1522d7e75e0a66817773099d22c3cb0bd
Reviewed-on: https://chromium-review.googlesource.com/318830
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
1 file changed