Skip to content

Commit

Permalink
wrong indent
Browse files Browse the repository at this point in the history
  • Loading branch information
vktrrdk committed Aug 15, 2024
1 parent 6edcb30 commit eeff645
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,32 +1046,32 @@ def get_or_create_project_security_group(self, project_name, project_id):

with lock:
logger.info(
f"Check if Security Group for project - [{project_name}-{project_id}] exists... "
)
sec = self.openstack_connection.get_security_group(
name_or_id=security_group_name
)
if sec:
logger.info(
f"Security group [{project_name}-{project_id}] already exists."
f"Check if Security Group for project - [{project_name}-{project_id}] exists... "
)
return sec["id"]
sec = self.openstack_connection.get_security_group(
name_or_id=security_group_name
)
if sec:
logger.info(
f"Security group [{project_name}-{project_id}] already exists."
)
return sec["id"]

logger.info(
f"No security Group for [{project_name}-{project_id}] exists. Creating.. "
)
new_security_group = self.openstack_connection.create_security_group(
name=security_group_name, description=f"{project_name} Security Group"
)
self.openstack_connection.network.create_security_group_rule(
direction="ingress",
protocol="tcp",
port_range_max=22,
port_range_min=22,
security_group_id=new_security_group["id"],
remote_group_id=new_security_group["id"],
)
return new_security_group["id"]
logger.info(
f"No security Group for [{project_name}-{project_id}] exists. Creating.. "
)
new_security_group = self.openstack_connection.create_security_group(
name=security_group_name, description=f"{project_name} Security Group"
)
self.openstack_connection.network.create_security_group_rule(
direction="ingress",
protocol="tcp",
port_range_max=22,
port_range_min=22,
security_group_id=new_security_group["id"],
remote_group_id=new_security_group["id"],
)
return new_security_group["id"]


def get_limits(self) -> dict[str, str]:
Expand Down

0 comments on commit eeff645

Please sign in to comment.