juju get incorrectly reports boolean default values
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | juju-core |
High
|
Menno Finlay-Smits | ||
| | 1.25 |
High
|
Menno Finlay-Smits | ||
Bug Description
Juju get incorrectly reports (at least some) boolean default values incorrectly, but it does set them to the correct value. This makes it look like the value has been changed from the default when it hasn't.
For example, with ntp:
$ juju get ntp
charm: ntp
service: ntp
settings:
auto_peers:
default: true
description: Will ntp auto peer between the environment
type: boolean
value: false
Checking on disk in the charm's config.yaml:
auto_peers:
default: false
type: boolean
description: Will ntp auto peer between the environment
The same applies to the other boolean values I checked. The end effect is that the right setting is being deployed, but it is misleading.
$ juju --version
1.24.5-trusty-amd64
Please let me know if you need any more information.
| Changed in juju-core: | |
| importance: | Undecided → High |
| milestone: | none → 1.25-beta2 |
| Changed in juju-core: | |
| status: | New → Triaged |
| Changed in juju-core: | |
| assignee: | nobody → Menno Smits (menno.smits) |
| Changed in juju-core: | |
| status: | Triaged → In Progress |
| Menno Finlay-Smits (menno.smits) wrote : | #1 |
| Menno Finlay-Smits (menno.smits) wrote : | #2 |
I've just realised there's no bug here. The "default" field indicates if the field is at its default value. It isn't the default value for the field.
For example:
$ juju service get ntp
...
use_iburst:
default: true
description: Use iburst for all servers, not just ntpmaster
type: boolean
value: false
$ juju set ntp use_iburst=true
$ juju service get ntp
...
use_iburst:
description: Use iburst for all servers, not just ntpmaster
type: boolean
value: true
| Changed in juju-core: | |
| status: | In Progress → Invalid |
| Paul Gear (paulgear) wrote : | #3 |
Don't you think this is rather confusing for options of type boolean? At the very least it should display as "is-default: true" rather than "default: true".
| Menno Finlay-Smits (menno.smits) wrote : | #4 |
I totally agree it's confusing and it's unfortunate it's been done this way. Due to backwards compatibility requirements we can't fix this until Juju 2.0.
The best I can do is clarify the documentation and raise a ticket for fixing this when we can. Reopening this ticket so that I remember to do that.
| Changed in juju-core: | |
| status: | Invalid → Won't Fix |
| status: | Won't Fix → In Progress |
| Changed in juju-core: | |
| milestone: | 1.25-beta2 → 1.26-alpha1 |
| Menno Finlay-Smits (menno.smits) wrote : | #5 |
Documentation improvement for 1.25: https:/
| Paul Gear (paulgear) wrote : | #6 |
Thanks Menno - that's definitely a good documentation improvement.
| Menno Finlay-Smits (menno.smits) wrote : | #7 |
For master here: https:/
| Menno Finlay-Smits (menno.smits) wrote : | #8 |
I've also added a note about revisiting this in our Juju 2.0 docs.
| Changed in juju-core: | |
| status: | In Progress → Fix Committed |
| Changed in juju-core: | |
| status: | Fix Committed → Fix Released |
| tags: | added: sts |
| no longer affects: | juju-core/2.0 |


Finding so far:
The default shown for all config options by "juju get" is "true" even for non-boolean options.
The problem is with the ServiceGet API call. The client code is simply dumping out what the API call returns.