@@ -533,7 +533,9 @@ def create_container(self, image, command=None, hostname=None, user=None,
533
533
volumes = [volumes , ]
534
534
535
535
if host_config and utils .compare_version ('1.15' , self ._version ) < 0 :
536
- raise errors .APIError ('host_config is not supported in API < 1.15' )
536
+ raise errors .InvalidVersion (
537
+ 'host_config is not supported in API < 1.15'
538
+ )
537
539
538
540
config = self ._container_config (
539
541
image , command , hostname , user , detach , stdin_open , tty , mem_limit ,
@@ -563,7 +565,7 @@ def events(self):
563
565
def execute (self , container , cmd , detach = False , stdout = True , stderr = True ,
564
566
stream = False , tty = False ):
565
567
if utils .compare_version ('1.15' , self ._version ) < 0 :
566
- raise errors .APIError ('Exec is not supported in API < 1.15' )
568
+ raise errors .InvalidVersion ('Exec is not supported in API < 1.15' )
567
569
if isinstance (container , dict ):
568
570
container = container .get ('Id' )
569
571
if isinstance (cmd , six .string_types ):
@@ -911,11 +913,11 @@ def start(self, container, binds=None, port_bindings=None, lxc_conf=None,
911
913
912
914
if utils .compare_version ('1.10' , self ._version ) < 0 :
913
915
if dns is not None :
914
- raise errors .APIError (
916
+ raise errors .InvalidVersion (
915
917
'dns is only supported for API version >= 1.10'
916
918
)
917
919
if volumes_from is not None :
918
- raise errors .APIError (
920
+ raise errors .InvalidVersion (
919
921
'volumes_from is only supported for API version >= 1.10'
920
922
)
921
923
0 commit comments