'Get a provider driver handle based on the ha/distributed flags.'

def _attrs_to_driver(self, router):

    distributed = _is_distributed(router.get('distributed', lib_const.ATTR_NOT_SPECIFIED))
    ha = _is_ha(router.get('ha', lib_const.ATTR_NOT_SPECIFIED))
    drivers = self.drivers.values()
    if self.default_provider:
        drivers.insert(0, self.drivers[self.default_provider])
    for driver in drivers:
        if _is_driver_compatible(distributed, ha, driver):
            return driver
    raise NotImplementedError((_('Could    not    find    a    service    provider    that    supports    distributed=%(d)s    and    ha=%(h)s') % {'d': distributed, 'h': ha}))
