Skip to content
Open
Show file tree
Hide file tree
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 @@ -389,7 +389,7 @@ private static String fetchTemplatesPath() {
}

protected static void cleanupStore(Long templateId, String filePath) {
String destTempFolder = filePath + PARTIAL_TEMPLATE_FOLDER + String.valueOf(templateId);
String destTempFolder = filePath + PARTIAL_TEMPLATE_FOLDER + templateId;
try {
Files.deleteIfExists(Paths.get(destTempFolder));
} catch (IOException e) {
Expand All @@ -400,8 +400,8 @@ protected static void cleanupStore(Long templateId, String filePath) {
protected static Pair<Long, Long> readTemplatePropertiesSizes(String path) {
File tmpFile = new File(path);
Long size = null;
Long physicalSize = 0L;
try (FileReader fr = new FileReader(tmpFile); BufferedReader brf = new BufferedReader(fr);) {
long physicalSize = 0L;
try (FileReader fr = new FileReader(tmpFile); BufferedReader brf = new BufferedReader(fr)) {
String line = null;
while ((line = brf.readLine()) != null) {
if (line.startsWith("size=")) {
Expand Down Expand Up @@ -532,7 +532,7 @@ public static void unmountStore(String filePath) {
try {
Files.deleteIfExists(Paths.get(filePath));
} catch (IOException e) {
LOGGER.error(String.format("Failed to cleanup mounted store at: %s", filePath), e);
LOGGER.error("Failed to cleanup mounted store at: {}", filePath, e);
}
} catch (Exception e) {
String msg = String.format("Failed to unmount store mounted at %s", filePath);
Expand Down Expand Up @@ -586,7 +586,7 @@ private VMTemplateVO createTemplateObjectInDB(SystemVMTemplateDetails details) {
Long templateId = vmTemplateDao.getNextInSequence(Long.class, "id");
VMTemplateVO template = new VMTemplateVO();
template.setUuid(details.getUuid());
template.setUniqueName(String.format("routing-%s" , String.valueOf(templateId)));
template.setUniqueName(String.format("routing-%s" , templateId));
template.setName(details.getName());
template.setPublicTemplate(false);
template.setFeatured(false);
Expand Down Expand Up @@ -919,7 +919,6 @@ protected File getTemplateFile(MetadataTemplateDetails templateDetails) {

/**
* Validate that templates for the provided hypervisor/architecture pairs which are in use and are valid.
*
* If a template is missing or validation fails for any required pair, a
* {@link CloudRuntimeException} is thrown to abort the upgrade. If system VM Template for a hypervisor/arch is
* not considered available then validation is skipped for that pair.
Expand Down Expand Up @@ -952,7 +951,6 @@ protected void validateTemplates(List<Pair<Hypervisor.HypervisorType, CPU.CPUArc

/**
* Register or ensure system VM Templates are present on the NFS store for a given zone.
*
* Mounts the zone image store, enumerates hypervisors and architectures in the zone,
* and for each template either adds an existing template to the store or registers
* a new template as required.
Expand Down Expand Up @@ -1250,7 +1248,6 @@ public VMTemplateVO getRegisteredTemplate(String templateName, Hypervisor.Hyperv

/**
* Update or register system VM Templates based on metadata.
*
* Runs the registration logic inside a database transaction: obtains the
* set of hypervisors/architectures in use, iterates over metadata entries
* and attempts to register or update each template.
Expand Down
Loading
Loading