Using salt util function to determine if OS X

This commit is contained in:
Daniel Hobley 2016-01-29 11:53:48 +01:00
parent bae0543d95
commit 269ba6088a
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,8 @@ Install certificates into the keychain on Mac OS
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'keychain'
@ -16,7 +18,7 @@ def __virtual__():
'''
Only work on Mac OS
'''
if __grains__['os'] in ['MacOS', 'Darwin']:
if salt.utils.is_darwin():
return __virtualname__
return False

View File

@ -17,15 +17,17 @@ import logging
import os
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'keychain'
def __virtual__():
'''
Only work on Mac OS
'''
if __grains__['os'] in ['MacOS', 'Darwin']:
if salt.utils.is_darwin():
return __virtualname__
return False