@@ -35,18 +35,19 @@ def exec_create(self, container, cmd, stdout=True, stderr=True,
35
35
If the server returns an error.
36
36
"""
37
37
38
- if privileged and utils .compare_version ( '1.19' , self . _version ) < 0 :
38
+ if privileged and utils .version_lt ( self . _version , '1.19' ) :
39
39
raise errors .InvalidVersion (
40
40
'Privileged exec is not supported in API < 1.19'
41
41
)
42
- if user and utils .compare_version ( '1.19' , self . _version ) < 0 :
42
+ if user and utils .version_lt ( self . _version , '1.19' ) :
43
43
raise errors .InvalidVersion (
44
44
'User-specific exec is not supported in API < 1.19'
45
45
)
46
- if environment and utils .compare_version ( '1.25' , self . _version ) < 0 :
46
+ if environment is not None and utils .version_lt ( self . _version , '1.25' ) :
47
47
raise errors .InvalidVersion (
48
48
'Setting environment for exec is not supported in API < 1.25'
49
49
)
50
+
50
51
if isinstance (cmd , six .string_types ):
51
52
cmd = utils .split_command (cmd )
52
53
@@ -109,6 +110,7 @@ def exec_resize(self, exec_id, height=None, width=None):
109
110
self ._raise_for_status (res )
110
111
111
112
@utils .minimum_version ('1.15' )
113
+ @utils .check_resource
112
114
def exec_start (self , exec_id , detach = False , tty = False , stream = False ,
113
115
socket = False ):
114
116
"""
@@ -130,8 +132,6 @@ def exec_start(self, exec_id, detach=False, tty=False, stream=False,
130
132
If the server returns an error.
131
133
"""
132
134
# we want opened socket if socket == True
133
- if isinstance (exec_id , dict ):
134
- exec_id = exec_id .get ('Id' )
135
135
136
136
data = {
137
137
'Tty' : tty ,
0 commit comments