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.
This commit is contained in:
Davanum Srinivas 2014-12-17 07:35:02 -05:00
parent 4a7bb9a9b0
commit 3a51d3fe0b
2 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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'}]}