Remove unused compare_version

docker.version()['ApiVersion'] in the function
gets error in docker 1.10.6

>>> import docker
>>> docker.version
'1.10.6'
>>>
>>> docker.version()['ApiVersion']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

The patch removes compare_version due to
the two functions are unused.

Change-Id: If867394725eca7ee2dd7ed46c21ba4468d756f4a
This commit is contained in:
Feng Shengqin 2017-04-08 14:07:23 +08:00
parent 93c9b81566
commit 87675787f5

View File

@ -12,11 +12,9 @@
import contextlib import contextlib
import six import six
import docker
from docker import client from docker import client
from docker import errors from docker import errors
from docker import tls from docker import tls
from docker.utils import utils
from zun.common import exception from zun.common import exception
import zun.conf import zun.conf
@ -25,18 +23,6 @@ from zun import objects
CONF = zun.conf.CONF CONF = zun.conf.CONF
def is_docker_library_version_atleast(version):
if utils.compare_version(docker.version, version) <= 0:
return True
return False
def is_docker_api_version_atleast(docker, version):
if utils.compare_version(docker.version()['ApiVersion'], version) <= 0:
return True
return False
@contextlib.contextmanager @contextlib.contextmanager
def docker_client(): def docker_client():
client_kwargs = dict() client_kwargs = dict()