Don't support tmpfs in API version < 1.22

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-03-16 17:35:08 +00:00
parent 4ffa1be825
commit 7417bc2cce
2 changed files with 4 additions and 0 deletions

View File

@ -781,6 +781,8 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
host_config['CpuPeriod'] = cpu_period
if tmpfs:
if version_lt(version, '1.22'):
raise host_config_version_error('tmpfs', '1.22')
host_config["Tmpfs"] = convert_tmpfs_mounts(tmpfs)
return host_config

View File

@ -1016,6 +1016,7 @@ class CreateContainerTest(DockerClientTest):
}
}}'''))
@requires_api_version('1.22')
def test_create_container_with_tmpfs_list(self):
self.client.create_container(
@ -1044,6 +1045,7 @@ class CreateContainerTest(DockerClientTest):
DEFAULT_TIMEOUT_SECONDS
)
@requires_api_version('1.22')
def test_create_container_with_tmpfs_dict(self):
self.client.create_container(