XBuddy path rewrites.
Set up default path rewrites.
Rewrites can be overridden by changing xbuddy_lookup_table.py
BUG=chromium:265917
TEST=manual
Attempt some of the default lookup paths defined in
xbuddy_lookup_table.py.
http://host:port/xbuddy/ --> serves latest local test image if it exists
http://host:port/xbuddy/ld --> serves latest local dev image if it exists
http://host:port/xbuddy/stable-update
http://host:port/xbuddy/paladin
Change-Id: I925ba37f3bfe6e61675aa35e0d89b837c8d5f0f3
Reviewed-on: https://gerrit.chromium.org/gerrit/63772
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/autoupdate.py b/autoupdate.py
index fe9b9ef..b6370d8 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -222,14 +222,6 @@
with open(metadata_file, 'w') as file_handle:
json.dump(file_dict, file_handle)
- def _GetDefaultBoardID(self):
- """Returns the default board id stored in .default_board."""
- board_file = '%s/.default_board' % (self.scripts_dir)
- try:
- return open(board_file).read()
- except IOError:
- return 'x86-generic'
-
@staticmethod
def _GetVersionFromDir(image_dir):
"""Returns the version of the image based on the name of the directory."""
@@ -626,7 +618,7 @@
client_version = app.getAttribute('version')
channel = app.getAttribute('track')
board = (app.hasAttribute('board') and app.getAttribute('board')
- or self._GetDefaultBoardID())
+ or self.GetDefaultBoardID())
# Add attributes to log message
log_message['version'] = client_version
log_message['track'] = channel