File tree Expand file tree Collapse file tree 2 files changed +0
-14
lines changed
server/src/main/java/com/cloud/template
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource Expand file tree Collapse file tree 2 files changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -487,10 +487,6 @@ public TemplateProfile prepareDelete(DeleteTemplateCmd cmd) {
487487 throw new InvalidParameterValueException ("Please specify a valid template." );
488488 }
489489
490- if (template .getState () == VirtualMachineTemplate .State .NotUploaded || template .getState () == VirtualMachineTemplate .State .UploadInProgress ) {
491- throw new InvalidParameterValueException ("The template is either getting uploaded or it may be initiated shortly, please wait for it to be completed" );
492- }
493-
494490 return new TemplateProfile (userId , template , zoneId );
495491 }
496492
@@ -530,10 +526,6 @@ public TemplateProfile prepareDelete(DeleteIsoCmd cmd) {
530526 throw new InvalidParameterValueException ("Please specify a valid iso." );
531527 }
532528
533- if (template .getState () == VirtualMachineTemplate .State .NotUploaded || template .getState () == VirtualMachineTemplate .State .UploadInProgress ) {
534- throw new InvalidParameterValueException ("The iso is either getting uploaded or it may be initiated shortly, please wait for it to be completed" );
535- }
536-
537529 return new TemplateProfile (userId , template , zoneId );
538530 }
539531
Original file line number Diff line number Diff line change @@ -2348,9 +2348,6 @@ protected Answer deleteTemplate(DeleteCommand cmd) {
23482348 File tmpltParent = null ;
23492349 if (tmpltPath .exists () && tmpltPath .isDirectory ()) {
23502350 tmpltParent = tmpltPath ;
2351- } else if (absoluteTemplatePath .endsWith (File .separator + obj .getId ())) {
2352- // the path ends with <account id>/<template id>, if upload fails
2353- tmpltParent = tmpltPath ;
23542351 } else {
23552352 tmpltParent = tmpltPath .getParentFile ();
23562353 }
@@ -2455,9 +2452,6 @@ protected Answer deleteVolume(final DeleteCommand cmd) {
24552452 if (volPath .exists () && volPath .isDirectory ()) {
24562453 // for vmware, absoluteVolumePath represents a directory where volume files are located.
24572454 tmpltParent = volPath ;
2458- } else if (absoluteVolumePath .endsWith (File .separator + obj .getId ())) {
2459- // the path ends with <account id>/<volume id>, if upload fails
2460- tmpltParent = volPath ;
24612455 } else {
24622456 // for other hypervisors, the volume .vhd or .qcow2 file path is passed
24632457 tmpltParent = new File (absoluteVolumePath ).getParentFile ();
You can’t perform that action at this time.
0 commit comments