Fix virtualization role for DigitalOcean droplets (#41062)

Fixes #41061
This commit is contained in:
Alex Tomkins 2019-10-23 09:30:05 +01:00 committed by Abhijeet Kasurde
parent 8c43697e3b
commit 2da2da54f8

View file

@ -111,13 +111,13 @@ class LinuxVirtual(Virtual):
virtual_facts['virtualization_type'] = 'virtualbox' virtual_facts['virtualization_type'] = 'virtualbox'
return virtual_facts return virtual_facts
if bios_vendor in ('Amazon EC2', 'Hetzner'): if bios_vendor in ('Amazon EC2', 'DigitalOcean', 'Hetzner'):
virtual_facts['virtualization_type'] = 'kvm' virtual_facts['virtualization_type'] = 'kvm'
return virtual_facts return virtual_facts
sys_vendor = get_file_content('/sys/devices/virtual/dmi/id/sys_vendor') sys_vendor = get_file_content('/sys/devices/virtual/dmi/id/sys_vendor')
KVM_SYS_VENDORS = ('QEMU', 'oVirt', 'Amazon EC2', 'Google', 'Scaleway') KVM_SYS_VENDORS = ('QEMU', 'oVirt', 'Amazon EC2', 'DigitalOcean', 'Google', 'Scaleway')
if sys_vendor in KVM_SYS_VENDORS: if sys_vendor in KVM_SYS_VENDORS:
virtual_facts['virtualization_type'] = 'kvm' virtual_facts['virtualization_type'] = 'kvm'
return virtual_facts return virtual_facts