mirror of https://github.com/apache/cloudstack.git
backport: default system vm template update implementation (#12935)
Fixes #12934
Backported from 889fc62
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
d38c1f8d12
commit
e2497cfc4d
|
|
@ -17,9 +17,23 @@
|
|||
|
||||
package com.cloud.upgrade.dao;
|
||||
|
||||
import com.cloud.upgrade.SystemVmTemplateRegistration;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
public interface DbUpgradeSystemVmTemplate {
|
||||
|
||||
void updateSystemVmTemplates(Connection conn);
|
||||
default void updateSystemVmTemplates(Connection conn) {
|
||||
Logger logger = LogManager.getLogger(getClass());
|
||||
logger.debug("Updating System Vm template IDs");
|
||||
try {
|
||||
SystemVmTemplateRegistration systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
|
||||
systemVmTemplateRegistration.updateSystemVmTemplates(conn);
|
||||
} catch (Exception e) {
|
||||
throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,4 @@ public class Upgrade42020to42030 extends DbUpgradeAbstractImpl implements DbUpgr
|
|||
public InputStream[] getCleanupScripts() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSystemVmTemplates(Connection conn) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue