Esempio n. 1
0
    def take_action(self, parsed_args):
        share_client = self.app.client_manager.share

        share_obj = apiutils.find_resource(share_client.shares,
                                           parsed_args.share)

        export_locations = share_client.share_export_locations.list(share_obj)
        export_locations = (cliutils.transform_export_locations_to_string_view(
            export_locations))

        data = share_obj._info
        data['export_locations'] = export_locations
        # Special mapping for columns to make the output easier to read:
        # 'metadata' --> 'properties'
        data.update(
            {
                'properties': format_columns.DictColumn(
                    data.pop('metadata', {})),
            }, )

        # Remove key links from being displayed
        data.pop("links", None)
        data.pop("shares_type", None)

        return self.dict2columns(data)
Esempio n. 2
0
    def take_action(self, parsed_args):
        share_client = self.app.client_manager.share

        share_snapshot = utils.find_resource(share_client.share_snapshots,
                                             parsed_args.snapshot)

        export_locations = (
            share_client.share_snapshot_export_locations.list(share_snapshot))
        export_locations = (cliutils.transform_export_locations_to_string_view(
            export_locations))

        data = share_snapshot._info
        data['export_locations'] = export_locations
        data.pop('links', None)

        return self.dict2columns(data)