def take_action(self, parsed_args):
        volume_client = self.app.client_manager.volume
        volume = utils.find_resource(volume_client.volumes, parsed_args.volume)

        if parsed_args.size:
            if volume.status != 'available':
                self.app.log.error("Volume is in %s state, it must be "
                                   "available before size can be extended" %
                                   volume.status)
                return
            if parsed_args.size <= volume.size:
                self.app.log.error("New size must be greater than %s GB" %
                                   volume.size)
                return
            volume_client.volumes.extend(volume.id, parsed_args.size)

        if parsed_args.property:
            volume_client.volumes.set_metadata(volume.id, parsed_args.property)
        if parsed_args.image_property:
            volume_client.volumes.set_image_metadata(
                volume.id, parsed_args.image_property)

        kwargs = {}
        if parsed_args.name:
            kwargs['display_name'] = parsed_args.name
        if parsed_args.description:
            kwargs['display_description'] = parsed_args.description
        if kwargs:
            volume_client.volumes.update(volume.id, **kwargs)

        if (not kwargs and not parsed_args.property
           and not parsed_args.image_property and not parsed_args.size):
            self.app.log.error("No changes requested\n")
dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/volume/v2/volume.py/SetVolume.take_action/original