mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5900: Failed to delete template/ISO that failed to download.
(cherry picked from commit ae22d1990e)
Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
parent
e089b91385
commit
16dbb20b5d
|
|
@ -1740,7 +1740,12 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||
parent += File.separator;
|
||||
}
|
||||
String absoluteTemplatePath = parent + relativeTemplatePath;
|
||||
File tmpltParent = new File(absoluteTemplatePath).getParentFile();
|
||||
File tmpltParent;
|
||||
if(absoluteTemplatePath.endsWith(String.valueOf(obj.getId()))) {
|
||||
tmpltParent = new File(absoluteTemplatePath);
|
||||
} else {
|
||||
tmpltParent = new File(absoluteTemplatePath).getParentFile();
|
||||
}
|
||||
String details = null;
|
||||
if (!tmpltParent.exists()) {
|
||||
details = "template parent directory " + tmpltParent.getName() + " doesn't exist";
|
||||
|
|
|
|||
Loading…
Reference in New Issue