Skip to content

Commit 8b6dc7c

Browse files
committed
CLOUDSTACK-6824: In case there is a failure to delete the soft link of a download url, dont bail out since there can be cases such as destroy ssvm where the soft links do not exist any more.
(cherry picked from commit 7333016)
1 parent eb8e630 commit 8b6dc7c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ public Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLComman
316316
command.add("unlink /var/www/html/userdata/" + extractUrl.substring(extractUrl.lastIndexOf(File.separator) + 1));
317317
String result = command.execute();
318318
if (result != null) {
319-
String errorString = "Error in deleting =" + result;
320-
s_logger.warn(errorString);
321-
return new Answer(cmd, false, errorString);
319+
// FIXME - Ideally should bail out if you cant delete symlink. Not doing it right now.
320+
// This is because the ssvm might already be destroyed and the symlinks do not exist.
321+
s_logger.warn("Error in deleting symlink :" + result);
322322
}
323323

324324
// If its a volume also delete the Hard link since it was created only for the purpose of download.
@@ -329,7 +329,7 @@ public Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLComman
329329
s_logger.warn(" " + parentDir + File.separator + path);
330330
result = command.execute();
331331
if (result != null) {
332-
String errorString = "Error in linking err=" + result;
332+
String errorString = "Error in deleting volume " + path + " : " + result;
333333
s_logger.warn(errorString);
334334
return new Answer(cmd, false, errorString);
335335
}

0 commit comments

Comments
 (0)