Merge lp:~pedronis/ubuntu-push/acceptanceclient-send-build-num into lp:ubuntu-push/automatic

Proposed by Samuele Pedroni
Status: Merged
Approved by: Samuele Pedroni
Approved revision: 395
Merged at revision: 394
Proposed branch: lp:~pedronis/ubuntu-push/acceptanceclient-send-build-num
Merge into: lp:ubuntu-push/automatic
Diff against target: 65 lines (+15/-7)
2 files modified
server/acceptance/acceptanceclient.go (+12/-7)
server/acceptance/kit/cliloop.go (+3/-0)
To merge this branch: bzr merge lp:~pedronis/ubuntu-push/acceptanceclient-send-build-num
Reviewer Review Type Date Requested Status
Bret Barker (community) Approve
Review via email: mp+256346@code.launchpad.net

Commit message

let send a build number with acceptanceclient

Description of the change

let send a build number with acceptanceclient

To post a comment you must log in.
395. By Samuele Pedroni

let send build num 0

Revision history for this message
Bret Barker (noise) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/acceptance/acceptanceclient.go'
2--- server/acceptance/acceptanceclient.go 2014-12-08 16:31:10 +0000
3+++ server/acceptance/acceptanceclient.go 2015-04-15 15:35:45 +0000
4@@ -37,6 +37,7 @@
5 DeviceId string
6 Model string
7 ImageChannel string
8+ BuildNumber int32
9 ServerAddr string
10 ExchangeTimeout time.Duration
11 ReportPings bool
12@@ -106,14 +107,18 @@
13 return err
14 }
15 proto := protocol.NewProtocol0(conn)
16+ info := map[string]interface{}{
17+ "device": sess.Model,
18+ "channel": sess.ImageChannel,
19+ }
20+ if sess.BuildNumber != -1 {
21+ info["build_number"] = sess.BuildNumber
22+ }
23 err = proto.WriteMessage(protocol.ConnectMsg{
24- Type: "connect",
25- DeviceId: sess.DeviceId,
26- Levels: sess.Levels,
27- Info: map[string]interface{}{
28- "device": sess.Model,
29- "channel": sess.ImageChannel,
30- },
31+ Type: "connect",
32+ DeviceId: sess.DeviceId,
33+ Levels: sess.Levels,
34+ Info: info,
35 Authorization: sess.Auth,
36 Cookie: sess.GetCookie(),
37 })
38
39=== modified file 'server/acceptance/kit/cliloop.go'
40--- server/acceptance/kit/cliloop.go 2014-08-20 19:48:59 +0000
41+++ server/acceptance/kit/cliloop.go 2015-04-15 15:35:45 +0000
42@@ -45,6 +45,7 @@
43 ReportPings bool `json:"reportPings" help:"report each Ping from the server"`
44 DeviceModel string `json:"model" help:"device image model"`
45 ImageChannel string `json:"imageChannel" help:"image channel"`
46+ BuildNumber int32 `json:"buildNumber" help:"build number"`
47 }
48
49 func (cfg *Configuration) PickByTarget(what, productionValue, stagingValue string) (value string) {
50@@ -75,6 +76,7 @@
51 "reportPings": true,
52 "model": "?",
53 "imageChannel": "?",
54+ "buildNumber": -1,
55 }
56 )
57
58@@ -112,6 +114,7 @@
59 // flags
60 Model: cfg.DeviceModel,
61 ImageChannel: cfg.ImageChannel,
62+ BuildNumber: cfg.BuildNumber,
63 ReportPings: cfg.ReportPings,
64 }
65 cfgDir := filepath.Dir(flag.Lookup("cfg@").Value.String())

Subscribers

People subscribed via source and target branches