Fix create consistency group form exception

Volume type extra specs may not contain ‘volume_backend_name’,
it should be judged before getting it.

Change-Id: I5dbc0636ba1c949df569acbbfc8a0879f7a76992
Closes-Bug: #1681073
This commit is contained in:
wei.ying 2017-04-08 21:41:24 +08:00
parent 8a8d3fb60e
commit 89bb926820

View File

@ -314,7 +314,8 @@ class CreateCGroupWorkflow(workflows.Workflow):
if not invalid_backend:
for vol_type in vol_types:
if selected_vol_type == vol_type.id:
if hasattr(vol_type, "extra_specs"):
if (hasattr(vol_type, "extra_specs") and
'volume_backend_name' in vol_type.extra_specs):
vol_type_backend = \
vol_type.extra_specs['volume_backend_name']
if vol_type_backend is None: