Browse Source

NSX|P: Get LB status carefully

Access status fields carefully in case they do not exist.

Change-Id: I9ce4abfd2ed80457038f72e4963f4f4d9afa61f4
tags/15.1.0
asarfaty 3 months ago
committed by Adit Sarfaty
parent
commit
c689b2f7a1
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      vmware_nsx/services/lbaas/nsx_p/implementation/loadbalancer_mgr.py

+ 6
- 2
vmware_nsx/services/lbaas/nsx_p/implementation/loadbalancer_mgr.py View File

@@ -356,17 +356,21 @@ def status_getter(context, core_plugin):
'operating_status': _nsx_status_to_lb_status(
vs_status['status'])})
for pool_status in result.get('pools', []):
if not pool_status.get('pool_path'):
LOG.warning("pool_path missing from lb status: %s",
lb_status_results)
continue
pool_id = lib_p_utils.path_to_id(pool_status['pool_path'])
pool_statuses.append({
'id': pool_id,
'operating_status': _nsx_status_to_lb_status(
pool_status['status'])})
pool_status.get('status'))})
for member in pool_status.get('members', []):
member_statuses.append({
'pool_id': pool_id,
'member_ip': member.get('ip_address'),
'operating_status': _nsx_status_to_lb_status(
member['status'])})
member.get('status'))})

else:
lb_operating_status = lb_const.OFFLINE


Loading…
Cancel
Save