diff --git a/neutron/templates/bin/_health-probe.py.tpl b/neutron/templates/bin/_health-probe.py.tpl index b5e170bcfd..d910045616 100644 --- a/neutron/templates/bin/_health-probe.py.tpl +++ b/neutron/templates/bin/_health-probe.py.tpl @@ -104,6 +104,10 @@ def check_agent_status(transport): " agent") sys.exit(0) + finally: + if transport: + transport.cleanup() + def sriov_readiness_check(): """Checks the sriov configuration on the sriov nic's""" diff --git a/nova/templates/bin/_health-probe.py.tpl b/nova/templates/bin/_health-probe.py.tpl index 6450301ae3..04e95d01a5 100644 --- a/nova/templates/bin/_health-probe.py.tpl +++ b/nova/templates/bin/_health-probe.py.tpl @@ -103,6 +103,10 @@ def check_service_status(transport): " service") sys.exit(0) + finally: + if transport: + transport.cleanup() + def tcp_socket_status(process, ports): """Check the tcp socket status on a process"""