From ec067785edd6062f0cce1356ad445fa8bc9de522 Mon Sep 17 00:00:00 2001 From: Eric Radman Date: Sat, 22 Apr 2017 20:07:35 -0400 Subject: [PATCH] Set virtual grain for OpenBSD on KVM None of the file system tests for /sys or /proc can succeed on OpenBSD; create a new branch for determining the 'virtual' grain --- salt/grains/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/grains/core.py b/salt/grains/core.py index bdc42dcf91..94762655b3 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -701,7 +701,7 @@ def _virtual(osdata): 'to execute them. Grains output might not be accurate.' ) - choices = ('Linux', 'OpenBSD', 'HP-UX') + choices = ('Linux', 'HP-UX') isdir = os.path.isdir sysctl = salt.utils.which('sysctl') if osdata['kernel'] in choices: @@ -827,6 +827,9 @@ def _virtual(osdata): grains['virtual_subtype'] = 'jail' if 'QEMU Virtual CPU' in model: grains['virtual'] = 'kvm' + elif osdata['kernel'] == 'OpenBSD': + if osdata['manufacturer'] == 'QEMU': + grains['virtual'] = 'kvm' elif osdata['kernel'] == 'SunOS': # Check if it's a "regular" zone. (i.e. Solaris 10/11 zone) zonename = salt.utils.which('zonename')