Merge "Also remove amphora_health entry during house_keeping amps"

This commit is contained in:
Jenkins 2017-06-16 00:50:58 +00:00 committed by Gerrit Code Review
commit 4b101f7901
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import datetime
from concurrent import futures
from oslo_config import cfg
from oslo_log import log as logging
from sqlalchemy.orm import exc as sqlalchemy_exceptions
from octavia.common import constants
from octavia.controller.worker import controller_worker as cw
@ -76,6 +77,10 @@ class DatabaseCleanup(object):
exp_age):
LOG.info('Attempting to delete Amphora id : %s', amp.id)
self.amp_repo.delete(session, id=amp.id)
try:
self.amp_health_repo.delete(session, amphora_id=amp.id)
except sqlalchemy_exceptions.NoResultFound:
pass # Best effort delete, this record might not exist
LOG.info('Deleted Amphora id : %s' % amp.id)
def cleanup_load_balancers(self):