Type conversion and validation classes for configuration options.
Use these classes as values for the type argument to oslo_config.cfg.Opt and its subclasses.
New in version 1.3.
Boolean type.
Values are case insensitive and can be set using 1/0, yes/no, true/false or on/off.
Parameters: | type_name – Type name to be used in the sample config file. |
---|
Changed in version 2.7: Added type_name parameter.
Dictionary type.
Dictionary type values are key:value pairs separated by commas. The resulting value is a dictionary of these key/value pairs. Type of dictionary key is always string, but dictionary value type can be customized.
Parameters: |
|
---|
Changed in version 2.7: Added type_name parameter.
Float type.
Parameters: | type_name – Type name to be used in the sample config file. |
---|
Changed in version 2.7: Added type_name parameter.
Hostname type.
A hostname refers to a valid DNS or hostname. It must not be longer than 253 characters, have a segment greater than 63 characters, nor start or end with a hyphen.
Parameters: | type_name – Type name to be used in the sample config file. |
---|
IP address type
Represents either ipv4 or ipv6. Without specifying version parameter both versions are checked
Parameters: |
|
---|
Changed in version 2.7: Added type_name parameter.
Integer type.
Converts value to an integer optionally doing range checking. If value is whitespace or empty string will return None.
Parameters: |
|
---|
Changed in version 2.4: The class now honors zero for min and max parameters.
Changed in version 2.7: Added type_name parameter.
Changed in version 3.2: Added choices parameter.
List type.
Represent values of other (item) type, separated by commas. The resulting value is a list containing those values.
List doesn’t know if item type can also contain commas. To workaround this it tries the following: if the next part fails item validation, it appends comma and next item until validation succeeds or there is no parts left. In the later case it will signal validation error.
Parameters: |
|
---|
Changed in version 2.7: Added type_name parameter.
Multi-valued string.
Return a list of formatted default values.
String type.
String values do not get transformed and are returned as str objects.
Parameters: |
|
---|
Changed in version 2.1: Added regex parameter.
Changed in version 2.5: Added ignore_case parameter.
Changed in version 2.7: Added max_length parameter. Added type_name parameter.