summaryrefslogtreecommitdiff
diff options
-rw-r--r--overlord/snapstate/snapstate.go4
-rw-r--r--overlord/snapstate/snapstate_test.go12
2 files changed, 8 insertions, 8 deletions
diff --git a/overlord/snapstate/snapstate.go b/overlord/snapstate/snapstate.go
index c1a5da507e..6a337054bf 100644
--- a/overlord/snapstate/snapstate.go
+++ b/overlord/snapstate/snapstate.go
@@ -983,7 +983,7 @@ func canSwitchChannel(st *state.State, snapName, newChannel string) error {
return err
}
if nch.Track != model.KernelTrack() {
- return fmt.Errorf("cannot switch from kernel track %q to %q", model.KernelTrack(), nch.String())
+ return fmt.Errorf("cannot switch from kernel track %q as specified for the (device) model to %q", model.KernelTrack(), nch.String())
}
}
if snapName == model.Gadget() && model.GadgetTrack() != "" {
@@ -992,7 +992,7 @@ func canSwitchChannel(st *state.State, snapName, newChannel string) error {
return err
}
if nch.Track != model.GadgetTrack() {
- return fmt.Errorf("cannot switch from gadget track %q to %q", model.GadgetTrack(), nch.String())
+ return fmt.Errorf("cannot switch from gadget track %q as specified for the (device) model to %q", model.GadgetTrack(), nch.String())
}
}
diff --git a/overlord/snapstate/snapstate_test.go b/overlord/snapstate/snapstate_test.go
index 3b69253b78..8100f74702 100644
--- a/overlord/snapstate/snapstate_test.go
+++ b/overlord/snapstate/snapstate_test.go
@@ -1215,7 +1215,7 @@ func (s *snapmgrTestSuite) TestSwitchKernelTrackForbidden(c *C) {
})
_, err := snapstate.Switch(s.state, "kernel", "new-channel")
- c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" to "new-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" as specified for the \(device\) model to "new-channel/stable"`)
}
func (s *snapmgrTestSuite) TestSwitchKernelTrackRiskOnlyIsOK(c *C) {
@@ -1251,7 +1251,7 @@ func (s *snapmgrTestSuite) TestSwitchGadgetTrackForbidden(c *C) {
})
_, err := snapstate.Switch(s.state, "brand-gadget", "new-channel")
- c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" to "new-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" as specified for the \(device\) model to "new-channel/stable"`)
}
func (s *snapmgrTestSuite) TestSwitchGadgetTrackRiskOnlyIsOK(c *C) {
@@ -4793,7 +4793,7 @@ func (s *snapmgrTestSuite) TestUpdateKernelTrackChecksSwitchingTracks(c *C) {
// switching tracks is not ok
_, err := snapstate.Update(s.state, "kernel", "new-channel", snap.R(0), s.user.ID, snapstate.Flags{})
- c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" to "new-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" as specified for the \(device\) model to "new-channel/stable"`)
// no change to the channel is ok
_, err = snapstate.Update(s.state, "kernel", "", snap.R(0), s.user.ID, snapstate.Flags{})
@@ -4825,7 +4825,7 @@ func (s *snapmgrTestSuite) TestUpdateGadgetTrackChecksSwitchingTracks(c *C) {
// switching tracks is not ok
_, err := snapstate.Update(s.state, "brand-gadget", "new-channel", snap.R(0), s.user.ID, snapstate.Flags{})
- c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" to "new-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" as specified for the \(device\) model to "new-channel/stable"`)
// no change to the channel is ok
_, err = snapstate.Update(s.state, "brand-gadget", "", snap.R(0), s.user.ID, snapstate.Flags{})
@@ -11227,7 +11227,7 @@ version: 1.0`)
Channel: "some-channel",
}
_, err := snapstate.InstallPath(s.state, si, someSnap, "some-channel", snapstate.Flags{Required: true})
- c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" to "some-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from kernel track "18" as specified for the \(device\) model to "some-channel/stable"`)
}
func (s *snapmgrTestSuite) TestInstallPathWithMetadataChannelSwitchGadget(c *C) {
@@ -11257,7 +11257,7 @@ version: 1.0`)
Channel: "some-channel",
}
_, err := snapstate.InstallPath(s.state, si, someSnap, "some-channel", snapstate.Flags{Required: true})
- c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" to "some-channel/stable"`)
+ c.Assert(err, ErrorMatches, `cannot switch from gadget track "18" as specified for the \(device\) model to "some-channel/stable"`)
}
func (s *snapmgrTestSuite) TestInstallLayoutsChecksFeatureFlag(c *C) {