If you use tl-config as your interface to the ThinLinc configuration, you are unable to remove configuration parameters. You should be able to remove configuration parameters as easy as you can add them.
Created attachment 868 [details]
Patch that adds a delete parameter option to hivetool
Note that we might want to add a confirmation and a "-force" flag to this as well.
Looking at subclusters and profiles we can see that not only parameters are subject to modification from the administrator, but also entire sections.
An admin can add a new section using tl-config, that means he should also be able to remove it.
Note that the attached patch only handles deleting parameters, and not sections.
There is code in hiveconf that is meant to be able to delete sections but it doesn't work very well. Sections are what hiveconf writes to file for the data-structure called "Folder". If we have the section [/A/B] that means we have a folder A, with a subfolder B.
Currently if Folder.delete() is called, in the .hconf file it will remove the section-line AND one additional line, no matter what that next line contains.
If you have the following content in your .hconf:
p1 = val1
p2 = val2
and call delete() on the folder "B" the result will be that the folder "C" will also get removed, and the parameter "p2" will now belong to the folder "A".
We added a FIXME for this in the offending code. This is not trivial to fix however, since it's not clear what the expected behaviour should be.
When parsing the configuration all Parameters belong to a Folder. That causes me to think that when removing a Folder or a "section", all the Parameters, and possibly all the subfolders, should be removed as well. So a Folder.delete() would result in removing all lines in between that section in the file, and the next section (or the end of file).
With the above line of thinking we run into some complications:
* How do we handle comments? The rest of the code never modifies any comments. The admin could also have a comment regarding the section ABOVE the section itself.
* What should happen if a section exists in multiple files?
Perhaps the best path forward would be that Folder.delete() causes the section to be commented-out.