Skip to content

Commit

Permalink
code cleanup and lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tardyp committed Jul 15, 2016
1 parent 29091a1 commit 0a53753
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 3 additions & 1 deletion master/buildbot/test/fake/hyper.py
Expand Up @@ -20,7 +20,9 @@ class Client(object):
def __init__(self, config):
self.config = config
self.containers = {}
#assert Client.instance is None
# there should be only one Client instance during tests
# if this is not the case then tests are leaking between each other
assert Client.instance is None
Client.instance = self

def start(self, container):
Expand Down
3 changes: 1 addition & 2 deletions master/buildbot/test/unit/test_worker_hyper.py
Expand Up @@ -42,7 +42,6 @@ def remoteSetBuilderList(self, builders):
return defer.succeed(None)

def loseConnection(self):
print "looseConnection"
self.n()


Expand Down Expand Up @@ -125,7 +124,7 @@ def test_start_worker_but_error(self):
worker = self.makeWorker(image="buggy")
d = worker.substantiate(None, FakeBuild())
self.reactor.pump([.1])
r = self.failureResultOf(d)
self.failureResultOf(d)
self.assertIsNotNone(worker.client)
self.assertEqual(worker.instance, None)
# teardown makes sure all containers are cleaned up
4 changes: 0 additions & 4 deletions master/buildbot/worker/hyper.py
Expand Up @@ -82,13 +82,10 @@ def reconfigService(self, name, password, hyper_host,

@defer.inlineCallbacks
def stopService(self):
print "stopping service", self.client
# stopService will call stop_instance if the worker was up.
yield AbstractLatentWorker.stopService(self)
print "stopped service", self.client
# we cleanup our thread and session (or reactor.stop will hang)
if self.client is not None:
print "closing client"
self.client.close()
self.client = None
if self.threadPool is not None:
Expand Down Expand Up @@ -153,7 +150,6 @@ def stop_instance(self, fast=False):

def _thd_stop_instance(self, instance, fast):
log.msg('Stopping container %s...' % instance['Id'][:6])
print "stopping"
self.client.stop(instance['Id'])
if not fast:
self.client.wait(instance['Id'])
Expand Down
4 changes: 2 additions & 2 deletions master/docs/manual/cfg-workers-docker.rst
Expand Up @@ -276,11 +276,11 @@ In addition to the arguments available for any :ref:`Latent-Workers`, :class:`Hy

``hyper_accesskey``
(mandatory)
Accesskey to use as part of the creds to access hyper.
Access key to use as part of the creds to access hyper.

``hyper_secretkey``
(mandatory)
Secretkey to use as part of the creds to access hyper.
Secret key to use as part of the creds to access hyper.

``hyper_size``
(mandatory)
Expand Down
1 change: 1 addition & 0 deletions master/docs/spelling_wordlist.txt
Expand Up @@ -125,6 +125,7 @@ bzip
bzr
Bzr
bzrignore
CaaS
callables
Callables
callee
Expand Down

0 comments on commit 0a53753

Please sign in to comment.