Skip to content

Commit

Permalink
daemon: avoid changing existing ConnRef
Browse files Browse the repository at this point in the history
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Jul 13, 2018
1 parent df33bd3 commit 039be9e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions daemon/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1799,12 +1799,12 @@ func getLegacyConnections(c *Command, r *http.Request, user *auth.UserState) Res
slotConns := map[string][]interfaces.PlugRef{}

for _, cref := range ifaces.Connections {
cref.PlugRef.Snap = ifacestate.RemapSnapToResponse(cref.PlugRef.Snap)
cref.SlotRef.Snap = ifacestate.RemapSnapToResponse(cref.SlotRef.Snap)
plugID := cref.PlugRef.String()
slotID := cref.SlotRef.String()
plugConns[plugID] = append(plugConns[plugID], cref.SlotRef)
slotConns[slotID] = append(slotConns[slotID], cref.PlugRef)
plugRef := interfaces.PlugRef{Snap: ifacestate.RemapSnapToResponse(cref.PlugRef.Snap), Name: cref.PlugRef.Name}
slotRef := interfaces.SlotRef{Snap: ifacestate.RemapSnapToResponse(cref.SlotRef.Snap), Name: cref.SlotRef.Name}
plugID := plugRef.String()
slotID := slotRef.String()
plugConns[plugID] = append(plugConns[plugID], slotRef)
slotConns[slotID] = append(slotConns[slotID], plugRef)
}

for _, plug := range ifaces.Plugs {
Expand Down

0 comments on commit 039be9e

Please sign in to comment.