def get_volume_type(ctxt, id, expected_fields=None):
 if (id is None):
  msg = _('id cannot be None')
  raise exception.InvalidVolumeType(reason=msg)
 if (ctxt is None):
  ctxt = context.get_admin_context()
 return db.volume_type_get(ctxt, id, expected_fields=expected_fields)

def get_volume_type ( ctxt , id , expected_fields = None ) : if ( id is None ) : msg = _ ( 'id cannot be None' ) raise exception . InvalidVolumeType ( reason = msg ) if ( ctxt is None ) : ctxt = context . get_admin_context ( ) return db . volume_type_get ( ctxt , id , expected_fields = expected_fields )
retrieves single volume type by id .