#NEWLINE# def _provision_ha( self , context , logical_global_router ) : #NEWLINE# #INDENT# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# ha_group_uuid = uuidutils . generate_uuid ( ) #NEWLINE# group_id = self . generate_ha_group_id ( context , logical_global_router , { #NEWLINE# #INDENT# 'device_owner' : l3_constants . DEVICE_OWNER_ROUTER_GW , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , ha_group_uuid ) #NEWLINE# subnet_id = logical_global_router [ l3 . EXTERNAL_GW_INFO ] [ 'external_fixed_ips' ] [ 0 ] [ 'subnet_id' ] #NEWLINE# r_ha_s = ha_db . RouterHASetting ( router_id = logical_global_router [ 'id' ] , ha_type = cfg . CONF . ha . default_ha_mechanism , redundancy_level = 1 , priority = ha_db . DEFAULT_MASTER_PRIORITY , probe_connectivity = False , probe_target = None , probe_interval = None ) #NEWLINE# context . session . add ( r_ha_s ) #NEWLINE# r_ha_g = ha_db . RouterHAGroup ( id = ha_group_uuid , tenant_id = '' , ha_type = r_ha_s . ha_type , group_identity = group_id , ha_port_id = logical_global_router [ 'gw_port_id' ] , extra_port_id = None , subnet_id = subnet_id , user_router_id = logical_global_router [ 'id' ] , timers_config = '' , tracking_config = '' , other_config = '' ) #NEWLINE# context . session . add ( subnet_id )