42
42
NOT_ON_HOST = os .environ .get ('NOT_ON_HOST' , False )
43
43
44
44
warnings .simplefilter ('error' )
45
- create_host_config = docker .utils .create_host_config
46
45
compare_version = docker .utils .compare_version
47
46
48
47
@@ -181,7 +180,7 @@ def runTest(self):
181
180
container = self .client .create_container (
182
181
'busybox' ,
183
182
['ls' , mount_dest ], volumes = {mount_dest : {}},
184
- host_config = create_host_config (
183
+ host_config = self . client . create_host_config (
185
184
binds = binds , network_mode = 'none'
186
185
)
187
186
)
@@ -223,7 +222,7 @@ def runTest(self):
223
222
container = self .client .create_container (
224
223
'busybox' ,
225
224
['ls' , mount_dest ], volumes = {mount_dest : {}},
226
- host_config = create_host_config (
225
+ host_config = self . client . create_host_config (
227
226
binds = binds , network_mode = 'none'
228
227
)
229
228
)
@@ -255,7 +254,7 @@ def runTest(self):
255
254
)
256
255
ctnr = self .client .create_container (
257
256
'busybox' , ['true' ],
258
- host_config = create_host_config (log_config = config )
257
+ host_config = self . client . create_host_config (log_config = config )
259
258
)
260
259
self .assertIn ('Id' , ctnr )
261
260
self .tmp_containers .append (ctnr ['Id' ])
@@ -277,7 +276,7 @@ class TestCreateContainerReadOnlyFs(BaseTestCase):
277
276
def runTest (self ):
278
277
ctnr = self .client .create_container (
279
278
'busybox' , ['mkdir' , '/shrine' ],
280
- host_config = create_host_config (
279
+ host_config = self . client . create_host_config (
281
280
read_only = True , network_mode = 'none'
282
281
)
283
282
)
@@ -353,7 +352,7 @@ def runTest(self):
353
352
class TestCreateContainerPrivileged (BaseTestCase ):
354
353
def runTest (self ):
355
354
res = self .client .create_container (
356
- 'busybox' , 'true' , host_config = create_host_config (
355
+ 'busybox' , 'true' , host_config = self . client . create_host_config (
357
356
privileged = True , network_mode = 'none'
358
357
)
359
358
)
@@ -599,7 +598,7 @@ def runTest(self):
599
598
600
599
container = self .client .create_container (
601
600
'busybox' , ['sleep' , '60' ], ports = list (port_bindings .keys ()),
602
- host_config = create_host_config (
601
+ host_config = self . client . create_host_config (
603
602
port_bindings = port_bindings , network_mode = 'bridge'
604
603
)
605
604
)
@@ -727,7 +726,7 @@ def runTest(self):
727
726
)
728
727
res2 = self .client .create_container (
729
728
'busybox' , 'cat' , detach = True , stdin_open = True ,
730
- host_config = create_host_config (
729
+ host_config = self . client . create_host_config (
731
730
volumes_from = vol_names , network_mode = 'none'
732
731
)
733
732
)
@@ -771,7 +770,7 @@ def runTest(self):
771
770
link_env_prefix2 = link_alias2 .upper ()
772
771
773
772
res2 = self .client .create_container (
774
- 'busybox' , 'env' , host_config = create_host_config (
773
+ 'busybox' , 'env' , host_config = self . client . create_host_config (
775
774
links = {link_path1 : link_alias1 , link_path2 : link_alias2 },
776
775
network_mode = 'none'
777
776
)
@@ -793,7 +792,8 @@ def runTest(self):
793
792
class TestRestartingContainer (BaseTestCase ):
794
793
def runTest (self ):
795
794
container = self .client .create_container (
796
- 'busybox' , ['sleep' , '2' ], host_config = create_host_config (
795
+ 'busybox' , ['sleep' , '2' ],
796
+ host_config = self .client .create_host_config (
797
797
restart_policy = {"Name" : "always" , "MaximumRetryCount" : 0 },
798
798
network_mode = 'none'
799
799
)
@@ -923,7 +923,7 @@ def runTest(self):
923
923
class TestCreateContainerWithHostPidMode (BaseTestCase ):
924
924
def runTest (self ):
925
925
ctnr = self .client .create_container (
926
- 'busybox' , 'true' , host_config = create_host_config (
926
+ 'busybox' , 'true' , host_config = self . client . create_host_config (
927
927
pid_mode = 'host' , network_mode = 'none'
928
928
)
929
929
)
@@ -958,7 +958,7 @@ def runTest(self):
958
958
link_alias = 'mylink'
959
959
960
960
container2 = self .client .create_container (
961
- 'busybox' , 'cat' , host_config = create_host_config (
961
+ 'busybox' , 'cat' , host_config = self . client . create_host_config (
962
962
links = {link_path : link_alias }, network_mode = 'none'
963
963
)
964
964
)
0 commit comments