File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
services/secondary-storage/src/org/apache/cloudstack/storage/resource Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1291,6 +1291,17 @@ protected Answer execute(final DeleteTemplateCommand cmd) {
12911291 if (!found && f .getName ().equals ("template.properties" )) {
12921292 found = true ;
12931293 }
1294+
1295+ // KVM HA monitor makes a mess in the templates with its heartbeat tests
1296+ // Don't let this stop us from cleaning up the template
1297+ if (f .isDirectory () && f .getName ().equals ("KVMHA" )) {
1298+ s_logger .debug ("Deleting KVMHA directory contents from template location" );
1299+ File [] haFiles = f .listFiles ();
1300+ for (File haFile : haFiles ) {
1301+ haFile .delete ();
1302+ }
1303+ }
1304+
12941305 if (!f .delete ()) {
12951306 return new Answer (cmd , false , "Unable to delete file " + f .getName () + " under Template path "
12961307 + relativeTemplatePath );
@@ -1339,6 +1350,17 @@ protected Answer execute(final DeleteVolumeCommand cmd) {
13391350 if (!found && f .getName ().equals ("volume.properties" )) {
13401351 found = true ;
13411352 }
1353+
1354+ // KVM HA monitor makes a mess in the templates with its heartbeat tests
1355+ // Don't let this stop us from cleaning up the template
1356+ if (f .isDirectory () && f .getName ().equals ("KVMHA" )) {
1357+ s_logger .debug ("Deleting KVMHA directory contents from template location" );
1358+ File [] haFiles = f .listFiles ();
1359+ for (File haFile : haFiles ) {
1360+ haFile .delete ();
1361+ }
1362+ }
1363+
13421364 if (!f .delete ()) {
13431365 return new Answer (cmd , false , "Unable to delete file " + f .getName () + " under Volume path "
13441366 + relativeVolumePath );
You can’t perform that action at this time.
0 commit comments