juju set is overloaded

Bug #1194945 reported by David Britton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Frank Mueller

Bug Description

When you run:

  juju set option=

in juju-core you actually have the perhaps unintended side-effect of setting back to a default value, rather than setting an empty string, or even unsetting the option.

This behavior should really be made more explicit with something like

    juju set --default <option> [ <option1> [...]]

Then, you can use

    juju set option=

to probably inject an empty string into the value of an option.

Related branches

William Reade (fwereade)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
Frank Mueller (themue)
Changed in juju-core:
assignee: nobody → Frank Mueller (themue)
Revision history for this message
Roger Peppe (rogpeppe) wrote :

+1 to the suggestion for a way to get juju set to reset to values.

I think I like "juju set --default" too - another alternative might be "--reset".

There was a suggestion that this might not be sufficient, because
we might want to set values to default in the same transaction
that we set values to explicit values. I can't see a compelling case
for that. If we really want to do that, we can use juju set followed
by juju set --default.

For example, if a charm has two config values, "user" and "password"
where password has a default value of "letmein" and the user
wants to reset the password to its default value while also changing
the user name, she could do:

    juju set user=anonymous password=letmein
    juju set --default password

The charm should see the user name and password change
once, in a single transaction, but if the charm is upgraded
and the default password happens to change, the password
value will change as appropriate.

Frank Mueller (themue)
Changed in juju-core:
status: Triaged → In Progress
Frank Mueller (themue)
Changed in juju-core:
milestone: none → 1.15.0
Frank Mueller (themue)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
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.