Do not add mode in volume representation if it's not a host binding

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-03-02 15:27:04 -08:00
parent 11329e779b
commit 83728d2bcc
2 changed files with 3 additions and 2 deletions

View File

@ -203,7 +203,8 @@ class VolumeSpec(namedtuple('_VolumeSpec', 'external internal mode')):
def repr(self):
external = self.external + ':' if self.external else ''
return '{ext}{v.internal}:{v.mode}'.format(ext=external, v=self)
mode = ':' + self.mode if self.external else ''
return '{ext}{v.internal}{mode}'.format(mode=mode, ext=external, v=self)
@property
def is_named_volume(self):

2
tests/acceptance/cli_test.py Executable file → Normal file
View File

@ -299,7 +299,7 @@ class CLITestCase(DockerClientTestCase):
},
'volume': {
'image': 'busybox',
'volumes': ['/data:rw'],
'volumes': ['/data'],
'network_mode': 'bridge',
},
'app': {