Skip to content

Commit

Permalink
Log a message on the worker when buildbot-slave is detected.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomprince committed Jun 26, 2016
1 parent e9fa9e6 commit 7ae5dbb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion master/buildbot/test/unit/test_worker_protocols_pb.py
Expand Up @@ -157,9 +157,12 @@ def side_effect(*args, **kwargs):
self.assertEqual(info, r)
calls = [
mock.call('getWorkerInfo'),
mock.call('print',
message='buildbot-slave detected, failing back to deprecated buildslave API. '
'(Ignoring missing getWorkerInfo method.)'),
mock.call('getSlaveInfo'),
mock.call('getCommands'),
mock.call('getVersion')
mock.call('getVersion'),
]
self.mind.callRemote.assert_has_calls(calls)

Expand Down Expand Up @@ -191,6 +194,9 @@ def side_effect(*args, **kwargs):
self.assertEqual(info, r)
calls = [
mock.call('getWorkerInfo'),
mock.call('print',
message='buildbot-slave detected, failing back to deprecated buildslave API. '
'(Ignoring missing getWorkerInfo method.)'),
mock.call('getSlaveInfo'),
]
self.mind.callRemote.assert_has_calls(calls)
Expand Down Expand Up @@ -253,6 +259,8 @@ def test_remoteGetWorkerInfo_no_info(self):
# All remote commands tried in remoteGetWorkerInfo are unavailable.
# This should be real old worker...
def side_effect(*args, **kwargs):
if args[0] == 'print':
return
return defer.fail(twisted_pb.RemoteError(
'twisted.spread.flavors.NoSuchMethod', None, None))

Expand All @@ -264,6 +272,9 @@ def side_effect(*args, **kwargs):
self.assertEqual(info, r)
calls = [
mock.call('getWorkerInfo'),
mock.call('print',
message='buildbot-slave detected, failing back to deprecated buildslave API. '
'(Ignoring missing getWorkerInfo method.)'),
mock.call('getSlaveInfo'),
mock.call('getCommands'),
mock.call('getVersion'),
Expand Down
3 changes: 3 additions & 0 deletions master/buildbot/worker/protocols/pb.py
Expand Up @@ -198,6 +198,9 @@ def remoteGetWorkerInfo(self):
info = yield self.mind.callRemote('getWorkerInfo')
defer.returnValue(info)
except _NoSuchMethod:
yield self.remotePrint(
"buildbot-slave detected, failing back to deprecated buildslave API. "
"(Ignoring missing getWorkerInfo method.)")
info = {}

# Probably this is deprecated buildslave.
Expand Down

0 comments on commit 7ae5dbb

Please sign in to comment.