summaryrefslogtreecommitdiff
path: root/compose/network.py
diff options
context:
space:
mode:
authorMatt Daue <mattdaue@gmail.com>2016-02-23 21:19:11 -0500
committerMatt Daue <mattdaue@gmail.com>2016-03-09 18:37:52 -0500
commitee136446a2e5d1a2b108f586e872f40d801485d6 (patch)
tree30c50b366bb1ef5b78ae72cb721009562b7cd116 /compose/network.py
parent8a86e204a0908458273584e4fe5f5b952af713ce (diff)
Fix #2804: Add ipv4 and ipv6 static addressing
- Added ipv4_network and ipv6_network to the networks section in the service section for each configured network - Added feature documentation - Added unit tests Signed-off-by: Matt Daue <mattdaue@gmail.com>
Diffstat (limited to 'compose/network.py')
-rw-r--r--compose/network.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/compose/network.py b/compose/network.py
index 135502cc..81e3b5bf 100644
--- a/compose/network.py
+++ b/compose/network.py
@@ -159,26 +159,26 @@ class ProjectNetworks(object):
network.ensure()
-def get_network_aliases_for_service(service_dict):
+def get_network_defs_for_service(service_dict):
if 'network_mode' in service_dict:
return {}
networks = service_dict.get('networks', {'default': None})
return dict(
- (net, (config or {}).get('aliases', []))
+ (net, (config or {}))
for net, config in networks.items()
)
def get_network_names_for_service(service_dict):
- return get_network_aliases_for_service(service_dict).keys()
+ return get_network_defs_for_service(service_dict).keys()
def get_networks(service_dict, network_definitions):
networks = {}
- for name, aliases in get_network_aliases_for_service(service_dict).items():
+ for name, netdef in get_network_defs_for_service(service_dict).items():
network = network_definitions.get(name)
if network:
- networks[network.full_name] = aliases
+ networks[network.full_name] = netdef
else:
raise ConfigurationError(
'Service "{}" uses an undefined network "{}"'