diff --git a/master/buildbot/test/unit/test_worker_protocols_pb.py b/master/buildbot/test/unit/test_worker_protocols_pb.py index 95af65fc1ce..5c8b9b6664c 100644 --- a/master/buildbot/test/unit/test_worker_protocols_pb.py +++ b/master/buildbot/test/unit/test_worker_protocols_pb.py @@ -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) @@ -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) @@ -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)) @@ -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'), diff --git a/master/buildbot/worker/protocols/pb.py b/master/buildbot/worker/protocols/pb.py index 4aeeec4641e..170fc9750c0 100644 --- a/master/buildbot/worker/protocols/pb.py +++ b/master/buildbot/worker/protocols/pb.py @@ -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.