Merge lp:~mvo/ubuntu-system-image/server-azure-device into lp:ubuntu-system-image/server

Proposed by Michael Vogt
Status: Merged
Merged at revision: 253
Proposed branch: lp:~mvo/ubuntu-system-image/server-azure-device
Merge into: lp:ubuntu-system-image/server
Diff against target: 59 lines (+11/-6)
2 files modified
lib/systemimage/generators.py (+9/-5)
tests/test_generators.py (+2/-1)
To merge this branch: bzr merge lp:~mvo/ubuntu-system-image/server-azure-device
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+242139@code.launchpad.net

Description of the change

This makes cdimage-device-raw more generic by supporting a device_name
so that we can support a different device tarfile for azure

To post a comment you must log in.
254. By Michael Vogt

device_name is azure_amd64

255. By Michael Vogt

fix rootfs lookup

256. By Michael Vogt

pep8 fix

257. By Michael Vogt

fix test coverage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/systemimage/generators.py'
2--- lib/systemimage/generators.py 2014-11-14 10:16:22 +0000
3+++ lib/systemimage/generators.py 2014-11-18 23:15:56 +0000
4@@ -368,7 +368,7 @@
5 arch = "armhf"
6 if environment['device_name'] in ("generic_x86", "generic_i386"):
7 arch = "i386"
8- elif environment['device_name'] in ("generic_amd64",):
9+ elif environment['device_name'] in ("generic_amd64", "azure_amd64"):
10 arch = "amd64"
11
12 # Check that the directory exists
13@@ -703,6 +703,8 @@
14 arch = "i386"
15 elif environment['device_name'] in ("generic_amd64",):
16 arch = "amd64"
17+ elif environment['device_name'] == "azure_amd64":
18+ arch = "amd64.azure"
19
20 # Check that the directory exists
21 if not os.path.exists(cdimage_path):
22@@ -715,10 +717,11 @@
23 continue
24
25 # Check for the custom tarball
26- raw_device_path = os.path.join(cdimage_path, version,
27- "%s-preinstalled-%s-%s.device.tar.gz" %
28- (series, options.get("product", "core"),
29- arch))
30+ raw_device_path = os.path.join(
31+ cdimage_path, version,
32+ "%s-preinstalled-%s-%s.device.tar.gz" %
33+ (series, options.get("product", "core"),
34+ arch))
35 if not os.path.exists(raw_device_path):
36 continue
37
38@@ -783,6 +786,7 @@
39 metadata['series'] = series
40 metadata['raw_device_path'] = raw_device_path
41 metadata['raw_device_checksum'] = raw_device_hash
42+ metadata['device'] = environment.get('device_name', 'none')
43
44 with open(path.replace(".tar.xz", ".json"), "w+") as fd:
45 fd.write("%s\n" % json.dumps(metadata, sort_keys=True,
46
47=== modified file 'tests/test_generators.py'
48--- tests/test_generators.py 2014-11-14 14:59:34 +0000
49+++ tests/test_generators.py 2014-11-18 23:15:56 +0000
50@@ -363,7 +363,8 @@
51 for device_arch, cdimage_arch in (
52 ("generic_x86", "i386"),
53 ("generic_i386", "i386"),
54- ("generic_amd64", "amd64")):
55+ ("generic_amd64", "amd64"),
56+ ("azure_amd64", "amd64.azure")):
57 environment['device_name'] = device_arch
58
59 for filename in (

Subscribers

People subscribed via source and target branches

to all changes: