Merge lp:~sergiusens/snappy/envvar_store_id into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Sergio Schvezov
Status: Merged
Approved by: Michael Vogt
Approved revision: 655
Merged at revision: 657
Proposed branch: lp:~sergiusens/snappy/envvar_store_id
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 13 lines (+3/-1)
1 file modified
snappy/snapp.go (+3/-1)
To merge this branch: bzr merge lp:~sergiusens/snappy/envvar_store_id
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+270428@code.launchpad.net

Commit message

Allow overriding the storeID with an environment variable

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

Nice!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/snapp.go'
2--- snappy/snapp.go 2015-09-04 09:42:44 +0000
3+++ snappy/snapp.go 2015-09-08 16:45:06 +0000
4@@ -1723,7 +1723,9 @@
5 req.Header.Set("X-Ubuntu-Architecture", string(Architecture()))
6 req.Header.Set("X-Ubuntu-Release", release.String())
7
8- if storeID := StoreID(); storeID != "" {
9+ if storeID := os.Getenv("UBUNTU_STORE_ID"); storeID != "" {
10+ req.Header.Set("X-Ubuntu-Store", storeID)
11+ } else if storeID := StoreID(); storeID != "" {
12 req.Header.Set("X-Ubuntu-Store", storeID)
13 }
14

Subscribers

People subscribed via source and target branches