Merge pull request #41069 from rallytime/merge-2016.11

[2016.11] Merge forward from 2016.3 to 2016.11
This commit is contained in:
Mike Place 2017-05-04 14:34:57 -06:00 committed by GitHub
commit 1179720327

View File

@ -16,6 +16,8 @@ try: # python 3
except ImportError: # python 2 except ImportError: # python 2
from pipes import quote as _cmd_quote from pipes import quote as _cmd_quote
import getpass
# Import salt libs # Import salt libs
import salt.utils import salt.utils
import salt.utils.mac_utils import salt.utils.mac_utils
@ -32,6 +34,9 @@ def __virtual__():
return (False, 'The mac_system module could not be loaded: ' return (False, 'The mac_system module could not be loaded: '
'module only works on MacOS systems.') 'module only works on MacOS systems.')
if getpass.getuser() != 'root':
return False, 'The mac_system module is not useful for non-root users.'
if not _atrun_enabled(): if not _atrun_enabled():
if not _enable_atrun(): if not _enable_atrun():
return False, 'atrun could not be enabled on this system' return False, 'atrun could not be enabled on this system'