def VerifyClusterName(name, _cfg_location=None):
  """Verifies cluster name against a local cluster name.

  @type name: string
  @param name: Cluster name

  """
  sstore = SimpleStore(cfg_location=_cfg_location)

  try:
    local_name = sstore.GetClusterName()
  except errors.ConfigurationError, err:
    logging.debug("Can't get local cluster name: %s", err)
  else:
    if name != local_name:
      raise errors.GenericError("Current cluster name is '%s'" % local_name)
dataset/ETHPy150Open ganeti/ganeti/lib/ssconf.py/VerifyClusterName/original