From 89bb9268204a2316fc526d660f38d5517980f209 Mon Sep 17 00:00:00 2001 From: "wei.ying" Date: Sat, 8 Apr 2017 21:41:24 +0800 Subject: [PATCH] Fix create consistency group form exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Volume type extra specs may not contain ‘volume_backend_name’, it should be judged before getting it. Change-Id: I5dbc0636ba1c949df569acbbfc8a0879f7a76992 Closes-Bug: #1681073 --- openstack_dashboard/dashboards/project/cgroups/workflows.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/cgroups/workflows.py b/openstack_dashboard/dashboards/project/cgroups/workflows.py index 66ec9f0e1a..8658ccf18d 100644 --- a/openstack_dashboard/dashboards/project/cgroups/workflows.py +++ b/openstack_dashboard/dashboards/project/cgroups/workflows.py @@ -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: