From b9b799ec1dc4fd3a5d38ed44683d0a447f76d117 Mon Sep 17 00:00:00 2001 From: abednarik Date: Tue, 22 Dec 2015 17:21:49 -0300 Subject: [PATCH] modules.softwareupdate: __virtual__ return err msg. Updated message when return False if is not MacOS system. --- salt/modules/softwareupdate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/modules/softwareupdate.py b/salt/modules/softwareupdate.py index 5ad00fefc9..299bcd6e43 100644 --- a/salt/modules/softwareupdate.py +++ b/salt/modules/softwareupdate.py @@ -19,7 +19,10 @@ def __virtual__(): ''' Only for MacOS ''' - return __virtualname__ if __grains__['os'] == 'MacOS' else False + if __grains__['os'] == 'MacOS': + return __virtualname__ + return (False, 'The softwareupdate module could not be loaded: ' + 'module only works on MacOS systems.') def _get_upgradable(rec=False, restart=False):