Use importlib to check for elasticsearch instead of import statement

Review Request #9099 — Created July 24, 2017 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x
d1dd8ee...

Reviewers

The import elasticsearch statement in elasticsearch.py was
succeeding if the module was not installed because it would find
./elasticsearch.py (itself) and import that instead. We now use
import_module to do the dependency check, which checks for
system-level modules and not local ones.

With this patch applied, I cannot enable elasticsearch when it is not
installed.