def get_volume_type_from_volume(volume):
 type_id = volume.get('volume_type_id')
 if (type_id is None):
  return {}
 ctxt = context.get_admin_context()
 return volume_types.get_volume_type(ctxt, type_id)

def get_volume_type_from_volume ( volume ) : type_id = volume . get ( 'volume_type_id' ) if ( type_id is None ) : return { } ctxt = context . get_admin_context ( ) return volume_types . get_volume_type ( ctxt , type_id )
provides volume type associated with volume .