Comment 3 for bug 1595269

Revision history for this message
KRISHNA MOULI. TANKALA (mouli-tankala) wrote :

By Octavia design unless Load balancer is in ACTIVE state, it is NOT allowing to delete it.

I think, we should be able to DELETE it, if it is in ERROR state too.

octavia/common/constants.py
64
PENDING_UPDATE, DELETED, ERROR)
65
MUTABLE_STATUSES = (ACTIVE,)
66

67
SUPPORTED_AMPHORA_STATUSES = (AMPHORA_ALLOCATED, AMPHORA_BOOTING,

octavia/db/repositories.py

        """Tests and sets a load balancer and provisioning status.

         Puts a lock on the load balancer table to check the status of a
         load balancer. If the status is ACTIVE then the status of the load
         balancer is updated and the method returns True. If the
         status is not ACTIVE, then nothing is done and False is returned.

         :param session: A Sql Alchemy database session.
         :param id: id of Load Balancer
         :param status: Status to set Load Balancer if check passes.
         :returns: bool
         """

  323
lb = session.query(self.model_class).with_for_update().filter_by(
  324
id=id).one()
  325
if lb.provisioning_status not in constants.MUTABLE_STATUSES:
return False
             lb.provisioning_status = status
             session.add(lb)
            return True