Skip to content

Commit

Permalink
Merge pull request canonical#2805 from mvo5/improve-snap-refresh-msg
Browse files Browse the repository at this point in the history
snap: improve message after `snap refresh pkg1 pkg2`
  • Loading branch information
pedronis authored Feb 8, 2017
2 parents 8cdd462 + f8c055a commit fe0849c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daemon/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,12 +843,12 @@ func snapUpdateMany(inst *snapInstruction, st *state.State) (msg string, updated

switch len(updated) {
case 0:
// not really needed but be paranoid
if len(inst.Snaps) != 0 {
return "", nil, nil, fmt.Errorf("internal error: when asking for a refresh of %s no update was found but no error was generated", strutil.Quoted(inst.Snaps))
// TRANSLATORS: the %s is a comma-separated list of quoted snap names
msg = fmt.Sprintf(i18n.G("Refresh snaps %s: no updates"), strutil.Quoted(inst.Snaps))
} else {
msg = fmt.Sprintf(i18n.G("Refresh all snaps: no updates"))
}
// FIXME: instead don't generated a change(?) at all
msg = fmt.Sprintf(i18n.G("Refresh all snaps: no updates"))
case 1:
msg = fmt.Sprintf(i18n.G("Refresh snap %q"), updated[0])
default:
Expand Down
2 changes: 2 additions & 0 deletions tests/main/refresh/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ execute: |
cat stderr.out | MATCH "snap \"$SNAP_NAME\" has no updates available"
echo "classic snaps "
snap refresh $SNAP_NAME core 2>&1 | MATCH "All snaps up to date."

0 comments on commit fe0849c

Please sign in to comment.