From 09a9f97407012eaf4dd47b8c6c672f7f477666f7 Mon Sep 17 00:00:00 2001 From: hanwei <499349274@qq.com> Date: Tue, 14 Mar 2017 22:35:53 -0400 Subject: [PATCH] get inappropriate information while failed to create host aggregates while creating a host aggregate named "test" with a host which belongs to another host aggregate. I get error "Unable to create host aggregate 'Create Host Aggregate'." and "Error adding Hosts to the aggregate." The name should be 'test' not 'Create Host Aggregate'. And the result is that aggregate 'test' has been created successfully, so the return information about creating aggregate should be successful. Change-Id: I3acf9c659fc0cf7fbdac75bfa0864d8b92478cd2 Close-Bug: #1672914 --- .../dashboards/admin/aggregates/workflows.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/admin/aggregates/workflows.py b/openstack_dashboard/dashboards/admin/aggregates/workflows.py index 15710a27da..3a15983a2e 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/workflows.py +++ b/openstack_dashboard/dashboards/admin/aggregates/workflows.py @@ -181,6 +181,9 @@ class CreateAggregateWorkflow(workflows.Workflow): success_url = constants.AGGREGATES_INDEX_URL default_steps = (SetAggregateInfoStep, AddHostsToAggregateStep) + def format_status_message(self, message): + return message % self.context['name'] + def handle(self, request, context): try: self.object = \ @@ -199,7 +202,9 @@ class CreateAggregateWorkflow(workflows.Workflow): except Exception: exceptions.handle( request, _('Error adding Hosts to the aggregate.')) - return False + # Host aggregate itself has been created successfully, + # so we return True here + return True return True