Merge pull request #1862 from mrfuxi/costom-container-name-in-logs

Use custom container name in logs
This commit is contained in:
Aanand Prasad 2015-09-08 14:36:28 -07:00
commit 85709d85d2
2 changed files with 13 additions and 1 deletions

View file

@ -6,6 +6,7 @@ from functools import reduce
import six
from .const import LABEL_CONTAINER_NUMBER
from .const import LABEL_PROJECT
from .const import LABEL_SERVICE
@ -70,7 +71,12 @@ class Container(object):
@property
def name_without_project(self):
return '{0}_{1}'.format(self.service, self.number)
project = self.labels.get(LABEL_PROJECT)
if self.name.startswith('{0}_{1}'.format(project, self.service)):
return '{0}_{1}'.format(self.service, self.number)
else:
return self.name
@property
def number(self):