Merge ~ltrager/maas:grub_ppc64 into maas:master

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: 9743631874d906ff99f824d6ac111cc316e7ef8d
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:grub_ppc64
Merge into: maas:master
Diff against target: 57 lines (+29/-3)
2 files modified
src/provisioningserver/boot/grub.py (+5/-3)
src/provisioningserver/boot/tests/test_grub.py (+24/-0)
Reviewer Review Type Date Requested Status
Lee Trager (community) Approve
MAAS Lander unittests Pending
Review via email: mp+402378@code.launchpad.net

Commit message

Add GRUB mapping for PPC64EL

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/provisioningserver/boot/grub.py b/src/provisioningserver/boot/grub.py
2index 6143e88..72f50bf 100644
3--- a/src/provisioningserver/boot/grub.py
4+++ b/src/provisioningserver/boot/grub.py
5@@ -94,12 +94,14 @@ class UEFIAMD64BootMethod(BootMethod):
6 mac = params.get("mac")
7 if mac is not None:
8 params["mac"] = mac.replace(":", "-")
9+
10+ # MAAS uses Debian architectures while GRUB uses standard Linux
11+ # architectures.
12 arch = params.get("arch")
13 if arch == "x86_64":
14- # MAAS uses Debian architectures while GRUB uses standard Linux
15- # architectures. Convert x86_64 to amd64 as they mean the same
16- # thing.
17 params["arch"] = "amd64"
18+ elif arch in {"powerpc", "ppc64", "ppc64le"}:
19+ params["arch"] = "ppc64el"
20
21 return params
22
23diff --git a/src/provisioningserver/boot/tests/test_grub.py b/src/provisioningserver/boot/tests/test_grub.py
24index 449d7b2..064d992 100644
25--- a/src/provisioningserver/boot/tests/test_grub.py
26+++ b/src/provisioningserver/boot/tests/test_grub.py
27@@ -408,6 +408,30 @@ class TestUEFIAMD64BootMethod(MAASTestCase):
28 method.match_path(backend, b"/grub/grub.cfg-default-x86_64"),
29 )
30
31+ def test_match_path_arch_powerpc(self):
32+ method = UEFIAMD64BootMethod()
33+ backend = random.choice(["http", "tftp"])
34+ self.assertEqual(
35+ {"arch": "ppc64el"},
36+ method.match_path(backend, b"/grub/grub.cfg-default-powerpc"),
37+ )
38+
39+ def test_match_path_arch_ppc64(self):
40+ method = UEFIAMD64BootMethod()
41+ backend = random.choice(["http", "tftp"])
42+ self.assertEqual(
43+ {"arch": "ppc64el"},
44+ method.match_path(backend, b"/grub/grub.cfg-default-ppc64"),
45+ )
46+
47+ def test_match_path_arch_ppc64le(self):
48+ method = UEFIAMD64BootMethod()
49+ backend = random.choice(["http", "tftp"])
50+ self.assertEqual(
51+ {"arch": "ppc64el"},
52+ method.match_path(backend, b"/grub/grub.cfg-default-ppc64le"),
53+ )
54+
55 def test_match_path_arch_subarch(self):
56 method = UEFIAMD64BootMethod()
57 backend = random.choice(["http", "tftp"])

Subscribers

People subscribed via source and target branches