Commit feb01ba9 authored by Daniele Venzano's avatar Daniele Venzano

Fix comma

parent 4db9ca9e
......@@ -153,6 +153,10 @@
},
"minItems": 0,
"uniqueItems": true
},
"network": {
"type": "string",
"minLength": 1
}
},
"additionalProperties": false,
......
......@@ -146,6 +146,11 @@ class Service(BaseRecord):
except KeyError:
self.labels = []
try:
self.network = self.description['network']
except KeyError:
self.network = None
def serialize(self):
"""Generates a dictionary that can be serialized in JSON."""
return {
......
......@@ -78,7 +78,7 @@ class DockerClient:
'memswap_limit': 0,
'name': service_instance.name,
'network_disabled': False,
'network_mode': get_conf().overlay_network_name,
'network_mode': service_instance.network,
'image': service_instance.image_name,
'command': service_instance.command,
'hostname': service_instance.hostname,
......
......@@ -73,3 +73,8 @@ class ServiceInstance:
self.ports = []
for port in service.ports:
self.ports.append(BackendPort(port.internal_number, port.protocol))
if service.network is not None:
self.network = service.network
else:
self.network = get_conf().overlay_network_name
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment