incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [2/7] git commit: refs/heads/qemu-img - When splitting lines limit it to two splits.
Date Sat, 16 Feb 2013 15:07:18 GMT
When splitting lines limit it to two splits.

This otherwise causes issues with lines like:
backing file: /tmp/wido.qcow2 (actual path: /tmp/wido.qcow2)


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

Branch: refs/heads/qemu-img
Commit: 42270940d29873dee83ae58ebc8dfad5a5c19698
Parents: 07096f0
Author: Wido den Hollander <wido@42on.com>
Authored: Sat Feb 16 11:08:10 2013 +0100
Committer: Wido den Hollander <wido@42on.com>
Committed: Sat Feb 16 11:08:10 2013 +0100

----------------------------------------------------------------------
 .../org/apache/cloudstack/utils/qemu/QemuImg.java  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/42270940/utils/src/org/apache/cloudstack/utils/qemu/QemuImg.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/qemu/QemuImg.java b/utils/src/org/apache/cloudstack/utils/qemu/QemuImg.java
index e37b038..85754a3 100644
--- a/utils/src/org/apache/cloudstack/utils/qemu/QemuImg.java
+++ b/utils/src/org/apache/cloudstack/utils/qemu/QemuImg.java
@@ -125,7 +125,7 @@ public class QemuImg {
         List<Map<String, String>> list = new ArrayList<Map<String, String>>();
         String[] outputBuffer = parser.getLines().trim().split("\n");
         for (int i = 0; i < outputBuffer.length; i++) {
-            String[] lineBuffer = outputBuffer[i].split(":");
+            String[] lineBuffer = outputBuffer[i].split(":", 2);
             if (lineBuffer.length == 2) {
                 HashMap<String,String> info = new HashMap<String,String>();
                 info.put(lineBuffer[0].trim(), lineBuffer[1].trim());


Mime
View raw message