mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #49584 from terminalmage/squelch-varstack-error
Squelch error logging when varstack is not installed
This commit is contained in:
commit
f9a01b72a0
1 changed files with 2 additions and 7 deletions
|
@ -49,11 +49,9 @@ from __future__ import absolute_import
|
|||
import logging
|
||||
|
||||
try:
|
||||
HAS_VARSTACK = False
|
||||
import varstack
|
||||
HAS_VARSTACK = True
|
||||
except ImportError:
|
||||
pass
|
||||
varstack = None
|
||||
|
||||
# Set up logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -63,10 +61,7 @@ __virtualname__ = 'varstack'
|
|||
|
||||
|
||||
def __virtual__():
|
||||
if not HAS_VARSTACK:
|
||||
log.error("Can't find varstack master_top")
|
||||
return False
|
||||
return __virtualname__
|
||||
return (False, 'varstack not installed') if varstack is None else __virtualname__
|
||||
|
||||
|
||||
def top(**kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue