CLOUDSTACK-8648: Do not configure the ImageFormat Processor when fetching filesize

It will throw an exception and that's needed.

Also, make the log show about which file we are talking about

Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
This commit is contained in:
Wido den Hollander 2015-07-17 15:16:35 +02:00 committed by Pierre-Luc Dion
parent ac9c2a224a
commit 554f5f9fbb
1 changed files with 1 additions and 2 deletions

View File

@ -860,10 +860,9 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
return file.length();
}
processor.configure("template processor", new HashMap<String, Object>());
return processor.getVirtualSize(file);
} catch (Exception e) {
s_logger.warn("Failed to get virtual size, returning file size instead:", e);
s_logger.warn("Failed to get virtual size of file " + file.getPath() + ", returning file size instead: ", e);
return file.length();
}