From 18f2b6ff91dcbf5f165c2463c82f97b1b1345bf9 Mon Sep 17 00:00:00 2001 From: Leonid Mirsky Date: Tue, 5 Aug 2014 15:47:02 +0300 Subject: [PATCH] Fixing styling issues --- docker/client.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/client.py b/docker/client.py index 2844cb57..19d52a37 100644 --- a/docker/client.py +++ b/docker/client.py @@ -119,18 +119,21 @@ class Client(requests.Session): 'm': 1024*1024, 'g': 1024*1024*1024} suffix = mem_limit[-1].lower() - + if suffix in units.keys(): try: - digits = int(mem_limit[:-1]) + digits = int(mem_limit[:-1]) except ValueError: - message = ('Failed converting the string value for mem_limit ({0}) to a number.') - raise errors.DockerException(message.format(mem_limit[:-1])) + message = ('Failed converting the string value for' + ' mem_limit ({0}) to a number.') + formatted_message = message.format(mem_limit[:-1]) + raise errors.DockerException(formatted_message) mem_limit = digits * units[suffix] else: - message = ('The specified value for mem_limit parameter ({0}) should specify' - ' the units. The postfix should be one of the `k` `m` `g` characters' ) + message = ('The specified value for mem_limit parameter' + ' ({0}) should specify the units. The postfix' + ' should be one of the `k` `m` `g` characters') raise errors.DockerException(message.format(mem_limit)) if isinstance(ports, list):