Skip to content

Commit 6a286cb

Browse files
committed
upgrade: 4.20.3 fix system vm template update
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent db858e9 commit 6a286cb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
import java.io.InputStream;
2020
import java.sql.Connection;
2121

22+
import com.cloud.upgrade.SystemVmTemplateRegistration;
2223
import com.cloud.utils.exception.CloudRuntimeException;
2324

2425
public class Upgrade42020to42030 extends DbUpgradeAbstractImpl implements DbUpgrade, DbUpgradeSystemVmTemplate {
26+
private SystemVmTemplateRegistration systemVmTemplateRegistration;
2527

2628
@Override
2729
public String[] getUpgradableVersionRange() {
@@ -58,7 +60,18 @@ public InputStream[] getCleanupScripts() {
5860
return null;
5961
}
6062

63+
private void initSystemVmTemplateRegistration() {
64+
systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
65+
}
66+
6167
@Override
6268
public void updateSystemVmTemplates(Connection conn) {
69+
logger.debug("Updating System Vm template IDs");
70+
initSystemVmTemplateRegistration();
71+
try {
72+
systemVmTemplateRegistration.updateSystemVmTemplates(conn);
73+
} catch (Exception e) {
74+
throw new CloudRuntimeException("Failed to find / register SystemVM template(s)", e);
75+
}
6376
}
6477
}

0 commit comments

Comments
 (0)