Skip to content

Commit

Permalink
Merge "svc_monitor unable to handle empty az list from nova" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 22, 2016
2 parents e111711 + 8cee707 commit 7190d2d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/config/svc-monitor/svc_monitor/scheduler/vrouter_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,21 @@ def _get_az_vrouter_list(self):
az_list = self._nc.oper('availability_zones', 'list',
self._args.admin_tenant_name,
detailed=True)
if not az_list:
self._logger.error("Failed fetching azs from nova")
return None

az_vr_list = []
for az in az_list:
if self._args.netns_availability_zone not in str(az):
continue
try:
# check if the az is available
if not az.zoneState['available']:
continue
# check if there are any hosts
if not az.hosts:
# check:
# 1. If az is mentioned in config
# 2. If the az is enabled & active
# 3. If it has any hosts
if az.zoneName not in self._args.netns_availability_zone or \
not az.zoneState['available'] or not az.hosts:
continue

# check if hosts are active & enabled
for host,host_status in az.hosts.iteritems():
if (('nova-compute' in host_status) and \
Expand Down

0 comments on commit 7190d2d

Please sign in to comment.