Make sure __virtual__ error message is helpful when psutil is missing

Fixes #19659
Fixes #31867
This commit is contained in:
rallytime 2016-03-14 12:33:53 -06:00
parent 5c592b6768
commit 44b29f72a1

View file

@ -27,7 +27,7 @@ except ImportError:
def __virtual__():
if not HAS_PSUTIL:
return False
return False, 'The ps module cannot be loaded: psutil not installed.'
# Functions and attributes used in this execution module seem to have been
# added as of psutil 0.3.0, from an inspection of the source code. Only
@ -38,7 +38,7 @@ def __virtual__():
# as of Dec. 2013 EPEL is on 0.6.1, Debian 7 is on 0.5.1, etc.).
if psutil.version_info >= (0, 3, 0):
return True
return False
return False, 'The ps module cannot be loaded: psutil must be version 0.3.0 or greater.'
def _get_proc_cmdline(proc):