Minor: remove unneded logging

This commit is contained in:
Dmitry Kuzmenko 2019-08-19 22:53:34 +03:00
parent 314bbb3a74
commit a5cccdfc3e
No known key found for this signature in database
GPG Key ID: 4C7CAD30C95651DA
3 changed files with 4 additions and 21 deletions

View File

@ -29,12 +29,8 @@ from salt.ext.six.moves import map
# pylint: enable=import-error
# Import third party libs
log = logging.getLogger(__name__)
try:
log.info('IMPORTING pyinotify')
import pyinotify
log.info('IMPORTED pyinotify')
HAS_PYINOTIFY = True
DEFAULT_MASK = pyinotify.IN_CREATE | pyinotify.IN_DELETE | pyinotify.IN_MODIFY
MASKS = {}
@ -48,13 +44,12 @@ except ImportError:
__virtualname__ = 'inotify'
log = logging.getLogger(__name__)
def __virtual__():
log.info('VIRTUAL: %s', HAS_PYINOTIFY)
if HAS_PYINOTIFY:
log.info('VIRTUAL: %s', __virtualname__)
return __virtualname__
log.info('VIRTUAL: %s', False)
return False

View File

@ -101,18 +101,15 @@ def list_available(return_yaml=True, **kwargs):
salt '*' beacons.list_available
'''
log.info('BEACONS.LIST_AVAILABLE started')
beacons = None
try:
eventer = salt.utils.event.get_event('minion', opts=__opts__, listen=True)
res = __salt__['event.fire']({'func': 'list_available'}, 'manage_beacons')
if res:
log.info('BEACONS.LIST_AVAILABLE waiting response with timeout %s', default_event_wait)
event_ret = eventer.get_event(
tag='/salt/minion/minion_beacons_list_available_complete',
wait=kwargs.get('timeout', default_event_wait))
log.info('BEACONS.LIST_AVAILABLE event_ret: %s', event_ret)
if event_ret and event_ret['complete']:
beacons = event_ret['beacons']
except KeyError:
@ -120,22 +117,16 @@ def list_available(return_yaml=True, **kwargs):
ret = {}
ret['result'] = False
ret['comment'] = 'Event module not available. Beacon add failed.'
log.info('BEACONS.LIST_AVAILABLE returning %s', ret)
return ret
if beacons:
if return_yaml:
tmp = {'beacons': beacons}
ret = salt.utils.yaml.safe_dump(tmp, default_flow_style=False)
log.info('BEACONS.LIST_AVAILABLE returning %s', ret)
return ret
return salt.utils.yaml.safe_dump(tmp, default_flow_style=False)
else:
log.info('BEACONS.LIST_AVAILABLE returning %s', beacons)
return beacons
else:
ret = {'beacons': {}}
log.info('BEACONS.LIST_AVAILABLE returning %s', ret)
return ret
return {'beacons': {}}
def add(name, beacon_data, **kwargs):

View File

@ -14,9 +14,6 @@ from salt.exceptions import CommandExecutionError
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
import logging
log = logging.getLogger(__name__)
class BeaconsAddDeleteTest(ModuleCase):
'''