<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> __virtualname__ = '<STR_LIT>' <EOL> import logging <EOL> log = logging . getLogger ( __name__ ) <EOL> def __virtual__ ( ) : <EOL> '''<STR_LIT>''' <EOL> return __virtualname__ if '<STR_LIT>' in __salt__ else False <EOL> def validate ( config ) : <EOL> '''<STR_LIT>''' <EOL> if not isinstance ( config , dict ) : <EOL> return False , ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' not in config : <EOL> return False , ( '<STR_LIT>' ) <EOL> return True , '<STR_LIT>' <EOL> def beacon ( config ) : <EOL> '''<STR_LIT>''' <EOL> ret = [ ] <EOL> _validate = validate ( config ) <EOL> if not _validate [ <NUM_LIT:0> ] : <EOL> return ret <EOL> _refresh = False <EOL> if '<STR_LIT>' in config and config [ '<STR_LIT>' ] : <EOL> _refresh = True <EOL> for pkg in config [ '<STR_LIT>' ] : <EOL> _installed = __salt__ [ '<STR_LIT>' ] ( pkg ) <EOL> _latest = __salt__ [ '<STR_LIT>' ] ( pkg , refresh = _refresh ) <EOL> if _installed and _latest : <EOL> _pkg = { '<STR_LIT>' : pkg , <EOL> '<STR_LIT:version>' : _latest <EOL> } <EOL> ret . append ( _pkg ) <EOL> return ret </s>
