summaryrefslogtreecommitdiff
diff options
authorPawel Stolowski <stolowski@gmail.com>2018-10-05 15:52:42 +0200
committerPawel Stolowski <stolowski@gmail.com>2018-10-05 15:52:42 +0200
commit77fe40701c6aab592d2302e65e67e79f028c00b0 (patch)
tree01bee296b3846767e45f07e05088cf4435aa77fa
parent2315e347e4385d69261e891616deb26aad0a02cf (diff)
Renamed patch 61 to 6_1.static-attrs-patch
-rw-r--r--overlord/patch/patch6.go2
-rw-r--r--overlord/patch/patch6_1.go (renamed from overlord/patch/patch61.go)12
-rw-r--r--overlord/patch/patch6_1_test.go (renamed from overlord/patch/patch61_test.go)4
3 files changed, 9 insertions, 9 deletions
diff --git a/overlord/patch/patch6.go b/overlord/patch/patch6.go
index 1246987fd6..f389a1c308 100644
--- a/overlord/patch/patch6.go
+++ b/overlord/patch/patch6.go
@@ -25,7 +25,7 @@ import (
)
func init() {
- patches[6] = []PatchFunc{patch6, patch61}
+ patches[6] = []PatchFunc{patch6, patch6_1}
}
type patch6Flags struct {
diff --git a/overlord/patch/patch61.go b/overlord/patch/patch6_1.go
index ceaaad8c83..e52ce569f3 100644
--- a/overlord/patch/patch61.go
+++ b/overlord/patch/patch6_1.go
@@ -25,7 +25,7 @@ import (
"github.com/snapcore/snapd/snap"
)
-type connStatePatch61 struct {
+type connStatePatch6_1 struct {
Auto bool `json:"auto,omitempty"`
ByGadget bool `json:"by-gadget,omitempty"`
Interface string `json:"interface,omitempty"`
@@ -39,7 +39,7 @@ type connStatePatch61 struct {
// processConns updates conns map and augments it with plug-static and slot-static attributes from current snap info.
// NOTE: missing snap or missing plugs/slots are ignored and not reported as errors as we might have stale connections
// and ifacemgr deals with them (i.e. discards) on startup; we want to process all good slots and plugs here.
-func processConns(conns map[string]connStatePatch61, infos map[string]*snap.Info) (bool, error) {
+func processConns(conns map[string]connStatePatch6_1, infos map[string]*snap.Info) (bool, error) {
var updated bool
for id, conn := range conns {
// static attributes already present
@@ -94,9 +94,9 @@ func processConns(conns map[string]connStatePatch61, infos map[string]*snap.Info
return updated, nil
}
-// patch61:
+// patch6_1:
// - add static plug and slot attributes to connections that miss them. Attributes are read from current snap info.
-func patch61(st *state.State) error {
+func patch6_1(st *state.State) error {
infos := make(map[string]*snap.Info)
// update all pending "discard-conns" tasks as they may keep connection data in "removed".
@@ -105,7 +105,7 @@ func patch61(st *state.State) error {
continue
}
- var removed map[string]connStatePatch61
+ var removed map[string]connStatePatch6_1
if task.Kind() == "discard-conns" {
err := task.Get("removed", &removed)
if err == state.ErrNoState {
@@ -127,7 +127,7 @@ func patch61(st *state.State) error {
}
// update conns
- var conns map[string]connStatePatch61
+ var conns map[string]connStatePatch6_1
err := st.Get("conns", &conns)
if err == state.ErrNoState {
// no connections to process
diff --git a/overlord/patch/patch61_test.go b/overlord/patch/patch6_1_test.go
index 35f4ef4d73..db10545c40 100644
--- a/overlord/patch/patch61_test.go
+++ b/overlord/patch/patch6_1_test.go
@@ -37,7 +37,7 @@ type patch61Suite struct{}
var _ = Suite(&patch61Suite{})
-var statePatch61JSON = []byte(`
+var statePatch6_1JSON = []byte(`
{
"last-task-id": 999,
"last-change-id": 99,
@@ -188,7 +188,7 @@ func (s *patch61Suite) SetUpTest(c *C) {
err := os.MkdirAll(filepath.Dir(dirs.SnapStateFile), 0755)
c.Assert(err, IsNil)
- err = ioutil.WriteFile(dirs.SnapStateFile, statePatch61JSON, 0644)
+ err = ioutil.WriteFile(dirs.SnapStateFile, statePatch6_1JSON, 0644)
c.Assert(err, IsNil)
snap.MockSanitizePlugsSlots(func(*snap.Info) {})