Merge pull request #40836 from eradman/grain_virtual

Set virtual grain for OpenBSD on KVM
This commit is contained in:
Mike Place 2017-04-23 04:31:27 -06:00 committed by GitHub
commit 51af49495b

View File

@ -697,7 +697,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:
@ -823,6 +823,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')