From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install Date: Mon, 11 May 2009 15:30:03 -0300 Message-ID: <20090511183003.GI4871@blackpad> References: <1254147621.368741242063155059.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> <443364434.369371242063386949.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mburns@redhat.com, kvm@vger.kernel.org, Uri Lublin To: Michael Goldish Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60501 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752782AbZEKSaI (ORCPT ); Mon, 11 May 2009 14:30:08 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4BIU9aC026790 for ; Mon, 11 May 2009 14:30:09 -0400 Content-Disposition: inline In-Reply-To: <443364434.369371242063386949.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 11, 2009 at 01:36:26PM -0400, Michael Goldish wrote: > > ----- "Mike Burns" wrote: > > > Eduardo Habkost wrote: > > > > > > Maybe something like (untested): > > > > > > for k in params.keys(): > > > os.putenv("KVM_INSTALL_%s" % (k), params[k]) > > > > > > Are all values on 'params' guaranteed to be strings, or they can be > > set > > > to any python value? In the latter case, we could use > > str(params[k]), or > > > export only the string parameters. > > > > > That's a good idea. I'm not sure about whether the params are all > > strings. I'll try it out and respin the patch after. > > 1. Not all params are strings -- 'depend' is a list of strings, so str(params[k]) is a good idea. Agreed. Using str(params[k]) won't hurt. > > 2. Why not just pass the parameters via the command line, e.g. > install_command = my_script.sh param1 param2 I think keeping the same convention for parameter passing for custom scripts makes it easier to make custom scripts that behave similarly to the predefined rules, but with just a few differences. Also, can't the install rule be used on the cartesian configuration file? In this case, the install parameters may be specified on a different config rule. For example, the Fedora project could use it like this: cvs_server = "cvs.fedoraproject.org:/..." variants: - CVSF10: cvs_branch = F10 - CVSF11: cvs_branch = F11 - CVSRawhide: cvs_branch = devel variants: - install: type = kvm_install mode = custom install_command = "install_from_fedora_cvs.sh" - ... I used Fedora CVS as an example, but the user may use anything we can imagine, to store KVM code (or pointer to its), possibly having different branches. -- Eduardo