def _usage_from_volume(context, volume_ref, **kw):
- usage_info = dict(tenant_id=volume_ref['project_id'],
- host=volume_ref['host'],
- user_id=volume_ref['user_id'],
- availability_zone=volume_ref['availability_zone'],
- volume_id=volume_ref['id'],
- volume_type=volume_ref['volume_type_id'],
- display_name=volume_ref['display_name'],
- launched_at=timeutils.isotime(at=
- volume_ref['launched_at']),
- created_at=timeutils.isotime(at=
- volume_ref['created_at']),
- status=volume_ref['status'],
- snapshot_id=volume_ref['snapshot_id'],
- size=volume_ref['size'],
- replication_status=volume_ref['replication_status'],
- replication_extended_status=
- volume_ref['replication_extended_status'],
- replication_driver_data=
- volume_ref['replication_driver_data'],
- )
+ usage_info = dict(
+ tenant_id=volume_ref['project_id'],
+ host=volume_ref['host'],
+ user_id=volume_ref['user_id'],
+ availability_zone=volume_ref['availability_zone'],
+ volume_id=volume_ref['id'],
+ volume_type=volume_ref['volume_type_id'],
+ display_name=volume_ref['display_name'],
+ launched_at=timeutils.isotime(at=volume_ref['launched_at']),
+ created_at=timeutils.isotime(at=volume_ref['created_at']),
+ status=volume_ref['status'],
+ snapshot_id=volume_ref['snapshot_id'],
+ size=volume_ref['size'],
+ replication_status=volume_ref['replication_status'],
+ replication_extended_status=volume_ref['replication_extended_status'],
+ replication_driver_data=volume_ref['replication_driver_data'],)
usage_info.update(kw)
return usage_info