1
0
mirror of https://github.com/jcwimer/openstack-exporter synced 2026-03-24 17:44:42 +00:00

Move connection quit to finally block

This commit is contained in:
2020-12-01 07:56:45 -05:00
parent 410b9c6447
commit dc659f80d3

View File

@@ -91,10 +91,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:
print(traceback.print_exc())
print("Waiting 30 seconds to gather more metrics.")
time.sleep(30)
time.sleep(30)
finally:
connection.close()