[Kimchi-devel] [WIP][PATCH 1/4] Storage volume upload: Dispatch volume create to right handler

Crístian Viana vianac at linux.vnet.ibm.com
Thu Aug 21 21:02:32 UTC 2014


On 21-08-2014 11:42, lvroyce0210 at gmail.com wrote:
> +        for p in vol_source:
> +            create_func = getattr(self, "_create_volume_with_" + p, None)
> +            if create_func and p in params:
> +                return create_func(pool_name, params)
> +
There needs to be a better error handling here. What if there's no 
appropriate function (create_volume_with_XXX)? The function create won't 
return anything and nothing will be reported. Actually, I guess an error 
will be raised later because whoever calls the function "create" expects 
a string in return.




More information about the Kimchi-devel mailing list