-
Notifications
You must be signed in to change notification settings - Fork 38
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
9.10 fix delete #2058
base: 9.10-stable
Are you sure you want to change the base?
9.10 fix delete #2058
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1612,6 +1612,13 @@ def _delete(self, bigip, payload, pool, service): | |
service['listener'] = listener | ||
""" Unmap listener and pool""" | ||
vs = self.driver.service_adapter.get_virtual_name(service) | ||
vs_exist = mgr.resource_helper.exists( | ||
bigip, name=vs['name'], | ||
partition=vs['partition'] | ||
) | ||
if not vs_exist: | ||
continue | ||
|
||
vs['pool'] = "" | ||
# Need to remove persist profile from virtual server, | ||
# if its persist profile is configured by its default pool. | ||
|
@@ -1641,7 +1648,13 @@ def update(self, old_pool, pool, service, **kwargs): | |
@serialized('PoolManager.delete') | ||
@log_helpers.log_method_call | ||
def delete(self, pool, service, **kwargs): | ||
self.driver.annotate_service_members(service) | ||
try: | ||
self.driver.annotate_service_members(service) | ||
except HTTPError as err: | ||
if err.response.status_code == 400: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to ignore it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Olvan delete the whole partition, and nothing is left. When you try to annotate the route domain for members, the partition is disappeared, and the method returns 400 HTTPError. It will break the pool deleting process, it cause the pool cannot be deleted in the Neutron DB at last. |
||
LOG.debug(err) | ||
else: | ||
raise err | ||
super(PoolManager, self).delete(pool, service) | ||
|
||
|
||
|
@@ -1730,8 +1743,16 @@ def _delete(self, bigip, payload, healthmonitor, service): | |
) | ||
pool_payload['monitor'] = '' | ||
try: | ||
# update the pool | ||
mgr._update(bigip, pool_payload, None, None, service) | ||
# check if pool exist, if not exist, | ||
# we delete healthmonitor directly | ||
exist = mgr.resource_helper.exists( | ||
bigip, | ||
name=pool_payload['name'], | ||
partition=pool_payload['partition'] | ||
) | ||
if exist: | ||
# update the pool | ||
mgr._update(bigip, pool_payload, None, None, service) | ||
|
||
super(MonitorManager, self)._delete( | ||
bigip, payload, healthmonitor, service | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change improve anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will throw the original HTTPError, rather cover up by f5ex.RouteDomainCreationException.
The caller will not tell what Exception happens exactly.