Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,11 @@ private void decryptInit(Connection conn) throws SQLException {
}

@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) {

Expand Down Expand Up @@ -488,5 +489,19 @@ public InputStream[] getCleanupScripts() {
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)");
}
}
}
}