charm config default values are broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Medium
|
Unassigned |
Bug Description
There are two (probably) related issue here.
Given a charm with a config.yaml that contains:
```
options:
option_name:
type: string
default:
```
I expect the following:
1) when reading the config in the charm, the default value should be the empty string.
2) When displaying the config in the CLI with 'juju config <service_name>' the value should be displayed as '' or "" (assuming I haven't set a config value yet).
What actually happens:
1) The charm gets 'None' as the value, which is odd, since I've explicitly said that the config type should be 'string'.
2) the 'juju config' command shows:
```
settings:
option_name:
default: true
type: string
description: "some description"
```
...which makes no sense at all. Where does 'true' come from?
I agree that the output is confusing (especially with respect to the input, i.e. metadata.yaml meanings). However, this was always the case.
"default" in the output is a boolean as it's an indication that the value is the same as the charm's default value.
The "none" value requires a bit more explaining. Essentially, when you did not specify a value, you wanted it to be 'nil'. However, internally nil values have special meaning. To differentiate between a special meaning and the fact that user actually wanted a nil value, we use 'None'. If you wanted an empty value, for string type settings, please specify empty string ("" or equivalent).