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

Aline Manera alinefm at linux.vnet.ibm.com
Mon Feb 10 18:44:37 UTC 2014


On 02/10/2014 12:32 AM, Leonardo Garcia wrote:
> From: Leonardo Garcia <lagarcia at br.ibm.com>

Just add a commit description

> 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
>
>




More information about the Kimchi-devel mailing list