def _untranslate_volume_summary_view(context, vol):
 d = {}
 d['id'] = vol.id
 d['status'] = vol.status
 d['size'] = vol.size
 d['availability_zone'] = vol.availability_zone
 d['created_at'] = vol.created_at
 d['attach_time'] = ''
 d['mountpoint'] = ''
 if vol.attachments:
  att = vol.attachments[0]
  d['attach_status'] = 'attached'
  d['instance_uuid'] = att['server_id']
  d['mountpoint'] = att['device']
 else:
  d['attach_status'] = 'detached'
 d['display_name'] = vol.display_name
 d['display_description'] = vol.display_description
 d['volume_type_id'] = vol.volume_type
 d['snapshot_id'] = vol.snapshot_id
 d['volume_metadata'] = []
 for (key, value) in vol.metadata.items():
  item = {}
  item['key'] = key
  item['value'] = value
  d['volume_metadata'].append(item)
 if hasattr(vol, 'volume_image_metadata'):
  d['volume_image_metadata'] = copy.deepcopy(vol.volume_image_metadata)
 return d

def _untranslate_volume_summary_view ( context , vol ) : d = { } d [ 'id' ] = vol . id d [ 'status' ] = vol . status d [ 'size' ] = vol . size d [ 'availability_zone' ] = vol . availability_zone d [ 'created_at' ] = vol . created_at d [ 'attach_time' ] = '' d [ 'mountpoint' ] = '' if vol . attachments : att = vol . attachments [ 0 ] d [ 'attach_status' ] = 'attached' d [ 'instance_uuid' ] = att [ 'server_id' ] d [ 'mountpoint' ] = att [ 'device' ] else : d [ 'attach_status' ] = 'detached' d [ 'display_name' ] = vol . display_name d [ 'display_description' ] = vol . display_description d [ 'volume_type_id' ] = vol . volume_type d [ 'snapshot_id' ] = vol . snapshot_id d [ 'volume_metadata' ] = [ ] for ( key , value ) in vol . metadata . items ( ) : item = { } item [ 'key' ] = key item [ 'value' ] = value d [ 'volume_metadata' ] . append ( item ) if hasattr ( vol , 'volume_image_metadata' ) : d [ 'volume_image_metadata' ] = copy . deepcopy ( vol . volume_image_metadata ) return d
maps keys for volumes summary view .