<s> import logging <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from horizon import tabs <EOL> from openstack_dashboard . api import sahara as saharaclient <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class GeneralTab ( tabs . Tab ) : <EOL> name = _ ( "<STR_LIT>" ) <EOL> slug = "<STR_LIT>" <EOL> template_name = ( "<STR_LIT>" ) <EOL> def get_context_data ( self , request ) : <EOL> job_execution_id = self . tab_group . kwargs [ '<STR_LIT>' ] <EOL> job_execution = saharaclient . job_execution_get ( request , <EOL> job_execution_id ) <EOL> object_names = self . get_object_names ( job_execution , <EOL> request ) <EOL> return { "<STR_LIT>" : job_execution , <EOL> "<STR_LIT>" : object_names } <EOL> def get_object_names ( self , job_ex , request ) : <EOL> object_names = { } <EOL> obj_names_map = { '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : job_ex . input_id } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : job_ex . output_id } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : job_ex . cluster_id } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : job_ex . job_id } } <EOL> for item in obj_names_map : <EOL> object_names [ item ] = ( <EOL> self . get_object_name ( obj_names_map [ item ] [ '<STR_LIT>' ] , <EOL> obj_names_map [ item ] [ '<STR_LIT>' ] , <EOL> request ) ) <EOL> return object_names <EOL> def get_object_name ( self , obj_id , sahara_obj , request ) : <EOL> object_name = None <EOL> try : <EOL> s_func = getattr ( saharaclient , sahara_obj ) <EOL> obj = s_func ( request , obj_id ) <EOL> object_name = obj . name <EOL> except Exception as e : <EOL> LOG . warn ( "<STR_LIT>" % <EOL> ( sahara_obj , obj_id , str ( e ) ) ) <EOL> return object_name <EOL> class JobExecutionDetailsTabs ( tabs . TabGroup ) : <EOL> slug = "<STR_LIT>" <EOL> tabs = ( GeneralTab , ) <EOL> sticky = True </s>
