Comment 1 for bug 1130149

Revision history for this message
Roger Peppe (rogpeppe) wrote :

I thought this was fixed, but no...

the fix is in statecmd.merge:

// Merge service settings and charm schema.
func merge(serviceCfg map[string]interface{}, charmCfg map[string]charm.Option) map[string]interface{} {
 results := make(map[string]interface{})
 log.Infof("charm config %#v", charmCfg)
 log.Infof("service config %#v", serviceCfg)
 for k, v := range charmCfg {
  m := map[string]interface{}{
   "description": v.Description,
   "type": v.Type,
  }
  s, ok := serviceCfg[k]
  if ok && s != nil {
   m["value"] = s
   if v.Default != nil && reflect.DeepEqual(v.Default, s) {
    m["default"] = true
   }
  } else {
   // Breaks compatibility with py/juju (is this true any more?)
   m["value"] = v.Default
  }
  results[k] = m
 }
 return results
}