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

Commit

Permalink
updated to list_server
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Nov 25, 2019
1 parent c15f7d7 commit c666862
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,16 @@ def openstack_server_to_thrift_server(self, server):

def get_servers(self):
self.logger.info("Get all servers")
servers = list(self.conn.compute.servers())
servers = self.conn.list_servers()
self.logger.info("Found {} servers".format(len(servers)))
server_list = []
for server in servers:
server_list.append(self.openstack_server_to_thrift_server(server))
try:
thrift_server = self.openstack_server_to_thrift_server(server)
server_list.append(thrift_server)

except Exception as e:
self.logger.exception("Could not transform to thrift_server: {}".format(e))
# self.logger.info(server_list)
return server_list

Expand Down

0 comments on commit c666862

Please sign in to comment.