Skip to content

Commit 30a6be0

Browse files
committed
Merge pull request #738 from bboreham/fix-deprecated-call
Call Client.create_host_config because the old call is deprecated
2 parents d9a149f + 4e4c342 commit 30a6be0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/integration_test.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
NOT_ON_HOST = os.environ.get('NOT_ON_HOST', False)
4343

4444
warnings.simplefilter('error')
45-
create_host_config = docker.utils.create_host_config
4645
compare_version = docker.utils.compare_version
4746

4847

@@ -181,7 +180,7 @@ def runTest(self):
181180
container = self.client.create_container(
182181
'busybox',
183182
['ls', mount_dest], volumes={mount_dest: {}},
184-
host_config=create_host_config(
183+
host_config=self.client.create_host_config(
185184
binds=binds, network_mode='none'
186185
)
187186
)
@@ -223,7 +222,7 @@ def runTest(self):
223222
container = self.client.create_container(
224223
'busybox',
225224
['ls', mount_dest], volumes={mount_dest: {}},
226-
host_config=create_host_config(
225+
host_config=self.client.create_host_config(
227226
binds=binds, network_mode='none'
228227
)
229228
)
@@ -255,7 +254,7 @@ def runTest(self):
255254
)
256255
ctnr = self.client.create_container(
257256
'busybox', ['true'],
258-
host_config=create_host_config(log_config=config)
257+
host_config=self.client.create_host_config(log_config=config)
259258
)
260259
self.assertIn('Id', ctnr)
261260
self.tmp_containers.append(ctnr['Id'])
@@ -277,7 +276,7 @@ class TestCreateContainerReadOnlyFs(BaseTestCase):
277276
def runTest(self):
278277
ctnr = self.client.create_container(
279278
'busybox', ['mkdir', '/shrine'],
280-
host_config=create_host_config(
279+
host_config=self.client.create_host_config(
281280
read_only=True, network_mode='none'
282281
)
283282
)
@@ -353,7 +352,7 @@ def runTest(self):
353352
class TestCreateContainerPrivileged(BaseTestCase):
354353
def runTest(self):
355354
res = self.client.create_container(
356-
'busybox', 'true', host_config=create_host_config(
355+
'busybox', 'true', host_config=self.client.create_host_config(
357356
privileged=True, network_mode='none'
358357
)
359358
)
@@ -599,7 +598,7 @@ def runTest(self):
599598

600599
container = self.client.create_container(
601600
'busybox', ['sleep', '60'], ports=list(port_bindings.keys()),
602-
host_config=create_host_config(
601+
host_config=self.client.create_host_config(
603602
port_bindings=port_bindings, network_mode='bridge'
604603
)
605604
)
@@ -727,7 +726,7 @@ def runTest(self):
727726
)
728727
res2 = self.client.create_container(
729728
'busybox', 'cat', detach=True, stdin_open=True,
730-
host_config=create_host_config(
729+
host_config=self.client.create_host_config(
731730
volumes_from=vol_names, network_mode='none'
732731
)
733732
)
@@ -771,7 +770,7 @@ def runTest(self):
771770
link_env_prefix2 = link_alias2.upper()
772771

773772
res2 = self.client.create_container(
774-
'busybox', 'env', host_config=create_host_config(
773+
'busybox', 'env', host_config=self.client.create_host_config(
775774
links={link_path1: link_alias1, link_path2: link_alias2},
776775
network_mode='none'
777776
)
@@ -793,7 +792,8 @@ def runTest(self):
793792
class TestRestartingContainer(BaseTestCase):
794793
def runTest(self):
795794
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(
797797
restart_policy={"Name": "always", "MaximumRetryCount": 0},
798798
network_mode='none'
799799
)
@@ -923,7 +923,7 @@ def runTest(self):
923923
class TestCreateContainerWithHostPidMode(BaseTestCase):
924924
def runTest(self):
925925
ctnr = self.client.create_container(
926-
'busybox', 'true', host_config=create_host_config(
926+
'busybox', 'true', host_config=self.client.create_host_config(
927927
pid_mode='host', network_mode='none'
928928
)
929929
)
@@ -958,7 +958,7 @@ def runTest(self):
958958
link_alias = 'mylink'
959959

960960
container2 = self.client.create_container(
961-
'busybox', 'cat', host_config=create_host_config(
961+
'busybox', 'cat', host_config=self.client.create_host_config(
962962
links={link_path: link_alias}, network_mode='none'
963963
)
964964
)

0 commit comments

Comments
 (0)