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
This commit is contained in:
Monty Taylor 2018-10-29 11:20:11 -05:00
parent a30cc754f2
commit ac1935b182
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 4 additions and 0 deletions

View File

@ -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()