[Kimchi-devel] [PATCH 1/5] Improve parse_cmd_output to split lines based on a given separator.

Leonardo Garcia lagarcia at linux.vnet.ibm.com
Mon Feb 10 02:32:30 UTC 2014


From: Leonardo Garcia <lagarcia at br.ibm.com>

Signed-off-by: Leonardo Garcia <lagarcia at br.ibm.com>
---
 src/kimchi/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index 8795957..9368331 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -188,11 +188,11 @@ def run_command(cmd, timeout=None):
             timer.cancel()
 
 
-def parse_cmd_output(output, output_items):
+def parse_cmd_output(output, output_items, separator=None):
     res = []
     for line in output.split("\n"):
         if line:
-            res.append(dict(zip(output_items, line.split())))
+            res.append(dict(zip(output_items, line.split(separator))))
     return res
 
 
-- 
1.8.5.3




More information about the Kimchi-devel mailing list