Add link alias without project name
REDIS_1_PORT_6379_TCP_ADDR instead of FIGTEST_REDIS_1_PORT_6379_TCP_ADDR. Ref #37
This commit is contained in:
parent
1bab14213d
commit
3e7e6e7656
4 changed files with 16 additions and 10 deletions
|
|
@ -50,6 +50,10 @@ class Container(object):
|
|||
def name(self):
|
||||
return self.dictionary['Name'][1:]
|
||||
|
||||
@property
|
||||
def name_without_project(self):
|
||||
return '_'.join(self.dictionary['Name'].split('_')[1:])
|
||||
|
||||
@property
|
||||
def number(self):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -207,10 +207,11 @@ class Service(object):
|
|||
return max(numbers) + 1
|
||||
|
||||
def _get_links(self):
|
||||
links = {}
|
||||
links = []
|
||||
for service in self.links:
|
||||
for container in service.containers():
|
||||
links[container.name] = container.name
|
||||
links.append((container.name, container.name))
|
||||
links.append((container.name, container.name_without_project))
|
||||
return links
|
||||
|
||||
def _get_container_options(self, override_options, one_off=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue