def _translate_conductor_summary_view(context, vol, image_id=None):
 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['display_name'] = vol['display_name']
 d['display_description'] = vol['display_description']
 if (vol['conductor_type_id'] and vol.get('conductor_type')):
  d['conductor_type'] = vol['conductor_type']['name']
 else:
  d['conductor_type'] = str(vol['conductor_type_id'])
 LOG.audit(_('vol=%s'), vol, context=context)
 if vol.get('conductor_metadata'):
  metadata = vol.get('conductor_metadata')
  d['metadata'] = dict(((item['key'], item['value']) for item in metadata))
 elif (vol.get('metadata') and isinstance(vol.get('metadata'), dict)):
  d['metadata'] = vol['metadata']
 else:
  d['metadata'] = {}
 if vol.get('conductor_glance_metadata'):
  d['bootable'] = 'true'
 else:
  d['bootable'] = 'false'
 return d

def _translate_conductor_summary_view ( context , vol , image_id = None ) : 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 [ 'display_name' ] = vol [ 'display_name' ] d [ 'display_description' ] = vol [ 'display_description' ] if ( vol [ 'conductor_type_id' ] and vol . get ( 'conductor_type' ) ) : d [ 'conductor_type' ] = vol [ 'conductor_type' ] [ 'name' ] else : d [ 'conductor_type' ] = str ( vol [ 'conductor_type_id' ] ) LOG . audit ( _ ( 'vol=%s' ) , vol , context = context ) if vol . get ( 'conductor_metadata' ) : metadata = vol . get ( 'conductor_metadata' ) d [ 'metadata' ] = dict ( ( ( item [ 'key' ] , item [ 'value' ] ) for item in metadata ) ) elif ( vol . get ( 'metadata' ) and isinstance ( vol . get ( 'metadata' ) , dict ) ) : d [ 'metadata' ] = vol [ 'metadata' ] else : d [ 'metadata' ] = { } if vol . get ( 'conductor_glance_metadata' ) : d [ 'bootable' ] = 'true' else : d [ 'bootable' ] = 'false' return d
maps keys for conductors summary view .