Skip to content

Commit 29cd184

Browse files
committed
minor refactor
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 2fd18bd commit 29cd184

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -825,13 +825,10 @@ public static String parseMetadataFile() {
825825
throw new CloudRuntimeException(errMsg);
826826
}
827827
Ini.Section defaultSection = ini.get("default");
828-
boolean updateCustomDownloadRepository = false;
829828
String defaultDownloadRepository = defaultSection.get(TEMPLATES_DOWNLOAD_REPOSITORY_KEY);
830829
String customDownloadRepository = ServerPropertiesUtil.getProperty(TEMPLATES_CUSTOM_DOWNLOAD_REPOSITORY_KEY);
831-
if (StringUtils.isNotBlank(customDownloadRepository) && StringUtils.isNotBlank(defaultDownloadRepository)) {
832-
LOGGER.debug("Updating custom download repository: {}", customDownloadRepository);
833-
updateCustomDownloadRepository = true;
834-
}
830+
boolean updateCustomDownloadRepository = StringUtils.isNotBlank(customDownloadRepository) &&
831+
StringUtils.isNotBlank(defaultDownloadRepository);
835832
for (Pair<Hypervisor.HypervisorType, CPU.CPUArch> hypervisorType : hypervisorList) {
836833
String key = getHypervisorArchKey(hypervisorType.first(), hypervisorType.second());
837834
Ini.Section section = ini.get(key);
@@ -844,7 +841,7 @@ public static String parseMetadataFile() {
844841
if (StringUtils.isNotBlank(url) && updateCustomDownloadRepository) {
845842
url = url.replaceFirst(defaultDownloadRepository.trim(),
846843
customDownloadRepository.trim());
847-
LOGGER.info("Updated download URL for {} to {}", key, url);
844+
LOGGER.debug("Updated download URL for {} using custom repository to {}", key, url);
848845
}
849846
NewTemplateMap.put(key, new MetadataTemplateDetails(
850847
hypervisorType.first(),

0 commit comments

Comments
 (0)