<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import logging <EOL> import salt . minion <EOL> log = logging . getLogger ( __name__ ) <EOL> CONFIG_KEY = '<STR_LIT>' <EOL> MMINION = None <EOL> def _mminion ( ) : <EOL> '''<STR_LIT>''' <EOL> global MMINION <EOL> if MMINION is None : <EOL> MMINION = salt . minion . MasterMinion ( __opts__ ) <EOL> return MMINION <EOL> def prep_jid ( nocache = False , passed_jid = None ) : <EOL> '''<STR_LIT>''' <EOL> jid = passed_jid <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> if jid is None : <EOL> jid = _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( nocache = nocache ) <EOL> else : <EOL> r_jid = _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( nocache = nocache ) <EOL> if r_jid != jid : <EOL> log . debug ( '<STR_LIT>' ) <EOL> return jid <EOL> def returner ( load ) : <EOL> '''<STR_LIT>''' <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( load ) <EOL> def save_load ( jid , clear_load ) : <EOL> '''<STR_LIT>''' <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( jid , clear_load ) <EOL> def save_minions ( jid , minions ) : <EOL> '''<STR_LIT>''' <EOL> pass <EOL> def get_load ( jid ) : <EOL> '''<STR_LIT>''' <EOL> ret = { } <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> ret . update ( _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( jid ) ) <EOL> return ret <EOL> def get_jid ( jid ) : <EOL> '''<STR_LIT>''' <EOL> ret = { } <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> ret . update ( _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( jid ) ) <EOL> return ret <EOL> def get_jids ( ) : <EOL> '''<STR_LIT>''' <EOL> ret = { } <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> ret . update ( _mminion ( ) . returners [ '<STR_LIT>' . format ( returner_ ) ] ( ) ) <EOL> return ret <EOL> def clean_old_jobs ( ) : <EOL> '''<STR_LIT>''' <EOL> for returner_ in __opts__ [ CONFIG_KEY ] : <EOL> fstr = '<STR_LIT>' . format ( returner_ ) <EOL> if fstr in _mminion ( ) . returners : <EOL> _mminion ( ) . returners [ fstr ] ( ) </s>
