Oslo Generator Required Behavior

Registered by Brian Stajkowski

Required Option
----------------------
Required options in oslo-config-generator can be handled differently to assist a user in configuring such options. Options that are considered required, most likely do not have a default value and need user input to make a service functional. These options can be marked as required and pushed to the top of the section or subsection in sample files generated by oslo-config-generator. They would also be uncommented and ready for use, which if not edited would fail any kind of configuration check, if implemented.

This behavior coupled with the sample default blueprint, https://blueprints.launchpad.net/oslo.config/+spec/oslo-generator-sample-default, would provide the necessary example usages if set.

Usage
---------

Required parameter already exists as 'required':

```
cfg.StrOpt('option1',
             required=True,
             help='This is help text.'),
```

Would yield an output from olso-config-generator if default value is 'None':

```
[DEFAULT]
...
<these options are pushed to the top of the section or subsection>
...
# This is help text. (string value)
# Note: Required Option
option1 = <REQUIRES_INPUT>
```

References
---------------
[1] Cross Project Spec - https://review.openstack.org/#/c/295543
[2] http://docs.openstack.org/developer/oslo.config/opts.html
[3] https://blueprints.launchpad.net/oslo.config/+spec/oslo-generator-sample-default

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Brian Stajkowski
Direction:
Needs approval
Assignee:
Brian Stajkowski
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Brian Stajkowski
Completed by
Brian Stajkowski

Related branches

Sprints

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.