Skip to content
This repository was archived by the owner on Jan 16, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions cassinyspawner/swarmspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def client(self):

placement = List([], config=True,
help=dedent(
"""List of placement constraints into the swarm
""""List of placement constraints into the swarm

"""))

networks = List([], config=True,
Expand Down Expand Up @@ -280,7 +281,7 @@ def start(self):
if hasattr(self, 'container_spec') and self.container_spec is not None:
container_spec = dict(**self.container_spec)
elif user_options == {}:
raise("A container_spec is needed in to create a service")
raise ("A container_spec is needed in to create a service")

container_spec.update(user_options.get('container_spec', {}))

Expand All @@ -295,10 +296,16 @@ def start(self):
username=self.service_owner)

if 'driver_config' in m:
device = m['driver_config']['options']['device'].format(
username=self.service_owner
)
m['driver_config']['options']['device'] = device
driver = m['driver_config']['name']
if driver == 'local-persist':
device = m['driver_config']['options']['mountpoint'].format(
username=self.service_owner)
m['driver_config']['options']['mountpoint'] = device
else:
device = m['driver_config']['options']['device'].format(
username=self.service_owner)
m['driver_config']['options']['device'] = device

m['driver_config'] = docker.types.DriverConfig(
**m['driver_config'])

Expand Down