'Event handler to set ha flag and status on creation.'

@registry.receives(resources.ROUTER, [events.PRECOMMIT_CREATE])
def _precommit_router_create(self, resource, event, trigger, context, router, router_db, **kwargs):

    is_ha = self._is_ha(router)
    router['ha'] = is_ha
    self.set_extra_attr_value(context, router_db, 'ha', is_ha)
    if (not is_ha):
        return
    self.get_number_of_agents_for_scheduling(context)
    ha_net = self.get_ha_network(context, router['tenant_id'])
    if (not ha_net):
        raise db_exc.RetryRequest(l3_ha.HANetworkConcurrentDeletion(tenant_id=router['tenant_id']))
