Exemple #1
0
    def remote_startCommand(self, stepref, stepId, command, args):
        """
        This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as
        part of various master-side BuildSteps, to start various commands
        that actually do the build. I return nothing. Eventually I will call
        .commandComplete() to notify the master-side RemoteCommand that I'm
        done.
        """

        self.activity()

        if self.command:
            log.msg("leftover command, dropping it")
            self.stopCommand()

        try:
            factory = registry.getFactory(command)
        except KeyError:
            raise UnknownCommand, "unrecognized SlaveCommand '%s'" % command
        self.command = factory(self, stepId, args)

        log.msg(" startCommand:%s [id %s]" % (command,stepId))
        self.remoteStep = stepref
        self.remoteStep.notifyOnDisconnect(self.lostRemoteStep)
        d = self.command.doStart()
        d.addCallback(lambda res: None)
        d.addBoth(self.commandComplete)
        return None
Exemple #2
0
    def remote_startCommand(self, stepref, stepId, command, args):
        """
        This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as
        part of various master-side BuildSteps, to start various commands
        that actually do the build. I return nothing. Eventually I will call
        .commandComplete() to notify the master-side RemoteCommand that I'm
        done.
        """

        self.activity()

        if self.command:
            log.msg("leftover command, dropping it")
            self.stopCommand()

        try:
            factory = registry.getFactory(command)
        except KeyError:
            raise UnknownCommand, "unrecognized SlaveCommand '%s'" % command
        self.command = factory(self, stepId, args)

        log.msg(" startCommand:%s [id %s]" % (command, stepId))
        self.remoteStep = stepref
        self.remoteStep.notifyOnDisconnect(self.lostRemoteStep)
        d = self.command.doStart()
        d.addCallback(lambda res: None)
        d.addBoth(self.commandComplete)
        return None
  def sync_startCommand(self, stepref, stepId, command, cmdargs):
    try:
      cmdfactory = registry.getFactory(command)
    except KeyError:
      raise UnknownCommand("unrecognized SlaveCommand '%s'" % command)

    self.command = cmdfactory(self, stepId, cmdargs)

    self.remoteStep = stepref
    d = self.command.doStart()
    d.addCallback(stepref.remote_complete)
    return d
    def sync_startCommand(self, stepref, stepId, command, cmdargs):
        try:
            cmdfactory = registry.getFactory(command)
        except KeyError:
            raise UnknownCommand("unrecognized SlaveCommand '%s'" % command)

        self.command = cmdfactory(self, stepId, cmdargs)

        self.remoteStep = stepref
        d = self.command.doStart()
        d.addCallback(stepref.remote_complete)
        return d
Exemple #5
0
 def test_all_commands_exist(self):
     # if this doesn't raise a KeyError, then we're good
     for n in registry.getAllCommandNames():
         registry.getFactory(n)
Exemple #6
0
 def test_getFactory_KeyError(self):
     self.assertRaises(
         KeyError, lambda: registry.getFactory('nosuchcommand'))
Exemple #7
0
 def test_getFactory(self):
     factory = registry.getFactory('shell')
     self.assertEqual(factory, shell.SlaveShellCommand)