Simple code review changes.
I sneakily also added local-test.sh and renamed run-local to local-run.sh.
This commit is contained in:
parent
0763f0d999
commit
d0763862b1
8 changed files with 27 additions and 25 deletions
|
@ -61,14 +61,14 @@ class BuilderServer(object):
|
|||
self._controller_app = controller_app
|
||||
|
||||
def run(self, host):
|
||||
logging.debug('Initializing the lifecycle manager')
|
||||
LOGGER.debug('Initializing the lifecycle manager')
|
||||
self._lifecycle_manager.initialize()
|
||||
|
||||
logging.debug('Initializing all members of the event loop')
|
||||
LOGGER.debug('Initializing all members of the event loop')
|
||||
loop = trollius.get_event_loop()
|
||||
trollius.Task(self._initialize(loop, host))
|
||||
|
||||
logging.debug('Starting server on port 8080, with controller on port 8181')
|
||||
LOGGER.debug('Starting server on port 8080, with controller on port 8181')
|
||||
try:
|
||||
loop.run_forever()
|
||||
except KeyboardInterrupt:
|
||||
|
@ -77,17 +77,17 @@ class BuilderServer(object):
|
|||
loop.close()
|
||||
|
||||
def close(self):
|
||||
logging.debug('Requested server shutdown')
|
||||
LOGGER.debug('Requested server shutdown')
|
||||
self._current_status = 'shutting_down'
|
||||
self._lifecycle_manager.shutdown()
|
||||
self._shutdown_event.wait()
|
||||
logging.debug('Shutting down server')
|
||||
LOGGER.debug('Shutting down server')
|
||||
|
||||
def _register_component(self, realm, component_klass, **kwargs):
|
||||
""" Registers a component with the server. The component_klass must derive from
|
||||
BaseComponent.
|
||||
"""
|
||||
logging.debug('Registering component with realm %s', realm)
|
||||
LOGGER.debug('Registering component with realm %s', realm)
|
||||
|
||||
component = component_klass(types.ComponentConfig(realm=realm), realm=realm, **kwargs)
|
||||
component.server = self
|
||||
|
@ -101,7 +101,7 @@ class BuilderServer(object):
|
|||
return component
|
||||
|
||||
def _unregister_component(self, component):
|
||||
logging.debug('Unregistering component with realm %s and token %s',
|
||||
LOGGER.debug('Unregistering component with realm %s and token %s',
|
||||
component.builder_realm, component.expected_token)
|
||||
|
||||
self._current_components.remove(component)
|
||||
|
@ -120,7 +120,7 @@ class BuilderServer(object):
|
|||
if self._current_status == 'shutting_down' and not self._job_count:
|
||||
self._shutdown_event.set()
|
||||
|
||||
# TODO:(jschorr) check for work here?
|
||||
# TODO(jschorr): check for work here?
|
||||
|
||||
@trollius.coroutine
|
||||
def _work_checker(self):
|
||||
|
|
Reference in a new issue