openQA icon indicating copy to clipboard operation
openQA copied to clipboard

Add openqa-config script for showing/changing config values

Open perlpunk opened this issue 8 months ago • 3 comments

Related issue: https://progress.opensuse.org/issues/184459

I was tired of either having to add instructions to manually edit config files, or to have to use some sed statement to manipulate a config file.

I think there can be made some improvements regarding the output. Right now it outputs human readable YAML, but I think it could also output JSON when requested, so you could process a section or the whole config file with jq for example.

perlpunk avatar Jul 16 '25 12:07 perlpunk

Note that there are some general ini manipulation scripts out there. I haven't tried them out yet. The advantage here could be that we could also show default values from OpenQA::Setup on request.

perlpunk avatar Jul 16 '25 12:07 perlpunk

There is https://github.com/pixelb/crudini which is in Leap 15.6. It doesn't have an option for JSON output unfortunately. But maybe they accept pull requests...

We would need to check if it is compatible with Config::IniFiles though

perlpunk avatar Jul 16 '25 13:07 perlpunk

I think for https://progress.opensuse.org/issues/184459 I will use crudini, it seems to work fine

perlpunk avatar Jul 16 '25 13:07 perlpunk