Merge lp:~chipaca/snappy/no-inactive-service-ops into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by John Lenton
Status: Merged
Approved by: Michael Vogt
Approved revision: 760
Merged at revision: 761
Proposed branch: lp:~chipaca/snappy/no-inactive-service-ops
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~chipaca/snappy/current-lightweight
Diff against target: 43 lines (+21/-1)
2 files modified
snappy/service.go (+4/-0)
snappy/service_test.go (+17/-1)
To merge this branch: bzr merge lp:~chipaca/snappy/no-inactive-service-ops
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+274041@code.launchpad.net

Commit message

Only run service commands on active parts.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for fixing this issue!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/service.go'
2--- snappy/service.go 2015-09-25 15:27:11 +0000
3+++ snappy/service.go 2015-10-10 10:41:57 +0000
4@@ -72,6 +72,10 @@
5
6 foundSnap := false
7 for _, part := range installed {
8+ if !part.IsActive() {
9+ continue
10+ }
11+
12 snap, ok := part.(*SnapPart)
13 if !ok {
14 // can't happen
15
16=== modified file 'snappy/service_test.go'
17--- snappy/service_test.go 2015-09-25 15:27:11 +0000
18+++ snappy/service_test.go 2015-10-10 10:41:57 +0000
19@@ -80,7 +80,23 @@
20 c.Assert(os.MkdirAll(filepath.Join(dirs.GlobalRootDir, "/etc/systemd/system/multi-user.target.wants"), 0755), IsNil)
21 systemd.SystemctlCmd = s.myRun
22 systemd.JournalctlCmd = s.myJctl
23- makeInstalledMockSnap(dirs.GlobalRootDir, "")
24+ _, err := makeInstalledMockSnap(dirs.GlobalRootDir, `name: hello-app
25+version: 1.09
26+vendor: mvo@ubuntu
27+services:
28+ - name: svc1
29+ start: bin/hello
30+`)
31+ c.Assert(err, IsNil)
32+ f, err := makeInstalledMockSnap(dirs.GlobalRootDir, `name: hello-app
33+version: 1.10
34+vendor: mvo@ubuntu
35+services:
36+ - name: svc1
37+ start: bin/hello
38+`)
39+ c.Assert(err, IsNil)
40+ c.Assert(makeSnapActive(f), IsNil)
41 s.i = 0
42 s.argses = nil
43 s.errors = nil

Subscribers

People subscribed via source and target branches