@@ -163,11 +163,11 @@ def convert_volume_binds(binds):
163
163
result = []
164
164
for k , v in binds .items ():
165
165
if isinstance (v , dict ):
166
- result .append ('%s:%s:%s' % (
166
+ result .append ('{0}:{1}:{2}' . format (
167
167
k , v ['bind' ], 'ro' if v .get ('ro' , False ) else 'rw'
168
168
))
169
169
else :
170
- result .append ('%s:%s :rw' % (k , v ))
170
+ result .append ('{0}:{1} :rw' . format (k , v ))
171
171
return result
172
172
173
173
@@ -201,7 +201,8 @@ def parse_host(addr):
201
201
addr = addr .replace ('http+unix://' , 'unix://' )
202
202
203
203
if addr == 'tcp://' :
204
- raise errors .DockerException ("Invalid bind address format: %s" % addr )
204
+ raise errors .DockerException (
205
+ "Invalid bind address format: {0}" .format (addr ))
205
206
elif addr .startswith ('unix://' ):
206
207
addr = addr [7 :]
207
208
elif addr .startswith ('tcp://' ):
@@ -215,15 +216,15 @@ def parse_host(addr):
215
216
else :
216
217
if "://" in addr :
217
218
raise errors .DockerException (
218
- "Invalid bind address protocol: %s" % addr
219
+ "Invalid bind address protocol: {0]" . format ( addr )
219
220
)
220
221
proto = "http"
221
222
222
223
if proto != "http+unix" and ":" in addr :
223
224
host_parts = addr .split (':' )
224
225
if len (host_parts ) != 2 :
225
226
raise errors .DockerException (
226
- "Invalid bind address format: %s" % addr
227
+ "Invalid bind address format: {0}" . format ( addr )
227
228
)
228
229
if host_parts [0 ]:
229
230
host = host_parts [0 ]
@@ -236,13 +237,14 @@ def parse_host(addr):
236
237
)
237
238
238
239
elif proto in ("http" , "https" ) and ':' not in addr :
239
- raise errors .DockerException ("Bind address needs a port: %s" % addr )
240
+ raise errors .DockerException (
241
+ "Bind address needs a port: {0}" .format (addr ))
240
242
else :
241
243
host = addr
242
244
243
245
if proto == "http+unix" :
244
- return "%s ://%s" % (proto , host )
245
- return "%s ://%s:%d " % (proto , host , port )
246
+ return "{0} ://{1}" . format (proto , host )
247
+ return "{0} ://{1}:{2} " % (proto , host , port )
246
248
247
249
248
250
def parse_devices (devices ):
0 commit comments