mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Squelch error logging when varstack is not installed
This gets rid of spurious errors when varstack isn't installed. Most people won't use this so these errors are not helpful.
This commit is contained in:
parent
d4d2b3658f
commit
c79a823964
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