User story #10507
closedGeneric method to edit separate parameters in key="values" line
Description
The idea is to develop a generic method, that can ensure that one parameter exists in a list of parameters, on one single line, in the right hand side of a key=value line, where all parameters are separated by a unique character (presumably different than the key-value seperator - '=' in this example, but this may actually not be a limitation). It would look something like this:
file_edit_line_key_value_ensure_parameter_in_list(file_name, key, key_value_separator, parameter, parameter_separator)
Where:
- file_name is a string with the full path to the file to look into ("/etc/default/grub", for example)
- key is a string with the full key name ("GRUB_CMDLINE_XEN" for example)
- key_value_separator is a character used to separate key and value in a key-value line ("=" in example)
- parameter is a string representing the sub-value to ensure is present in the list of parameters that form the value part of that line. If missing, it will be added (probably at the end) ("dom0_max_vcpus=32" in example below)
- parameter_separator is a character used to separate parameters in the list (" " in example)
In file /etc/default/grub
GRUB_CMDLINE_XEN="dom0_mem=16G"
calling the method would result in
GRUB_CMDLINE_XEN="dom0_mem=16G dom0_max_vcpus=32"
Updated by Nicolas CHARLES over 7 years ago
- Tracker changed from Bug to User story
Updated by Nicolas CHARLES over 7 years ago
- Status changed from New to In progress
- Assignee set to Nicolas CHARLES
Updated by Nicolas CHARLES over 7 years ago
- Status changed from In progress to Pending technical review
- Pull Request set to https://github.com/Normation/ncf/pull/558
Updated by Nicolas CHARLES over 7 years ago
- Status changed from Pending technical review to In progress
Updated by Nicolas CHARLES over 7 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Nicolas CHARLES to Alexis Mousset
Updated by Nicolas CHARLES over 7 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset 2796ba91354ee49f0ab862f6e3a89524a12d9f74.
Updated by Nicolas CHARLES over 7 years ago
- Related to User story #10561: Generic method to remove separate parameters in key="values" line added
Updated by Vincent MEMBRÉ about 7 years ago
- Status changed from Pending release to Released
Updated by François ARMAND over 5 years ago
- Related to Bug #15387: Clean-up Jetty abort on boot added
Updated by François ARMAND over 5 years ago
- Related to deleted (Bug #15387: Clean-up Jetty abort on boot)
Updated by Alexis Mousset over 2 years ago
- Target version changed from 0.x to ncf-0.x
Updated by Alexis Mousset over 2 years ago
- Project changed from 41 to Rudder
- Category changed from Generic methods to Generic methods