'Attach vr_id to router while tolerating network deletes.'

@n_utils.transaction_guard
def _ensure_vr_id_and_network(self, context, router_db):

    creator = functools.partial(self._ensure_vr_id, context, router_db)
    dep_getter = functools.partial(self.get_ha_network, context, router_db.tenant_id)
    dep_creator = functools.partial(self._create_ha_network, context, router_db.tenant_id)
    dep_deleter = functools.partial(self._delete_ha_network, context)
    dep_id_attr = 'network_id'
    return n_utils.create_object_with_dependency(creator, dep_getter, dep_creator, dep_id_attr, dep_deleter)[1]
