Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Unified Diff: scripts/master/master_gen.py

Issue 1152093002: Adjust master_gen.PopulateBuildmasterConfig() to look at master_site_config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: add active_master_cls param to AnnotatorFactory() Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master.tryserver.client.catapult/master.cfg ('k') | scripts/master/unittests/master_gen_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/master_gen.py
diff --git a/scripts/master/master_gen.py b/scripts/master/master_gen.py
index 373b928cc9fa81ef8faf182cb9d5c9d2b5b6c765..b24052d1d6d9d51448d123a1a517874ac80096fc 100644
--- a/scripts/master/master_gen.py
+++ b/scripts/master/master_gen.py
@@ -19,35 +19,19 @@ from master.factory import annotator_factory
def PopulateBuildmasterConfig(BuildmasterConfig, builders_path,
- master_cls=None):
+ active_master_cls):
"""Read builders_path and populate a build master config dict."""
- master_cls = master_cls or Master
builders = chromium_utils.ReadBuildersFile(builders_path)
- _Populate(BuildmasterConfig, builders, master_cls)
+ _Populate(BuildmasterConfig, builders, active_master_cls)
-
-def _Populate(BuildmasterConfig, builders, master_cls):
- classname = builders['master_classname']
- base_class = getattr(master_cls, builders['master_base_class'])
- active_master_cls = type(classname, (base_class,), {
- 'buildbot_url': builders['buildbot_url'],
- 'project_name': builders['master_classname'],
- 'master_port': int(builders['master_port']),
- 'master_port_alt': int(builders['master_port_alt']),
- 'slave_port': int(builders['slave_port']),
- })
-
- # TODO: Modify this and the factory call, below, so that we can pass the
- # path to the builders.pyl file through the annotator to the slave so that
- # the slave can get the recipe name and the factory properties dynamically
- # without needing the master to re-read things.
- m_annotator = annotator_factory.AnnotatorFactory()
+def _Populate(BuildmasterConfig, builders, active_master_cls):
+ m_annotator = annotator_factory.AnnotatorFactory(active_master_cls)
c = BuildmasterConfig
c['logCompressionLimit'] = False
c['projectName'] = active_master_cls.project_name
- c['projectURL'] = master_cls.project_url
+ c['projectURL'] = Master.project_url
c['buildbotURL'] = active_master_cls.buildbot_url
# This sets c['db_url'] to the database connect string in found in
@@ -88,7 +72,7 @@ def _Populate(BuildmasterConfig, builders, master_cls):
# slaves registered to a builder. Remove dupes.
c['slaves'] = master_utils.AutoSetupSlaves(
c['builders'],
- master_cls.GetBotPassword(),
+ Master.GetBotPassword(),
missing_recipients=['buildbot@chromium-build-health.appspotmail.com'])
# This does some sanity checks on the configuration.
« no previous file with comments | « masters/master.tryserver.client.catapult/master.cfg ('k') | scripts/master/unittests/master_gen_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698