From f34abc1a6d057c1c6052088d18c2e512d694358f Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 11 Dec 2020 15:11:35 -0500 Subject: [PATCH] Close openstack connections to prevent pid growth --- openstack_exporter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openstack_exporter.py b/openstack_exporter.py index ceb492c..3af58f4 100644 --- a/openstack_exporter.py +++ b/openstack_exporter.py @@ -95,9 +95,11 @@ if __name__ == '__main__': instance_deploy.get_metrics(connection, args.flavor, args.image, args.network,args.cloud_name) if args.horizon_url is not None: horizon.get_metrics(args.horizon_url, args.cloud_name) + connection.close() print("Waiting 30 seconds to gather more metrics.") time.sleep(30) except Exception: + connection.close() print(traceback.print_exc()) print("Waiting 30 seconds to gather more metrics.") time.sleep(30)