From ac1935b18217407efffd29d5b00c9b6f24321f3e Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 29 Oct 2018 11:20:11 -0500 Subject: [PATCH] Add close method to shutdown threadpool There are contexts where people need to ensure a threadpool shuts down. Add a close method that can be used to ensure releasing of resources. Change-Id: I70d55a203c3104f70e3837db9601a1ebfe6fbd1f --- openstack/connection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openstack/connection.py b/openstack/connection.py index ad094319e..d4968dc0f 100644 --- a/openstack/connection.py +++ b/openstack/connection.py @@ -367,3 +367,7 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta, return self.session.get_token() except keystoneauth1.exceptions.ClientException as e: raise exceptions.raise_from_response(e.response) + + def close(self): + """Release any resources held open.""" + self.task_manager.stop()