<s> from app_catalog . version import version_info as acvi <EOL> from django . conf import settings <EOL> from horizon import Horizon <EOL> from horizon . version import version_info as hvi <EOL> from horizon import views <EOL> from openstack_dashboard import api <EOL> import re <EOL> import json <EOL> class IndexView ( views . APIView ) : <EOL> template_name = '<STR_LIT>' <EOL> def get_data ( self , request , context , * args , ** kwargs ) : <EOL> has_murano = False <EOL> try : <EOL> Horizon . get_dashboard ( '<STR_LIT>' ) <EOL> has_murano = True <EOL> except Exception : <EOL> pass <EOL> regex = re . compile ( '<STR_LIT>' ) <EOL> heat_version = None <EOL> heat_release = None <EOL> try : <EOL> info = api . heat . heatclient ( <EOL> request ) . build_info . build_info ( ) [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> match = regex . match ( info ) <EOL> if match : <EOL> heat_version = match . group ( <NUM_LIT:1> ) <EOL> heat_release = match . group ( <NUM_LIT:0> ) <EOL> except Exception : <EOL> pass <EOL> heat_version = getattr ( settings , <EOL> '<STR_LIT>' , heat_version ) <EOL> heat_release = getattr ( settings , <EOL> '<STR_LIT>' , heat_release ) <EOL> murano_version = getattr ( settings , <EOL> '<STR_LIT>' , None ) <EOL> murano_release = getattr ( settings , <EOL> '<STR_LIT>' , None ) <EOL> app_catalog_settings = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : heat_version , <EOL> '<STR_LIT>' : heat_release <EOL> } , <EOL> '<STR_LIT>' : has_murano , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : murano_version , <EOL> '<STR_LIT>' : murano_release <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : hvi . version_string ( ) , <EOL> '<STR_LIT>' : hvi . release_string ( ) <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : acvi . version_string ( ) , <EOL> '<STR_LIT>' : acvi . release_string ( ) <EOL> } , <EOL> '<STR_LIT>' : getattr ( settings , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> } <EOL> context [ '<STR_LIT>' ] = json . dumps ( app_catalog_settings ) <EOL> return context </s>
