Esempio n. 1
0
def resetDatabaseConsoleScriptEntryPoint():
    """ Setuptools console script entry point for resetting Taurus Engine's
  database.

  :returns: 0 if reset was completed successfully; 1 if user doesn't confirm the
    request
  """
    logging_support.LoggingSupport.initTool()

    parser = argparse.ArgumentParser(description=(
        "WARNING: PERMANENT DATA LOSS! Obliterate/reset Taurus Engine's sql "
        "database {db} on server {host}.").format(
            **dict(config.items("repository"))))

    parser.add_argument(
        "--suppress-prompt-and-continue-with-deletion",
        action="store_true",
        dest="suppressPrompt",
        help=("Suppresses confirmation prompt and proceedes with this "
              "DESTRUCTIVE operation. This option is intended for scripting."))

    args = parser.parse_args()

    if args.suppressPrompt:
        return reset(suppressPromptAndContinueWithDeletion=True)
    else:
        return reset()
Esempio n. 2
0
def resetDatabaseConsoleScriptEntryPoint():
  """ Setuptools console script entry point for resetting Taurus Engine's
  database.

  :returns: 0 if reset was completed successfully; 1 if user doesn't confirm the
    request
  """
  logging_support.LoggingSupport.initTool()

  parser = argparse.ArgumentParser(
    description=(
      "WARNING: PERMANENT DATA LOSS! Obliterate/reset Taurus Engine's sql "
      "database {db} on server {host}.").format(
        **dict(config.items("repository")))
  )

  parser.add_argument(
    "--suppress-prompt-and-continue-with-deletion",
    action="store_true",
    dest="suppressPrompt",
    help=("Suppresses confirmation prompt and proceedes with this "
          "DESTRUCTIVE operation. This option is intended for scripting."))

  args = parser.parse_args()

  if args.suppressPrompt:
    return reset(suppressPromptAndContinueWithDeletion=True)
  else:
    return reset()
Esempio n. 3
0
def getDbDSN():
  return DB_DSN_FORMAT % dict(config.items("repository"))
Esempio n. 4
0
def getDbDSN():
    return DB_DSN_FORMAT % dict(config.items("repository"))