Ejemplo n.º 1
0
Archivo: cli.py Proyecto: kou/ursabot
def restart_master(obj, no_daemon, start_timeout, clean, no_wait):
    """Restart the buildmaster

    It is a wrapper around `buildbot restart`.
    """
    from buildbot.scripts.restart import restart
    command_cfg = {
        'basedir': obj['config_path'].parent.absolute(),
        'quiet': False,
        'nodaemon': no_daemon,
        'start_timeout': start_timeout,
        'clean': clean,
        'no-wait': no_wait
    }
    restart(command_cfg)
Ejemplo n.º 2
0
def restart_master(obj, no_daemon, start_timeout, clean, no_wait):
    """Restart the buildmaster

    It is a wrapper around `buildbot restart`.
    """
    from buildbot.scripts.restart import restart
    command_cfg = {
        'basedir': obj['config_path'].parent.absolute(),
        'quiet': False,
        'nodaemon': no_daemon,
        'start_timeout': start_timeout,
        'clean': clean,
        'no-wait': no_wait
    }
    result = restart(command_cfg)
    if result > 0:
        raise click.Abort('Failed to restart the Buildbot master!')

    url = obj['config'].url
    click.echo('Buildbot UI is available at: ' + click.style(url, fg='green'))
Ejemplo n.º 3
0
 def test_restart_clean(self):
     self.patch(stop, 'stop', lambda config, wait : 0)
     self.patch(start, 'start', lambda config : 0)
     self.assertEqual(restart.restart(mkconfig(quiet=True, clean=True)), 0)
     self.assertWasQuiet()
Ejemplo n.º 4
0
 def test_restart_succeeds(self):
     self.patch(stop, 'stop', lambda config, wait : 0)
     self.patch(start, 'start', lambda config : 0)
     self.assertEqual(restart.restart(mkconfig()), 0)
     self.assertInStdout('now restarting')
Ejemplo n.º 5
0
 def test_restart_stop_succeeds_start_fails(self):
     self.patch(stop, 'stop', lambda config, wait : 0)
     self.patch(start, 'start', lambda config : 1)
     self.assertEqual(restart.restart(mkconfig()), 1)
Ejemplo n.º 6
0
 def test_restart_not_basedir(self):
     self.assertEqual(restart.restart(mkconfig(basedir='doesntexist')), 1)
     self.assertInStdout('invalid buildmaster directory')