Commit f49a6e1f authored by Łukasz Nowak's avatar Łukasz Nowak

grid: Stabilise service list

In order to minimise eventual changes of supervisord configuration, and so
avoid needless restarts, sort the list of services. They are read from
filesystem, and os.listdir does not guarantee same list on each invocation.
parent 6e80c77d
......@@ -663,10 +663,10 @@ class Partition(object):
self.supervisor_configuration_group = ""
if os.path.exists(self.run_path):
if os.path.isdir(self.run_path):
runner_list = os.listdir(self.run_path)
runner_list = sorted(os.listdir(self.run_path))
if os.path.exists(self.service_path):
if os.path.isdir(self.service_path):
service_list = os.listdir(self.service_path)
service_list = sorted(os.listdir(self.service_path))
if len(runner_list) == 0 and len(service_list) == 0:
self.logger.warning('No runners nor services found for partition %r' %
self.partition_id)
......
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