Merge "Fix "Set as Active" button's display for replicas"

This commit is contained in:
Zuul 2023-02-18 00:27:30 +00:00 committed by Gerrit Code Review
commit fb9cd73dde
2 changed files with 7 additions and 1 deletions

3
manila_ui/dashboards/project/shares/replicas/tables.py Normal file → Executable file
View File

@ -64,7 +64,8 @@ class SetReplicaAsActive(tables.LinkAction):
policy_rules = (("share_replica", "share_replica:promote"),)
def allowed(self, request, replica=None):
return replica.replica_state == "in_sync"
return (replica.status == "available" and
replica.replica_state == "in_sync")
def get_policy_target(self, request, datum=None):
return {"project_id": getattr(datum, "project_id", None)}

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Visibility of Set as Active button for replicas in transitional states
such as Deleting and Replication Change is now fixed.