Index: tools/observatory_tool.py |
diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py |
index 8450a07d62ad057fa6d88efcde39609fc21020b5..5936b8220517fe4c9c8da69a42d5724d44b3dec2 100755 |
--- a/tools/observatory_tool.py |
+++ b/tools/observatory_tool.py |
@@ -8,6 +8,7 @@ import argparse |
import os |
import platform |
import shutil |
+import socket |
import subprocess |
import sys |
import utils |
@@ -217,6 +218,13 @@ def ExecuteCommand(options, args): |
return -1; |
def main(): |
+ # Sanity check that localhost can be resolved. |
+ try: |
+ socket.gethostbyname('localhost') |
+ except: |
+ print("The hostname 'localhost' could not be resolved. Please fix your" |
+ "/etc/hosts file and try again") |
+ return -1 |
# Parse the options. |
parser = BuildArguments() |
(options, args) = parser.parse_known_args() |