Commit 20a04993 authored by Antoine Catton's avatar Antoine Catton

Fix container start/stop bug

parent 079c8333
...@@ -17,7 +17,7 @@ class SlapContainerError(Exception): ...@@ -17,7 +17,7 @@ class SlapContainerError(Exception):
def main(sr_directory, partition_list, bridge_name): def main(sr_directory, partition_list, bridge_name):
started_containers = set() to_start = set()
for partition_path in partition_list: for partition_path in partition_list:
slapcontainer_filename = os.path.join(partition_path, slapcontainer_filename = os.path.join(partition_path,
'.slapcontainer') '.slapcontainer')
...@@ -38,9 +38,9 @@ def main(sr_directory, partition_list, bridge_name): ...@@ -38,9 +38,9 @@ def main(sr_directory, partition_list, bridge_name):
slapcontainer_conf) == 'stopped': slapcontainer_conf) == 'stopped':
start(sr_directory, partition_path, start(sr_directory, partition_path,
slapcontainer_conf) slapcontainer_conf)
started_containers.add( to_start.add(
slapcontainer_conf.get('requested', 'name') slapcontainer_conf.get('requested', 'name')
) )
else: else:
if status(sr_directory, partition_path, if status(sr_directory, partition_path,
slapcontainer_conf) == 'started': slapcontainer_conf) == 'started':
...@@ -59,7 +59,7 @@ def main(sr_directory, partition_list, bridge_name): ...@@ -59,7 +59,7 @@ def main(sr_directory, partition_list, bridge_name):
except SlapContainerError: except SlapContainerError:
active_containers = set() active_containers = set()
to_stop = active_containers - started_containers to_stop = active_containers - to_start
for container in to_stop: for container in to_stop:
try: try:
......
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