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
=== modified file 'server/acceptance/acceptanceclient.go'
--- server/acceptance/acceptanceclient.go 2014-12-08 16:31:10 +0000
+++ server/acceptance/acceptanceclient.go 2015-04-15 15:35:45 +0000
@@ -37,6 +37,7 @@
37 DeviceId string37 DeviceId string
38 Model string38 Model string
39 ImageChannel string39 ImageChannel string
40 BuildNumber int32
40 ServerAddr string41 ServerAddr string
41 ExchangeTimeout time.Duration42 ExchangeTimeout time.Duration
42 ReportPings bool43 ReportPings bool
@@ -106,14 +107,18 @@
106 return err107 return err
107 }108 }
108 proto := protocol.NewProtocol0(conn)109 proto := protocol.NewProtocol0(conn)
110 info := map[string]interface{}{
111 "device": sess.Model,
112 "channel": sess.ImageChannel,
113 }
114 if sess.BuildNumber != -1 {
115 info["build_number"] = sess.BuildNumber
116 }
109 err = proto.WriteMessage(protocol.ConnectMsg{117 err = proto.WriteMessage(protocol.ConnectMsg{
110 Type: "connect",118 Type: "connect",
111 DeviceId: sess.DeviceId,119 DeviceId: sess.DeviceId,
112 Levels: sess.Levels,120 Levels: sess.Levels,
113 Info: map[string]interface{}{121 Info: info,
114 "device": sess.Model,
115 "channel": sess.ImageChannel,
116 },
117 Authorization: sess.Auth,122 Authorization: sess.Auth,
118 Cookie: sess.GetCookie(),123 Cookie: sess.GetCookie(),
119 })124 })
120125
=== modified file 'server/acceptance/kit/cliloop.go'
--- server/acceptance/kit/cliloop.go 2014-08-20 19:48:59 +0000
+++ server/acceptance/kit/cliloop.go 2015-04-15 15:35:45 +0000
@@ -45,6 +45,7 @@
45 ReportPings bool `json:"reportPings" help:"report each Ping from the server"`45 ReportPings bool `json:"reportPings" help:"report each Ping from the server"`
46 DeviceModel string `json:"model" help:"device image model"`46 DeviceModel string `json:"model" help:"device image model"`
47 ImageChannel string `json:"imageChannel" help:"image channel"`47 ImageChannel string `json:"imageChannel" help:"image channel"`
48 BuildNumber int32 `json:"buildNumber" help:"build number"`
48}49}
4950
50func (cfg *Configuration) PickByTarget(what, productionValue, stagingValue string) (value string) {51func (cfg *Configuration) PickByTarget(what, productionValue, stagingValue string) (value string) {
@@ -75,6 +76,7 @@
75 "reportPings": true,76 "reportPings": true,
76 "model": "?",77 "model": "?",
77 "imageChannel": "?",78 "imageChannel": "?",
79 "buildNumber": -1,
78 }80 }
79)81)
8082
@@ -112,6 +114,7 @@
112 // flags114 // flags
113 Model: cfg.DeviceModel,115 Model: cfg.DeviceModel,
114 ImageChannel: cfg.ImageChannel,116 ImageChannel: cfg.ImageChannel,
117 BuildNumber: cfg.BuildNumber,
115 ReportPings: cfg.ReportPings,118 ReportPings: cfg.ReportPings,
116 }119 }
117 cfgDir := filepath.Dir(flag.Lookup("cfg@").Value.String())120 cfgDir := filepath.Dir(flag.Lookup("cfg@").Value.String())

Subscribers

People subscribed via source and target branches