juju get does not print default values correctly
Bug #1130149 reported by
Roger Peppe
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Roger Peppe |
Bug Description
juju get should print current config values even if they are currently
set to their default values. Currently it always prints null for default values.
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I thought this was fixed, but no...
the fix is in statecmd.merge:
// Merge service settings and charm schema. interface{ }, charmCfg map[string] charm.Option) map[string] interface{ } { string] interface{ }) interface{ }{ DeepEqual( v.Default, s) {
func merge(serviceCfg map[string]
results := make(map[
log.Infof("charm config %#v", charmCfg)
log.Infof("service config %#v", serviceCfg)
for k, v := range charmCfg {
m := map[string]
"description": v.Description,
"type": v.Type,
}
s, ok := serviceCfg[k]
if ok && s != nil {
m["value"] = s
if v.Default != nil && reflect.
m["default"] = true
}
} else {
// Breaks compatibility with py/juju (is this true any more?)
m["value"] = v.Default
}
results[k] = m
}
return results
}