Skip to content

Commit dd68867

Browse files
committed
Close open https connections
1 parent cbecca8 commit dd68867

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cpapi/mgmt_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ def api_call(self, command, payload=None, sid=None, wait_for_task=True):
300300
res = APIResponse("", False, err_message=err)
301301
except Exception as err:
302302
res = APIResponse("", False, err_message=err)
303+
finally:
304+
conn.close()
303305

304306
if response:
305307
res.status_code = response.status
@@ -446,7 +448,9 @@ def get_server_fingerprint(self):
446448
else:
447449
conn = HTTPSConnection(self.server, self.get_port(), context=context)
448450

449-
return conn.get_fingerprint_hash()
451+
fingerprint_hash = conn.get_fingerprint_hash()
452+
conn.close()
453+
return fingerprint_hash
450454

451455
def __wait_for_task(self, task_id):
452456
"""

0 commit comments

Comments
 (0)