Merge lp:~mterry/snappy/rollback-reboot into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Michael Terry on 2015-06-04
Status: Merged
Approved by: Michael Terry on 2015-06-04
Approved revision: 487
Merged at revision: 485
Proposed branch: lp:~mterry/snappy/rollback-reboot
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 26 lines (+10/-0)
1 file modified
cmd/snappy/cmd_rollback.go (+10/-0)
To merge this branch: bzr merge lp:~mterry/snappy/rollback-reboot
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-06-04 Approve on 2015-06-04
Review via email: mp+261114@code.launchpad.net

Commit Message

When rolling back. output version info, especially any messages about rebooting to pick up the new version.

Description of the Change

When rolling back. output version info, especially any messages about rebooting to pick up the new version.

This makes "rollback" work just like "update" which makes the same output about parts it updates.

I didn't add a test. Seems like such cmd tests tend to go in the selftests branch.

To post a comment you must log in.
Sergio Schvezov (sergiusens) wrote :

We have no spec for this, so I'll leave it up to you.
Setting ubuntu-core to version 59
Name Date Version Developer
ubuntu-core 2015-06-03 59 ubuntu!
Reboot to use the new ubuntu-core.

How about just using showRebootMessage?
(amd64)ubuntu@localhost:~$ sudo ./snappy rollback ubuntu-core
Setting ubuntu-core to version 59
Reboot to use the new ubuntu-core.

Just to avoid the double display of version, the other option would be to remove the print for
"Setting ubuntu-core to version 59" to keep output consistency with the other commands

(amd64)ubuntu@localhost:~$ sudo ./snappy rollback ubuntu-core
Name Date Version Developer
ubuntu-core 2015-06-03 59 ubuntu!
Reboot to use the new ubuntu-core.

review: Needs Information
Michael Terry (mterry) wrote :

I hear ya. But I was trying to make it feel very similar to "update" which has the same redundant output:

===
Installing ubuntu-core (60)
Starting download of ubuntu-core
30.51 MB / 30.51 MB [====================================] 100.00 % 485.97 KB/s
Done
Name Date Version Developer
ubuntu-core 2015-06-04 60 ubuntu!
Reboot to use the new ubuntu-core.
===

But if you still prefer, I'm happy to remove the "Setting ubuntu-core to version 59" bit.

Sergio Schvezov (sergiusens) wrote :

> But if you still prefer, I'm happy to remove the "Setting ubuntu-core to
> version 59" bit.

Well at least we are on the same page, I guess we want the first print since on armhf the time between some feedback and this will not be instant.

We probably need a spinner here instead.

review: Approve
lp:~mterry/snappy/rollback-reboot updated on 2015-06-04
486. By Michael Terry on 2015-06-04

Move notice about rolling back up a bit

487. By Michael Terry on 2015-06-04

Move print back, version isn't available yet

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/snappy/cmd_rollback.go'
2--- cmd/snappy/cmd_rollback.go 2015-05-19 14:09:19 +0000
3+++ cmd/snappy/cmd_rollback.go 2015-06-04 19:02:18 +0000
4@@ -21,6 +21,7 @@
5
6 import (
7 "fmt"
8+ "os"
9
10 "launchpad.net/snappy/logger"
11 "launchpad.net/snappy/priv"
12@@ -69,5 +70,14 @@
13 }
14 fmt.Printf("Setting %s to version %s\n", pkg, nowVersion)
15
16+ m := snappy.NewMetaRepository()
17+ installed, err := m.Installed()
18+ if err != nil {
19+ return err
20+ }
21+
22+ parts := snappy.FindSnapsByNameAndVersion(pkg, nowVersion, installed)
23+ showVerboseList(parts, os.Stdout)
24+
25 return nil
26 }

Subscribers

People subscribed via source and target branches