juju get incorrectly reports boolean default values

Bug #1496639 reported by Brad Marshall
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Menno Finlay-Smits
1.25
Fix Released
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
Tim Penhey (thumper)
Changed in juju-core:
status: New → Triaged
Tim Penhey (thumper)
Changed in juju-core:
assignee: nobody → Menno Smits (menno.smits)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

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.

Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

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
Revision history for this message
Paul Gear (paulgear) wrote :

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".

Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

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
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

Documentation improvement for 1.25: https://github.com/juju/juju/pull/3338

Revision history for this message
Paul Gear (paulgear) wrote :

Thanks Menno - that's definitely a good documentation improvement.

Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :
Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

I've also added a note about revisiting this in our Juju 2.0 docs.

Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Gema Gomez (gema)
tags: added: sts
no longer affects: juju-core/2.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.