Comment 2 for bug 2015328

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :


Commenting back here to retain the "low-hanging-fruit" tag on this bug. In the fix, the code must check if the reset_replica_state action is being run against an "active" replica.

In ; we're introducing a "get" operation in the mix, so we'd have the data to verify the existing replica_state; so we'd need to add the following validation:

  if (status_attr == 'replica_state'
          and resource['replica_state'] == constants.REPLICA_STATE_ACTIVE):
     msg = _("Cannot reset replica_state of active replica")
     raise webob.exc.HTTPBadRequest(explanation=msg)