Merge pull request #4562 from shin-/lindt-bugfix/unnamed_volumes_do_not_support_mode_suffix

Do not add mode to anonymous volumes in config output
This commit is contained in:
Joffrey F 2017-03-06 18:21:36 -08:00 committed by GitHub
commit 4dca6adeb1
2 changed files with 4 additions and 3 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):

View File

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