def METHOD_NAME():
  cmdv = [CONF.KINIT_PATH.get(),
          "-k", # host ticket
          "-t", CONF.HUE_KEYTAB.get(), # specify keytab
          "-c", CONF.CCACHE_PATH.get(), # specify credentials cache
          CONF.HUE_PRINCIPAL.get()]
  retries = 0
  max_retries = 3
  while retries < max_retries:
    LOG.info("Reinitting kerberos retry attempt %s from keytab %s" % (retries, " ".join(cmdv)))
    subp = subprocess.Popen(cmdv, stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE, close_fds=True,
                            bufsize=-1)
    subp.wait()
    max_retries = 0 if subp.returncode == 0 else max_retries
    if subp.returncode != 0:
      retries = retries + 1
      subp_stdout = subp.stdout.readlines()
      subp_stderr = subp.stderr.readlines()
      if sys.version_info[0] > 2:
        subp_stdout = [line.decode() for line in subp.stdout.readlines()]
        subp_stderr = [line.decode() for line in subp.stderr.readlines()]
      LOG.error("Couldn't reinit from keytab! `kinit' exited with %s.\n%s\n%s" % (
                subp.returncode, "\n".join(subp_stdout), "\n".join(subp_stderr)))
      if retries >= max_retries:
        LOG.error("FATAL: max_retries of %s reached. Exiting..." % max_retries)
        sys.exit(subp.returncode)
      time.sleep(3)
    elif CONF.ENABLE_RENEWLIFETIME.get() and max_retries == 0:
      break
  global NEED_KRB181_WORKAROUND
  if NEED_KRB181_WORKAROUND is None:
    NEED_KRB181_WORKAROUND = detect_conf_var()
  if NEED_KRB181_WORKAROUND and CONF.ENABLE_RENEWLIFETIME.get():
    # HUE-640. Kerberos clock have seconds level granularity. Make sure we
    # renew the ticket after the initial valid time.
    time.sleep(1.5)
    perform_krb181_workaround()