cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [7/9] git commit: updated refs/heads/master to 93845af
Date Thu, 04 Jun 2015 10:34:31 GMT
Using a try-wioth resrouce block as suggested in @DaanHoogland review.

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #355


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/93845afd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/93845afd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/93845afd

Branch: refs/heads/master
Commit: 93845afd53fea7f9b9d95e995478054f823aa8b8
Parents: 7f4e2c7
Author: wilderrodrigues <wrodrigues@schubergphilis.com>
Authored: Thu Jun 4 11:16:23 2015 +0200
Committer: Daan Hoogland <daan.hoogland@gmail.com>
Committed: Thu Jun 4 12:34:05 2015 +0200

----------------------------------------------------------------------
 .../com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93845afd/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
index d785293..0ad2b30 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
@@ -59,7 +59,6 @@ import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat;
 import org.apache.cloudstack.utils.qemu.QemuImgException;
 import org.apache.cloudstack.utils.qemu.QemuImgFile;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.log4j.Logger;
 import org.libvirt.Connect;
 import org.libvirt.Domain;
@@ -543,14 +542,12 @@ public class KVMStorageProcessor implements StorageProcessor {
                 final Date date = new Date();
                 templateContent += "snapshot.name=" + dateFormat.format(date) + System.getProperty("line.separator");
 
-                final FileOutputStream templFo = new FileOutputStream(templateProp);
-                try {
+
+                try(FileOutputStream templFo = new FileOutputStream(templateProp);){
                     templFo.write(templateContent.getBytes());
                     templFo.flush();
                 } catch (final IOException e) {
                     throw e;
-                } finally {
-                    IOUtils.closeQuietly(templFo);
                 }
             }
 


Mime
View raw message