[Fuego] fuego config file

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Wed Jun 13 07:09:06 UTC 2018


> -----Original Message-----
> From: Tim.Bird at sony.com [mailto:Tim.Bird at sony.com]
> Sent: Tuesday, June 12, 2018 12:36 PM
> To: daniel.sangorrin at toshiba.co.jp; fuego at lists.linuxfoundation.org
> Subject: RE: [Fuego] fuego config file
> 
> 
> 
> > -----Original Message-----
> > From: Daniel Sangorrin
> > Hi Tim,
> >
> > I see that you have created a config_class with its own syntax and parsing
> > tool.
> > Was there any reason not to use ConfigParser?
> 
> Yes, but not super strong ones  ConfigParser doesn't allow values with leading or
> trailing
> whitespace (I believe).  

This is normal behaviour, isn't it?
Why would you want leading/trailing whitespace to be recognized as part of the variable?
For example: Do you want that the following variables are different?
host_name=fuego_host
host_name= fuego_host 
I think that from the user point of view ignoring whitespace is the sane thing to do.

> Also, I'm not a big fan of the syntax they user for multi-line
> values.
> I can't tell how strict it is preserving leading and trailing whitespace of continued
> lines,
> for multi-line values. 

Right, they are stripped and newlines appear. But do we actually need multi-line values?

> Also I'm not sure I need to put stuff into sections.  I don't
> know if
> ConfigParser requires that or not. I'm using triple-quotes for that (like python
> multi-line strings).

If we don't need sections (kind of namespaces) then we can just use a 'default' section.
But I think sections are a nice thing to have.

> I don't think my syntax is difficult, but I don't have strong reasons for it, and it might
> be easier
> for users if we used ConfigParser.
> 
> If you have strong feelings about it, I'm willing to change it.

I would like to change and use ConfigParser. Specially from the point of view of maintainability, and minimization of custom code. Using ConfigParser would make the code much easier to read.
If you don't mind, I will modify this.

Also, I noticed that there was a dead function "do_set_config" but no related ftc subcommand.
How about using the following interface?

$ ftc config -g var1,var2,var3 (-g|--get: get the values of one or more variables)
var1=how
var2=are
var3=you
$ ftc config -s "var1=am, var2=I" (-s|--set: set variables)
$ ftc config -g (by default gets the values of all variables)
var1=am
var2=I
var3=you

Thanks,
Daniel






More information about the Fuego mailing list