Add logging to start and stop

This commit is contained in:
Ben Firshman 2013-12-18 13:13:40 +00:00
parent 90130eec65
commit cb366eed7a
1 changed files with 5 additions and 3 deletions

View File

@ -61,6 +61,7 @@ class Service(object):
port_bindings[int(internal_port)] = int(external_port) port_bindings[int(internal_port)] = int(external_port)
else: else:
port_bindings[int(port)] = None port_bindings[int(port)] = None
log.info("Starting %s..." % container_options['name'])
self.client.start( self.client.start(
container['Id'], container['Id'],
links=self._get_links(), links=self._get_links(),
@ -69,9 +70,10 @@ class Service(object):
return container return container
def stop_container(self): def stop_container(self):
container_id = self.containers[-1]['Id'] container = self.containers[-1]
self.client.kill(container_id) log.info("Stopping and removing %s..." % get_container_name(container))
self.client.remove_container(container_id) self.client.kill(container)
self.client.remove_container(container)
def next_container_number(self): def next_container_number(self):
numbers = [parse_name(get_container_name(c))[1] for c in self.containers] numbers = [parse_name(get_container_name(c))[1] for c in self.containers]