On 01/19/2012 09:45 AM, Kristóf Katus wrote: > Hi there, > > is it possible to add a new variant to an already defined variants block from > another included Cartesian config file? The variants blocks themselves are not > named as far as I can see, so it would not be that easy. Here's a very simple > example: > > # original.cfg > variants: > - 1: > - 2: > > variants: > - a: > - b: > - c: > > # overwrites.cfg > include original.cfg > > # ??? > My question here: what should I write in "overwrites.cfg", if I want to add a > variant named "3" to the first variants block parsed from "original.cfg"? And > you can have multiple embedded variants blocks in other cases of course... > Important: I do not want to modify the original config file. > > Thanks, > > Kristóf > _______________________________________________ > Autotest mailing list > [email protected] > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Hi, I don't believe this is possible exactly as you describe. The parser is line-oriented. i.e. it parses files line-by-line, moving on to other files when it hits an include (then possibly jumping back also). However, you could use top-level 'no 1' and 'no 2' statements in 'overwrites.cfg' to cause it to ignore those variants. You could then subsequently redefine them all (as a set) however you like, in overwrites.cfg Depending on how big the set is, you may find using top-level 'only a, b, c' is easier. Also, you'll find you can execute client/common_lib/cartesian_config.py against your files to experiment/test/verify the output. If you pass it the --contents parameter, it will show you the key/value for each dict as well. Hope that helps. -- Chris Evich, RHCA, RHCE, RHCDS, RHCSS Quality Assurance Engineer e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
