From fb592dd34bf0e96e278076e4fd0320f3a98509f0 Mon Sep 17 00:00:00 2001 From: edison Date: Thu, 26 Aug 2010 16:30:19 -0700 Subject: [PATCH] fix build --- .../computing/LibvirtComputingResource.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java index d867e3c33c3..ad7c036fe31 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java @@ -1231,13 +1231,13 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv public Answer execute(DestroyCommand cmd) { VolumeTO vol = cmd.getVolume(); - - StorageVol volume = getVolume(vol.getPath()); - if (volume == null) { - s_logger.debug("Failed to find the volume: " + vol.getPath()); - return new Answer(cmd, true, "Success"); - } + try { + StorageVol volume = getVolume(vol.getPath()); + if (volume == null) { + s_logger.debug("Failed to find the volume: " + vol.getPath()); + return new Answer(cmd, true, "Success"); + } volume.delete(0); volume.free(); } catch (LibvirtException e) { @@ -1430,7 +1430,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv String templatePath = _mountPoint + File.separator + secondaryPool.getUUIDString() + File.separator + templateInstallFolder; File f = new File(templatePath); if (!f.exists()) { - f.mkdir(); + f.mkdirs(); } String tmplPath = templateInstallFolder + File.separator + tmplFileName; Script command = new Script(_createTmplPath, _timeout, s_logger); @@ -1704,7 +1704,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv pool.getHostAddress(), pool.getPath(), targetPath); File tpFile = new File(targetPath); if (!tpFile.exists()) { - tpFile.mkdir(); + tpFile.mkdirs(); } StoragePool sp = null; try { @@ -3366,7 +3366,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv File logPath = new File("/var/run/cloud"); if (!logPath.exists()) { - logPath.mkdir(); + logPath.mkdirs(); } cleanup_rules_for_dead_vms();