Add flake8 and fix errors.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
0dc55fda45
commit
50a24bc3bf
9 changed files with 24 additions and 13 deletions
|
|
@ -281,13 +281,13 @@ class TopLevelCommand(Command):
|
|||
try:
|
||||
num = int(num)
|
||||
except ValueError:
|
||||
raise UserError('Number of containers for service "%s" is not a number' % service)
|
||||
raise UserError('Number of containers for service "%s" is not a '
|
||||
'number' % service_name)
|
||||
try:
|
||||
self.project.get_service(service_name).scale(num)
|
||||
except CannotBeScaledError:
|
||||
raise UserError('Service "%s" cannot be scaled because it specifies a port on the host. If multiple containers for this service were created, the port would clash.\n\nRemove the ":" from the port definition in fig.yml so Docker can choose a random port for each container.' % service_name)
|
||||
|
||||
|
||||
def start(self, options):
|
||||
"""
|
||||
Start existing containers.
|
||||
|
|
@ -357,5 +357,6 @@ class TopLevelCommand(Command):
|
|||
print("Gracefully stopping... (press Ctrl+C again to force)")
|
||||
self.project.stop(service_names=service_names)
|
||||
|
||||
|
||||
def list_containers(containers):
|
||||
return ", ".join(c.name for c in containers)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue