Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unknown state set in error #937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions f5lbaasdriver/v2/bigip/plugin_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

from neutron_lib.api.definitions import portbindings
from neutron_lib import constants as neutron_const
from neutron_lib import exceptions as q_exc

from oslo_log import helpers as log_helpers
from oslo_log import log as logging
Expand Down Expand Up @@ -758,10 +759,17 @@ def validate_loadbalancers_state(self, context, loadbalancers, host=None):
lbid)
lb_status[lbid] = lb_db.provisioning_status

except q_exc.NotFound:
lb_status[lbid] = 'Unknown'

except Exception as e:
LOG.error('Exception: get_loadbalancer: %s',
e.message)
lb_status[lbid] = 'Unknown'
if 'could not be found' in e.message:
lb_status[lbid] = 'Unknown'
else:
lb_status[lbid] = ''

return lb_status

# validate a list of pools id - assure they are not deleted
Expand All @@ -773,10 +781,17 @@ def validate_pools_state(self, context, pools, host=None):
try:
pool_db = self.driver.plugin.db.get_pool(context, poolid)
pool_status[poolid] = pool_db.provisioning_status

except q_exc.NotFound:
pool_status[poolid] = 'Unknown'

except Exception as e:
LOG.error('Exception: get_pool: %s',
e.message)
pool_status[poolid] = 'Unknown'
if 'could not be found' in e.message:
pool_status[poolid] = 'Unknown'
else:
pool_status[poolid] = ''
return pool_status

@log_helpers.log_method_call
Expand All @@ -803,10 +818,17 @@ def validate_listeners_state(self, context, listeners, host=None):
listener_id)
listener_status[listener_id] = \
listener_db.provisioning_status

except q_exc.NotFound:
listener_status[listener_id] = 'Unknown'

except Exception as e:
LOG.error('Exception: get_listener: %s',
e.message)
listener_status[listener_id] = 'Unknown'
if 'could not be found' in e.message:
listener_status[listener_id] = 'Unknown'
else:
listener_status[listener_id] = ''
return listener_status

# validate a list of l7policys id - assure they are not deleted
Expand Down