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

Commit

Permalink
fix(Flavor):fixed difference flavor answer
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Nov 18, 2019
1 parent 505af56 commit dc28fa7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,12 @@ def openstack_server_to_thrift_server(self, server):
flav = self.conn.compute.get_flavor(serv["flavor"]["id"]).to_dict()
except Exception as e:
self.logger.exception(e)
flav = None

try:
flav = serv['flavor']
except Exception as e:
self.logger.exception(e)
flav = None
try:
img = self.get_Image_with_Tag(serv["image"]["id"])
except Exception as e:
Expand All @@ -882,10 +887,10 @@ def openstack_server_to_thrift_server(self, server):
server = VM(
flav=Flavor(
vcpus=flav["vcpus"] if flav else None,
ram=flav["ram"],
disk=flav["disk"],
name=flav["name"],
openstack_id=flav["id"],
ram=flav["ram"] if flav else None,
disk=flav["disk"] if flav else None,
name=flav["name"] if flav else None,
openstack_id=flav["id"] if flav else None,
),
img=img,
status=serv["status"],
Expand Down Expand Up @@ -922,7 +927,9 @@ def add_security_group_to_server(self, http, https, udp, server_id):
"""
self.logger.info("Setting up security groups for {0}".format(server_id))
if self.conn.network.find_security_group(server_id) is not None:
self.logger.info("Security group with name {0} already exists. Returning from function.".format(server_id))
self.logger.info(
"Security group with name {0} already exists. Returning from function.".format(
server_id))
return True

ip_base = \
Expand Down

0 comments on commit dc28fa7

Please sign in to comment.