Exemplo n.º 1
0
def untar_backup_files():
    """ Restores a previous backup into the Cassandra directory structure
  from a tar ball. 

  Raises:
    BRException: On untar issues.
  """
    logging.info("Untarring Cassandra backup files...")
    try:
        tar = tarfile.open(BACKUP_FILE_LOCATION, "r:gz")
        tar.extractall(path="/")
        tar.close()
    except tarfile.TarError, tar_error:
        logging.exception(tar_error)
        raise backup_exceptions.BRException(
            "Exception while untarring Zookeeper backup files.")
Exemplo n.º 2
0
def untar_backup_files(source):
    """ Restores a previous backup into the Cassandra directory structure
  from a tar ball.

  Args:
    source: A str, the path to the backup tar.
  Raises:
    BRException: On untar issues.
  """
    logging.info("Untarring backup file '{0}'...".format(source))
    try:
        tar = tarfile.open(source, "r:gz")
        tar.extractall(path="/")
        tar.close()
    except tarfile.TarError, tar_error:
        logging.exception(tar_error)
        raise backup_exceptions.BRException(
            "Exception while untarring backup file '{0}'.".format(source))