[Kimchi-devel] [PATCH] [wip-v1] Create template from guest (BACKEND)

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Mon Sep 22 18:47:17 UTC 2014


On 09/09/2014 02:28 PM, Crístian Viana wrote:
> On 26-08-2014 11:23, Rodrigo Trujillo wrote:
>> +    def _get_vm_params(self, vm):
>> +        from kimchi.model.vms import VMModel
>
> I'd suggest importing modules at the top of the file, not where 
> they're used. There are other occurrences of this in the rest of the 
> code.
>
Definitively! I had this discussion with Aline, but if I import in the 
begging, as the module is loaded, python raises an error, due to cyclic 
import.
Importing in the middle, at runtime, I do not see the the problem.

> And what will happen if the user sets the parameter 'vm' as well as 
> other values (e.g. 'cdrom', 'cpus', etc)? According to this code, the 
> parameter 'vm' will override whatever has been set before. Is that 
> expected? I think this should be documented somewhere, probably at 
> src/kimchi/API.json.
>
Did not get your point Cristian.  "vm" is the name of the guest which 
parameters will be copied to create a new Template.
User should not pass any other parameter.  What will be overwritten ??


> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>




More information about the Kimchi-devel mailing list