diff -Nru landscape-client-16.03/debian/changelog landscape-client-16.03/debian/changelog --- landscape-client-16.03/debian/changelog 2017-11-24 18:05:52.000000000 +0000 +++ landscape-client-16.03/debian/changelog 2018-01-11 22:37:30.000000000 +0000 @@ -1,3 +1,9 @@ +landscape-client (16.03-0ubuntu2.16.04.3) xenial; urgency=medium + + * Sets vm_info to "kvm" for new AWS EC2 C5 instances (LP: #1742531) + + -- Simon Poirier Thu, 11 Jan 2018 22:35:06 +0000 + landscape-client (16.03-0ubuntu2.16.04.2) xenial; urgency=medium [ Simon Poirier ] diff -Nru landscape-client-16.03/debian/patches/aws-c5-vminfo-1742531.diff landscape-client-16.03/debian/patches/aws-c5-vminfo-1742531.diff --- landscape-client-16.03/debian/patches/aws-c5-vminfo-1742531.diff 1970-01-01 00:00:00.000000000 +0000 +++ landscape-client-16.03/debian/patches/aws-c5-vminfo-1742531.diff 2018-01-13 00:30:51.000000000 +0000 @@ -0,0 +1,48 @@ +Description: Add vm_info to new cloud instances. +Author: Simon Poirier +Origin: upstream, https://code.launchpad.net/~landscape/landscape-client/+git/master +Bug: https://bugs.launchpad.net/landscape-client/+bug/1742531 +Last-Update: 2018-01-12 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/landscape/lib/tests/test_vm_info.py ++++ b/landscape/lib/tests/test_vm_info.py +@@ -76,6 +76,21 @@ + + self.assertEqual("", get_vm_info(root_path=self.root_path)) + ++ def test_get_vm_info_with_ec2_sys_vendor(self): ++ """ ++ get_vm_info should return "kvm" when sys_vendor is "Amazon EC2", ++ which is the case for C5 instances which are based on KVM. ++ """ ++ self.make_sys_vendor("Amazon EC2") ++ self.assertEqual(b"kvm", get_vm_info(root_path=self.root_path)) ++ ++ def test_get_vm_info_with_digitalocean_sys_vendor(self): ++ """ ++ get_vm_info should return "kvm" when sys_vendor is "DigitalOcean". ++ """ ++ self.make_sys_vendor("DigitalOcean") ++ self.assertEqual(b"kvm", get_vm_info(root_path=self.root_path)) ++ + def test_get_vm_info_with_bochs_sys_vendor(self): + """ + L{get_vm_info} should return "kvm" when we detect the sys_vendor is +--- a/landscape/lib/vm_info.py ++++ b/landscape/lib/vm_info.py +@@ -65,8 +65,14 @@ + """Return the VM type string (possibly empty) based on the vendor.""" + vendor = read_file(sys_vendor_path).lower() + # Use lower-key string for vendors, since we do case-insentive match. ++ ++ # 2018-01: AWS and DO are now returning custom sys_vendor names ++ # instead of qemu. If this becomes a trend, it may be worth also checking ++ # dmi/id/chassis_vendor which seems to unchanged (bochs). + content_vendors_map = ( ++ ("amazon ec2", "kvm"), + ("bochs", "kvm"), ++ ("digitalocean", b"kvm"), + ("google", "gce"), + ("innotek", "virtualbox"), + ("microsoft", "hyperv"), diff -Nru landscape-client-16.03/debian/patches/series landscape-client-16.03/debian/patches/series --- landscape-client-16.03/debian/patches/series 2017-11-24 18:05:52.000000000 +0000 +++ landscape-client-16.03/debian/patches/series 2018-01-11 22:43:30.000000000 +0000 @@ -4,3 +4,4 @@ iso-configuration-1699789.diff autoremovable-report-1208393.diff config-no-reregister-1618483.diff +aws-c5-vminfo-1742531.diff