Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix replicated processes not shutting down properly

  • Loading branch information...
commit a2286649b7b56c1604aebfe63df6229194aa5f29 1 parent 3bd81b3
@oldpatricka oldpatricka authored
Showing with 12 additions and 10 deletions.
  1. +12 −10 epuharness/harness.py
View
22 epuharness/harness.py
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.