fix virtual grain on SmartOS

This commit is contained in:
Jorge Schrauwen 2016-02-22 13:13:19 +00:00
parent 87032995ed
commit 22a64ac9e4

View File

@ -503,6 +503,14 @@ def _virtual(osdata):
if osdata['kernel'] in skip_cmds:
_cmds = ()
# Quick backout for BrandZ (Solaris LX Branded zones, don't wast time on other commands)
uname = salt.utils.which('uname')
if osdata['kernel'] == 'Linux' and uname:
ret = __salt__['cmd.run_all']('{0} -v'.format(uname))
if 'BrandZ' in ret['stdout']:
grains['virtual'] = 'zone'
return grains
failed_commands = set()
for command in _cmds:
args = []