mirror of https://github.com/apache/cloudstack.git
make NoopDbUpgrade do a systemvm template check (#7564)
This commit is contained in:
parent
fd13184dda
commit
2bb079189c
|
|
@ -444,10 +444,11 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||
}
|
||||
|
||||
@VisibleForTesting
|
||||
protected static final class NoopDbUpgrade implements DbUpgrade {
|
||||
protected static final class NoopDbUpgrade implements DbUpgrade, DbUpgradeSystemVmTemplate {
|
||||
|
||||
private final String upgradedVersion;
|
||||
private final String[] upgradeRange;
|
||||
private SystemVmTemplateRegistration systemVmTemplateRegistration;
|
||||
|
||||
private NoopDbUpgrade(final CloudStackVersion fromVersion, final CloudStackVersion toVersion) {
|
||||
|
||||
|
|
@ -488,5 +489,19 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||
return new InputStream[0];
|
||||
}
|
||||
|
||||
private void initSystemVmTemplateRegistration() {
|
||||
systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSystemVmTemplates(Connection conn) {
|
||||
s_logger.debug("Updating System Vm template IDs");
|
||||
initSystemVmTemplateRegistration();
|
||||
try {
|
||||
systemVmTemplateRegistration.updateSystemVmTemplates(conn);
|
||||
} catch (Exception e) {
|
||||
throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue