@staticmethod
    def convert_volume(vol, cfg, cloud):
        compute = cloud.resources[utils.COMPUTE_RESOURCE]
        volume = {
            'id': vol.id,
            'size': vol.size,
            'display_name': vol.display_name,
            'display_description': vol.display_description,
            'volume_type': (
                None if vol.volume_type == u'None' else vol.volume_type),
            'availability_zone': vol.availability_zone,
            'device': vol.attachments[0][
                'device'] if vol.attachments else None,
            'bootable': vol.bootable.lower() == 'true',
            'volume_image_metadata': {},
            'host': None,
            'path': None,
            'project_id': getattr(vol, 'os-vol-tenant-attr:tenant_id'),
            'metadata': vol.metadata
        }
        if vol.__dict__ in 'volume_image_metadata':
            volume['volume_image_metadata'] = {
                'image_id': vol.volume_image_metadata['image_id'],
                'checksum': vol.volume_image_metadata['checksum'],
                'image_name': vol.volume_image_metadata.get('image_name'),
                'size': int(vol.volume_image_metadata.get('size', 0))
            }
        if cfg.storage.backend == utils.CEPH:
            volume['path'] = "%s/%s%s" % (
                cfg.storage.rbd_pool, cfg.storage.volume_name_template, vol.id)
            volume['host'] = (cfg.storage.host
                              if cfg.storage.host
                              else cfg.cloud.ssh_host)
        elif vol.attachments and (cfg.storage.backend == utils.ISCSI):
            instance = compute.read_info(
                search_opts={'id': vol.attachments[0]['server_id']})
            instance = instance[utils.INSTANCES_TYPE]
            instance_info = instance.values()[0][utils.INSTANCE_BODY]
            volume['host'] = instance_info['host']
            list_disk = utils.get_libvirt_block_info(
                instance_info['instance_name'],
                cfg.cloud.ssh_host,
                instance_info['host'],
                cfg.cloud.ssh_user,
                cfg.cloud.ssh_sudo_password)
            volume['path'] = utils.find_element_by_in(list_disk, vol.id)
        return volume
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/storage/cinder_storage.py/CinderStorage.convert_volume/swapped operands of `in`