Shadow config for xbuddy.
Add the capability to customize some xBuddy settings via a shadow
configuration file, shadow_xbuddy_config.ini
- Path rewrite aliases
- xBuddy capacity
- Whether or not xBuddy manages src/build/images
Also
- Restructure the existing rewrite lookup table into an ini file
- Have devserver's autoupdate module also use the default board in
src/scripts/.default_board
BUG=chromium:271799
BUG=chromium:260473
TEST=manual
- Checked the lookup table contents with presence/absence of shadow
file, with overrides and additions to the base lookup file.
- Checked that the default board is used by both XBuddy and Updater
modules.
- Pinged server for its xbuddy capacity.
- Pinged server using aliases: '', 'stable_update', and 'release'.
TEST=trybot on mario-paladin
Change-Id: I2cd6f9fda41a878da024deb7936da0c23355c351
Reviewed-on: https://gerrit.chromium.org/gerrit/65780
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
Commit-Queue: Joy Chen <joychen@chromium.org>
diff --git a/build_util.py b/build_util.py
index 9bd4b24..82dc2df 100644
--- a/build_util.py
+++ b/build_util.py
@@ -34,9 +34,13 @@
return os.popen(cmd).read().strip()
def GetDefaultBoardID(self):
- """Returns the default board id stored in .default_board."""
+ """Returns the default board id stored in .default_board.
+
+ Default to x86-generic, if that isn't set.
+ """
board_file = '%s/.default_board' % (self.scripts_dir)
try:
- return open(board_file).read()
+ with open(board_file) as bf:
+ return bf.read().strip()
except IOError:
return 'x86-generic'