# HG changeset patch # User Jeff Hammel # Date 1294446644 28800 # Node ID 30ec24255ce9f930b7cb0ea8d3ba207f270acc56 # Parent 6abe5fb1fafc969239829c27e4c3a03636bba9f2 stub out having a slave template too diff -r 6abe5fb1fafc -r 30ec24255ce9 autobot/template.py --- a/autobot/template.py Fri Jan 07 14:05:46 2011 -0800 +++ b/autobot/template.py Fri Jan 07 16:30:44 2011 -0800 @@ -22,8 +22,8 @@ templates = [os.path.join('template', 'master')] vars = [Variable('slave', 'buildslave name', 'slave'), Variable('passwd', 'buildslave password', default='passwd'), - Variable('slaveport', 'port to talk to slaves on', default=9010), - Variable('htmlport', 'port for waterfall display', default=8010)] + Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int), + Variable('htmlport', 'port for waterfall display', default=8010, cast=int)] def pre(self, variables): factory = variables.get('factory') @@ -54,12 +54,32 @@ name = 'autobot-slave' description = 'template for the autotools buildbot slave' templates = [os.path.join('template', 'slave')] - look = True + vars = [Variable('master', 'host of the master', default='localhost'), + Variable('slave', 'buildslave name', 'slave'), + Variable('passwd', 'buildslave password', default='passwd'), + Variable('slaveport', 'port to talk to slaves on', default=9010)] -def main(args=sys.argv[1:]): + def post(self, variables): + command = ['buildslave', 'create-slave', self.output, + 'localhost:%d' % variables['slaveport'], + variables['slave'], + variables['passwd'] ] + +# CLI front end functions +# (console_script entry points) + +def create_master(args=sys.argv[1:]): cli = MakeItSoCLI(AutobotMasterTemplate) template = cli.parse() template.substitute() +def create_slave(args=sys.argv[1:]): + cli = MakeItSoCLI(AutobotSlaveTemplate) + template = cli.parse() + template.substitute() + +def create_autobot(args=sys.argv[1:]): + raise NotImpmenetedError + if __name__ == '__main__': - main() + create_master() diff -r 6abe5fb1fafc -r 30ec24255ce9 setup.py --- a/setup.py Fri Jan 07 14:05:46 2011 -0800 +++ b/setup.py Fri Jan 07 16:30:44 2011 -0800 @@ -26,6 +26,7 @@ entry_points=""" # -*- Entry points: -*- [console_scripts] - create-autobot-master = autobot.template:main + create-autobot-master = autobot.template:create_master + create-autobot-slave = autobot.template:create_slave """, )