modules.freebsd_sysctl: __virtual__ return err msg.

Added message when return False if OS is not FreeBSD.
This commit is contained in:
abednarik 2015-12-17 21:45:23 -03:00
parent c7d3ac58ef
commit aa9e3ac4c8

View File

@ -14,9 +14,12 @@ __virtualname__ = 'sysctl'
def __virtual__():
'''
Only run on FreeBSD systems
Only runs on FreeBSD systems
'''
return __virtualname__ if __grains__['os'] == 'FreeBSD' else False
if __grains__['os'] == 'FreeBSD':
return __virtualname__
return (False, 'The freebsd_sysctl execution module cannot be loaded: '
'only available on FreeBSD systems.')
def _formatfor(name, value, config, tail=''):