Merge lp:~blake-rouse/maas/ppc64el-to-powerkvm into lp:~maas-committers/maas/trunk

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 2363
Proposed branch: lp:~blake-rouse/maas/ppc64el-to-powerkvm
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 140 lines (+21/-21)
3 files modified
src/provisioningserver/boot/__init__.py (+2/-2)
src/provisioningserver/boot/powerkvm.py (+6/-6)
src/provisioningserver/boot/tests/test_powerkvm.py (+13/-13)
To merge this branch: bzr merge lp:~blake-rouse/maas/ppc64el-to-powerkvm
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+220817@code.launchpad.net

Commit message

Rename ppc64el boot loader to PowerKVM.

Description of the change

Renames the ppc64el boot loader to PowerKVM, as it is only used for booting PowerKVM nodes. Have incoming support for PowerNV, that uses the same architecture, renaming makes it easy to distinguish.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Looks good. Mechanical refactoring.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/provisioningserver/boot/__init__.py'
--- src/provisioningserver/boot/__init__.py 2014-05-15 17:27:53 +0000
+++ src/provisioningserver/boot/__init__.py 2014-05-23 15:04:04 +0000
@@ -202,13 +202,13 @@
202# Import the supported boot methods after defining BootMethod.202# Import the supported boot methods after defining BootMethod.
203from provisioningserver.boot.pxe import PXEBootMethod203from provisioningserver.boot.pxe import PXEBootMethod
204from provisioningserver.boot.uefi import UEFIBootMethod204from provisioningserver.boot.uefi import UEFIBootMethod
205from provisioningserver.boot.ppc64el import PPC64ELBootMethod205from provisioningserver.boot.powerkvm import PowerKVMBootMethod
206206
207207
208builtin_boot_methods = [208builtin_boot_methods = [
209 PXEBootMethod(),209 PXEBootMethod(),
210 UEFIBootMethod(),210 UEFIBootMethod(),
211 PPC64ELBootMethod(),211 PowerKVMBootMethod(),
212]212]
213for method in builtin_boot_methods:213for method in builtin_boot_methods:
214 BootMethodRegistry.register_item(method.name, method)214 BootMethodRegistry.register_item(method.name, method)
215215
=== renamed file 'src/provisioningserver/boot/ppc64el.py' => 'src/provisioningserver/boot/powerkvm.py'
--- src/provisioningserver/boot/ppc64el.py 2014-05-15 17:18:18 +0000
+++ src/provisioningserver/boot/powerkvm.py 2014-05-23 15:04:04 +0000
@@ -1,7 +1,7 @@
1# Copyright 2014 Canonical Ltd. This software is licensed under the1# Copyright 2014 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""PPC64EL Boot Method"""4"""PowerKVM Boot Method"""
55
6from __future__ import (6from __future__ import (
7 absolute_import,7 absolute_import,
@@ -13,7 +13,7 @@
1313
14__metaclass__ = type14__metaclass__ = type
15__all__ = [15__all__ = [
16 'PPC64ELBootMethod',16 'PowerKVMBootMethod',
17 ]17 ]
1818
19import glob19import glob
@@ -38,10 +38,10 @@
38 """)38 """)
3939
4040
41class PPC64ELBootMethod(BootMethod):41class PowerKVMBootMethod(BootMethod):
4242
43 name = "ppc64el"43 name = "powerkvm"
44 template_subdir = "ppc64el"44 template_subdir = None
45 bootloader_path = "bootppc64.bin"45 bootloader_path = "bootppc64.bin"
46 arch_octet = "00:0C"46 arch_octet = "00:0C"
4747
@@ -58,7 +58,7 @@
58 return ""58 return ""
5959
60 def install_bootloader(self, destination):60 def install_bootloader(self, destination):
61 """Installs the required files for PPC64EL booting into the61 """Installs the required files for PowerKVM booting into the
62 tftproot.62 tftproot.
63 """63 """
64 with tempdir() as tmp:64 with tempdir() as tmp:
6565
=== renamed file 'src/provisioningserver/boot/tests/test_ppc64el.py' => 'src/provisioningserver/boot/tests/test_powerkvm.py'
--- src/provisioningserver/boot/tests/test_ppc64el.py 2014-05-15 17:18:18 +0000
+++ src/provisioningserver/boot/tests/test_powerkvm.py 2014-05-23 15:04:04 +0000
@@ -1,7 +1,7 @@
1# Copyright 2014 Canonical Ltd. This software is licensed under the1# Copyright 2014 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for `provisioningserver.boot.ppc64el`."""4"""Tests for `provisioningserver.boot.powerkvm`."""
55
6from __future__ import (6from __future__ import (
7 absolute_import,7 absolute_import,
@@ -22,39 +22,39 @@
22from maastesting.testcase import MAASTestCase22from maastesting.testcase import MAASTestCase
23from provisioningserver.boot import (23from provisioningserver.boot import (
24 BootMethodInstallError,24 BootMethodInstallError,
25 ppc64el as ppc64el_module,25 powerkvm as powerkvm_module,
26 utils,26 utils,
27 )27 )
28from provisioningserver.boot.ppc64el import (28from provisioningserver.boot.powerkvm import (
29 GRUB_CONFIG,29 GRUB_CONFIG,
30 PPC64ELBootMethod,30 PowerKVMBootMethod,
31 )31 )
32from provisioningserver.tests.test_kernel_opts import make_kernel_parameters32from provisioningserver.tests.test_kernel_opts import make_kernel_parameters
3333
3434
35class TestPPC64ELBootMethod(MAASTestCase):35class TestPowerKVMBootMethod(MAASTestCase):
36 """Tests `provisioningserver.boot.ppc64el.PPC64ELBootMethod`."""36 """Tests `provisioningserver.boot.powerkvm.PowerKVMBootMethod`."""
3737
38 def test_match_config_path_returns_none(self):38 def test_match_config_path_returns_none(self):
39 method = PPC64ELBootMethod()39 method = PowerKVMBootMethod()
40 paths = [factory.getRandomString() for _ in range(3)]40 paths = [factory.getRandomString() for _ in range(3)]
41 for path in paths:41 for path in paths:
42 self.assertEqual(None, method.match_config_path(path))42 self.assertEqual(None, method.match_config_path(path))
4343
44 def test_render_config_returns_empty_string(self):44 def test_render_config_returns_empty_string(self):
45 method = PPC64ELBootMethod()45 method = PowerKVMBootMethod()
46 params = [make_kernel_parameters() for _ in range(3)]46 params = [make_kernel_parameters() for _ in range(3)]
47 for param in params:47 for param in params:
48 self.assertEqual("", method.render_config(params))48 self.assertEqual("", method.render_config(params))
4949
50 def test_install_bootloader_get_package_raises_error(self):50 def test_install_bootloader_get_package_raises_error(self):
51 method = PPC64ELBootMethod()51 method = PowerKVMBootMethod()
52 self.patch(utils, 'get_updates_package').return_value = (None, None)52 self.patch(utils, 'get_updates_package').return_value = (None, None)
53 self.assertRaises(53 self.assertRaises(
54 BootMethodInstallError, method.install_bootloader, None)54 BootMethodInstallError, method.install_bootloader, None)
5555
56 def test_install_bootloader(self):56 def test_install_bootloader(self):
57 method = PPC64ELBootMethod()57 method = PowerKVMBootMethod()
58 filename = factory.make_name('dpkg')58 filename = factory.make_name('dpkg')
59 data = factory.getRandomString()59 data = factory.getRandomString()
60 tmp = self.make_dir()60 tmp = self.make_dir()
@@ -69,11 +69,11 @@
6969
70 mock_get_updates_package = self.patch(utils, 'get_updates_package')70 mock_get_updates_package = self.patch(utils, 'get_updates_package')
71 mock_get_updates_package.return_value = (data, filename)71 mock_get_updates_package.return_value = (data, filename)
72 self.patch(ppc64el_module, 'call_and_check')72 self.patch(powerkvm_module, 'call_and_check')
73 self.patch(ppc64el_module, 'tempdir').side_effect = tempdir73 self.patch(powerkvm_module, 'tempdir').side_effect = tempdir
7474
75 mock_install_bootloader = self.patch(75 mock_install_bootloader = self.patch(
76 ppc64el_module, 'install_bootloader')76 powerkvm_module, 'install_bootloader')
7777
78 method.install_bootloader(dest)78 method.install_bootloader(dest)
7979