Skip to content

Commit

Permalink
fixed limits
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Feb 15, 2024
1 parent 1e17515 commit 05ab8d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,12 @@ def get_or_create_project_security_group(self, project_name, project_id):

def get_limits(self) -> dict[str, str]:
logger.info("Get Limits")
limits = self.openstack_connection.get_compute_limits()
limits.update(self.openstack_connection.get_volume_limits()["absolute"])
# Retrieve compute and volume limits
compute_limits = self.openstack_connection.get_compute_limits()
volume_limits = self.openstack_connection.get_volume_limits()["absolute"]

# Merge compute and volume limits into a single dictionary
limits = {**compute_limits, **volume_limits}
return {
"cores_limit": str(limits["max_total_cores"]),
"vms_limit": str(limits["max_total_instances"]),
Expand Down

0 comments on commit 05ab8d8

Please sign in to comment.