Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ignore_none_type to config template
It is sometimes useful to tell ConfigTemplateParser to write out options that are valueless and not suffixed with '=' or ':', such as when overriding a my.cnf. This commit adds the 'ignore_none_type' attribute to the config_template module. If this attribute is set to false, then valueless options will be written out to the resultant INI file as-is, without the '=' or ':' suffix. Change-Id: I5c88b2019c01b44193a5d0df9299ecce6de52f01 Partial-Bug: #1693234
- Loading branch information
Miguel Alex Cantu
committed
Jun 26, 2017
1 parent
30af082
commit 76d5f02
Showing
5 changed files
with
90 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
releasenotes/notes/config-template-ignore-none-type-9387c236853f061b.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
The config_template template module now supports writing out valueless | ||
INI options without suffixing them with '=' or ':'. This is done via the | ||
'ignore_none_type' attribute. If ignore_none_type is set to true, these | ||
key/value entries will be ignored, if it's set to false, then | ||
ConfigTemplateParser will write out only the option name without the | ||
'=' or ':' suffix. The default is true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[alfa] | ||
bravo = charlie | ||
delta = echo | ||
[foxtrot] | ||
golf = hotel | ||
india | ||
juliett kilo | ||
lima = mike |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters