Skip to content

Commit fe9398d

Browse files
author
Marcus Sorensen
committed
Summary: Fix S3 from trying to upload directories found in template dirs
Detail: The S3 upload code fails on directories in the templates dir, such as "KVMHA" that gets created for KVM. This skips directories in the templates dir. BUG-ID: CLOUDSTACK-1056 Bugfix-for: 4.1 (master) Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1359390176 -0700
1 parent afd7de7 commit fe9398d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ private Answer execute(UploadTemplateToS3FromSecondaryStorageCommand cmd) {
398398
@Override
399399
public boolean accept(final File directory,
400400
final String fileName) {
401-
return !fileName.startsWith(".");
401+
File fileToUpload = new File(directory.getAbsolutePath() + "/" + fileName);
402+
return !fileName.startsWith(".") && !fileToUpload.isDirectory();
402403
}
403404
}, new ObjectNamingStrategy() {
404405
@Override

0 commit comments

Comments
 (0)