Search in sources :

Example 1 with DataPlaneAnswerElement

use of org.batfish.datamodel.answers.DataPlaneAnswerElement in project batfish by batfish.

the class Batfish method loadDataPlaneAnswerElement.

private DataPlaneAnswerElement loadDataPlaneAnswerElement(boolean compressed, boolean firstAttempt) {
    Path answerPath = compressed ? _testrigSettings.getEnvironmentSettings().getCompressedDataPlaneAnswerPath() : _testrigSettings.getEnvironmentSettings().getDataPlaneAnswerPath();
    DataPlaneAnswerElement bae = deserializeObject(answerPath, DataPlaneAnswerElement.class);
    if (!Version.isCompatibleVersion("Service", "Old data plane", bae.getVersion())) {
        if (firstAttempt) {
            repairDataPlane(compressed);
            return loadDataPlaneAnswerElement(compressed, false);
        } else {
            throw new BatfishException("Version error repairing data plane for data plane answer element");
        }
    } else {
        return bae;
    }
}
Also used : Path(java.nio.file.Path) CleanBatfishException(org.batfish.common.CleanBatfishException) BatfishException(org.batfish.common.BatfishException) DataPlaneAnswerElement(org.batfish.datamodel.answers.DataPlaneAnswerElement)

Aggregations

Path (java.nio.file.Path)1 BatfishException (org.batfish.common.BatfishException)1 CleanBatfishException (org.batfish.common.CleanBatfishException)1 DataPlaneAnswerElement (org.batfish.datamodel.answers.DataPlaneAnswerElement)1