Skip to content

Commit

Permalink
Add defensive check when fetching KVM machines, fixes issue with non-…
Browse files Browse the repository at this point in the history
…responding hosts
  • Loading branch information
d-mo committed Nov 18, 2022
1 parent d33a946 commit 0729607
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mist/api/clouds/controllers/compute/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4951,9 +4951,13 @@ def _get_host_driver(self, machine):
return driver

def list_machines_single_host(self, host):
driver = self._get_host_driver(host)
return driver.list_nodes(
parse_arp_table=config.LIBVIRT_PARSE_ARP_TABLES)
try:
driver = self._get_host_driver(host)
return driver.list_nodes(
parse_arp_table=config.LIBVIRT_PARSE_ARP_TABLES)
except Exception as e:
log.error('Failed to get machines from host: %s', host)
return []

async def list_machines_all_hosts(self, hosts, loop):
vms = [
Expand Down

0 comments on commit 0729607

Please sign in to comment.