mirror of https://github.com/docker/docker-py.git
Update name behaviour to match Docker CLI
Signed-off-by: Stuart Thomson <stuartwthomson@live.co.uk>
This commit is contained in:
parent
290ee89a8c
commit
2bf5d56c73
|
@ -29,7 +29,11 @@ class Container(Model):
|
|||
if self.attrs.get('Name') is not None:
|
||||
return self.attrs['Name'].lstrip('/')
|
||||
if self.attrs.get('Names') is not None:
|
||||
return self.attrs['Names'][0].lstrip('/')
|
||||
stripped_names = [name.lstrip('/') for name in self.attrs['Names']]
|
||||
for name in stripped_names:
|
||||
if '/' not in name:
|
||||
return name
|
||||
return ','.join(stripped_names)
|
||||
|
||||
@property
|
||||
def image(self):
|
||||
|
|
Loading…
Reference in New Issue