Make "availability zone" field optional for host aggregates
Nova allows an admin to create/update a host aggregate without specifying the "availability zone" but on the Horizon dashboard it is still required. This patch makes the availability zone field optional. Change-Id: I44a8b9ff469a203a7e1e1ae3a91e2f49bb94de86 Closes-bug: #1386076
This commit is contained in:
parent
1d4efb3535
commit
5c5037d3c6
@ -28,6 +28,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 __init__(self, request, *args, **kwargs):
|
||||
|
@ -113,7 +113,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',
|
||||
@ -238,7 +238,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')
|
||||
|
||||
|
||||
|
@ -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:
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user