// fetchAllDeployedCharms returns a map from service name to service // and a map from service name to unit name to unit. func fetchAllDeployedCharms(st *state.State) (map[string]*charm.URL, error) { deployedCharms := make(map[string]*charm.URL) services, err := st.AllServices() if err != nil { return nil, err } for _, s := range services { url, _ := s.CharmURL() // Record the basic charm information so it can be bulk processed later to // get the available revision numbers from the repo. baseCharm := url.WithRevision(-1) deployedCharms[baseCharm.String()] = baseCharm } return deployedCharms, nil }