Skip to content

Commit 0379bdd

Browse files
committed
added version compliable check
1 parent bbc2121 commit 0379bdd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docker/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,10 @@ def start(self, container, binds=None, port_bindings=None, lxc_conf=None,
967967
self._raise_for_status(res)
968968

969969
def stats(self, container):
970+
if utils.compare_version('1.17', self._version) < 0:
971+
raise errors.InvalidVersion(
972+
'Stats retrieval is not supported in API < 1.17!')
973+
970974
if isinstance(container, dict):
971975
container = container.get('Id')
972976
url = self._url("/containers/{0}/stats".format(container))

0 commit comments

Comments
 (0)