Merge "fix workflow exception on host aggregate create form"

This commit is contained in:
Jenkins 2017-03-03 12:34:51 +00:00 committed by Gerrit Code Review
commit fc8c13231a
2 changed files with 12 additions and 1 deletions

View File

@ -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()

View File

@ -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)