summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2014-12-17 07:35:02 -0500
committerDavanum Srinivas <dims@linux.vnet.ibm.com>2014-12-17 07:35:07 -0500
commit3a51d3fe0b0977c58c0d0d400a64389f1ce33421 (patch)
treea2e5c41d4650000fc486294a583545a62421a179
parent4a7bb9a9b0230ed8c640f6c538df0e00cea80c2d (diff)
downloaddocker-py-3a51d3fe0b0977c58c0d0d400a64389f1ce33421.tar.gz
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.
-rw-r--r--docker/utils/utils.py2
-rw-r--r--tests/test.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py
index 7cd3b1a..1126a10 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 38cbc2f..38678fb 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'}]}