Merge pull request #31878 from rallytime/fix-psutil-warning

Make sure __virtual__ error message is helpful when psutil is missing
This commit is contained in:
Mike Place 2016-03-14 15:31:42 -06:00
commit c44c1b5e59

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):