mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Make sure __virtual__ error message is helpful when psutil is missing
Fixes #19659 Fixes #31867
This commit is contained in:
parent
5c592b6768
commit
44b29f72a1
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue