diff --git a/openstack_dashboard/dashboards/project/volume_groups/workflows.py b/openstack_dashboard/dashboards/project/volume_groups/workflows.py index 12a0aad19e4cf7523f93816e8031517e2d9f773c..67a066cad9f1df5a93cf91a60239a0ee42ed1999 100644 --- a/openstack_dashboard/dashboards/project/volume_groups/workflows.py +++ b/openstack_dashboard/dashboards/project/volume_groups/workflows.py @@ -77,12 +77,19 @@ class AddGroupInfoAction(workflows.Action): self.fields['availability_zone'].choices = \ availability_zones(request) try: + # Group type name 'default_cgsnapshot_type' is reserved for + # consistency group and it cannot be used for a group type. + # Let's exclude it. group_types = [(t.id, t.name) for t - in api.cinder.group_type_list(request)] - group_types.insert(0, ("", _("Select group type"))) - self.fields['group_type'].choices = group_types + in api.cinder.group_type_list(request) + if t.name != 'default_cgsnapshot_type'] except Exception: exceptions.handle(request, _('Unable to retrieve group types.')) + if group_types: + group_types.insert(0, ("", _("Select group type"))) + else: + group_types.insert(0, ("", _("No valid group type"))) + self.fields['group_type'].choices = group_types class Meta(object): name = _("Group Information") diff --git a/releasenotes/notes/generic-volumes-support-407406de8233c912.yaml b/releasenotes/notes/generic-volumes-support-407406de8233c912.yaml index bf284d538d6c50bc981d51a5ec577d0d44b018b2..2a747d1b3b5e717ab2cb52b4875a5ff9259e406b 100644 --- a/releasenotes/notes/generic-volumes-support-407406de8233c912.yaml +++ b/releasenotes/notes/generic-volumes-support-407406de8233c912.yaml @@ -5,3 +5,8 @@ features: Cinder generic groups is now supported. Consistency groups views will be disabled if the generic group support is available. User is able to create generic groups and snapshots now. + + Note that operators need to create at least one group type so that + users can use the generic group feature. Otherwise, it might be better + to disable the group and group snapshot panels by the horizon plugin + ``enabled`` files.