4
4
5
5
from .. import errors
6
6
from .. import utils
7
- from ..utils .utils import create_networking_config , create_endpoint_config
7
+ from ..types import (
8
+ ContainerConfig , EndpointConfig , HostConfig , NetworkingConfig
9
+ )
8
10
9
11
10
12
class ContainerApiMixin (object ):
@@ -430,16 +432,16 @@ def create_container(self, image, command=None, hostname=None, user=None,
430
432
)
431
433
432
434
config = self .create_container_config (
433
- image , command , hostname , user , detach , stdin_open ,
434
- tty , mem_limit , ports , environment , dns , volumes , volumes_from ,
435
+ image , command , hostname , user , detach , stdin_open , tty , mem_limit ,
436
+ ports , dns , environment , volumes , volumes_from ,
435
437
network_disabled , entrypoint , cpu_shares , working_dir , domainname ,
436
438
memswap_limit , cpuset , host_config , mac_address , labels ,
437
439
volume_driver , stop_signal , networking_config , healthcheck ,
438
440
)
439
441
return self .create_container_from_config (config , name )
440
442
441
443
def create_container_config (self , * args , ** kwargs ):
442
- return utils . create_container_config (self ._version , * args , ** kwargs )
444
+ return ContainerConfig (self ._version , * args , ** kwargs )
443
445
444
446
def create_container_from_config (self , config , name = None ):
445
447
u = self ._url ("/containers/create" )
@@ -582,7 +584,7 @@ def create_host_config(self, *args, **kwargs):
582
584
"keyword argument 'version'"
583
585
)
584
586
kwargs ['version' ] = self ._version
585
- return utils . create_host_config (* args , ** kwargs )
587
+ return HostConfig (* args , ** kwargs )
586
588
587
589
def create_networking_config (self , * args , ** kwargs ):
588
590
"""
@@ -608,7 +610,7 @@ def create_networking_config(self, *args, **kwargs):
608
610
)
609
611
610
612
"""
611
- return create_networking_config (* args , ** kwargs )
613
+ return NetworkingConfig (* args , ** kwargs )
612
614
613
615
def create_endpoint_config (self , * args , ** kwargs ):
614
616
"""
@@ -641,7 +643,7 @@ def create_endpoint_config(self, *args, **kwargs):
641
643
)
642
644
643
645
"""
644
- return create_endpoint_config (self ._version , * args , ** kwargs )
646
+ return EndpointConfig (self ._version , * args , ** kwargs )
645
647
646
648
@utils .check_resource
647
649
def diff (self , container ):
0 commit comments