def _clean_databasename(name):
  try:
    if name in db.get_databases(): # Will always fail
      raise forms.ValidationError(_('Database "%(name)s" already exists.') % {'name': name})
  except Exception:
    return name
dataset/ETHPy150Open cloudera/hue/apps/beeswax/src/beeswax/forms.py/_clean_databasename/original