#NEWLINE# def get_context_data( self , request ) : #NEWLINE# #INDENT# cluster_id = self . tab_group . kwargs [ 'cluster_id' ] #NEWLINE# cluster_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# sahara = saharaclient . client ( request ) #NEWLINE# cluster = sahara . clusters . get ( cluster_id ) #NEWLINE# for ( info_key , info_val ) in cluster . info . items ( ) : #NEWLINE# #INDENT# for ( key , val ) in info_val . items ( ) : #NEWLINE# #INDENT# if str ( val ) . startswith ( ( 'http://' , 'https://' ) ) : #NEWLINE# #INDENT# cluster . info [ info_key ] [ key ] = build_link ( val ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# base_image = glance . image_get ( request , cluster . default_image_id ) #NEWLINE# if getattr ( cluster , 'cluster_template_id' , None ) : #NEWLINE# #INDENT# cluster_template = helpers . safe_call ( sahara . cluster_templates . get , cluster . cluster_template_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cluster_template = None #NEWLINE# #UNINDENT# if getattr ( cluster , 'neutron_management_network' , None ) : #NEWLINE# #INDENT# net_id = cluster . neutron_management_network #NEWLINE# network = neutron . network_get ( request , net_id ) #NEWLINE# net_name = network . name_or_id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# net_name = None #NEWLINE# #UNINDENT# cluster_info . update ( { #NEWLINE# #INDENT# 'cluster' : cluster , #NEWLINE# 'base_image' : cluster , #NEWLINE# 'cluster_template' : cluster_template , #NEWLINE# 'network' : net_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOG . error ( ( 'Unable to fetch cluster details: %s' % str ( e ) ) ) #NEWLINE# #UNINDENT# return cluster_info