[Avocado-devel] RFC: Configuration by convention

Cleber Rosa crosa at redhat.com
Wed Dec 4 17:31:03 UTC 2019


On Wed, Dec 04, 2019 at 07:19:30PM +0200, Plamen Dimitrov wrote:
> Hi Cleber,
> 
> On 12/4/19 7:06 PM, Cleber Rosa wrote:
> >> I would suggest simply using the a single "core" keyword here. It is explicit
> >> and we always know that everything that is not "core" relates to some plugin
> >> with its unique suffix (e.g. "vt" above).
> >>
> > That may work, but may also lead to configuration entries that are rather
> > long because of the lack of specificity of the section name.  So, instead
> > of:
> > 
> >   [sysinfo.collect]
> >   enabled = True
> > 
> > We would have
> > 
> >   [core]
> >   sysinfo_collect_enabled = True
> > 
> > I'm not arguing against it, but just making it clear.  In fact, it may
> > even make things simpler wrt to the upcoming discussion on the Job
> > API.
> > 
> 
> This seems ok but may lead to a lot of redundant prefixes for the parameter names
> like "sysinfo_option1", ... "sysinfo_optionN" while the section name is generally
> meant to generalize over the specific parameters. How about
> 
> [core.sysinfo]
> collect_enabled = True
> 
> instead? We could have multiple "core.x" subsections in the same fashion as above.
> Does that seem feasible or there could be I problem with it I didn't foresee?
> 
> Best,
> Plamen
> 

Yep, the common "core" prefix, with dots separating additional levels
seems like good idea.  The only limitation for plugins would be that
one could never be called "core", which should be fine! :D

- Cleber.




More information about the Avocado-devel mailing list