Skip to content

Commit 46a8454

Browse files
Pearl1594Pearl Dsilva
andauthored
ssvm: Check to prevent redownloaded of downloaded templates (#19)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
1 parent db5aa33 commit 46a8454

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,10 @@ private List<String> listVolumes(String rootdir) {
795795
script.add("-r", rootdir);
796796
ZfsPathParser zpp = new ZfsPathParser(rootdir);
797797
script.execute(zpp);
798+
if (script.getExitValue() != 0) {
799+
s_logger.error("Error while executing script " + script.toString());
800+
throw new CloudRuntimeException("Error while executing script " + script.toString());
801+
}
798802
result.addAll(zpp.getPaths());
799803
s_logger.info("found " + zpp.getPaths().size() + " volumes" + zpp.getPaths());
800804
return result;
@@ -807,6 +811,10 @@ private List<String> listTemplates(String rootdir) {
807811
script.add("-r", rootdir);
808812
ZfsPathParser zpp = new ZfsPathParser(rootdir);
809813
script.execute(zpp);
814+
if (script.getExitValue() != 0) {
815+
s_logger.error("Error while executing script " + script.toString());
816+
throw new CloudRuntimeException("Error while executing script " + script.toString());
817+
}
810818
result.addAll(zpp.getPaths());
811819
s_logger.info("found " + zpp.getPaths().size() + " templates" + zpp.getPaths());
812820
return result;

0 commit comments

Comments
 (0)