<s> from utils import get_client <EOL> from st2actions . runners . pythonrunner import Action <EOL> import logging <EOL> class ESBaseAction ( Action ) : <EOL> def __init__ ( self , config = None ) : <EOL> super ( ESBaseAction , self ) . __init__ ( config = config ) <EOL> self . _client = None <EOL> @ property <EOL> def client ( self ) : <EOL> if not self . _client : <EOL> o = self . config <EOL> self . _client = get_client ( ** ( { <EOL> '<STR_LIT:host>' : o . host , '<STR_LIT:port>' : o . port , '<STR_LIT>' : o . url_prefix , <EOL> '<STR_LIT>' : o . http_auth , '<STR_LIT>' : o . use_ssl , <EOL> '<STR_LIT>' : o . master_only , '<STR_LIT>' : o . timeout <EOL> } ) ) <EOL> return self . _client <EOL> def set_up_logging ( self ) : <EOL> """<STR_LIT>""" <EOL> log_level = self . config . log_level or '<STR_LIT>' <EOL> numeric_log_level = getattr ( logging , log_level . upper ( ) , None ) <EOL> if not isinstance ( numeric_log_level , int ) : <EOL> raise ValueError ( '<STR_LIT>' . format ( log_level ) ) <EOL> logging . basicConfig ( level = numeric_log_level ) </s>
