'Event handler to set distributed flag on creation.'

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

    dist = is_distributed_router(router)
    router['distributed'] = dist
    self.l3plugin.set_extra_attr_value(context, router_db, 'distributed', dist)
