1
0
mirror of https://github.com/jcwimer/openstack-exporter synced 2026-03-25 01:44:43 +00:00

Close openstack connections to prevent pid growth

This commit is contained in:
2020-12-11 15:11:35 -05:00
parent 211df849c2
commit f34abc1a6d

View File

@@ -95,9 +95,11 @@ if __name__ == '__main__':
instance_deploy.get_metrics(connection, args.flavor, args.image, args.network,args.cloud_name) instance_deploy.get_metrics(connection, args.flavor, args.image, args.network,args.cloud_name)
if args.horizon_url is not None: if args.horizon_url is not None:
horizon.get_metrics(args.horizon_url, args.cloud_name) horizon.get_metrics(args.horizon_url, args.cloud_name)
connection.close()
print("Waiting 30 seconds to gather more metrics.") print("Waiting 30 seconds to gather more metrics.")
time.sleep(30) time.sleep(30)
except Exception: except Exception:
connection.close()
print(traceback.print_exc()) print(traceback.print_exc())
print("Waiting 30 seconds to gather more metrics.") print("Waiting 30 seconds to gather more metrics.")
time.sleep(30) time.sleep(30)