Skip to content
Snippets Groups Projects
Commit 7b181bfb authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

lrdp-v2: better error message for bad local_settings.py

When local_settings.py is missing variables we just error out when
trying to access those attributes. Improve the error message by
mentioning local_settings.py and pointing the user to README.txt.

Change-Id: Iaa2a1ab96ca889d75972bbfa1d4e127a8bf5bec1
parent 8d02f6cf
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
import sys
import os
import re
from optparse import OptionParser
import parser_util
......@@ -156,12 +157,19 @@ if __name__ == '__main__':
try:
import local_settings
if options.arm64:
gdb_path = gdb_path or local_settings.gdb64_path
nm_path = nm_path or local_settings.nm64_path
else:
gdb_path = gdb_path or local_settings.gdb_path
nm_path = nm_path or local_settings.nm_path
try:
if options.arm64:
gdb_path = gdb_path or local_settings.gdb64_path
nm_path = nm_path or local_settings.nm64_path
else:
gdb_path = gdb_path or local_settings.gdb_path
nm_path = nm_path or local_settings.nm_path
except AttributeError as e:
print_out_str("local_settings.py looks bogus. Please see README.txt")
missing_attr = re.sub(".*has no attribute '(.*)'", '\\1', e.message)
print_out_str("Specifically, looks like you're missing `%s'\n" % missing_attr)
print_out_str("Full message: %s" % e.message)
sys.exit(1)
except ImportError:
cross_compile = os.environ.get('CROSS_COMPILE')
if cross_compile is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment