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

Proposed by Michael Vogt
Status: Merged
Merged at revision: 711
Proposed branch: lp:snappy/15.04
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 152 lines (+68/-48)
3 files modified
coreconfig/config.go (+12/-3)
coreconfig/config_test.go (+12/-0)
docs/oem.md (+44/-45)
To merge this branch: bzr merge lp:snappy/15.04
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+271625@code.launchpad.net

Description of the change

Merge fixes from 15.04 back into trunk.

To post a comment you must log in.
lp:snappy/15.04 updated
709. By David Callé

Markdown fix in docs/oem.md by davidc3 approved by mvo

710. By Federico Gimenez

Avoid a panic when coreconfig is given invalid config. by chipaca approved by mvo

711. By Michael Vogt

merged lp:snappy

Revision history for this message
John Lenton (chipaca) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'coreconfig/config.go'
--- coreconfig/config.go 2015-09-15 21:35:38 +0000
+++ coreconfig/config.go 2015-09-23 08:39:03 +0000
@@ -58,9 +58,15 @@
58 watchdogStartupPath = "/etc/default/watchdog"58 watchdogStartupPath = "/etc/default/watchdog"
59)59)
6060
61// ErrInvalidUnitStatus signals that a unit is not returning a status61var (
62// of "enabled" or "disabled".62 // ErrInvalidUnitStatus signals that a unit is not returning a status
63var ErrInvalidUnitStatus = errors.New("invalid unit status")63 // of "enabled" or "disabled".
64 ErrInvalidUnitStatus = errors.New("invalid unit status")
65
66 // ErrInvalidConfig is returned from Set when the value
67 // provided is not a valid configuration string.
68 ErrInvalidConfig = errors.New("invalid ubuntu-core configuration")
69)
6470
65type systemConfig struct {71type systemConfig struct {
66 Autopilot *bool `yaml:"autopilot,omitempty"`72 Autopilot *bool `yaml:"autopilot,omitempty"`
@@ -194,6 +200,9 @@
194 return "", err200 return "", err
195 }201 }
196 newConfig := configWrap.Config.UbuntuCore202 newConfig := configWrap.Config.UbuntuCore
203 if newConfig == nil {
204 return "", ErrInvalidConfig
205 }
197206
198 rNewConfig := reflect.ValueOf(newConfig).Elem()207 rNewConfig := reflect.ValueOf(newConfig).Elem()
199 rType := rNewConfig.Type()208 rType := rNewConfig.Type()
200209
=== modified file 'coreconfig/config_test.go'
--- coreconfig/config_test.go 2015-09-15 21:36:22 +0000
+++ coreconfig/config_test.go 2015-09-23 08:39:03 +0000
@@ -148,6 +148,18 @@
148 c.Assert(rawConfig, Equals, expected)148 c.Assert(rawConfig, Equals, expected)
149}149}
150150
151func (cts *ConfigTestSuite) TestSetBadValueDoesNotPanic(c *C) {
152 for _, s := range []string{
153 "",
154 "\n",
155 "config:\n",
156 "config:\n ubuntu-core:\n",
157 } {
158 _, err := Set(s)
159 c.Assert(err, Equals, ErrInvalidConfig)
160 }
161}
162
151// TestSetTimezone is a broad test, close enough to be an integration test.163// TestSetTimezone is a broad test, close enough to be an integration test.
152func (cts *ConfigTestSuite) TestSetTimezone(c *C) {164func (cts *ConfigTestSuite) TestSetTimezone(c *C) {
153 // TODO figure out if we care about exact output or just want valid yaml.165 // TODO figure out if we care about exact output or just want valid yaml.
154166
=== modified file 'docs/oem.md'
--- docs/oem.md 2015-09-11 20:13:00 +0000
+++ docs/oem.md 2015-09-23 08:39:03 +0000
@@ -193,48 +193,47 @@
193193
194As an example194As an example
195195
196```yaml196
197name: beagleboneblack.sergiusens197 name: beagleboneblack.sergiusens
198vendor: Sergio Schvezov <sergiusens@gmail.com>198 vendor: Sergio Schvezov <sergiusens@gmail.com>
199icon: meta/element14.png199 icon: meta/element14.png
200version: 1.1200 version: 1.1
201type: oem201 type: oem
202202
203config:203 config:
204 ubuntu-core:204 ubuntu-core:
205 hostname: myhostname205 hostname: myhostname
206 no-cloud: true206 no-cloud: true
207 config-example.canonical:207 config-example.canonical:
208 msg: Yay!208 msg: Yay!
209209
210immutable-config:210 immutable-config:
211 - ubuntu-core/services/*211 - ubuntu-core/services/*
212 - webdm/*212 - webdm/*
213213
214oem:214 oem:
215 store:215 store:
216 id: mystore216 id: mystore
217 branding:217 branding:
218 name: Beagle Bone Black218 name: Beagle Bone Black
219 logo: logo.png219 logo: logo.png
220 software:220 software:
221 built-in:221 built-in:
222 - webdm222 - webdm
223 preinstalled:223 preinstalled:
224 - system-status.victor224 - system-status.victor
225 - pastebinit.mvo225 - pastebinit.mvo
226 - config-example.canonical226 - config-example.canonical
227 hardware:227 hardware:
228 platform: am335x-boneblack228 platform: am335x-boneblack
229 architecture: armhf229 architecture: armhf
230 partition-layout: system-AB230 partition-layout: system-AB
231 bootloader: u-boot231 bootloader: u-boot
232 boot-assets:232 boot-assets:
233 files:233 files:
234 - path: uEnv.txt234 - path: uEnv.txt
235 raw-files:235 raw-files:
236 - path: MLO236 - path: MLO
237 offset: 131072 # 128 * 1024237 offset: 131072 # 128 * 1024
238 - path: u-boot.img238 - path: u-boot.img
239 offset: 393216 # 384 * 1024239 offset: 393216 # 384 * 1024
240```

Subscribers

People subscribed via source and target branches