Merge ~mpontillo/maas:kvm-deploy-arm64--bug-1794560 into maas:master

Proposed by Mike Pontillo on 2018-10-12
Status: Merged
Approved by: Mike Pontillo on 2018-10-12
Approved revision: edcb18ed71da7fe563107ed0f932d9c4310f38e8
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~mpontillo/maas:kvm-deploy-arm64--bug-1794560
Merge into: maas:master
Diff against target: 34 lines (+16/-2)
2 files modified
src/metadataserver/tests/test_vendor_data.py (+8/-0)
src/metadataserver/vendor_data.py (+8/-2)
Reviewer Review Type Date Requested Status
Newell Jensen (community) 2018-10-12 Approve on 2018-10-12
Review via email: mp+356633@code.launchpad.net

Commit message

LP: #1794560 - Include qemu-efi package for AMD64 KVM pod deployments.

To post a comment you must log in.
Newell Jensen (newell-jensen) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/metadataserver/tests/test_vendor_data.py b/src/metadataserver/tests/test_vendor_data.py
2index 3b1a6d3..341717a 100644
3--- a/src/metadataserver/tests/test_vendor_data.py
4+++ b/src/metadataserver/tests/test_vendor_data.py
5@@ -242,3 +242,11 @@ class TestGenerateRackControllerConfiguration(MAASServerTestCase):
6 virsh_password_meta = NodeMetadata.objects.filter(
7 node=node, key="virsh_password").first()
8 self.assertThat(virsh_password_meta.value, HasLength(32))
9+
10+ def test_includes_qemu_efi_for_install_kvm_on_amd64(self):
11+ node = factory.make_Node(
12+ osystem='ubuntu', netboot=False, architecture='amd64/generic')
13+ node.install_kvm = True
14+ configuration = get_vendor_data(node)
15+ config = dict(configuration)
16+ self.assertThat(config['packages'], Contains("qemu-efi"))
17diff --git a/src/metadataserver/vendor_data.py b/src/metadataserver/vendor_data.py
18index b6bbf72..a7d942e 100644
19--- a/src/metadataserver/vendor_data.py
20+++ b/src/metadataserver/vendor_data.py
21@@ -149,5 +149,11 @@ def generate_kvm_pod_configuration(node):
22 'shell': '/bin/rbash',
23 }
24 ]
25- # XXX: Use correct packages based on architecture.
26- yield "packages", ["qemu-kvm", "libvirt-bin"]
27+ packages = ["qemu-kvm", "libvirt-bin"]
28+ if node.architecture is not None:
29+ architecture = node.architecture
30+ if '/' in architecture:
31+ architecture = architecture.split('/')[0]
32+ if architecture == 'amd64':
33+ packages.append('qemu-efi')
34+ yield "packages", packages

Subscribers

People subscribed via source and target branches