Skip to content

Commit

Permalink
Reorganize buildbot.slave.commands
Browse files Browse the repository at this point in the history
buildbot.slave.commands is now split up into 5 modules:

buildbot.slave.commands.base
buildbot.slave.commands.registry
buildbot.slave.commands.transfer
buildbot.slave.commands.vcs
buildbot.slave.commands.utils
  • Loading branch information
Chris AtLee committed Mar 1, 2010
1 parent e342e5c commit 8474a2a
Show file tree
Hide file tree
Showing 15 changed files with 1,395 additions and 1,375 deletions.
2 changes: 1 addition & 1 deletion buildbot/broken_test/runs/test_properties.py
Expand Up @@ -9,7 +9,7 @@
from buildbot.process import base
from buildbot.process.properties import WithProperties, Properties
from buildbot.status import builder
from buildbot.slave.commands import rmdirRecursive
from buildbot.slave.commands.utils import rmdirRecursive
from buildbot.broken_test.runutils import RunMixin, run_one_build
from buildbot.buildrequest import BuildRequest

Expand Down
2 changes: 1 addition & 1 deletion buildbot/broken_test/runs/test_run.py
Expand Up @@ -13,7 +13,7 @@

from buildbot.broken_test.runutils import MasterMixin, TestFlagMixin, StallMixin
from buildbot.broken_test.pollmixin import PollMixin
from buildbot.slave.commands import waitCommandRegistry
from buildbot.slave.commands.base import waitCommandRegistry


config_base = """
Expand Down
2 changes: 1 addition & 1 deletion buildbot/broken_test/runs/test_slaves.py
Expand Up @@ -727,7 +727,7 @@ def _check2():
]
"""

from buildbot.slave.commands import waitCommandRegistry
from buildbot.slave.commands.base import waitCommandRegistry

class Reconfig(RunMixin, StallMixin, unittest.TestCase):

Expand Down
7 changes: 4 additions & 3 deletions buildbot/broken_test/runs/test_steps.py
Expand Up @@ -31,7 +31,8 @@
from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, SKIPPED
from buildbot.broken_test.runutils import RunMixin, rmtree, run_one_build
from buildbot.broken_test.runutils import makeBuildStep, StepTester
from buildbot.slave import commands, registry
from buildbot.slave.commands import registry
from buildbot.slave.commands.base import command_version, Command


class MyShellCommand(shell.ShellCommand):
Expand Down Expand Up @@ -377,7 +378,7 @@ def doBuild(self, buildername):
return d

def checkCompare(self, s):
cver = commands.command_version
cver = command_version
# this insures that we are getting the version correctly
self.failUnlessEqual(s.slaveVersion("svn", None), cver)
# and that non-existent commands do not provide a version
Expand Down Expand Up @@ -407,7 +408,7 @@ def start(self):
d = self.runCommand(cmd)
d.addCallback(lambda res: self.finished(SUCCESS))

class _SimpleCommand(commands.Command):
class _SimpleCommand(Command):
def start(self):
self.builder.flag = True
self.builder.flag_args = self.args
Expand Down
2 changes: 1 addition & 1 deletion buildbot/broken_test/runutils.py
Expand Up @@ -308,7 +308,7 @@ def setupBuildStepStatus(basedir):
return s3

def fake_slaveVersion(command, oldversion=None):
from buildbot.slave.registry import commandRegistry
from buildbot.slave.commands.registry import commandRegistry
return commandRegistry[command]

class FakeBuildMaster:
Expand Down
2 changes: 1 addition & 1 deletion buildbot/broken_test/unit/test_shell.py
Expand Up @@ -6,7 +6,7 @@
from twisted.trial import unittest
from twisted.internet import reactor, defer
from twisted.python import util
from buildbot.slave.commands import SlaveShellCommand
from buildbot.slave.commands.base import SlaveShellCommand
from buildbot.broken_test.runutils import SlaveCommandTestBase

class SlaveSide(SlaveCommandTestBase, unittest.TestCase):
Expand Down
8 changes: 4 additions & 4 deletions buildbot/broken_test/unit/test_slavecommand.py
Expand Up @@ -6,8 +6,8 @@

import os, sys

from buildbot.slave import commands
SlaveShellCommand = commands.SlaveShellCommand
from buildbot.slave.commands import base, utils
SlaveShellCommand = base.SlaveShellCommand

from buildbot.broken_test.runutils import SignalMixin, FakeSlaveBuilder

Expand Down Expand Up @@ -48,7 +48,7 @@ def test_rmdirRecursive(self):
self.touch(d, "a/d/3.txt", 0)
os.chmod(os.path.join(d, "a/d"), 0)

commands.rmdirRecursive(d)
utils.rmdirRecursive(d)
self.failIf(os.path.exists(d))


Expand Down Expand Up @@ -268,7 +268,7 @@ def _testInterrupt2_1(self, res):
# status. In our test environment, it isn't such a big deal.
self.failUnless(isinstance(res, failure.Failure),
"res is not a Failure: %s" % (res,))
self.failUnless(res.check(commands.TimeoutError))
self.failUnless(res.check(base.TimeoutError))
self.checkrc(-1)
return
# the command is still actually running. Start another command, to
Expand Down
7 changes: 4 additions & 3 deletions buildbot/broken_test/vc/test_vc.py
Expand Up @@ -17,8 +17,9 @@
from buildbot import master, interfaces
from buildbot.db import dbspec, schema
from buildbot.buildrequest import BuildRequest
from buildbot.slave import bot, commands
from buildbot.slave.commands import rmdirRecursive
from buildbot.slave import bot
from buildbot.slave.commands.utils import rmdirRecursive
from buildbot.slave.commands.base import ShellCommand
from buildbot.status.builder import SUCCESS, FAILURE
from buildbot.process import base
from buildbot.process.properties import Properties
Expand Down Expand Up @@ -3276,7 +3277,7 @@ class FakeBuilder:
usePTY = False
def sendUpdate(self, status):
pass
c = commands.ShellCommand(FakeBuilder(), command, self.workdir,
c = ShellCommand(FakeBuilder(), command, self.workdir,
sendRC=False, initialStdin=p0_diff)
d = c.start()
d.addCallback(self._testPatch_1)
Expand Down
7 changes: 3 additions & 4 deletions buildbot/slave/bot.py
Expand Up @@ -11,12 +11,11 @@

from buildbot.util import now
from buildbot.pbutil import ReconnectingPBClientFactory
from buildbot.slave import registry
from buildbot.slave.commands import registry

# make sure the standard commands get registered. This import is performed
# for its side-effects.
from buildbot.slave import commands
# and make pyflakes think we aren't being stupid
commands = commands
from buildbot.slave.commands import base, transfer, vcs

class NoCommandRunning(pb.Error):
pass
Expand Down
Empty file.

0 comments on commit 8474a2a

Please sign in to comment.