Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #718 from deNBI/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
dweinholz authored May 26, 2021
2 parents 1ddd9a5 + 83b059e commit 8535068
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,18 +1895,28 @@ def add_udp_security_group(self, server_id):
:param server_id: The id of the server
:return:
"""
LOG.info("Setting up security groups for {0}".format(server_id))
LOG.info("Setting up UDP security group for {0}".format(server_id))
server = self.conn.get_server(name_or_id=server_id)
if server is None:
LOG.exception("Instance {0} not found".format(server_id))
raise serverNotFoundException
sec = self.conn.get_security_group(name_or_id=server.name + "_udp")
if sec:
LOG.info(
"Security group with name {} already exists.".format(
"UDP Security group with name {} already exists.".format(
server.name + "_udp"
)
)
server_security_groups = self.conn.list_server_security_groups(server)
for sg in server_security_groups:
if sg["name"] == server.name + "_udp":
LOG.info(
"UDP Security group with name {} already added to server.".format(
server.name + "_udp"
)
)
return True

self.conn.compute.add_security_group_to_server(
server=server_id, security_group=sec
)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python-keystoneclient
openstacksdk ==0.56.0
deprecated == 1.2.12
Click==7.1.2
ansible==3.3.0
ansible==3.4.0
flake8==3.9.2
ruamel.yaml<0.18.0
paramiko==2.7.2
Expand Down

0 comments on commit 8535068

Please sign in to comment.