summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2018-08-08 21:06:39 +0900
committerAkihiro Motoki <amotoki@gmail.com>2018-08-08 21:10:38 +0900
commit4c9cf5f00e5b978e77678de6c4c257e733f4c46d (patch)
tree69681cca75baa4f1c5941692bda73840a4e618e0
parenta4443f4be7a7e38ce052080ed157337bc778c18d (diff)
downloadhorizon-14.0.0.0rc1.tar.gz
Hide default_cgsnapshot_type from cinder group types14.0.0.0rc1
The generic group type named "default_cgsnapshot_type" is reserved for the consistency group and we cannot use a generic group using "default_cgsnapshot_type". "default_cgsnapshot_type" should not be listed in "Group Type" selection in "Create Group" form. In addition, "Group" and "Group Snapshot" panels make no sense when there is no group type other than "default_cgsnapshot_type". This commit adds a suggestion to hide "Group" and "Group Snapshot" panels if there is no valid group type to the release notes. Closes-Bug: #1785178 Change-Id: I2dce39bcbcf6bedc8dc0c94d11f3c0a85ea61490
-rw-r--r--openstack_dashboard/dashboards/project/volume_groups/workflows.py13
-rw-r--r--releasenotes/notes/generic-volumes-support-407406de8233c912.yaml5
2 files changed, 15 insertions, 3 deletions
diff --git a/openstack_dashboard/dashboards/project/volume_groups/workflows.py b/openstack_dashboard/dashboards/project/volume_groups/workflows.py
index 12a0aad19..67a066cad 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 bf284d538..2a747d1b3 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.