Fix "Set as Active" button's display for replicas
Previously "Set as Active" button was displayed during replicas in transitional states such as deleting or replication change which is fixed with this patch. Closes-Bug: #1624425 Change-Id: I32ecf22ce1df0a752d0e66f989ad15fd776e4175
This commit is contained in:
3
manila_ui/dashboards/project/shares/replicas/tables.py
Normal file → Executable file
3
manila_ui/dashboards/project/shares/replicas/tables.py
Normal file → Executable 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)}
|
||||
|
@@ -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.
|
Reference in New Issue
Block a user