Ejemplo n.º 1
0
def _restore_db(url, path, filename):
    """
    Special case of restore. DB files need to be handled differently
    """
    url = "{}/{}".format(url, filename)
    res, err, msg = storage_iface.copy_storage_to_local(url, path)
    if err:
        msg = "Error restoring DB from {}, to {}, file {}: {}".format(url, path, filename, res)

    return err, msg
Ejemplo n.º 2
0
def restore(state, suburl, path, filename, atype):
    """
    Restore file from storage to local disk
    """
    url = build_url(state, suburl, filename)
    result, err, msg = storage_iface.copy_storage_to_local(url, path)
    if err:
        msg = "Error restoring from {}, to {}: {}".format(url, path, msg)

    else:
        # Add size to stats
        # TODO finish
        # _increment_stats_restore(state, atype, os.stat(os.path.join(path, filename)).st_size)
        pass

    return err, msg