Comment 3 for bug 1572993

Revision history for this message
Sheel Rana (ranasheel2000) wrote : Re: command "cinder consisgroup-show" and "cinder cgsnapshot-show" doesn't list volume-type, snapshot-volumes and snapshot volume-type

Right, cinder code specify that cinder consisgroup-show displays volume_type in output

        if is_detail:
            consistencygroups = self._view_builder.detail_list(
                req, consistencygroups)
        else:
            consistencygroups = self._view_builder.summary_list(
                req, consistencygroups)

view_buider->

    def detail_list(self, request, consistencygroups):
        """Detailed view of a list of consistency groups ."""
        return self._list_view(self.detail, request, consistencygroups)

    def detail(self, request, consistencygroup):
        """Detailed view of a single consistency group."""
        if consistencygroup.volume_type_id:
            volume_types = consistencygroup.volume_type_id.split(",")
            volume_types = [type_id for type_id in volume_types if type_id]
        else:
            volume_types = []

        return {
            'consistencygroup': {
                'id': consistencygroup.id,
                'status': consistencygroup.status,
                'availability_zone': consistencygroup.availability_zone,
                'created_at': consistencygroup.created_at,
                'name': consistencygroup.name,
                'description': consistencygroup.description,
                'volume_types': volume_types,
            }
        }

But "cinder cgsnapshot-show" does not show snapshot-volumes and snapshot-volume-types:

    def detail(self, request, cgsnapshot):
        """Detailed view of a single cgsnapshot."""
        return {
            'cgsnapshot': {
                'id': cgsnapshot.id,
                'consistencygroup_id': cgsnapshot.consistencygroup_id,
                'status': cgsnapshot.status,
                'created_at': cgsnapshot.created_at,
                'name': cgsnapshot.name,
                'description': cgsnapshot.description
            }
        }