Merge lp:~cprov/snappy-proposed-image-builder/release-payload into lp:snappy-proposed-image-builder

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: 10
Merged at revision: 10
Proposed branch: lp:~cprov/snappy-proposed-image-builder/release-payload
Merge into: lp:snappy-proposed-image-builder
Diff against target: 80 lines (+9/-10)
1 file modified
snappy_proposed_image_builder/worker.py (+9/-10)
To merge this branch: bzr merge lp:~cprov/snappy-proposed-image-builder/release-payload
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Review via email: mp+260619@code.launchpad.net

Commit message

Replace hardcoded 'release' and 'channel' value by their corresponding payload values (set by the agent).

Description of the change

Replace hardcoded 'release' and 'channel' value by their corresponding payload values (set by the agent).

To post a comment you must log in.
Revision history for this message
Joe Talbott (joetalbott) wrote :

Looks good, thanks for doing this work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy_proposed_image_builder/worker.py'
2--- snappy_proposed_image_builder/worker.py 2015-05-29 19:23:55 +0000
3+++ snappy_proposed_image_builder/worker.py 2015-05-29 19:41:59 +0000
4@@ -69,6 +69,7 @@
5 try:
6 rootfs_path = download_rootfs(
7 image_name,
8+ release,
9 channel,
10 device,
11 tmpdir
12@@ -123,6 +124,7 @@
13 image_path = build_image(
14 image_name,
15 new_rootfs_path,
16+ release,
17 channel,
18 device,
19 tmpdir
20@@ -168,24 +170,22 @@
21 return MessageActions.Acknowledge
22
23
24-def download_rootfs(name, channel, device, tmpdir):
25+def download_rootfs(name, release, channel, device, tmpdir):
26 """Download the ubuntu code image, return a path to it on disk."""
27 image_path = os.path.join(tmpdir, 'snappy-proposed-{}.img'.format(name))
28
29- # The following uses hardcoded parameters for '--channel' and 'release'.
30- # It is ignoring the channel value passed in.
31 cmd = ['sudo',
32 './ubuntu-device-flash',
33 '--revision', name,
34 '--download-only',
35 'core',
36 '--device', device,
37- '--channel', 'edge',
38+ '--channel', channel,
39 '--size', '3',
40 '-o', image_path,
41 '--developer-mode',
42 '--cloud',
43- 'rolling']
44+ release]
45 check_call(cmd)
46
47 cmd = ['sudo',
48@@ -327,23 +327,21 @@
49 return new_rootfs_path
50
51
52-def build_image(name, rootfs_path, channel, device, tmpdir):
53+def build_image(name, rootfs_path, release, channel, device, tmpdir):
54 """Download the ubuntu code image, return a path to it on disk."""
55 image_path = os.path.join(tmpdir, 'snappy-proposed-{}.img'.format(name))
56- # The following uses hardcoded parameters for '--channel' and 'release'.
57- # It is ignoring the channel value passed in.
58 cmd = ['sudo',
59 './ubuntu-device-flash',
60 '--revision', name,
61 'core',
62 '--device', device,
63- '--channel', 'edge',
64+ '--channel', channel,
65 '--size', '3',
66 '--image-part', rootfs_path,
67 '-o', image_path,
68 '--developer-mode',
69 '--cloud',
70- 'rolling']
71+ release]
72 check_call(cmd)
73
74 cmd = ['sudo',
75@@ -367,6 +365,7 @@
76 image_path,
77 converted_image_path]
78 check_call(cmd)
79+
80 return converted_image_path
81
82

Subscribers

People subscribed via source and target branches