From 3a51d3fe0b0977c58c0d0d400a64389f1ce33421 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 17 Dec 2014 07:35:02 -0500 Subject: [PATCH] Devices should be separated by colon separated string Totally bad test :( (written by me). The documentation and code should match now. Many thanks to pranavs18 for spotting the error and proposing the fix. --- docker/utils/utils.py | 2 +- tests/test.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/utils/utils.py b/docker/utils/utils.py index 7cd3b1a4..1126a102 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -246,7 +246,7 @@ def parse_host(addr): def parse_devices(devices): device_list = [] for device in devices: - device_mapping = device.split(",") + device_mapping = device.split(":") if device_mapping: path_on_host = device_mapping[0] if len(device_mapping) > 1: diff --git a/tests/test.py b/tests/test.py index 38cbc2f3..38678fb6 100644 --- a/tests/test.py +++ b/tests/test.py @@ -959,11 +959,11 @@ class DockerClientTest(Cleanup, unittest.TestCase): json.loads(args[1]['data']), {"PublishAllPorts": False, "Privileged": False, "Devices": [{'CgroupPermissions': 'rwm', - 'PathInContainer': '/dev/sda:/dev/xvda:rwm', - 'PathOnHost': '/dev/sda:/dev/xvda:rwm'}, + 'PathInContainer': '/dev/xvda', + 'PathOnHost': '/dev/sda'}, {'CgroupPermissions': 'rwm', - 'PathInContainer': '/dev/sdb:/dev/xvdb', - 'PathOnHost': '/dev/sdb:/dev/xvdb'}, + 'PathInContainer': '/dev/xvdb', + 'PathOnHost': '/dev/sdb'}, {'CgroupPermissions': 'rwm', 'PathInContainer': '/dev/sdc', 'PathOnHost': '/dev/sdc'}]}