[Kimchi-devel] [PATCH] Issue #290: correct the log usage

Aline Manera alinefm at linux.vnet.ibm.com
Thu Dec 19 12:47:34 UTC 2013


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 12/19/2013 03:21 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> It is recommended that the log message should use comma.
> Arguments should be separated by comma.
> and they should not be in a tuple.
>
> Before this patch:
> Kimchi throws an exception as follow:
> TypeError: not enough arguments for format string
> Logged from file disks.py, line 117
>
> After use the log correctly:
> Kimchi log works well:
> Error getting partition info for 35000c5002eaa8392p2: Error executing
> lsblk: lsblk: dm-2: unknown device name
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
>   src/kimchi/disks.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/kimchi/disks.py b/src/kimchi/disks.py
> index 991bb4a..a054961 100644
> --- a/src/kimchi/disks.py
> +++ b/src/kimchi/disks.py
> @@ -114,7 +114,7 @@ def get_partition_details(name):
>           dev = _get_lsblk_devs(keys, [dev_path])[0]
>       except OperationFailed as e:
>           kimchi_log.error(
> -            "Error getting partition info for %s: %s", (name, e))
> +            "Error getting partition info for %s: %s", name, e)
>           return {}
>
>       if dev['mountpoint']:




More information about the Kimchi-devel mailing list