Merge "Hide the Button of delete aggregate if a host in the aggregate"

This commit is contained in:
Zuul 2019-05-22 03:33:51 +00:00 committed by Gerrit Code Review
commit 3f71f171e0
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ class DeleteAggregateAction(tables.DeleteAction):
count
)
def allowed(self, request, aggregate):
if aggregate and aggregate.hosts:
return False
return True
def delete(self, request, obj_id):
api.nova.aggregate_delete(request, obj_id)