Permalink
Browse files

Fix replicated processes not shutting down properly

  • Loading branch information...
1 parent 3bd81b3 commit a2286649b7b56c1604aebfe63df6229194aa5f29 @oldpatricka oldpatricka committed Aug 3, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 epuharness/harness.py
View
@@ -94,16 +94,18 @@ def stop(self, services=None, force=False):
log.info("Stopping %s" % ", ".join(services))
for service in services:
- instance = instances[service]
- try:
- # Clean up config files
- command = instance._program_object.command
- command = command.split()
- [os.remove(config) for config in command if config.endswith('.yml')]
- except Exception, e:
- # Perhaps instance internals have changed
- log.warning("Couldn't delete temporary config files: %s" % e)
- instance.cleanup()
+ instances_to_kill = filter(lambda x: x.startswith(service), instances.keys())
+ for instance_name in instances_to_kill:
+ instance = instances[instance_name]
+ try:
+ # Clean up config files
+ command = instance._program_object.command
+ command = command.split()
+ [os.remove(config) for config in command if config.endswith('.yml')]
+ except Exception, e:
+ # Perhaps instance internals have changed
+ log.warning("Couldn't delete temporary config files: %s" % e)
+ instance.cleanup()
if cleanup:
self.factory.terminate()

0 comments on commit a228664

Please sign in to comment.