summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/heat_utils.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-03-09 14:42:34 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-03-12 08:28:45 -0600
commit9e9e09590cce321f55996c1a31370ffdf28251b0 (patch)
treea0e031d0365604f4a299ad8f748fe10d09a75a8a /snaps/openstack/utils/heat_utils.py
parentfb0ab37c323717ca10ac3f3bda24ae390635495e (diff)
Closing keystone sessions after done with them.
By not closing all of the keystone sessions being created when running all of the tests, this may be the root cause to the IOError occasionally being observed: IOError: [Errno 24] Too many open files JIRA: SNAPS-285 Change-Id: I7fc7ab0c6cdd02f1ae32bb3ae4f121cb465d5693 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/heat_utils.py')
-rw-r--r--snaps/openstack/utils/heat_utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/snaps/openstack/utils/heat_utils.py b/snaps/openstack/utils/heat_utils.py
index d42eefa..3d62fdf 100644
--- a/snaps/openstack/utils/heat_utils.py
+++ b/snaps/openstack/utils/heat_utils.py
@@ -32,15 +32,17 @@ __author__ = 'spisarski'
logger = logging.getLogger('heat_utils')
-def heat_client(os_creds):
+def heat_client(os_creds, session=None):
"""
Retrieves the Heat client
:param os_creds: the OpenStack credentials
:return: the client
"""
logger.debug('Retrieving Heat Client')
+ if not session:
+ session = keystone_utils.keystone_session(os_creds)
return Client(os_creds.heat_api_version,
- session=keystone_utils.keystone_session(os_creds),
+ session=session,
region_name=os_creds.region_name)