diff --git a/openstack_dashboard/dashboards/admin/aggregates/forms.py b/openstack_dashboard/dashboards/admin/aggregates/forms.py index 1c762e223c..8856b3103a 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/forms.py +++ b/openstack_dashboard/dashboards/admin/aggregates/forms.py @@ -26,6 +26,7 @@ class UpdateAggregateForm(forms.SelfHandlingForm): name = forms.CharField(label=_("Name"), max_length=255) availability_zone = forms.CharField(label=_("Availability Zone"), + required=False, max_length=255) def handle(self, request, data): diff --git a/openstack_dashboard/dashboards/admin/aggregates/tests.py b/openstack_dashboard/dashboards/admin/aggregates/tests.py index e95b1b17e1..84718c1dac 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/tests.py +++ b/openstack_dashboard/dashboards/admin/aggregates/tests.py @@ -111,7 +111,7 @@ class CreateAggregateWorkflowTests(BaseAggregateWorkflowTests): workflow_data = self._get_create_workflow_data(aggregate) workflow_data['name'] = '' workflow_data['availability_zone'] = '' - self._test_generic_create_aggregate(workflow_data, aggregate, 2, + self._test_generic_create_aggregate(workflow_data, aggregate, 1, u'This field is required') @test.create_stubs({api.nova: ('host_list', @@ -243,7 +243,7 @@ class AggregatesViewTests(test.BaseAdminViewTests): aggregate = self.aggregates.first() form_data = {'id': aggregate.id} - self._test_generic_update_aggregate(form_data, aggregate, 2, + self._test_generic_update_aggregate(form_data, aggregate, 1, u'This field is required') diff --git a/openstack_dashboard/dashboards/admin/aggregates/workflows.py b/openstack_dashboard/dashboards/admin/aggregates/workflows.py index 22ddb8c4ad..b9fe82962d 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/workflows.py +++ b/openstack_dashboard/dashboards/admin/aggregates/workflows.py @@ -25,6 +25,7 @@ class SetAggregateInfoAction(workflows.Action): max_length=255) availability_zone = forms.CharField(label=_("Availability Zone"), + required=False, max_length=255) class Meta(object): @@ -186,7 +187,7 @@ class CreateAggregateWorkflow(workflows.Workflow): api.nova.aggregate_create( request, name=context['name'], - availability_zone=context['availability_zone']) + availability_zone=context['availability_zone'] or None) except Exception: exceptions.handle(request, _('Unable to create host aggregate.')) return False