diff --git a/openstack_dashboard/dashboards/admin/aggregates/tests.py b/openstack_dashboard/dashboards/admin/aggregates/tests.py index 31a929925b..61cb3b952b 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/tests.py +++ b/openstack_dashboard/dashboards/admin/aggregates/tests.py @@ -117,6 +117,17 @@ class CreateAggregateWorkflowTests(BaseAggregateWorkflowTests): self._test_generic_create_aggregate(workflow_data, aggregate, (), 1, u'This field is required') + def test_create_aggregate_fails_missing_fields_existing_aggregates(self): + aggregate = self.aggregates.first() + existing_aggregates = self.aggregates.list() + workflow_data = self._get_create_workflow_data(aggregate) + workflow_data['name'] = '' + workflow_data['availability_zone'] = '' + + self._test_generic_create_aggregate(workflow_data, aggregate, + existing_aggregates, 1, + u'This field is required') + def test_create_aggregate_fails_duplicated_name(self): aggregate = self.aggregates.first() existing_aggregates = self.aggregates.list() diff --git a/openstack_dashboard/dashboards/admin/aggregates/workflows.py b/openstack_dashboard/dashboards/admin/aggregates/workflows.py index b9fe82962d..15710a27da 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/workflows.py +++ b/openstack_dashboard/dashboards/admin/aggregates/workflows.py @@ -37,7 +37,7 @@ class SetAggregateInfoAction(workflows.Action): def clean(self): cleaned_data = super(SetAggregateInfoAction, self).clean() - name = cleaned_data.get('name') + name = cleaned_data.get('name', '') try: aggregates = api.nova.aggregate_details_list(self.request)