You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ek...@apache.org on 2015/06/08 11:45:59 UTC

[38/50] [abbrv] git commit: updated refs/heads/feature/vpc-ipv6 to 6140db5

Using a try-wioth resrouce block as suggested in @DaanHoogland review.

Signed-off-by: Daan Hoogland <da...@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/feature/vpc-ipv6
Commit: 93845afd53fea7f9b9d95e995478054f823aa8b8
Parents: 7f4e2c7
Author: wilderrodrigues <wr...@schubergphilis.com>
Authored: Thu Jun 4 11:16:23 2015 +0200
Committer: Daan Hoogland <da...@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);
                 }
             }