always load/repair configs for question
@@ -530,6 +530,10 @@ public class Batfish extends PluginConsumer implements AutoCloseable, IBatfish {
boolean diffActive = _settings.getDiffActive() && !diff;
_settings.setDiffActive(diffActive);
_settings.setDiffQuestion(diff);
+
+ // Ensures configurations are parsed and ready
+ loadConfigurations();
+
initQuestionEnvironments(question, diff, diffActive, dp);
AnswerElement answerElement = null;
BatfishException exception = null;
@@ -2590,11 +2594,15 @@ public class Batfish extends PluginConsumer implements AutoCloseable, IBatfish {
private ConvertConfigurationAnswerElement loadConvertConfigurationAnswerElement(
boolean firstAttempt) {
+ if (Files.exists(_testrigSettings.getConvertAnswerPath())) {
ConvertConfigurationAnswerElement ccae = deserializeObject(
_testrigSettings.getConvertAnswerPath(),
ConvertConfigurationAnswerElement.class);
- if (!Version.isCompatibleVersion("Service",
+ if (Version.isCompatibleVersion("Service",
"Old processed configurations", ccae.getVersion())) {
+ return ccae;
+ }
+ }
if (firstAttempt) {
repairConfigurations();
return loadConvertConfigurationAnswerElement(false);
@@ -2604,10 +2612,6 @@ public class Batfish extends PluginConsumer implements AutoCloseable, IBatfish {
"Version error repairing configurations for convert configuration answer element");
}
}
- else {
- return ccae;
- }
- }
@Override
public DataPlane loadDataPlane() {
@@ -2767,11 +2771,15 @@ public class Batfish extends PluginConsumer implements AutoCloseable, IBatfish {
private ParseVendorConfigurationAnswerElement loadParseVendorConfigurationAnswerElement(
boolean firstAttempt) {
+ if (Files.exists(_testrigSettings.getParseAnswerPath())) {
ParseVendorConfigurationAnswerElement pvcae = deserializeObject(
_testrigSettings.getParseAnswerPath(),
ParseVendorConfigurationAnswerElement.class);
- if (!Version.isCompatibleVersion("Service",
+ if (Version.isCompatibleVersion("Service",
"Old processed configurations", pvcae.getVersion())) {
+ return pvcae;
+ }
+ }
if (firstAttempt) {
repairVendorConfigurations();
return loadParseVendorConfigurationAnswerElement(false);
@@ -2781,10 +2789,6 @@ public class Batfish extends PluginConsumer implements AutoCloseable, IBatfish {
"Version error repairing vendor configurations for parse configuration answer element");
}
}
- else {
- return pvcae;
- }
- }
public Topology loadTopology() {
Path topologyPath = _testrigSettings.getEnvironmentSettings()
